• 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 Revive not working

Status
Not open for further replies.
Level 5
Joined
Nov 4, 2006
Messages
132
I am having trouble with a trigger of mine that is supposed to revive your hero after (hero level x 6 seconds) has past. The hero is supposed to revive at one of the basepoints (1-61) as well as creating a zombie if killed by player 11 or 12.

For some reason the hero sometimes does not repawn at all and this basicly forces the player to leave.

I have posted the trigger below and if you think you need the whole map could you please tell me

I would like to have this be done in only 1 or 2 triggers and not be in JASS as I dont know JASS

Probably end up being something really simple I overlooked
Thanks in Advance

  • Hero Dies
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) is A Hero) Equal to True
      • Or - Any (Conditions) are true
        • Conditions
          • (Triggering unit) Equal to playerhero[1]
          • (Triggering unit) Equal to playerhero[2]
          • (Triggering unit) Equal to playerhero[3]
          • (Triggering unit) Equal to playerhero[4]
          • (Triggering unit) Equal to playerhero[5]
          • (Triggering unit) Equal to playerhero[6]
          • (Triggering unit) Equal to playerhero[7]
          • (Triggering unit) Equal to playerhero[8]
      • (Evacuation Point 0067 <gen> is alive) Equal to True
    • Actions
      • Game - Display to (All players) the text: ((|c00640000 + (((Name of (Owner of (Dying unit))) + 's ) + (Name of (Dying unit)))) + ( has been killed by + ((Name of (Owner of (Killing unit))) + |r)))
      • Game - Display to (All players matching ((Owner of (Dying unit)) Equal to (Matching player))) the text: (|c00FFFF00Your Hero will revive in + ((String((6 x (Level of (Dying unit))))) + seconds))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Owner of (Killing unit)) Equal to Player 11 (Dark Green)
              • (Owner of (Killing unit)) Equal to Player 12 (Brown)
        • Then - Actions
          • Set temp_point = (Position of (Dying unit))
          • Unit - Create 1 Infected Hero for (Owner of (Killing unit)) at temp_point facing Default building facing degrees
          • Unit - Order (Last created unit) to Attack-Move To basepoints[(Random integer number between 1 and 61)]
          • Special Effect - Create a special effect at temp_point using Abilities\Spells\Undead\DarkRitual\DarkRitualTarget.mdl
          • Custom script: call RemoveLocation(udg_temp_point)
        • Else - Actions
          • Do nothing
      • Wait (6.00 x (Real((Level of playerhero[(Player number of (Owner of (Dying unit)))])))) seconds
      • Set temp_point = basepoints[(Random integer number between 1 and 61)]
      • Hero - Instantly revive playerhero[(Player number of (Owner of (Triggering unit)))] at temp_point, Show revival graphics
      • Camera - Pan camera for (Owner of (Triggering unit)) to temp_point over 0.00 seconds
      • Custom script: call RemoveLocation(udg_temp_point)
      • Unit - Make playerhero[(Player number of (Owner of (Triggering unit)))] Invulnerable
      • Wait 5.00 seconds
      • Unit - Make playerhero[(Player number of (Owner of (Triggering unit)))] Vulnerable
 
Level 6
Joined
Mar 22, 2009
Messages
276
try making it multiple conditions.
  • And - All (Conditions) are true
    • Conditions
      • ((Dying unit) is A Hero) Equal to True
    • Or - Any (Conditions) are true
      • Conditions
        • (Triggering unit) Equal to playerhero[1]
        • (Triggering unit) Equal to playerhero[2]
        • (Triggering unit) Equal to playerhero[3]
        • (Triggering unit) Equal to playerhero[4]
        • (Triggering unit) Equal to playerhero[5]
        • (Triggering unit) Equal to playerhero[6]
        • (Triggering unit) Equal to playerhero[7]
        • (Triggering unit) Equal to playerhero[8]
      • (Evacuation Point 0067 <gen> is alive) Equal to True
 
Level 6
Joined
Nov 14, 2007
Messages
155
try this events:

  • Events
    • Unit - A unit owned by (Player) Dies
Let say Player is any player;
and

  • Conditions
    • ((Dying unit) is A Hero) Equal to True
or set (Triggering unit) to (Dying Unit)
  • Conditions
    • ((Dying unit)) Equal to playerhero[1]
and try to put that condition under the AND condition and under the AND condition add OR condition and put there ((Dying unit)) Equal to playerhero[1]
as seen below
  • Conditions
    • And - All (Conditions) are true
      • Conditions
        • ((Dying unit) is A Hero) Equal to True
        • Or - Any (Conditions) are true
          • Conditions
            • (Dying unit) Equal to playerhero[1]
If nothing works; well let's see the others if they can help

+REP to those who can HELP
 
Level 5
Joined
Nov 4, 2006
Messages
132
it is not the conditions that are failing

The conditions work fine coz the Display text action always works when a hero dies and sometimes the hero does revive.

The problem is that sometime the hero doesn't revive after the text shows.

It seems the revive action always works in single player but not when palying with more that one player
 
Level 6
Joined
Nov 14, 2007
Messages
155
  • Action
  • Wait (6.00 x (Real((Level of playerhero[(Player number of (Owner of (Dying unit)))])))) seconds
  • Set temp_point = basepoints[(Random integer number between 1 and 61)]
  • Hero - Instantly revive playerhero[(Player number of (Owner of (Triggering unit)))] at temp_point, Show revival graphics
  • Camera - Pan camera for (Owner of (Triggering unit)) to temp_point over 0.00 seconds
  • Custom script: call RemoveLocation(udg_temp_point)
  • Unit - Make playerhero[(Player number of (Owner of (Triggering unit)))] Invulnerable
  • Wait 5.00 seconds
  • Unit - Make playerhero[(Player number of (Owner of (Triggering unit)))] Vulnerable
Try to put these under else action
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
  • Wait (6.00 x (Real((Level of playerhero[(Player number of (Owner of (Dying unit)))])))) seconds
->
  • Wait (6.00 x (Real((Level of (Triggering unit)))) seconds

  • Hero - Instantly revive playerhero[(Player number of (Owner of (Triggering unit)))] at temp_point, Show revival graphics
->
  • Hero - Instantly revive (Triggering unit) at temp_point, Show revival graphics

  • Unit - Make playerhero[(Player number of (Owner of (Triggering unit)))] Invulnerable
->
  • Unit - Make (Triggering unit) Invulnerable

  • Unit - Make playerhero[(Player number of (Owner of (Triggering unit)))] Vulnerable
->
  • Unit - Make (Triggering unit) Vulnerable
These may not solve the problem, but will simplify things.
 
Level 14
Joined
Mar 4, 2009
Messages
1,156
Maybe you could just make a dummy unit and add life time that will last for (level of your hero x 6) seconds

When dummy unit dies

revive hero for owner of unit (dying unit)

also if player has only one hero use random unit from unit group - units owned by dying unit matching condition matching unit is a hero
 
Level 13
Joined
Sep 14, 2008
Messages
1,408
NEVER!!! AND I mean NEVER!!!! use a WAIT in a trigger which can run several times.

It will nearly ALWAYS kill the trigger.

Imagine 1 trigger is still waiting and another hero dies. That will mess things up.

Different solutions:

1. Timer. Start a timer and wait for it to expire
2. Int-Array. Use an int array and a periodic trigger to count.
3. Dummy-Unit with timer.


But never use wait.
(even 1 sec waits can kill hole triggers.)
 
Level 19
Joined
Feb 25, 2009
Messages
2,004
Wut the hell is this?
  • (Evacuation Point 0067 <gen> is alive) Equal to True
Remove this:
  • Do nothing
It only slows down the trigger functionallity

Clear this:
  • Special Effect - Create a special effect at temp_point using Abilities\Spells\Undead\DarkRitual\DarkRitualTarget.mdl
With the SFX destroy function

Instead of using 8 array values for the Heroes try this:
  • (Triggering unit) Equal to playerhero[Player number of (Owner of (Triggering Unit))]
Remove the waits, clear leaks, and make ressurection via countdown timers, which will make it MPI (Multi-Player-Instanceable)
Otherwise, ressurect heroes instantly without any cooldown.
 
Level 5
Joined
Nov 4, 2006
Messages
132
@Alien95 I have already posted that I have changed it to a dummy with a life timer and that seems to work well though I know that using a countdown timer would work as well.

@MortAr- Evac point is a unit that when destroyed causes the game to end shortly after so heroes should not revive if it is dead. I will remove the Do Nothing I just had it there for neatness. Have already changed the special effect and condition array but thank you for pointing them out.

what leaks where you referring to btw?
 
Status
Not open for further replies.
Top