HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Vehicle Acceleration

03-10-2010, 06:29 AM#1
Sunwarrior25
Just fooling around. I want to see if I got this right though:
Input

Trigger:
Collapse ArrowUpOn
Collapse Events
Player - Player 1 (Red) Presses the Up Arrow key
Conditions
Collapse Actions
Set NPTarw[0] = True
Collapse ArrowUpOff
Collapse Events
Player - Player 1 (Red) Releases the Up Arrow key
Conditions
Collapse Actions
Set NPTarw[0] = False
Collapse ArrowLeftOn
Collapse Events
Player - Player 1 (Red) Presses the Left Arrow key
Conditions
Collapse Actions
Set NPTarw[1] = True
Collapse ArrowLeftOff
Collapse Events
Player - Player 1 (Red) Releases the Left Arrow key
Conditions
Collapse Actions
Set NPTarw[1] = False
Collapse ArrowDownOn
Collapse Events
Player - Player 1 (Red) Presses the Down Arrow key
Conditions
Collapse Actions
Set NPTarw[2] = True
Collapse ArrowDownOff
Collapse Events
Player - Player 1 (Red) Releases the Down Arrow key
Conditions
Collapse Actions
Set NPTarw[2] = False
Collapse ArrowRightOn
Collapse Events
Player - Player 1 (Red) Presses the Right Arrow key
Conditions
Collapse Actions
Set NPTarw[3] = True
Collapse ArrowRightOff
Collapse Events
Player - Player 1 (Red) Releases the Right Arrow key
Conditions
Collapse Actions
Set NPTarw[3] = False


