Lord_Kakashi
The Wabbits are attacking
- Reaction score
- 27
The little slidin' guide..
1. Open trigger editor duh...
2. Create new trigger (oh rly?)
3. Create new variable point type [array] named TempPoints.
note: name doesnt really matter, but thats the name im gonna use.
4. Create a new Variable Unit group type [Array] named TempPicked.
5. Click new event for your new trigger find Time - Periodic Event on the list. set the value to 0.03
6. Create new action, Find Set variable on the action list.
7. in the first value select TempPicked and set array size to 0
8. Now in the second value set it to Unit in region matching condition
9. Edit the condition and find the And condition on the list.
10. Edit the the first of the new condition fields to Player controller comparison - the condition set under player comparison must be:
a. Player owner of matching unit controller
b. Equal to
c. User
11. Close the condition by clicking on untill you are back at the "and" condition.
12. Select the other value and find Terrain type Comparison on the list.
13. set the first field value to: Terrain type at position of matching unit
14. Next value "Equal to"
15. Last value "your terrain type in your tileset"
Example: Icecrown Glacier - Ice
16. Now create a new action, Find Unit group - Pick every unit in unit group and do multiple actions on the list now select your TempPicked[0] as the unit group
17. Now add a new action in your "player group loop" With Set Variable
18. Set the variable as TempPoints[0] and the second value as Unit - Position of picked unit
19. Select picked unit as your value in the "position of picked unit"
20 add new action to your "player group loop." Find Unit - Move unit instantly on the list.
21. Open the value under move unit instantly and find point with polar offset
22. Set the point as TempPoints[0]
23. Set the offset as 11.
24 set the towards value to Unit Facing Angle
25. Select picked unit as the unit in the facing angle conditions
26. Create new action. Find custom script on the list.
27 write or copy/paste this into the line: call DestroyGroup (udg_TempPicked[0])
28 create another action with custom script
29 Write or copy paste this into the line: call RemoveLocation(udg_TempPoints[0])
How did the custom script lines work again?? :nuts:
well.. very simply put, You ask it to "Call" the function "RemoveLocation or DestroyGroup" to kill memory leaks
after that you tell it what to remove or destroy. This value is put inside () marks and written with a udg_ infront of it
so the line is actually:
call RemoveLocation(udg_VariableName[Array number Should only be added if the variable is an array])
My finished trigger looks like this:
Code:
Ice Slide
Events
Time - Every 0.03 seconds of game time
Conditions
Actions
Set TempPicked[0] = (Units in (Playable map area) matching ((((Owner of (Matching unit)) controller) Equal to User) and ((Terrain type at (Position of (Matching unit))) Equal to Icecrown Glacier - Ice)))
Unit Group - Pick every unit in TempPicked[0] and do (Actions)
Loop - Actions
Set TempPoints[0] = (Position of (Picked unit))
Unit - Move (Picked unit) instantly to (TempPoints[0] offset by 11.00 towards (Facing of (Picked unit)) degrees)
Custom script: call DestroyGroup (udg_TempPicked[0])
Custom script: call RemoveLocation(udg_TempPoints[0])
Side notes: To make the slide slower/faster try changing the time of the event to accour and the offset length. "Offset is 11 in the trigger above"
-Lord_Kakashi
Hope this helps