1
Script / Re: Attack Script (multiple q's)
« on: 2006-08-20, 09:21:09 AM »
Ouch. Thanks for the quick reply. Looks like I have some reworking to do.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

First I'll throw out the script and then detail the scenario. Also, yes I have looked at the sword script example. That one tends to use something very similar to the shooting script, which is a bit complicated for this.' VBScript source code
'////////////////////////////////
'Test Attack Script
'///////////////////////////////
MsgBox "TEST"
Sub Player_OnControllerMove(OldActions, NewActions)
Select Case ProjectObj.Gameplayer.rMap.Name
Case "AttackTestMap.map"
If ((OldActions And eActionBits.ACTION_BUTTON1) = 0) AND _
((NewActions And eActionBits.ACTION_BUTTON1) <> 0) Then
Set NewSpr = ProjectObj.GamePlayer.rMap.SpriteDefs("Weapon").MakeInstance
With ProjectObj.GamePlayer.PlayerSprite
.rDef.rLayer.AddSprite HostObj.AsObject(NewSpr)
NewSpr.Y = .Y -16
NewSpr.CurState = .CurState
Select Case .CurState
Case 0,2
NewSpr.X = .X - 128
Case 1,3
NewSpr.X = .X + 128
End Select
End With
End If
End Select
End Sub
HostObj.SinkObjectEvents ProjectObj.GamePlayer, "Player"
HostObj.ConnectEventsNow()
ProjectObj.GamePlayer.Play 16