• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Sliding trigger...

Status
Not open for further replies.
Level 11
Joined
May 31, 2008
Messages
698
Ur lucky im makin a slidin map too :D
3 triggers:

  • Slide
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Set Sliding_Units = (Units in (Playable map area) matching ((Terrain type at (Position of (Matching unit))) Equal to Northrend - Ice))
      • Set Paused_Units = (Units in (Playable map area) matching (((Matching unit) is paused) Equal to True))
      • Unit Group - Pick every unit in Paused_Units and do (Unit Group - Remove (Picked unit) from Sliding_Units)
      • Unit Group - Pick every unit in Sliding_Units and do (Actions)
        • Loop - Actions
          • Set Slide_Unit_Loc[(Player number of (Owner of (Picked unit)))] = ((Position of (Picked unit)) offset by (((Real((Level of (Picked unit)))) / 10.00) +
          • *>((Current movement speed of (Picked unit)) / 65.25)) towards (Facing of (Picked unit)) degrees)
          • Unit - Move (Picked unit) instantly to Slide_Unit_Loc[(Player number of (Owner of (Picked unit)))]
          • Unit - Order (Picked unit) to Move To Move[(Player number of (Owner of (Picked unit)))]
      • Custom script: call DestroyGroup(udg_Sliding_Units)
      • Custom script: call DestroyGroup(udg_Paused_Units)
      • Custom script: call RemoveLocation(udg_Slide_Unit_Loc[GetPlayerId(GetOwningPlayer(GetEnumUnit()))+1])

  • Turn PointTarget
    • Events
      • Unit - A unit Is issued an order targeting a point
    • Conditions
      • (Terrain type at (Position of (Triggering unit))) Equal to Northrend - Ice
    • Actions
      • Set Move[(Player number of (Owner of (Ordered unit)))] = (Target point of issued order)
      • Wait 0.04 seconds
      • Custom script: call RemoveLocation(udg_Move[GetPlayerId(GetOwningPlayer(GetTriggerUnit()))+1])

  • Turn UnitTarget
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • (Terrain type at (Position of (Triggering unit))) Equal to Northrend - Ice
    • Actions
      • Set Move[(Player number of (Owner of (Picked unit)))] = (Position of (Target unit of issued order))
      • Wait 0.04 seconds
      • Custom script: call RemoveLocation(udg_Move[GetPlayerId(GetOwningPlayer(GetTriggerUnit()))+1])
This is my basic slide trigger (hopefully) leak free. It is a tag so thats why there is that stuff with the paused unit and whatnot. The speed of the slide is based on the units movespeed and its level. Just add or remove what you need for your purposes.

+rep if this helped you pls :thumbs_up:

EDIT:
*Made 1 line into 2 so it didnt make the post ginormous*
BTW the turn doesnt work because everytime it moves the unit it makes it stop, so you have to make it move to the target again everytime it moves the unit (instantly)
 
Level 15
Joined
Aug 18, 2007
Messages
1,390
His trigger us using waits, and points, mine would look like this:

  • Event
    • Every 0.03 seconds
  • Conditions
  • Actions
    • Unit group - Pick every unit in (Units in playable map matching (terrain type of position of (matching unit) equal to (Northrend - Ice)
      • Loop - actions
        • Unit - move picked unit to (position of picked unit) offset by 10 towards (facing of picked unit)
  • Event
    • Unit is issued an order to target a point
  • Conditions
    • Order type of (issued order) equal to order(smart)
  • Actions
    • Make (triggering unit) face (target point of issued order) over 0.00 seconds
My trigger there will leak, just look at the "things that leak" thread, and remove them :p
 
Level 11
Joined
May 31, 2008
Messages
698
  • Event
    • Unit is issued an order to target a point
  • Conditions
    • Order type of (issued order) equal to order(smart)
  • Actions
    • Make (triggering unit) face (target point of issued order) over 0.00 seconds

Did you test this out? I didnt, but it seems like the unit would face the direction instantly instead of smoothly turning. With my trigger, it actually makes the unit turn in a smooth motion and the speed in which it turns is actually related to the specific units turn speed (in object editor). Also everytime that the units is moved forward instantly in the actual slide trigger its order is reset to stop.
 
Level 11
Joined
May 31, 2008
Messages
698
Ok but my first trigger (actual slide) is pretty much the same as urs but its leak free. Also using every .01 seconds would prolly be better than every .03 cuz it will make it more smooth. If its too fast then just change the distance to something smaller
 
Level 15
Joined
Aug 18, 2007
Messages
1,390
Ok but my first trigger (actual slide) is pretty much the same as urs but its leak free. Also using every .01 seconds would prolly be better than every .03 cuz it will make it more smooth. If its too fast then just change the distance to something smaller

Didn't make the leak removal of 2 reasons:

1) its easy
2) It was just an example.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
wolfman, your triggers leak.
Infact it leaks multiple locations based on the number of units affected. Please do not say it is leak free when it is not.

On average WC3 updates at 60 FPS or lower, thus it is pointless running in 100 times a second as 40 of the updates will not even be graphically visable.
If you want it to look ultra smooth, use 0.02 seconds as already that halfs the recources used to 50 times a second which results in only atmost 10 frames displaying the same data a second.

If your PC is like mine and struggles to pass 30 FPS, then you could lower it even still.
 
Level 11
Joined
May 31, 2008
Messages
698
Ok i attached a map with slide trigger. It is leak free and very efficient. It also is set up so units can slide faster on certain terrains (like dark ice vs. regular ice).
Brought to you courteosy of Clan BoM :spell_breaker: Hope it helps

EDIT:
Sorry for double post >.< didnt realize my post was the most recent one
 

Attachments

  • GUI Slide.w3x
    28.7 KB · Views: 101
Status
Not open for further replies.
Top