• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Trigger] Heros not reviving, random event it certain games

Status
Not open for further replies.
Level 5
Joined
Aug 15, 2007
Messages
145
Iv had this problem for a while now, while playing a game the auto revive stops working and u have to buy back manually, but when this happens its often to expensive to buy back and the game ends really quickly because ppl cant revive their heros, Pls help i changed nothing in my revive triggers it just stops working in some games.
  • Revive Hero Copy
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) is A Hero) Equal to True
    • Actions
      • Unit Group - Add (Dying unit) to RevivableHeroes
      • Set TempReal = (((Real((Hero level of (Dying unit)))) x Hero_Revive_Time_Factor) + 5.00)
      • Countdown Timer - Start ReviveTimers[(Player number of (Owner of (Dying unit)))] as a One-shot timer that will expire in TempReal seconds
  • Revive Hero Timer
    • Events
      • Time - ReviveTimers[2] expires
      • Time - ReviveTimers[3] expires
      • Time - ReviveTimers[4] expires
      • Time - ReviveTimers[5] expires
      • Time - ReviveTimers[6] expires
      • Time - ReviveTimers[8] expires
      • Time - ReviveTimers[9] expires
      • Time - ReviveTimers[10] expires
      • Time - ReviveTimers[11] expires
      • Time - ReviveTimers[12] expires
    • Conditions
    • Actions
      • Set HeroCentreXmen = (Center of HeroCreationXmen <gen>)
      • Set HeroCentreBH = (Center of HeroCreationBh <gen>)
      • Unit Group - Pick every unit in RevivableHeroes and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Remaining time for ReviveTimers[(Player number of (Owner of (Picked unit)))]) Less than 1.00
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Owner of (Picked unit)) is in PlayersXmen) Equal to True
                • Then - Actions
                  • Hero - Instantly revive (Picked unit) at HeroCentreXmen, Show revival graphics
                • Else - Actions
                  • Hero - Instantly revive (Picked unit) at HeroCentreBH, Show revival graphics
            • Else - Actions
              • Do nothing
      • Wait 2.00 seconds
      • Custom script: call RemoveLocation(udg_HeroCentreXmen)
      • Custom script: call RemoveLocation(udg_HeroCentreBH)
  • Revive Hero Tavern
    • Events
      • Unit - A unit Finishes reviving
    • Conditions
      • ((Reviving Hero) is in RevivableHeroes) Equal to True
    • Actions
      • Unit Group - Remove (Reviving Hero) from RevivableHeroes
      • Set ReviveHeroPos = (Position of (Reviving Hero))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Multiboard_ShowDeaths Equal to True
        • Then - Actions
          • Multiboard - Set the text for (Last created multiboard) item in column 2, row Multiboard_Spots[(Player number of (Owner of (Reviving Hero)))] to
        • Else - Actions
          • Countdown Timer - Destroy RevivableTimersWindows[(Player number of (Owner of (Reviving Hero)))]
      • Camera - Pan camera for (Owner of (Reviving Hero)) to ReviveHeroPos over 0.05 seconds
      • Selection - Select (Reviving Hero) for (Owner of (Reviving Hero))
      • Custom script: call RemoveLocation(udg_ReviveHeroPos)
Im thinking maybe the revivable heros group is getting destroyed by something
 
Level 16
Joined
Jul 21, 2008
Messages
1,121
Hmm, I see some flaws but that isn't bad. First of all, in second trigger there may be ReviveTimers[1] missing.

Secondly, try replacing second trigger actions with this:
  • Unit Group - Pick every unit in RevivableHeroes and do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Remaining time for ReviveTimers[(Player number of (Owner of (Picked unit)))]) Less than 1.00
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Owner of (Picked unit)) is in PlayersXmen) Equal to True
          • Then - Actions
            • Set HeroCentreXmen = (Center of HeroCreationXmen <gen>)
            • Hero - Instantly revive (Picked unit) at HeroCentreXmen, Show revival graphics
            • Custom script: call RemoveLocation(udg_HeroCentreXmen)
            • Else - Actions
              • Set HeroCentreBH = (Center of HeroCreationBh <gen>)
              • Hero - Instantly revive (Picked unit) at HeroCentreBH, Show revival graphics
              • Custom script: call RemoveLocation(udg_HeroCentreBH)
            • Else - Actions
Remove DoNothing from all your trigger because it just lowers performance. Set Temporary variables just before you need them and clear them just after you used them.

I am not sure about this condition; you may try removing it.
  • (Remaining time for ReviveTimers[(Player number of (Owner of (Picked unit)))]) Less than 1.00
In the third trigger it seems that multiboard doesn't get any string value when the hero is revived.
 
Level 5
Joined
Aug 15, 2007
Messages
145
huh?? i ddint destroy that group, but in another trigger (totally seperate a, a creep spawn trigger) i used the set bj_wantDestroyGroup = true function, could that maybe destroy this group during the game?
 
Level 15
Joined
Jul 19, 2007
Messages
618
huh?? i ddint destroy that group, but in another trigger (totally seperate a, a creep spawn trigger) i used the set bj_wantDestroyGroup = true function, could that maybe destroy this group during the game?

set bj_wantDestroyGroup = true will destroy next called group in Pick Every Units... when you call that function bj_wantDestroyGroup automatically becomes false and you do not leak that group which was inserted in Pick Every...

about your problem well first of all you should not use groups for this anyway.
use trigger with event unit enters playable map area (is he hero) then store it in unit array variable set udg_Hero[GetPlayerId(GetOwningPlayer(GetTriggerUnit()))+1] = GetTriggerUnit()

thats how u do it now u simply check when hero dies and then use again GetPlayerId+1 to get unit in a variables (check at which location it needs to be revived) and simple revive!

and btw do not use wait 2 seconds coz if trigger is executed in less then 2 seconds at same time it will bug (leaks will not be cleared)

Greets!
~Dark Dragon
 
Level 5
Joined
Aug 15, 2007
Messages
145
i removed the 2 second wait dnt knw y it was there, iv changed evrything as u stated child, ill be testing now, but i can only really test it on a full game because that is when it seems to bug.
  • Custom script: set bj_wantDestroyGroup = true
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • ((Units within 700.00 of NeutralSpawnPoint[1]) is empty) Equal to True
    • Then - Actions
      • Set CreeprandomvariableLesser = (Random integer number between 1 and 4)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • CreeprandomvariableLesser Equal to 1
        • Then - Actions
          • Unit - Create 2 Ice Troll for Neutral Hostile at NeutralSpawnPoint[1] facing Default building facing degrees
          • Unit - Create 1 Ice Troll Priest for Neutral Hostile at NeutralSpawnPoint[1] facing Default building facing degrees
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • CreeprandomvariableLesser Equal to 2
            • Then - Actions
              • Unit - Create 4 Spiderling for Neutral Hostile at NeutralSpawnPoint[1] facing Default building facing degrees
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • CreeprandomvariableLesser Equal to 3
                • Then - Actions
                  • Unit - Create 1 Unbroken Darkhunter for Neutral Hostile at NeutralSpawnPoint[1] facing Default building facing degrees
                  • Unit - Create 2 Unbroken Rager for Neutral Hostile at NeutralSpawnPoint[1] facing Default building facing degrees
                • Else - Actions
                  • Unit - Create 3 Crystal Arachnathid for Neutral Hostile at NeutralSpawnPoint[1] facing Default building facing degrees
    • Else - Actions
Is this valid??
does this leak at all?
 
Last edited:
Status
Not open for further replies.
Top