Trigger:
Collapse Map Initialization
Collapse Events
Map initialization
Conditions
Collapse Actions
Game - Set the time of day to 0.00
Game - Turn the day/night cycle Off
Set tempheight = -128.00
Set tempdist = 2176.00
Custom script: set udg_angleofattack = Atan2(udg_tempheight,udg_tempdist)*bj_RADTODEG
Trigger - Run SetupAutomaton <gen> (ignoring conditions)
Set playerBOT = 0
Unit - Create 1 BOTtype[playerBOT] for Player 1 (Red) at (Position of Circle of Power (large) 0000 <gen>) facing 135.00 degrees
Set PLAYER = (Last created unit)
Animation - Play PLAYER's walk animation
Collapse ZeroSeconds
Collapse Events
Time - Elapsed game time is 0.00 seconds
Conditions
Collapse Actions
Trigger - Turn off (This trigger)
Countdown Timer - Start SystemTimer as a Repeating timer that will expire in 0.15 seconds
Trigger - Turn on Camera <gen>
Trigger - Turn on Movement <gen>
Collapse SetupAutomaton
Events
Conditions
Collapse Actions
-------- Wheel-Based Civilian --------
-------- Ford Falcon --------
Set BOTtype[0] = Ford Falcon
Set BOThp[0] = 800.00
Set BOTfuelMax[0] = 30.00
Set BOTattack[0] = 0.00
Set BOTattackRange[0] = 50.00
Set BOTattackdmg[0] = Normal
Set BOTattackType[0] = Normal
Set BOTattackSnd[0] = Metal Medium Bash
Set BOTarmor[0] = 10.00
Set BOTspeedMax[0] = 241.40
Set BOTmnuvr[0] = 3.00
-------- --------
-------- Wheel-Based Military --------
-------- Badger --------
Set BOTtype[1] = ASPV "Badger"
Set BOThp[1] = 1500.00
Set BOTfuelMax[1] = 80.00
Set BOTattack[1] = 90.00
Set BOTattackRange[1] = 900.00
Set BOTattackdmg[1] = Normal
Set BOTattackType[1] = Pierce
Set BOTattackSnd[1] = Metal Light Slice
Set BOTarmor[1] = 20.00
Set BOTspeedMax[1] = 209.22
Set BOTmnuvr[1] = 3.00
-------- --------
-------- Finalize --------
-------- --------
Set BOTlist = 1
Collapse Camera
Collapse Events
Time - SystemTimer expires
Conditions
Collapse Actions
Camera - Pan camera for Player 1 (Red) to ((Position of PLAYER) offset by 1536.00 towards (Facing of PLAYER) degrees) over 0.15 seconds
Camera - Set Player 1 (Red)'s camera Distance to target to 2318.18 over 0.15 seconds
Camera - Set Player 1 (Red)'s camera Far Z to 10000.00 over 0.15 seconds
Camera - Set Player 1 (Red)'s camera Angle of attack to angleofattack over 0.15 seconds
Camera - Set Player 1 (Red)'s camera Rotation to (Facing of PLAYER) over 0.15 seconds
Collapse Movement
Collapse Events
Time - SystemTimer expires
Conditions
Collapse Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
NPTarw[0] Equal to True
CurrentSpeed Less than BOTspeedMax[playerBOT]
Collapse Then - Actions
Set CurrentSpeed = (CurrentSpeed + 2.00)
Collapse Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
NPTarw[2] Equal to True
CurrentSpeed Greater than (BOTspeedMax[playerBOT] / -2.00)
Collapse Then - Actions
Set CurrentSpeed = (CurrentSpeed - 2.00)
Collapse Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Collapse And - All (Conditions) are true
Collapse Conditions
CurrentSpeed Greater than 0.00
Collapse Then - Actions
Set CurrentSpeed = (CurrentSpeed - 1.00)
Collapse Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Collapse And - All (Conditions) are true
Collapse Conditions
CurrentSpeed Less than 0.00
Collapse Then - Actions
Set CurrentSpeed = (CurrentSpeed + 1.00)
Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Collapse And - All (Conditions) are true
Collapse Conditions
NPTarw[1] Equal to True
NPTarw[3] Equal to False
CurrentSpeed Greater than 0.00
Collapse Then - Actions
Unit - Move PLAYER instantly to ((Position of PLAYER) offset by CurrentSpeed towards (Facing of PLAYER) degrees), facing ((Facing of PLAYER) + BOTmnuvr[playerBOT]) degrees
Collapse Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Collapse And - All (Conditions) are true
Collapse Conditions
NPTarw[3] Equal to True
NPTarw[1] Equal to False
CurrentSpeed Greater than 0.00
Collapse Then - Actions
Unit - Move PLAYER instantly to ((Position of PLAYER) offset by CurrentSpeed towards (Facing of PLAYER) degrees), facing ((Facing of PLAYER) - BOTmnuvr[playerBOT]) degrees
Collapse Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Collapse And - All (Conditions) are true
Collapse Conditions
NPTarw[1] Equal to True
NPTarw[3] Equal to False
CurrentSpeed Less than 0.00
Collapse Then - Actions
Unit - Move PLAYER instantly to ((Position of PLAYER) offset by CurrentSpeed towards (Facing of PLAYER) degrees), facing ((Facing of PLAYER) - BOTmnuvr[playerBOT]) degrees
Collapse Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Collapse And - All (Conditions) are true
Collapse Conditions
NPTarw[3] Equal to True
NPTarw[1] Equal to False
CurrentSpeed Less than 0.00
Collapse Then - Actions
Unit - Move PLAYER instantly to ((Position of PLAYER) offset by CurrentSpeed towards (Facing of PLAYER) degrees), facing ((Facing of PLAYER) + BOTmnuvr[playerBOT]) degrees
Collapse Else - Actions
Unit - Move PLAYER instantly to ((Position of PLAYER) offset by CurrentSpeed towards (Facing of PLAYER) degrees)
Animation - Change PLAYER's animation speed to CurrentSpeed% of its original speed

Also, How on earth should I detect collision with this? Any help would be appreciated.

EDIT: Added a few variables for turning. Test Vidideo: url removed

