The TFT "Slide" trigger. Step-By-Step

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 :)
 

Chocobo

White-Flower
Reaction score
409
Better should be that.

Code:
Variables
Facing (real)
Position (location, array)

Code:
Events
Game - Every 0.04 seconds of game-time //0.04 is enough for a fluid action and a less lag to around 0.3 sec instead of 0.5 with 0.03

Conditions
None

Actions
Custom Script : set bj_wantDestroyGroup = true
Pick Every Units in (Units in (Playable map area) matching ((Terrain type at (Position of (Matching unit)) Equal to Icecrown Glacier - Ice) and do Actions
      Set Position[1] = (Position of (Picked unit))
      Set Facing = (Facing of (Picked unit))
      Set Position[2] = (Position[1] offset by <Whatever you want> towards Facing degrees)
      Unit - Move instantly (Picked unit) to (Position[2])
Custom script:   call RemoveLocation(udg_Position[1])
Custom script:   call RemoveLocation(udg_Position[2])
 

Lord_Kakashi

The Wabbits are attacking
Reaction score
27
as far as i recall "set bj_wantDestroyGroup = true" was just a temporary solution blizzard made and is no longer "the correct way to do it"?
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
> Position of (Matching unit)

This leaks a position, which is a bad idea on something that runs that often.

Why is "TempPicked" an array?
 

Lord_Kakashi

The Wabbits are attacking
Reaction score
27
AceHart said:
> Position of (Matching unit)

This leaks a position, which is a bad idea on something that runs that often.

Why is "TempPicked" an array?

Well its used for more then one thing. The variable...

soo would this trigger be better?
Code:
Ice Slide
    Events
        Time - Every 0.04 seconds of game time
    Conditions
    Actions
        Set TempPicked[0] = (Units in (Playable map area) matching ((((Owner of (Matching unit)) controller) Equal to User) and ((Unit-type of (Matching unit)) Equal to Dude)))
        Unit Group - Pick every unit in TempPicked[0] and do (Actions)
            Loop - Actions
                Set TempPoints[0] = (Position of (Picked unit))
                Set TempPoints[3] = (TempPoints[0] offset by 11.00 towards (Facing of (Picked unit)) degrees)
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Terrain type at TempPoints[0]) Equal to Icecrown Glacier - Ice
                    Then - Actions
                        Unit - Move (Picked unit) instantly to TempPoints[3]
                    Else - Actions
                        Do nothing
        Custom script:   call DestroyGroup (udg_TempPicked[0])
        Custom script:   call RemoveLocation(udg_TempPoints[0])
        Custom script:   call RemoveLocation(udg_TempPoints[3])
 

Chocobo

White-Flower
Reaction score
409
Fixed units still better than groups, you can't fix who can slide and who can not slide.

Code:
Sliding Group
    Events
         Time - Elasped game time 0.00 seconds
    Conditions
    Actions
         Set trigger = (<whatever, create a trigger with nothing)
         Unit Group - Add <your hero> to SlidingGroup
         Unit Group - Pick every unit in SlidingGroup and do (Actions)
            Loop - Actions
                  Trigger - Take trigger and add ((Picked unit) dies)
         Trigger - Take trigger and add (Unit Group - Remove ((Triggering unit) from SlidingGroup)
         Custom Script : call TriggerAddAction(trigger, DestroyTrigger(GetTriggeringTrigger))

Code:
Ice Slide
    Events
        Time - Every 0.04 seconds of game time
    Conditions
    Actions
        Unit Group - Pick every unit in SlidingGroup and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Terrain type at Position[1]) Equal to Icecrown Glacier - Ice
                    Then - Actions
                        Set Position[1] = (Position of (Picked unit))
                        Set Degrees = (Facing of (Picked unit))
                        Set Position[2] = (Position[1] offset by 11.00 towards Degrees degrees)
                        Unit - Move (Picked unit) instantly to Position[2]
                    Else - Actions
                        Do nothing
 

dudds4

New Member
Reaction score
0
uh... i tried the way the guide said, and it didnt work, but it did show me the idea of it. i figured one out myself

events - every 0.05 seconds
conditions -
actions - unit group - pick every unit in units of type (here would be the hero unit, for me, its demon hunter) and do actions
loop-actions
if (all conditions are true) then do (then actions) else do (else actions)
if conditions -
terrain type at position of picked unit equal to northrend ice
then actions -
unit-move (picked unit) instantly to ((position of (picked unit)) offset by 20.00 towards (facing of (picked unit)) degrees)
else actions -
do nothing
 

electricrain

New Member
Reaction score
0
hey can you write me step by step on how you did it with steering? this guy is confusing!! plz help! and for roc. plzplzplzpzlplz!!! i rele wanna do this in my map.
 

Dirac

22710180
Reaction score
147
hey can you write me step by step on how you did it with steering? this guy is confusing!! plz help! and for roc. plzplzplzpzlplz!!! i rele wanna do this in my map.

ROC? Roc editor is useless. I wouldnt play a map made in ROC. Get TFT
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top