• 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] Hero Revival Based on Dota

Status
Not open for further replies.
Level 2
Joined
Jan 1, 2013
Messages
9
This is the trigger i made
but doesn't work i am not used to make custom scripts
because i don't how i only based on triggers
need some help fixing this one :vw_sad:

Trigger.png
 
Last edited:
Level 23
Joined
Oct 20, 2012
Messages
3,075
Remove last three lines of your trigger..

  • Trigger 1
  • Events
  • Unit - A unit dies
  • Conditions
  • ((Triggering unit) belongs to an ally of (player 1 Red)) equal to true
  • ((triggering unit) is a hero) equal to true)
  • Actions
  • Set Unit_variable[player number of (owner of (triggering unit))] = triggering unit
  • Countdown Timer - start revive1 as a one-shot timer that will expire in ((hero level of (Unit_variable[player number of (owner of (triggering unit))]) x 3) seconds
  • Countdown Timer - create a timer window for last started time with the title Hero Revival:
  • Set timerwindow_variable[player number of (owner of (triggering unit))] = last created timer window
  • Countdown Timer - Show last created timer window for owner of triggering unit
  • Trigger 2
  • Events
  • Timer - Revive1 expires
  • Conditions
  • Actions
  • Hero - instantly revive (Unit_variable[player number of (owner of (triggering unit))]) at (center of bot hero). show revival graphics
  • Countdown timer - destroy timerwindow_variable[player number of (owner of (triggering unit))]
triggers might be all wrong coz it's not made from the editor.. XD
but do something like that..
 
Level 37
Joined
Mar 6, 2006
Messages
9,243

  • RevInit
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set Hash = (Last created hashtable)
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Custom script: if udg_RTIM[bj_forLoopAIndex] == null then
          • Custom script: set udg_RTIM[bj_forLoopAIndex] = CreateTimer()
          • Custom script: endif
          • Trigger - Add to RevRevive <gen> the event (Time - RTIM[(Integer A)] expires)
  • RevHeroDie
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • Set i1 = (Player number of (Triggering player))
      • Set RHER[i1] = (Triggering unit)
      • Countdown Timer - Start RTIM[i1] as a One-shot timer that will expire in 3.00 seconds
      • Custom script: if udg_RWIN[udg_i1] == null then
      • Countdown Timer - Create a timer window for RTIM[i1] with title (Proper name of (Triggering unit))
      • Set RWIN[i1] = (Last created timer window)
      • Countdown Timer - Hide RWIN[i1]
      • Custom script: endif
      • Countdown Timer - Show RWIN[i1] for (Triggering player)
      • Custom script: call SaveInteger(udg_Hash, GetHandleId(udg_RTIM[udg_i1]), 0, udg_i1)
  • RevRevive
    • Events
    • Conditions
    • Actions
      • Custom script: set udg_i1 = LoadInteger(udg_Hash, GetHandleId(GetExpiredTimer()), 0)
      • Set TempLoc = (Random point in Region 000 <gen>)
      • Hero - Instantly revive RHER[i1] at TempLoc, Show revival graphics
      • Countdown Timer - Hide RWIN[i1]
      • Custom script: call RemoveLocation(udg_TempLoc)


http://www.hiveworkshop.com/forums/miscellaneous-tutorials-456/how-easily-post-triggers-163285/
 

Attachments

  • Revive_Timers.w3x
    19.1 KB · Views: 66
Last edited:
Level 19
Joined
Aug 8, 2007
Messages
2,765

  • RevInit
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set Hash = (Last created hashtable)
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Custom script: if udg_RTIM[bj_forLoopAIndex] == null then
          • Custom script: set udg_RTIM[bj_forLoopAIndex] = CreateTimer()
          • Custom script: endif
          • Trigger - Add to RevRevive <gen> the event (Time - RTIM[(Integer A)] expires)
  • RevHeroDie
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • Set i1 = (Player number of (Triggering player))
      • Set RHER[i1] = (Triggering unit)
      • Countdown Timer - Start RTIM[i1] as a One-shot timer that will expire in 3.00 seconds
      • Custom script: if udg_RWIN[bj_forLoopAIndex] == null then
      • Countdown Timer - Create a timer window for RTIM[i1] with title (Proper name of (Triggering unit))
      • Set RWIN[i1] = (Last created timer window)
      • Countdown Timer - Hide RWIN[i1]
      • Custom script: endif
      • Countdown Timer - Show RWIN[i1] for (Triggering player)
      • Custom script: call SaveInteger(udg_Hash, GetHandleId(udg_RTIM[udg_i1]), 0, udg_i1)
  • RevRevive
    • Events
    • Conditions
    • Actions
      • Custom script: set udg_i1 = LoadInteger(udg_Hash, GetHandleId(GetExpiredTimer()), 0)
      • Game - Display to Player Group - Player 1 (Red) for 2.00 seconds the text: (String(i1))
      • Set TempLoc = (Random point in Region 000 <gen>)
      • Hero - Instantly revive RHER[i1] at TempLoc, Show revival graphics
      • Countdown Timer - Hide RWIN[i1]
      • Custom script: call RemoveLocation(udg_TempLoc)


http://www.hiveworkshop.com/forums/miscellaneous-tutorials-456/how-easily-post-triggers-163285/
unneccesary debug in RevRevive. Also, when will RevRevive fire...

@Juno, your trigger wouldnt work because you need a seperate trigger for every player + timer arrays arent initalized properly so you have to loop and initialize each indice.
 
Level 2
Joined
Jan 1, 2013
Messages
9
Revive [Solved]

  • Revive
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) belongs to an ally of Player 1 (Red)) Equal to True
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • Countdown Timer - Start Revive1 as a One-shot timer that will expire in ((Real((Hero level of (Triggering unit)))) x 3.00) seconds
      • Countdown Timer - Create a timer window for Revive1 with title Hero Revival:
      • Countdown Timer - Show (Last created timer window) for (Owner of (Triggering unit))
      • Wait (Remaining time for Revive1) seconds
      • Hero - Instantly revive (Triggering unit) at (Center of Bot Hero <gen>), Hide revival graphics
      • Camera - Pan camera for (Owner of (Triggering unit)) to (Position of (Triggering unit)) over 0.00 seconds
      • Countdown Timer - Destroy (Last created timer window)