EDIT: Hey there Fraps, how's it going? Warcraft III - Driving
03-12-2010, 08:17 AM#2
Sunwarrior25
Ya know, I might be fooling around with a Sandbox, but that's one Sandbox I actually want to finish!
Trigger:
Collapse Map Initialization
Collapse Events
Map initialization
Conditions
Collapse Actions
Game - Set the time of day to 0.00
Game - Turn the day/night cycle Off
Collapse ZeroSeconds
Collapse Events
Time - Elapsed game time is 0.00 seconds
Conditions
Collapse Actions
Trigger - Turn off (This trigger)
Countdown Timer - Start SystemTimer as a Repeating timer that will expire in 0.10 seconds
Trigger - Turn on Movement <gen>
Set tempheight = -128.00
Set tempdist = 2176.00
Custom script: set udg_angleofattack = Atan2(udg_tempheight,udg_tempdist)*bj_RADTODEG
Trigger - Run SetupAutomaton <gen> (ignoring conditions)
Set playerBOT = 0
Unit - Create 1 BOTtype[playerBOT] for Player 1 (Red) at (Position of Circle of Power (large) 0000 <gen>) facing 90.00 degrees
Set PLAYER = (Last created unit)
Animation - Play PLAYER's walk animation
Custom script: call EnableThirdPersonCam(GetOwningPlayer(udg_PLAYER), udg_PLAYER, 0.1)
Collapse SetupAutomaton
Events
Conditions
Collapse Actions
-------- Wheel-Based Civilian --------
-------- Ford Falcon --------
Set BOTtype[0] = Ford Falcon
Set BOThp[0] = 800.00
Set BOTfuelMax[0] = 30.00
Set BOTattack[0] = 0.00
Set BOTattackRange[0] = 50.00
Set BOTattackdmg[0] = Normal
Set BOTattackType[0] = Normal
Set BOTattackSnd[0] = Metal Medium Bash
Set BOTarmor[0] = 10.00
Set BOTspeedMax[0] = 135.00
Set BOTaccel[0] = 2.00
Set BOTmnuvr[0] = 3.00
-------- --------
-------- Wheel-Based Military --------
-------- Badger --------
Set BOTtype[1] = ASPV "Badger"
Set BOThp[1] = 1500.00
Set BOTfuelMax[1] = 80.00
Set BOTattack[1] = 90.00
Set BOTattackRange[1] = 900.00
Set BOTattackdmg[1] = Normal
Set BOTattackType[1] = Pierce
Set BOTattackSnd[1] = Metal Light Slice
Set BOTarmor[1] = 20.00
Set BOTspeedMax[1] = 120.00
Set BOTaccel[1] = 1.50
Set BOTmnuvr[1] = 3.00
-------- Badger --------
Set BOTtype[2] = AT-AAV "Hedgehog"
Set BOThp[2] = 1750.00
Set BOTfuelMax[2] = 100.00
Set BOTattack[2] = 150.00
Set BOTattackRange[2] = 1150.00
Set BOTattackdmg[2] = Enhanced
Set BOTattackType[2] = Siege
Set BOTattackSnd[2] = Metal Heavy Bash
Set BOTarmor[2] = 25.00
Set BOTspeedMax[2] = 90.00
Set BOTaccel[2] = 1.00
Set BOTmnuvr[2] = 4.00
-------- --------
-------- Tread-Based Military --------
-------- --------
-------- Med Tank --------
Set BOTtype[3] = Med Tank
Set BOThp[3] = 1750.00
Set BOTfuelMax[3] = 100.00
Set BOTattack[3] = 150.00
Set BOTattackRange[3] = 1150.00
Set BOTattackdmg[3] = Enhanced
Set BOTattackType[3] = Siege
Set BOTattackSnd[3] = Metal Heavy Bash
Set BOTarmor[3] = 30.00
Set BOTspeedMax[3] = 60.00
Set BOTaccel[3] = 0.50
Set BOTmnuvr[3] = 6.00
-------- Finalize --------
-------- --------
Set BOTlist = 3
Oppicam (Yes, Oppicam. It works surprisingly well here, so it stays.)
Collapse Movement
Collapse Events
Time - SystemTimer expires
Conditions
Collapse Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
NPTarw[0] Equal to True
CurrentSpeed Less than BOTspeedMax[playerBOT]
Collapse Then - Actions
Set CurrentSpeed = (CurrentSpeed + BOTaccel[playerBOT])
Collapse Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
NPTarw[2] Equal to True
CurrentSpeed Greater than (BOTspeedMax[playerBOT] / -2.00)
Collapse Then - Actions
Set CurrentSpeed = (CurrentSpeed - BOTaccel[playerBOT])
Collapse Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Collapse And - All (Conditions) are true
Collapse Conditions
CurrentSpeed Greater than 0.00
Collapse Then - Actions
Set CurrentSpeed = (CurrentSpeed - 1.00)
Collapse Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Collapse And - All (Conditions) are true
Collapse Conditions
CurrentSpeed Less than 0.00
Collapse Then - Actions
Set CurrentSpeed = (CurrentSpeed + 1.00)
Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Collapse And - All (Conditions) are true
Collapse Conditions
NPTarw[1] Equal to True
NPTarw[3] Equal to False
CurrentSpeed Greater than 0.00
Collapse Then - Actions
Set pathTest = ((Position of PLAYER) offset by 50.00 towards (Facing of PLAYER) degrees)
Item - Create Cheese at pathTest
Set PathItem = (Last created item)
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(PathItem is in (Region centered at pathTest with size (2.00, 2.00))) Equal to False
Collapse Then - Actions
Set CurrentSpeed = 0.00
Special Effect - Create a special effect at pathTest using war3mapImported\Explosion.mdx
Special Effect - Destroy (Last created special effect)
Else - Actions
Unit - Move PLAYER instantly to ((Position of PLAYER) offset by CurrentSpeed towards (Facing of PLAYER) degrees), facing ((Facing of PLAYER) + BOTmnuvr[playerBOT]) degrees
Item - Remove PathItem
Collapse Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Collapse And - All (Conditions) are true
Collapse Conditions
NPTarw[3] Equal to True
NPTarw[1] Equal to False
CurrentSpeed Greater than 0.00
Collapse Then - Actions
Set pathTest = ((Position of PLAYER) offset by 50.00 towards (Facing of PLAYER) degrees)
Item - Create Cheese at pathTest
Set PathItem = (Last created item)
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(PathItem is in (Region centered at pathTest with size (2.00, 2.00))) Equal to False
Collapse Then - Actions
Set CurrentSpeed = 0.00
Special Effect - Create a special effect at pathTest using war3mapImported\Explosion.mdx
Special Effect - Destroy (Last created special effect)
Else - Actions
Unit - Move PLAYER instantly to ((Position of PLAYER) offset by CurrentSpeed towards (Facing of PLAYER) degrees), facing ((Facing of PLAYER) - BOTmnuvr[playerBOT]) degrees
Item - Remove PathItem
Collapse Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Collapse And - All (Conditions) are true
Collapse Conditions
NPTarw[1] Equal to True
NPTarw[3] Equal to False
CurrentSpeed Less than 0.00
Collapse Then - Actions
Set pathTest = ((Position of PLAYER) offset by 50.00 towards ((Facing of PLAYER) + 180.00) degrees)
Item - Create Cheese at pathTest
Set PathItem = (Last created item)
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(PathItem is in (Region centered at pathTest with size (2.00, 2.00))) Equal to False
Collapse Then - Actions
Set CurrentSpeed = 0.00
Special Effect - Create a special effect at pathTest using war3mapImported\Explosion.mdx
Special Effect - Destroy (Last created special effect)
Else - Actions
Unit - Move PLAYER instantly to ((Position of PLAYER) offset by CurrentSpeed towards (Facing of PLAYER) degrees), facing ((Facing of PLAYER) - BOTmnuvr[playerBOT]) degrees
Item - Remove PathItem
Collapse Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Collapse And - All (Conditions) are true
Collapse Conditions
NPTarw[3] Equal to True
NPTarw[1] Equal to False
CurrentSpeed Less than 0.00
Collapse Then - Actions
Set pathTest = ((Position of PLAYER) offset by 50.00 towards ((Facing of PLAYER) + 180.00) degrees)
Item - Create Cheese at pathTest
Set PathItem = (Last created item)
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(PathItem is in (Region centered at pathTest with size (2.00, 2.00))) Equal to False
Collapse Then - Actions
Set CurrentSpeed = 0.00
Special Effect - Create a special effect at pathTest using war3mapImported\Explosion.mdx
Special Effect - Destroy (Last created special effect)
Else - Actions
Unit - Move PLAYER instantly to ((Position of PLAYER) offset by CurrentSpeed towards (Facing of PLAYER) degrees), facing ((Facing of PLAYER) + BOTmnuvr[playerBOT]) degrees
Item - Remove PathItem
Collapse Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
CurrentSpeed Greater than 0.00
Collapse Then - Actions
Animation - Change PLAYER's animation speed to ((CurrentSpeed / BOTspeedMax[playerBOT]) x 100.00)% of its original speed
Set pathTest = ((Position of PLAYER) offset by 50.00 towards (Facing of PLAYER) degrees)
Item - Create Cheese at pathTest
Set PathItem = (Last created item)
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(PathItem is in (Region centered at pathTest with size (2.00, 2.00))) Equal to False
Collapse Then - Actions
Set CurrentSpeed = 0.00
Special Effect - Create a special effect at pathTest using war3mapImported\Explosion.mdx
Special Effect - Destroy (Last created special effect)
Else - Actions
Unit - Move PLAYER instantly to ((Position of PLAYER) offset by CurrentSpeed towards (Facing of PLAYER) degrees)
Collapse Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
CurrentSpeed Less than 0.00
Collapse Then - Actions
Animation - Change PLAYER's animation speed to ((CurrentSpeed / BOTspeedMax[playerBOT]) x 100.00)% of its original speed
Set pathTest = ((Position of PLAYER) offset by 50.00 towards ((Facing of PLAYER) + 180.00) degrees)
Item - Create Cheese at pathTest
Set PathItem = (Last created item)
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(PathItem is in (Region centered at pathTest with size (2.00, 2.00))) Equal to False
Collapse Then - Actions
Set CurrentSpeed = 0.00
Special Effect - Create a special effect at pathTest using war3mapImported\Explosion.mdx
Special Effect - Destroy (Last created special effect)
Else - Actions
Unit - Move PLAYER instantly to ((Position of PLAYER) offset by CurrentSpeed towards (Facing of PLAYER) degrees)
Else - Actions
Item - Remove PathItem
Collapse ESC
Collapse Events
Player - Player 1 (Red) skips a cinematic sequence
Conditions
Collapse Actions
Custom script: call EnableThirdPersonCam(GetOwningPlayer(udg_PLAYER), null, 0)
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(playerBOT + 1) Greater than BOTlist
Collapse Then - Actions
Set playerBOT = 0
Collapse Else - Actions
Set playerBOT = (playerBOT + 1)
Set CurrentSpeed = 0.00
Unit - Replace PLAYER with a BOTtype[playerBOT] using The new unit's max life and mana
Set PLAYER = (Last replaced unit)
Animation - Play PLAYER's walk animation
Animation - Change PLAYER's animation speed to ((CurrentSpeed / BOTspeedMax[playerBOT]) x 100.00)% of its original speed
Custom script: call EnableThirdPersonCam(GetOwningPlayer(udg_PLAYER), udg_PLAYER, 0.1)
The inclusion of Oppicam means I have to edit in JNGP or bad people will come down and beat me.

