w00t22
CSS L4D DoD? Steam ID = w00t22
- Reaction score
- 43
Wisp Wheels Increasing Radius
Variables at creation
- Wheel_Angle - Real - Default
- Wheel_Point - Point - Default
- WheelGroup - Unit Group - Default
- Wisp_Distance - Real - Default
- Wisp_Grow - Boolean - Default (false)
Theres two triggers. First one will create the wisps at points and add them to a group. The trigger creates the wisps 75 points from the players start and puts them in a circle 60 points from each other. 6 wisps total.
Simple Wheel Creation
Code:
Events
Map initialization
Conditions
Actions
For each (Integer A) from 1 to 6, do (Actions)
Loop - Actions
Set Wheel_Point = ((Player 1 (Red) start location) offset by 150.00 towards ((Real((Integer A))) x 60.00) degrees)
Unit - Create 1 Wisp for Player 1 (Red) at Wheel_Point facing Default building facing degrees
Unit Group - Add (Last created unit) to WheelGroup
Unit - Set the custom value of (Last created unit) to ((Integer A) x 60)
Custom script: call RemoveLocation (udg_Wheel_Point)
Custom script: set udg_Wheel_Point = null
Set Wisp_Distance = 150.00
Set Wisp_grow = True
Trigger - Turn on Wheel On <gen>
Then my second trigger will do 3 things. First it will check to see if the wheel is bigger than 700 points from origin to wisp. if it is it will set Wisp_Grow to false. Then if it isn't, it will check if it is smaller than 100 points from origin to wisp. If it is it will set Wisp_Grow true. Then if Wisp_Grow is true it will set the distance to increase by 1 point every .04 seconds but if false it will set -1 point every .04 seconds. Then it will move the wisp to the spot depending on wisp angle and wisp distance. Wisp angle is periodically increased by 1 point every .04 seconds.
Wheel On
Code:
Events
Time - Every 0.05 seconds of game time
Conditions
Actions
Set Wheel_Angle = (Wheel_Angle + 1.00)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
[COLOR="Lime"]Wisp_Distance Less than or equal to 100.00[/COLOR]
Then - Actions
Set Wisp_grow = True
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
[COLOR="Lime"]Wisp_Distance Greater than or equal to 700.00[/COLOR]
Then - Actions
Set Wisp_grow = False
Else - Actions
Set Wheel_Angle = ([COLOR="DarkOrange"]Wheel_Angle + 1.00[/COLOR])
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Wisp_grow Equal to True
Then - Actions
Set Wisp_Distance = ([COLOR="Blue"]Wisp_Distance + 1.00[/COLOR])
Else - Actions
Set Wisp_Distance = ([COLOR="Blue"]Wisp_Distance - 1.00[/COLOR])
Unit Group - Pick every unit in WheelGroup and do (Actions)
Loop - Actions
Set Wheel_Point = ((Player 1 (Red) start location) offset by Wisp_Distance towards ((Real((Custom value of (Picked unit)))) + Wheel_Angle) degrees)
Unit - Move (Picked unit) instantly to Wheel_Point
Custom script: call RemoveLocation (udg_Wheel_Point)
Custom script: set udg_Wheel_Point = null
Screenshots
Enjoy. If you want it to be faster change the coloured parts. Blue is distance and orange is speed, and lime green is for how big or small you want the wheel to get.