Need help with slide triggers

Fir3l0rD

New Member
Reaction score
1
OK so i have a trigger written for a slide.

Code:
White Marble
Events-every 0.04 Seconds
Conditions
Actions- Set temp_group(0)= (units of type (unit type))
            Unit Group - Pick every unit in temp_group(0) and do (actions)
                  Loop-Actions
                          Set temp_point(0) = (position of (picked unit))
                          If (all conditions are true) then do (then actions) else do (else actions)
                               If Conditions
                               Terrain type at temp_point(0) Equal to Cityscape-white marble
                               ((Picked unit) is alive) equal to true
                         Then actions
                       Unit-move (picked unit) instantly to (temp_point(0) offset by 11.00 towards (facing of(picked unit)) degrees)
                            Custom Script: call DestroyGroup(udg_temp_group(0))
                            Custom Script: call RemoveLocation(udg_temp_point(0))
               
                         Else actions-
                                       Do nothing

Not sure why i made the variables arrays but it shouldn't matter

Basically, if i set the time so that the slide is smooth and looks good, i cannot turn my unit. If i make the time interval slower, i'm able to turn my unit decently while sliding, but it choppy and he like blinks along.

What is the best code for a smooth slide trigger that gives you the ability to change the direction of your units?
 

Iwan_Krissov

New Member
Reaction score
18
perhaps you will have to increase the turning rate of your unit, while it slides...
It may than be able to change direction while sliding, but just a guess...
 

Flare

Stops copies me!
Reaction score
662
make a boolean variable called Sliding or something, and set it to True when the unit is sliding, and set it to False when the unit stops sliding. in a new trigger, add the events Unit targets an object/a unit/a point. if (Boolean variable) = True, set temppt = Target point of issued order, or position of target unit of issued order, and make ur unit face that point over # seconds
 

Fir3l0rD

New Member
Reaction score
1
make a boolean variable called Sliding or something, and set it to True when the unit is sliding, and set it to False when the unit stops sliding. in a new trigger, add the events Unit targets an object/a unit/a point. if (Boolean variable) = True, set temppt = Target point of issued order, or position of target unit of issued order, and make ur unit face that point over # seconds

I was trying this, one problem, I cant set a variable to "when a unit is sliding" because the editor doesnt know what sliding is. This idea is good, i just need to know how to set the variable correctly.
 

Fir3l0rD

New Member
Reaction score
1
in your if/then/else function, add Set <Boolean variable> equal to true in the Then part. in the else part, add Set <Boolean variable> equal to false. that way, itll be true when ur unit is on sliding terrain, and false when the unit isnt on sliding terrain.

how can i make a condition set to "if unit is sliding"
 

Sinan2

New Member
Reaction score
9
If terrain in TempPoint(Location of unit) equal to (Your Terrain Here) then set Sliding=True else do set Sliding=False
 

Flare

Stops copies me!
Reaction score
662
1) make the boolean variable, name it whatever you want

2) in the then part of ur if/then/else in the posted trigger, set the above
variable to TRUE

3) in the else part of if/then/else of posted trigger, set the above variable to FALSE

4) in a totally new trigger, add the event Unit is issued an order targetting a point, and targetting a unit.

4 part 2) add the condition - (the boolean variable we made at the beginning) equal to true

5) add an if/then else to this new trigger, with condition (target unit of issued order equal to no unit)

6) in the Then part of this new if/then/else, set a point variable (call it temppoint for example) at target point of issued order

6 part 2) in the Else part of this new If/then/else, set a point variable (temppoint) to position of target unit of issued order.

7) make (sliding unit, it needs to be stored in a variable) face temppoint over (whatever amount of time you want it to take for the turn to be complete) seconds

8) add this line OUTSIDE the if/then/ese of the new trigger - Custom script: call RemoveLocation (udg_temppoint)

WE doesnt actually have something to check if the unit is sliding, since the unit technically isnt sliding (just being moved instantly, very often) so we make a work-around for it

if that doesnt explain if to you, i dont kno wat will
 

Ghostwind

o________o
Reaction score
172
I did not make this tool, but it is helpful for this kind of stuff.
Also does other maze triggers for you.
 

Attachments

  • MazeTriggers v1.4b.zip
    30.6 KB · Views: 118
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      • Ghan
        Administrator - Servers are fun

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top