| 03-10-2010, 06:29 AM | #1 | |
Just fooling around. I want to see if I got this right though: Trigger: ![]() Map Initialization![]() ![]() Conditions![]() ![]() 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![]() SetupAutomaton![]() ![]() Events![]() ![]() Conditions![]() ![]() 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![]() Camera![]() ![]() Conditions![]() ![]() 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![]() Movement![]() ![]() Conditions![]() ![]() Actions![]() ![]() ![]() If (All Conditions are True) then do (Then Actions) else do (Else Actions)![]() ![]() ![]() If (All Conditions are True) then do (Then Actions) else do (Else Actions)![]() ![]() ![]() ![]() 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![]() ![]() ![]() ![]() Else - Actions![]() ![]() ![]() ![]() ![]() If (All Conditions are True) then do (Then Actions) else do (Else Actions)![]() ![]() ![]() ![]() ![]() ![]() 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![]() ![]() ![]() ![]() ![]() ![]() Else - Actions![]() ![]() ![]() ![]() ![]() ![]() ![]() If (All Conditions are True) then do (Then Actions) else do (Else Actions)![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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![]() ![]() ![]() Animation - Change PLAYER's animation speed to CurrentSpeed% of its original speedAlso, 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 |
Ya know, I might be fooling around with a Sandbox, but that's one Sandbox I actually want to finish! Trigger: ![]() ZeroSeconds![]() ![]() Conditions![]() ![]() 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)![]() SetupAutomaton![]() ![]() Events![]() ![]() Conditions![]() ![]() 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.)![]() Movement![]() ![]() Conditions![]() ![]() Actions![]() ![]() ![]() If (All Conditions are True) then do (Then Actions) else do (Else Actions)![]() ![]() ![]() If (All Conditions are True) then do (Then Actions) else do (Else Actions)![]() ![]() ![]() ![]() 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)![]() ![]() ![]() ![]() ![]() 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![]() ![]() ![]() ![]() Else - Actions![]() ![]() ![]() ![]() ![]() If (All Conditions are True) then do (Then Actions) else do (Else Actions)![]() ![]() ![]() ![]() ![]() ![]() 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)![]() ![]() ![]() ![]() ![]() ![]() ![]() 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![]() ![]() ![]() ![]() ![]() ![]() Else - Actions![]() ![]() ![]() ![]() ![]() ![]() ![]() If (All Conditions are True) then do (Then Actions) else do (Else Actions)![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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)![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Else - Actions![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() If (All Conditions are True) then do (Then Actions) else do (Else Actions)![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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)![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Else - Actions![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() If (All Conditions are True) then do (Then Actions) else do (Else Actions)![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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)![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Unit - Move PLAYER instantly to ((Position of PLAYER) offset by CurrentSpeed towards (Facing of PLAYER) degrees)![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Else - Actions![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() If (All Conditions are True) then do (Then Actions) else do (Else Actions)![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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)![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Unit - Move PLAYER instantly to ((Position of PLAYER) offset by CurrentSpeed towards (Facing of PLAYER) degrees)![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Else - Actions![]() ![]() ![]() Item - Remove PathItem![]() ESC![]() ![]() Conditions![]() ![]() Actions![]() ![]() ![]() Custom script: call EnableThirdPersonCam(GetOwningPlayer(udg_PLAYER), null, 0)![]() ![]() ![]() 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) 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 |
You need to use use custom script to keep animations on permanently: 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... |