And of course, a documented test: YouTube: Warcraft III - Moar Driving!!

EDIT: I have a feeling that I could handle collision detection better (as evidenced by the number of times I slide sideways along the wall). I'm just not sure how.

EDIT2: I've noticed that telling the game to play the Walk animation when the unit is created, then changing the animation speed, doesn't work. (for making it look like the car is moving instead of sliding). Anyone know a good way to do that while I still have JNGP open?
03-14-2010, 05:26 PM#3
Element of Water
You need to use use custom script to keep animations on permanently:

Collapse JASS:
call SetUnitAnimationByIndex(udg_MyUnit, udg_AnimationIndex)

Where MyUnit is a unit variable in GUI and AnimationIndex is an integer variable. As for which integer to use, just try them 0, 1, 2, 3... until it looks like it's moving...
03-15-2010, 05:32 AM#4
Sunwarrior25
Thanks! With that, I can finish this sandbox via terrain. I probably won't release it, but at least the systems will be there (so I can CnP into other maps).

Here's what I have so far if anyone's interested:
Stuffs

Initialization:
Collapse Map Initialization
Collapse Events
Map initialization
Conditions
Collapse Actions
Game - Set the time of day to 0.00
Game - Turn the day/night cycle Off
Collapse ZeroSeconds
Collapse Events
Time - Elapsed game time is 0.00 seconds
Conditions
Collapse Actions
Trigger - Turn off (This trigger)
Countdown Timer - Start SystemTimer as a Repeating timer that will expire in 0.05 seconds
Trigger - Turn on Movement <gen>
Set tempheight = -128.00
Set tempdist = 2176.00
Custom script: set udg_angleofattack = Atan2(udg_tempheight,udg_tempdist)*bj_RADTODEG
Trigger - Run SetupAutomaton <gen> (ignoring conditions)
Set playerBOT = 0
Unit - Create 1 BOTtype[playerBOT] for Player 1 (Red) at (Position of Circle of Power (large) 0000 <gen>) facing 90.00 degrees
Set PLAYER = (Last created unit)
Custom script: call SetUnitAnimationByIndex(udg_PLAYER, udg_AnimationIndex[udg_playerBOT])
Custom script: call EnableThirdPersonCam(GetOwningPlayer(udg_PLAYER), udg_PLAYER, 0.1)
Automaton:
Collapse SetupAutomaton
Events
Conditions
Collapse Actions
-------- Wheel-Based Civilian --------
-------- Ford Falcon --------
Set BOTtype[0] = Ford Falcon
Set BOTspeedMax[0] = 65.00
Set BOTaccel[0] = 1.00
Set BOTmnuvr[0] = 1.50
Set AnimationIndex[0] = 1
-------- --------
-------- Wheel-Based Military --------
-------- Badger --------
Set BOTtype[1] = ASPV "Badger"
Set BOTspeedMax[1] = 60.00
Set BOTaccel[1] = 0.75
Set BOTmnuvr[1] = 1.50
Set AnimationIndex[1] = 2
-------- Hedgehog --------
Set BOTtype[2] = AT-AAV "Hedgehog"
Set BOTspeedMax[2] = 30.00
Set BOTaccel[2] = 0.50
Set BOTmnuvr[2] = 1.00
Set AnimationIndex[2] = 2
-------- --------
-------- Tread-Based Military --------
-------- --------
-------- Med Tank --------
Set BOTtype[3] = Med Tank
Set BOTspeedMax[3] = 30.00
Set BOTaccel[3] = 0.25
Set BOTmnuvr[3] = 2.00
Set AnimationIndex[3] = 1
-------- Wolf --------
Set BOTtype[4] = Howitzer "Wolf"
Set BOTspeedMax[4] = 25.00
Set BOTaccel[4] = 0.25
Set BOTmnuvr[4] = 0.25
Set AnimationIndex[4] = 2
-------- Hover --------
Set BOTtype[5] = Unknown
Set BOTspeedMax[5] = 75.00
Set BOTaccel[5] = 5.00
Set BOTmnuvr[5] = 5.00
Set AnimationIndex[5] = 5
-------- Space Guy --------
Set BOTtype[6] = Space Marine
Set BOTspeedMax[6] = 15.00
Set BOTaccel[6] = 1.00
Set BOTmnuvr[6] = 2.00
Set AnimationIndex[6] = 5
-------- Finalize --------
-------- --------
Set BOTlist = 6
OppiCam (3rd Person ONLY)
Collapse Movement
Collapse Events
Time - SystemTimer expires
Conditions
Collapse Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
NPTarw[0] Equal to True
CurrentSpeed Less than BOTspeedMax[playerBOT]
Collapse Then - Actions
Set CurrentSpeed = (CurrentSpeed + BOTaccel[playerBOT])
Collapse Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
NPTarw[2] Equal to True
CurrentSpeed Greater than (BOTspeedMax[playerBOT] / -2.00)
Collapse Then - Actions
Set CurrentSpeed = (CurrentSpeed - BOTaccel[playerBOT])
Collapse Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Collapse And - All (Conditions) are true
Collapse Conditions
CurrentSpeed Greater than 0.00
Collapse Then - Actions
Set CurrentSpeed = (CurrentSpeed - 1.00)
Collapse Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Collapse And - All (Conditions) are true
Collapse Conditions
CurrentSpeed Less than 0.00
Collapse Then - Actions
Set CurrentSpeed = (CurrentSpeed + 1.00)
Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Collapse And - All (Conditions) are true
Collapse Conditions
NPTarw[1] Equal to True
NPTarw[3] Equal to False
CurrentSpeed Greater than 0.00
Collapse Then - Actions
Set pathTest = ((Position of PLAYER) offset by 50.00 towards (Facing of PLAYER) degrees)
Item - Create Cheese at pathTest
Set PathItem = (Last created item)
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(PathItem is in (Region centered at pathTest with size (2.00, 2.00))) Equal to False
Collapse Then - Actions
Set CurrentSpeed = 0.00
Special Effect - Create a special effect at pathTest using war3mapImported\Explosion.mdx
Special Effect - Destroy (Last created special effect)
Else - Actions
Unit - Move PLAYER instantly to ((Position of PLAYER) offset by CurrentSpeed towards (Facing of PLAYER) degrees), facing ((Facing of PLAYER) + BOTmnuvr[playerBOT]) degrees
Item - Remove PathItem
Collapse Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Collapse And - All (Conditions) are true
Collapse Conditions
NPTarw[3] Equal to True
NPTarw[1] Equal to False
CurrentSpeed Greater than 0.00
Collapse Then - Actions
Set pathTest = ((Position of PLAYER) offset by 50.00 towards (Facing of PLAYER) degrees)
Item - Create Cheese at pathTest
Set PathItem = (Last created item)
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(PathItem is in (Region centered at pathTest with size (2.00, 2.00))) Equal to False
Collapse Then - Actions
Set CurrentSpeed = 0.00
Special Effect - Create a special effect at pathTest using war3mapImported\Explosion.mdx
Special Effect - Destroy (Last created special effect)
Else - Actions
Unit - Move PLAYER instantly to ((Position of PLAYER) offset by CurrentSpeed towards (Facing of PLAYER) degrees), facing ((Facing of PLAYER) - BOTmnuvr[playerBOT]) degrees
Item - Remove PathItem
Collapse Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Collapse And - All (Conditions) are true
Collapse Conditions
NPTarw[1] Equal to True
NPTarw[3] Equal to False
CurrentSpeed Less than 0.00
Collapse Then - Actions
Set pathTest = ((Position of PLAYER) offset by 50.00 towards ((Facing of PLAYER) + 180.00) degrees)
Item - Create Cheese at pathTest
Set PathItem = (Last created item)
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(PathItem is in (Region centered at pathTest with size (2.00, 2.00))) Equal to False
Collapse Then - Actions
Set CurrentSpeed = 0.00
Special Effect - Create a special effect at pathTest using war3mapImported\Explosion.mdx
Special Effect - Destroy (Last created special effect)
Else - Actions
Unit - Move PLAYER instantly to ((Position of PLAYER) offset by CurrentSpeed towards (Facing of PLAYER) degrees), facing ((Facing of PLAYER) - BOTmnuvr[playerBOT]) degrees
Item - Remove PathItem
Collapse Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Collapse And - All (Conditions) are true
Collapse Conditions
NPTarw[3] Equal to True
NPTarw[1] Equal to False
CurrentSpeed Less than 0.00
Collapse Then - Actions
Set pathTest = ((Position of PLAYER) offset by 50.00 towards ((Facing of PLAYER) + 180.00) degrees)
Item - Create Cheese at pathTest
Set PathItem = (Last created item)
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(PathItem is in (Region centered at pathTest with size (2.00, 2.00))) Equal to False
Collapse Then - Actions
Set CurrentSpeed = 0.00
Special Effect - Create a special effect at pathTest using war3mapImported\Explosion.mdx
Special Effect - Destroy (Last created special effect)
Else - Actions
Unit - Move PLAYER instantly to ((Position of PLAYER) offset by CurrentSpeed towards (Facing of PLAYER) degrees), facing ((Facing of PLAYER) + BOTmnuvr[playerBOT]) degrees
Item - Remove PathItem
Collapse Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
CurrentSpeed Greater than 0.00
Collapse Then - Actions
Set pathTest = ((Position of PLAYER) offset by 50.00 towards (Facing of PLAYER) degrees)
Item - Create Cheese at pathTest
Set PathItem = (Last created item)
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(PathItem is in (Region centered at pathTest with size (2.00, 2.00))) Equal to False
Collapse Then - Actions
Set CurrentSpeed = 0.00
Special Effect - Create a special effect at pathTest using war3mapImported\Explosion.mdx
Special Effect - Destroy (Last created special effect)
Else - Actions
Unit - Move PLAYER instantly to ((Position of PLAYER) offset by CurrentSpeed towards (Facing of PLAYER) degrees)
Collapse Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
CurrentSpeed Less than 0.00
Collapse Then - Actions
Set pathTest = ((Position of PLAYER) offset by 50.00 towards ((Facing of PLAYER) + 180.00) degrees)
Item - Create Cheese at pathTest
Set PathItem = (Last created item)
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(PathItem is in (Region centered at pathTest with size (2.00, 2.00))) Equal to False
Collapse Then - Actions
Set CurrentSpeed = 0.00
Special Effect - Create a special effect at pathTest using war3mapImported\Explosion.mdx
Special Effect - Destroy (Last created special effect)
Else - Actions
Unit - Move PLAYER instantly to ((Position of PLAYER) offset by CurrentSpeed towards (Facing of PLAYER) degrees)
Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Collapse And - All (Conditions) are true
Collapse Conditions
Collapse Or - Any (Conditions) are true
Collapse Conditions
CurrentSpeed Greater than or equal to 50.00
CurrentSpeed Less than or equal to -50.00
SoundNum Not equal to 3
Collapse Then - Actions
Sound - Stop CarNoise Immediately
Set CarNoise = CarLoop3 <gen>
Sound - Play CarNoise
Set SoundNum = 3
Collapse Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Collapse And - All (Conditions) are true
Collapse Conditions
Collapse Or - Any (Conditions) are true
Collapse Conditions
CurrentSpeed Greater than or equal to 30.00
CurrentSpeed Less than or equal to -30.00
SoundNum Not equal to 2
Collapse Then - Actions
Sound - Stop CarNoise Immediately
Set CarNoise = CarLoop2 <gen>
Sound - Play CarNoise
Set SoundNum = 2
Collapse Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Collapse And - All (Conditions) are true
Collapse Conditions
Collapse Or - Any (Conditions) are true
Collapse Conditions
CurrentSpeed Greater than or equal to 10.00
CurrentSpeed Less than or equal to -10.00
SoundNum Not equal to 1
Collapse Then - Actions
Sound - Stop CarNoise Immediately
Set CarNoise = CarLoop1 <gen>
Sound - Play CarNoise
Set SoundNum = 1
Collapse Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Collapse And - All (Conditions) are true
Collapse Conditions
CurrentSpeed Less than 10.00
CurrentSpeed Greater than -10.00
SoundNum Not equal to 0
Collapse Then - Actions
Sound - Stop CarNoise Immediately
Set CarNoise = W3RaceCarLoop <gen>
Sound - Play CarNoise
Set SoundNum = 0
Else - Actions
Item - Remove PathItem
Animation - Change PLAYER's animation speed to ((CurrentSpeed / BOTspeedMax[playerBOT]) x 100.00)% of its original speed
INPUT:
Collapse ESC
Collapse Events
Player - Player 1 (Red) skips a cinematic sequence
Conditions
Collapse Actions
Custom script: call EnableThirdPersonCam(GetOwningPlayer(udg_PLAYER), null, 0)
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(playerBOT + 1) Greater than BOTlist
Collapse Then - Actions
Set playerBOT = 0
Collapse Else - Actions
Set playerBOT = (playerBOT + 1)
Set CurrentSpeed = 0.00
Unit - Replace PLAYER with a BOTtype[playerBOT] using The new unit's max life and mana
Set PLAYER = (Last replaced unit)
Custom script: call SetUnitAnimationByIndex(udg_PLAYER, udg_AnimationIndex[udg_playerBOT])
Animation - Change PLAYER's animation speed to ((CurrentSpeed / BOTspeedMax[playerBOT]) x 100.00)% of its original speed
Custom script: call EnableThirdPersonCam(GetOwningPlayer(udg_PLAYER), udg_PLAYER, 0.1)
Collapse ArrowUpOn
Collapse Events
Player - Player 1 (Red) Presses the Up Arrow key
Conditions
Collapse Actions
Set NPTarw[0] = True
Collapse ArrowUpOff
Collapse Events
Player - Player 1 (Red) Releases the Up Arrow key
Conditions
Collapse Actions
Set NPTarw[0] = False
Collapse ArrowLeftOn
Collapse Events
Player - Player 1 (Red) Presses the Left Arrow key
Conditions
Collapse Actions
Set NPTarw[1] = True
Collapse ArrowLeftOff
Collapse Events
Player - Player 1 (Red) Releases the Left Arrow key
Conditions
Collapse Actions
Set NPTarw[1] = False
Collapse ArrowDownOn
Collapse Events
Player - Player 1 (Red) Presses the Down Arrow key
Conditions
Collapse Actions
Set NPTarw[2] = True
Collapse ArrowDownOff
Collapse Events
Player - Player 1 (Red) Releases the Down Arrow key
Conditions
Collapse Actions
Set NPTarw[2] = False
Collapse ArrowRightOn
Collapse Events
Player - Player 1 (Red) Presses the Right Arrow key
Conditions
Collapse Actions
Set NPTarw[3] = True
Collapse ArrowRightOff
Collapse Events
Player - Player 1 (Red) Releases the Right Arrow key
Conditions
Collapse Actions
Set NPTarw[3] = False