• 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] need help

Status
Not open for further replies.
Level 3
Joined
Sep 30, 2011
Messages
60
Hey guys, does this trigger leaks? or is it mui/mpi?

  • Revive Heroes
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • Wait 5.00 seconds
      • Hero - Instantly revive (Triggering unit) at (Random point in Region 000 <gen>), Show revival graphics
and.. can someone fix this trigger for me..

  • Untitled Trigger 001
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Hiraishin
    • Actions
      • Set HiraishinC_Unit[0] = (Triggering unit)
      • Set HiraishinC_Unit[1] = (Target unit of ability being cast)
      • -------- -------------------------- --------
      • Unit - Pause HiraishinC_Unit[0]
      • Animation - Play HiraishinC_Unit[0]'s Attack animation
      • -------- -------------------------- --------
      • Set HiraishinC_Point[0] = (Position of HiraishinC_Unit[0])
      • Set HiraishinC_Point[1] = (Position of HiraishinC_Unit[0])
      • -------- -------------------------- --------
      • Set HiraishinC_Angle[0] = (Angle from HiraishinC_Point[0] to HiraishinC_Point[1])
      • Set HiraishinC_Point[2] = ((Position of HiraishinC_Unit[0]) offset by 25.00 towards (Facing of HiraishinC_Unit[0]) degrees)
      • Unit - Create 1 dummy kunai for (Owner of HiraishinC_Unit[0]) at HiraishinC_Point[0] facing HiraishinC_Angle[0] degrees
      • Set HiraishinC_Unit[2] = (Last created unit)
      • -------- -------------------------- --------
      • Custom script: call RemoveLocation(udg_HiraishinC_Point[0])
      • Custom script: call RemoveLocation(udg_HiraishinC_Point[1])
      • Custom script: call RemoveLocation(udg_HiraishinC_Point[2])
      • -------- -------------------------- --------
      • Trigger - Turn on Untitled Trigger 002 <gen>
  • Untitled Trigger 002
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Set HiraishinC_Point[0] = (Position of HiraishinC_Unit[2])
      • Set HiraishinC_Point[1] = (Position of HiraishinC_Unit[1])
      • Set HiraishinC_Angle[0] = (Angle from HiraishinC_Point[0] to HiraishinC_Point[1])
      • Set HiraishinC_Point[2] = (HiraishinC_Point[0] offset by 30.00 towards HiraishinC_Angle[0] degrees)
      • -------- -------------------------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Distance between HiraishinC_Point[0] and HiraishinC_Point[1]) Less than or equal to 75.00
        • Then - Actions
          • Unit - Remove HiraishinC_Unit[2] from the game
          • Animation - Change HiraishinC_Unit[0]'s animation speed to 250.00% of its original speed
          • Unit - Move HiraishinC_Unit[0] instantly to HiraishinC_Point[2]
          • Custom script: call RemoveLocation(udg_HiraishinC_Point[2])
          • Set HiraishinC_Point[2] = (HiraishinC_Point[1] offset by 40.00 towards 60.00 degrees)
          • Animation - Play HiraishinC_Unit[0]'s attack animation
          • Wait 0.20 seconds
          • Unit - Move HiraishinC_Unit[0] instantly to HiraishinC_Point[2]
          • Custom script: call RemoveLocation(udg_HiraishinC_Point[2])
          • Set HiraishinC_Point[2] = (HiraishinC_Point[1] offset by 60.00 towards 180.00 degrees)
          • Animation - Play HiraishinC_Unit[0]'s attack 2 animation
          • Wait 0.20 seconds
          • Unit - Move HiraishinC_Unit[0] instantly to HiraishinC_Point[2]
          • Custom script: call RemoveLocation(udg_HiraishinC_Point[2])
          • Set HiraishinC_Point[2] = (HiraishinC_Point[1] offset by 40.00 towards 360.00 degrees)
          • Animation - Play HiraishinC_Unit[0]'s attack animation
          • Wait 0.20 seconds
          • Unit - Move HiraishinC_Unit[0] instantly to HiraishinC_Point[2]
          • Custom script: call RemoveLocation(udg_HiraishinC_Point[2])
          • Set HiraishinC_Point[2] = (HiraishinC_Point[1] offset by 50.00 towards 90.00 degrees)
          • Animation - Play HiraishinC_Unit[0]'s attack 2 animation
          • Wait 0.20 seconds
          • Unit - Move HiraishinC_Unit[0] instantly to HiraishinC_Point[2]
          • Custom script: call RemoveLocation(udg_HiraishinC_Point[2])
          • Set HiraishinC_Point[2] = (HiraishinC_Point[1] offset by 50.00 towards -180.00 degrees)
          • Animation - Play HiraishinC_Unit[0]'s attack animation
          • Unit - Move HiraishinC_Unit[0] instantly to HiraishinC_Point[2]
          • Custom script: call RemoveLocation(udg_HiraishinC_Point[2])
        • Else - Actions
          • Unit - Move HiraishinC_Unit[2] instantly to HiraishinC_Point[2]
          • Custom script: call RemoveLocation(udg_HiraishinC_Point[0])
          • Custom script: call RemoveLocation(udg_HiraishinC_Point[1])
          • Custom script: call RemoveLocation(udg_HiraishinC_Point[2])
