• 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.

Revive Trigger Not Working

Status
Not open for further replies.
Level 14
Joined
Oct 16, 2010
Messages
749
Hi,

I've gone back to an old map and have decided to make loads of changes. My current issue is that my Revive trigger/index isn't working, I've tried adding gameplay text to show what happens and all of it is running correctly. But it just isn't reviving the Hero.

The map uses Heroes as basic units because of the levels/stats, as there are lots of Heroes owned by that player would that cause the issue? If so does anyone have any other suggestions?

  • Res Boss Init
    • Events
      • Time - Elapsed game time is 5.00 seconds
    • Conditions
    • Actions
      • Set ResBoss_MaxIndex = (ResBoss_MaxIndex + 1)
      • Set ResBoss_Unit[ResBoss_MaxIndex] = Gloom 0179 <gen>
      • Set ResBoss_Timer[ResBoss_MaxIndex] = 0
      • Set ResBoss_LvlGain[ResBoss_MaxIndex] = 4
      • Set ResBoss_SpawnPoint[ResBoss_MaxIndex] = (Position of Gloom 0179 <gen>)
      • Unit Group - Add Gloom 0179 <gen> to ResBoss_Group
      • Trigger - Turn on Res Boss Loop <gen>

  • Res Boss Dies
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Set TempUnit = (Dying unit)
      • For each (Integer ResBoss_LoopInt) from 1 to ResBoss_MaxIndex, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • TempUnit Equal to ResBoss_Unit[ResBoss_LoopInt]
            • Then - Actions
              • Set ResBoss_Timer[ResBoss_LoopInt] = 20
            • Else - Actions

  • Res Boss Loop
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer ResBoss_LoopInt) from 1 to ResBoss_MaxIndex, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ResBoss_Timer[ResBoss_LoopInt] Greater than 0
            • Then - Actions
              • Set ResBoss_Timer[ResBoss_LoopInt] = (ResBoss_Timer[ResBoss_LoopInt] - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ResBoss_Timer[ResBoss_LoopInt] Equal to 0
                • Then - Actions
                  • Hero - Instantly revive ResBoss_Unit[ResBoss_LoopInt] at ResBoss_SpawnPoint[ResBoss_LoopInt], Hide revival graphics
                  • Hero - Set ResBoss_Unit[ResBoss_LoopInt] Hero-level to ((Hero level of ResBoss_Unit[ResBoss_LoopInt]) + ResBoss_LvlGain[ResBoss_LoopInt]), Hide level-up graphics
                • Else - Actions
            • Else - Actions
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,286
The map uses Heroes as basic units because of the levels/stats, as there are lots of Heroes owned by that player would that cause the issue?
Yes it will cause the issue. Only the last 5 heroes to die will be saved and revivable, the rest will be removed permanently.

If so does anyone have any other suggestions?
Revive them instantly on death to prevent removal. Hide them and place them at a corner of the map. When you want them "revived" move them to the resurrection spot and unhide them.
 
Level 14
Joined
Oct 16, 2010
Messages
749
Just changed it to this and it's still not reviving?

  • Res Boss Dies
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Set TempUnit = (Dying unit)
      • For each (Integer ResBoss_LoopInt) from 1 to ResBoss_MaxIndex, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • TempUnit Equal to ResBoss_Unit[ResBoss_LoopInt]
            • Then - Actions
              • Set TempPoint = (Center of Res Spawn Zone <gen>)
              • Hero - Instantly revive TempUnit at TempPoint, Hide revival graphics
              • Set ResBoss_Timer[ResBoss_LoopInt] = 5
              • Custom script: call RemoveLocation(udg_TempPoint)
            • Else - Actions
 
Level 14
Joined
Oct 16, 2010
Messages
749
I added gameplay messages to show myself that the conditions where being met, as far as I could see it should have been working.

However I think I might be better of saving the unit type + level and just creating a new unit entirely each time. It doesn't need to be the exact same Hero, just one that looks the same really.

Thanks for the help though, good to know these bits and bobs!
 
Status
Not open for further replies.
Top