-------------------------------------------------------------------------
here's the changes iv'e made when i deleted the three lines everything is all good now tnx for the help
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
  • Revive
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) belongs to an ally of Player 1 (Red)) Equal to True
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • Countdown Timer - Start Revive1 as a One-shot timer that will expire in ((Real((Hero level of (Triggering unit)))) x 3.00) seconds
      • Countdown Timer - Create a timer window for Revive1 with title Hero Revival:
      • Countdown Timer - Show (Last created timer window) for (Owner of (Triggering unit))
      • Wait (Remaining time for Revive1) seconds
      • Hero - Instantly revive (Triggering unit) at (Center of Bot Hero <gen>), Hide revival graphics
      • Camera - Pan camera for (Owner of (Triggering unit)) to (Position of (Triggering unit)) over 0.00 seconds
      • Countdown Timer - Destroy (Last created timer window)


-------------------------------------------------------------------------
here's the changes iv'e made when i deleted the three lines everything is all good now tnx for the help
leaks over and over again
if 2 heroes die within each other than only one timer window will be destroyed
 
Level 2
Joined
Jan 1, 2013
Messages
9
yes your'e right even i tried using individual variables or triggers the leak is still there
i am trying to solve this, i think the problem is multiple heroes death uses only one timer
which means the:

Countdown Timer - Show (Last created timer window) for (Owner of (Triggering unit))

triggers all players
example:
two players die at once the timer will create two timers and show to the owner of dying unit which means both of them can see the timer and there is only one:

Countdown Timer - Destroy (Last created timer window)

which only removes one timer and the other stays
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
yes your'e right even i tried using individual variables or triggers the leak is still there
i am trying to solve this, i think the problem is multiple heroes death uses only one timer
which means the:

Countdown Timer - Show (Last created timer window) for (Owner of (Triggering unit))

triggers all players
example:
two players die at once the timer will create two timers and show to the owner of dying unit which means both of them can see the timer and there is only one:

Countdown Timer - Destroy (Last created timer window)

which only removes one timer and the other stays

Use makers trigger
 
Status
Not open for further replies.
Top