the 2nd trigger.. it is supposed to telepor the hero everytime he attacks. but he just stays to one place :ogre_haosis: im new at triggers sorry
:goblin_boom:
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
  • Revive Heroes
    • Events
    • Unit - A unit Dies
    • Conditions
    • ((Triggering unit) is A Hero) Equal to True
    • Actions
    • Wait 5.00 seconds
    • Hero - Instantly revive (Triggering unit) at (Random point in Region 000 <gen>), Show revival graphics
This trigger is perfectly MUI because you used (Triggering unit) as its event-response.

But it leaks, point leak;
  • (Random point in Region 000 <gen>)
Your trigger should look like this;
  • Revive Heroes
    • Events
    • Unit - A unit Dies
    • Conditions
    • ((Triggering unit) is A Hero) Equal to True
    • Actions
    • Set TempLoc = (Random point in Region 000 <gen>)
    • Wait 5.00 seconds
    • Hero - Instantly revive (Triggering unit) at TempLoc, Show revival graphics
    • Custom script: call RemoveLocation(udg_TempLoc)
TempLoc is Point variable.
 
Level 3
Joined
Sep 30, 2011
Messages
60
This trigger is perfectly MUI because you used (Triggering unit) as its event-response.

But it leaks, point leak;
  • (Random point in Region 000 <gen>)
Your trigger should look like this;
  • Revive Heroes
    • Events
    • Unit - A unit Dies
    • Conditions
    • ((Triggering unit) is A Hero) Equal to True
    • Actions
    • Set TempLoc = (Random point in Region 000 <gen>)
    • Wait 5.00 seconds
    • Hero - Instantly revive (Triggering unit) at TempLoc, Show revival graphics
    • Custom script: call RemoveLocation(udg_TempLoc)
TempLoc is Point variable.

thanks :D how about the spell?
 
Level 3
Joined
Aug 20, 2012
Messages
36
Do you want to make the spell work in multiplayer (with other players casting it at the same time)?

I think you've made a typo here (trigger 1):
Set HiraishinC_Point[1] = (Position of HiraishinC_Unit[0])
And the last action in "trigger 1" should be "Trigger - Run Trigger (trigger 2)"
And in the editor set "trigger 2" to be enabled but remove the event. So that it doesn't loop every 0.03 seconds, that would probably crash the game.

I'll take a deeper look into the triggers when I come home later today.
 
Last edited:
Level 8
Joined
Oct 26, 2008
Messages
387
the 2nd trigger.. it is supposed to telepor the hero everytime he attacks. but he just stays to one place :ogre_haosis: im new at triggers sorry
:goblin_boom:


  • Untitled Trigger 001
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
You say the trigger is susposed to teleport the hero everytimg he attacks (to the position of its target I persume) however your event is, a unit starts the effect on an ability, and in the looping trigger, its a periodic time event.

So how does the computer know when your unit is attacking?
Give more details as to what you want to spell to do and maybe I can help you..
 
Level 3
Joined
Sep 30, 2011
Messages
60
  • Untitled Trigger 001
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
You say the trigger is susposed to teleport the hero everytimg he attacks (to the position of its target I persume) however your event is, a unit starts the effect on an ability, and in the looping trigger, its a periodic time event.

So how does the computer know when your unit is attacking?
Give more details as to what you want to spell to do and maybe I can help you..
[YOUTUBE]it should work like this
http://www.youtube.com/watch?v=5DWmamXrPjI&feature=player_detailpage#t=38s[/YOUTUBE]
0:38

the caster is supposed to teleport to the random place near the target's loc then play attack animation. but the problem is the caster just stays to one place, he never teleports randomly
 
Level 16
Joined
Oct 12, 2008
Messages
1,570
This trigger is perfectly MUI because you used (Triggering unit) as its event-response.

But it leaks, point leak;
  • (Random point in Region 000 <gen>)
Your trigger should look like this;
  • Revive Heroes
    • Events
    • Unit - A unit Dies
    • Conditions
    • ((Triggering unit) is A Hero) Equal to True
    • Actions
    • Set TempLoc = (Random point in Region 000 <gen>)
    • Wait 5.00 seconds
    • Hero - Instantly revive (Triggering unit) at TempLoc, Show revival graphics
    • Custom script: call RemoveLocation(udg_TempLoc)
TempLoc is Point variable.

Slight improvement:
  • Revive Heroes
    • Events
    • Unit - A unit Dies
    • Conditions
    • ((Triggering unit) is A Hero) Equal to True
    • Actions
    • Wait 5.00 seconds
    • Set TempLoc = (Random point in Region 000 <gen>)
    • Hero - Instantly revive (Triggering unit) at TempLoc, Show revival graphics
    • Custom script: call RemoveLocation(udg_TempLoc)
This way, TempLoc cannot be overridden during those 5 seconds
 
Level 19
Joined
Feb 25, 2009
Messages
2,004
  • Set HiraishinC_Point[2] = ((Position of HiraishinC_Unit[0]) offset by 25.00 towards (Facing of HiraishinC_Unit[0]) degrees)
Leaks a point.

Untitled Trigger 002 could use a loop.
Waits cannot be less than 0.27 seconds.

  • Animation - Play HiraishinC_Unit[0]'s attack animation
  • Unit - Move HiraishinC_Unit[0] instantly to HiraishinC_Point[2]
Moving a unit via a trigger using this cancels its animation immediately.

You can attach a special effect using the dummy.mdx by Vexorian instead of making new dummy for every spell.
I highly recommend you get rid off all array variables and replace them with non-array ones.
 
Status
Not open for further replies.
Top