• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Slippery Ice Trigger Blues (Help with ice trigger), UNSOLVED

Status
Not open for further replies.
Level 2
Joined
Jul 12, 2010
Messages
7
Slippery Ice Trigger Blues (Help with ice trigger), SOLVED

Hello everyone!!!! i am trying to get players 1-12's Runner to slide on ice, and i cannot use regions i absolutely MUST use terrain conditions. so it works just dandy, but something kind of weird happens

when a player's runner is sliding on ice.. then another player's runner is issued an order to move somewhere, the guy sliding on the ice goes in the direction of the order given by player #2

get what im saying? heres my triggers, one for sliding and one for turning. i figure it has to do with turning

Sliding
Events
Time - Every 0.03 seconds of game time
Conditions
(Terrain type at (Position of Maze Runner 0018 <gen>)) Equal to Northrend - Ice
Actions
Unit - Move Maze Runner 0018 <gen> instantly to ((Position of Maze Runner 0018 <gen>) offset by 9.00 towards (Facing of Maze Runner 0018 <gen>) degrees)

Untitled Trigger 005
Events
Unit - A unit Is issued an order targeting a point
Conditions
(Terrain type at (Position of Maze Runner 0018 <gen>)) Equal to Northrend - Ice
Actions
Unit - Make Maze Runner 0018 <gen> face (Target point of issued order) over 0.00 seconds

i do these for each separate runner. also i am aware im leaking like a bitch, but thats ok right now

also these little orc icons are too cute :grin:
 
Last edited:
Level 10
Joined
Aug 15, 2008
Messages
720
In second trigger, Add Condition:
  • (Triggering Unit) equal to Maze Runner 0018 <gen>
Else it will work when ANY player issues an order targeting a point.

Well, if you want to fix leak, then make variable like temploc and fix first trigger's point action. You basically spawn points and do not remove em. And in these periodic events, it is very vital to fix leaks. With 0.03 periodic event you spawn like over 30 points per second. That will definitely cause some lag xD
 
Level 16
Joined
May 1, 2008
Messages
1,605
Moin moin =)

Actually there different way to make a sliding "system". I used sometime ago something like that:

  • Slide
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units in (Playable map area) matching (((((Matching unit) is dead) Equal to False) and ((Unit-type of (Matching unit)) Equal to Peasant)) and ((Terrain type at (Position of (Matching unit))) Equal to Lordaeron Summer - Dark Grass))) and do (Actions)
        • Loop - Actions
          • Set TempLoc1 = (Position of (Picked unit))
          • Set TempLoc2 = (TempLoc1 offset by 9.00 towards (Facing of (Picked unit)) degrees)
          • Unit - Move (Picked unit) instantly to TempLoc2
      • Custom script: call RemoveLocation(udg_TempLoc1)
      • Custom script: call RemoveLocation(udg_TempLoc2)
  • Slide 2
    • Events
      • Unit - A unit Is issued an order targeting a point
    • Conditions
    • Actions
      • Set TempLoc3 = (Position of (Triggering unit))
      • Set TempLoc4 = (Target point of issued order)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Terrain type at TempLoc3) Equal to Lordaeron Summer - Dark Grass
        • Then - Actions
          • Unit - Make (Triggering unit) face TempLoc4 over 0.00 seconds
        • Else - Actions
      • Custom script: call RemoveLocation(udg_TempLoc3)
      • Custom script: call RemoveLocation(udg_TempLoc4)
No leaks and works for every player, so no miss-moves

Greetings
~ The Bomb King > Dr. Boom
 
Level 2
Joined
Jul 12, 2010
Messages
7
In second trigger, Add Condition:
  • (Triggering Unit) equal to Maze Runner 0018 <gen>
Else it will work when ANY player issues an order targeting a point.

Well, if you want to fix leak, then make variable like temploc and fix first trigger's point action. You basically spawn points and do not remove em. And in these periodic events, it is very vital to fix leaks. With 0.03 periodic event you spawn like over 30 points per second. That will definitely cause some lag xD
ty for fixing my turn problems!!!!
can u pls explain in newbie terms how to fix the leak
 
Level 8
Joined
Jun 26, 2010
Messages
530
Read it once and you will always fix your leaks. Just use somebody's solution and you may ask for another =)
 
Level 2
Joined
Jul 12, 2010
Messages
7
Read it once and you will always fix your leaks. Just use somebody's solution and you may ask for another =)
the maker of that guide assumes the reader is mostly adept at world editor. idk what custom scripts are is there anywhere i can learn about those :cry:
 
Level 8
Joined
Jun 26, 2010
Messages
530
Custom Scripts are a GUI function that allows you to use Jass Scripts without converting the whole trigger to Jass. Let me give you an example:

Let's say i want to create a ability that heals a unit by 500 hp, then, 3 seconds after, dmg it by 500hp. Should be simply made with Gui, but the problem is, i wanna add an effect when the unit is healed, and another, 3 seconds after, when the unit is damaged. If setting the special effects to globals, if i have 2 units casting this ability at the same time, the frist special effect would overwrite the second. So, only the second would be destroyed (and the first would leak). The only way to solve that is using Jass locals. They're variables that only exist in specific functions. So, everytime the trigger runs, they are created, used only in that trigger and only in that "instance", and then they are destroyed after the trigger is finished. But i am too confortable with GUI, i don't want to convert my trigger to Jass just for removing that leak, so i use custom scripts.

  • TempLife
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to TemporaryLife
    • Actions
      • Custom script: local effect EFX
      • Custom script: local effect EFX2
      • Unit - set life of (triggering unit) = (life of triggering unit) + 500
      • Special Effect - Create a special effect attached to the chest of (triggering unit) using Abilities\Spells\don'tremember\whatever\HealTarget.mdl
      • Custom script: set EFX = GetLastCreatedEffectBJ()
      • Wait 3 seconds
      • Custom script: call DestroyEffectBJ( EFX )
      • Unit - set life of (triggering unit) = (life of triggering unit) - 500
      • Special Effect - Create a special effect attached to the chest of (triggering unit) using Abilities\Spells\blablabla\DeathPact.mdl
      • Custom script: set EFX2= GetLastCreatedEffectBJ()
      • Wait 1.60 seconds
      • Custom script: call DestroyEffectBJ( EFX2 )
See, locals MUST be declared on the beggining of the function. That's why they're at top. You set them as
local <variable type> <name>

Here, set EFX = GetLastCreatedEffectBJ() is the function to set EFX (the first effect local) to the last created special effect. It does exactly the same as the GUI
  • Set effectvariable = LastCreatedSpecialEffect]
but they can work with locals.

Finally, i use the call DestroyEffectBJ( EFX ) twice to destroy the effects i created
 
Status
Not open for further replies.
Top