• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

An Odd Problem (Revive Bug)

Status
Not open for further replies.
So the revive trigger in a map I'm working on no longer works. I've had issues like this with every map I've ever worked on. I don't know how it happens, but somehow basic trigger functions completely cease to work.

I tried disabling anything that could potentially interfere and using troubleshooting texts along the way providing information throughout the respawn trigger's process to prove that the game has the right info (the name of the hero, spawn location, etc), and it had everything right and yet still did not revive the hero.

Eventually I got so sick of it that I simplified the trigger to its most basic form for testing purposes:

  • Respawn Copy
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) is A Hero) Equal to True
    • Actions
      • Hero - Instantly revive (Dying unit) at (Center of (Playable map area)), Hide revival graphics
I tested this trigger using unedited heroes from the melee game.

This is as simple as a trigger can get, and I see no reason for this to still do nothing.

Whatever is causing this issue, it's not in the trigger; it's in the map. If anyone knows what might cause a map to no longer be capable of reviving heroes, that info would help.
 
Last edited:
Level 18
Joined
May 11, 2012
Messages
2,103
This trigger should work.
Btw, you're leaking location (C of PMA).
Something is definitely interfering with your trigger, as this should work properly. Maybe you have a trigger that prevents units from dying and such?
Does your hero have some kind of ressurection ability?
Use 0.00 wait timer at the beggining of the trigger, and change dying unit to to Triggering Unit.
 
This trigger should work.
Btw, you're leaking location (C of PMA).
Something is definitely interfering with your trigger, as this should work properly. Maybe you have a trigger that prevents units from dying and such?
Does your hero have some kind of ressurection ability?
Use 0.00 wait timer at the beggining of the trigger, and change dying unit to to Triggering Unit.

I know the trigger leaks location, as I said in the original post, this was a test trigger, not the real trigger, simplified as much as possible to pinpoint where it went wrong. Since I don't need to respawn the hero 1,000,000 times to test it, a memory leak isn't a relevant issue.

There is no trigger preventing units from dying. The hero is not resurrecting. It is dying, and simply not respawning.

I know for a fact that using "Dying unit" is not the cause of the problem, and that lack of a wait is also not a cause of the problem, because my original respawning trigger used a timer and, as I stated before, I troubleshot the trigger with game text stating the name of the hero, pinging the region, etc, to make sure the game knew what the dying unit was and what the region was, etc; everything worked fine. I used the respawn trigger successfully for a long time and never needed to change it; suddenly it stopped working, without even being changed. It's as though the map itself is no longer capable of reviving heroes. I would really like to be able to fix this strange bug.
 
How's that even possible? I've done the same trigger with much more commands and it works properly. Post the map then.

I can't post the map, it's private and belongs to more people than myself. I also would not want to share it even if it was only up to me. I'd send it directly to someone depending on who that person is.

And yeah, I have no idea how it's possible. Every map I've ever made has developed weird bugs like this where it's suddenly unable to do specific trigger functions, causing triggers that always worked flawlessly to suddenly do nothing, without being changed and without having changes to any triggers that could affect them. It's really annoying, and it's the main reason I've never finished a single map.
 
Try in a blank map.
If it doesn't work then change the event to a unit decays (dissipates in case of Hero).

I already know the trigger works. As I've said before, I've used the same trigger for months without changing it. I've troubleshot every part of the trigger to find out what part of it was messing up, and found that something was preventing the game from reviving heroes.

Changing parts of the trigger which already work into other things which would also work isn't going to fix the problem; I need to find out what could cause a map to not revive heroes.

The only solution I can think of to this problem would be to revive the heroes from altars, but that's a sloppy solution and doesn't get rid of the problem which could potentially be having other effects on the map.

Edit: Even ordering the altar to revive the hero isn't working... It seems like nothing involving reviving heroes is working in this map for some reason... The only thing that's working is manually reviving the hero, which is going to look sloppy.
 
Last edited:
Level 25
Joined
May 11, 2007
Messages
4,651
It's because you don't have the food count to revive the hero.
It's idiotic, I know.

But all the Campaign heroes use no food. So just make sure your hero doesn't cost any food or modify the food supplied before reviving the hero.
 
Level 11
Joined
Nov 24, 2010
Messages
203
I've encountered a bug like this before and I must say, there are two ways I found to fix it for two separate people's maps. Try this.

1. Try adding 0.50 wait seconds before the hero revives. Maybe it works (I doubt it)

2. Second thing is that when you do this kind of a trigger and if multiple, even if it's a dying unit who's not a hero, it can be bugged. So make the dying hero a variable, because if other heroes who die at the same time as the original unit does, then it revives someone completely else.

P.S: If this doesn't work. God speak and help you, my chocolate comrade.
 
It's because you don't have the food count to revive the hero.
It's idiotic, I know.

But all the Campaign heroes use no food. So just make sure your hero doesn't cost any food or modify the food supplied before reviving the hero.

That isn't the reason. I already had the food cap set and food used set upon death.

may also be caused by RemoveRect/Region called on "Playable map area". But I guess LordDz's suggestion is a lot more probable

I used playable map area as the region only to simplify it with a region that every map has rather than one specific to my map, to make testing purposes easier for troubleshooting. The original trigger did not use that as the region, so that isn't the problem.

I've encountered a bug like this before and I must say, there are two ways I found to fix it for two separate people's maps. Try this.

1. Try adding 0.50 wait seconds before the hero revives. Maybe it works (I doubt it)

2. Second thing is that when you do this kind of a trigger and if multiple, even if it's a dying unit who's not a hero, it can be bugged. So make the dying hero a variable, because if other heroes who die at the same time as the original unit does, then it revives someone completely else.

P.S: If this doesn't work. God speak and help you, my chocolate comrade.

The original trigger used a countdown timer. Originally my testing trigger also contained a Wait, this had no effect. The dying unit is not the issue, either, because this is for an RPG, and there aren't a lot of heroes dying left and right. And as I said before, I troubleshot the trigger to have it identify the dying hero in text, and it identified it correctly.

Thanks for trying to help, though. I'm off to work.
 
that doesnt mean the region you are trying to use is not destroyed/not exising/not initialized

I made the map and all code written within it. I'd know whether or not I had any code running that destroyed the region prior to testing it. The region works. As I've said repeatedly, that isn't the region I used in the real trigger. I changed it to that for testing purposes to simplify the trigger and make it compatible with any map without having to make any changes for implementation. If "playable map area" as a region was the cause of the issue, there never would have been an issue in the first place because that isn't the region I used in the initial trigger. And as I said repeatedly, I had the map ping the center of the region it was intended to revive the hero at, and say the name of the dying hero. It pinged the region correctly and identified the hero correctly when it was supposed to revive it. I said this in the original post, and would appreciate if people would read it before posting. Pretty much every reply has been "change it from dying unit to X" or "change the region". The issue has nothing to do with that.

The code in the trigger I made isn't the issue. I have troubleshot every aspect of the original trigger with added code along every step of the way to verify that every part of it works, identifying the units' names, pinging regions used, etc, to make sure the game is seeing everything right. The only part that didn't work properly was the actual revival of the hero. No form of revival is working in the map; triggered revival, triggering the ordering of an invisible altar to revive the hero; none. The only method of revival that is currently functioning properly is manually reviving the hero by clicking it in the altar. So whatever's going wrong, it has to do with that.
 
It has something to do with OP limit, perhaps split the trigger into two and use ExecuteFunc (Jassers mostly hate this thing though, ugh).

Did you even look at my post before responding? The test trigger I showed had only a single line of action code. The trigger's not too long. It would literally be impossible to split it into two separate triggers with less lines of code.
 
Since you stated that it's not the actual code, so I can assume that.
If I recall, death animation and dissipate needs to be completed before heroes can be revived.
Or do you by any chance pause the hero upon death or something similar?

As stated previously the original trigger had a timer. Specifically, it was 10 seconds. I shortened the trigger for simplicity's sake.
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
"I changed it to this just for explanation" does not rule out breaking it by modifing the original one, but ok.

And you would be surprised how many times people write scripts themselves and they work completly different than they should.

also, if you were to read what I said, I never said change the region, but check if it even exists(print its maxX or something)

I cant help you because all information you provided is 1 trigger that works normally on any empty map
 
"I changed it to this just for explanation" does not rule out breaking it by modifing the original one, but ok.

And you would be surprised how many times people write scripts themselves and they work completly different than they should.

also, if you were to read what I said, I never said change the region, but check if it even exists(print its maxX or something)

I cant help you because all information you provided is 1 trigger that works normally on any empty map

You responded to part of my message, but you continue to exclude the most relevant point: I tested the same trigger with an added function to ping the center of the region. It pings the correct region every time. The region has nothing to do with the issue.
 
Level 12
Joined
Feb 22, 2010
Messages
1,115
Not much going to change without providing a map.People already stated most likely reasons here.
 
Can you tell us: after revival trigger fail, does other triggers /triggered spells/ works properly? If they don't you hit OP limit like Daffa suggested

The revival trigger doesn't work, period, from the start of the map. Even the one with a single line of code. That's not hitting an OP limit. There's an issue with the map that's preventing it from reviving heroes. Even triggering an altar to revive a hero doesn't work; it has to be clicked manually.

Whatever the problem is, it's relating specifically to reviving. Now, you can all keep arguing with me about it, but that's not helping anyone. Sure, it would be really great if it was one of the simple solutions you all have suggested many times, but it isn't, I've thoroughly tested every method of revival I can think of, all of which I've used in other maps successfully, and none of them work in this map.

On a side note, anyone know an effective way to order locust units via trigger? My triggers only seem to see them when I register them in hashtables and select them directly; it seems to exclude them from "units matching condition" when selecting units.
 
Level 12
Joined
Feb 22, 2010
Messages
1,115
You can't pick units with locust by "units in region" or "units in range".You can use "units of player" or "units of type" though.
 
In the object editor, check if the hero has a requirement prior to being built, say an altar.
If so, remove the requirement and try your trigger again.

It doesn't have a requirement, and if it did, it wouldn't matter, because as I mentioned before, one of the methods I tried was triggering an altar (meaning the player already possesses an altar) to revive the hero, and even that didn't work.
 
Level 25
Joined
May 11, 2007
Messages
4,651
It doesn't have a requirement, and if it did, it wouldn't matter, because as I mentioned before, one of the methods I tried was triggering an altar (meaning the player already possesses an altar) to revive the hero, and even that didn't work.
Just trying to help. :)
And that includes asking shitty questions to bring it down to the solution.
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,191
To clarify what an "op limit" problem is.

Both Warcraft III and StarCraft II trigger threads will only allow a certain number of "operations" before the thread crashes. The number of operations used per line is likely based on the number and complexity of virtual machine instructions that the trigger system compiles it to. Once the operation limit has been reached, the thread crashes meaning all operations after the point of crash will not be executed. The limit can be reset by calling a "blocking" native function (TriggerSleepAction is most well known, others do exist however).

If a thread crash occurs there is no noticeable long term affect on the game state other than the part of the script after the crash failing to run that time. New threads will still be created and they will execute like normal.

The problem with the initialization thread is that it can and will only ever be called once while the session is loaded. If it crashes then initialization will fail to complete resulting in a lot of stuff not working (because it never was started). Since this thread is responsible for constructing all triggers and attaching their events it is possible that one or more triggers will not be completely initialized if a thread crash occurs in the initialization thread. This is especially the case if you crash it during array initialization since trigger initialization sequentially occurs after array initialization.

I would strongly recommend that the topic creator post a map with any problems being easily re-creatable. It is possible something else is the cause of the problem.

I am not sure one can instantly revive a hero since the dying unit event may fire before the hero becomes revivable. Try adding a wait.
 
To clarify what an "op limit" problem is.

Both Warcraft III and StarCraft II trigger threads will only allow a certain number of "operations" before the thread crashes. The number of operations used per line is likely based on the number and complexity of virtual machine instructions that the trigger system compiles it to. Once the operation limit has been reached, the thread crashes meaning all operations after the point of crash will not be executed. The limit can be reset by calling a "blocking" native function (TriggerSleepAction is most well known, others do exist however).

If a thread crash occurs there is no noticeable long term affect on the game state other than the part of the script after the crash failing to run that time. New threads will still be created and they will execute like normal.

The problem with the initialization thread is that it can and will only ever be called once while the session is loaded. If it crashes then initialization will fail to complete resulting in a lot of stuff not working (because it never was started). Since this thread is responsible for constructing all triggers and attaching their events it is possible that one or more triggers will not be completely initialized if a thread crash occurs in the initialization thread. This is especially the case if you crash it during array initialization since trigger initialization sequentially occurs after array initialization..

I know what an OP limit is, and that isn't the problem. This map doesn't run anywhere near enough code at startup for that to be an issue.

I would strongly recommend that the topic creator post a map with any problems being easily re-creatable. It is possible something else is the cause of the problem.

I cannot post the map for reasons previously stated.
I am not sure one can instantly revive a hero since the dying unit event may fire before the hero becomes revivable. Try adding a wait.

It would be a lot more helpful if you would read my post before replying. I stated already that the original trigger used a timer.

Believe me, I wish it was as simple to fix as the suggestions you folks keep giving me over and over again, but those were all of the first things I checked before I even posted. Suggesting the same things after I've already repeatedly said that I've tested for those things and found they weren't an issue, isn't helping anyone.
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,191
I cannot post the map for reasons previously stated.
If you send the specific map (where the issue is present) via Private Message I might be able to find the cause. I can assure you I will not disclose any detail about it and am purely interested in finding the cause of the problem. I have done such work for various authors in the past.

So far I can think of only three possible causes for this.
1. Initialization thread crash. Could be a very obscure cause that is not easily noticed.
2. Unintended trigger interaction. The actions of one or more triggers is interfering with the execution of such actions.
3. JASS compiler silent error. The GUI triggers are not being compiled into JASS properly. Never actually seen this before but anything is possible with WE.

The process to find the cause would involve.
1. Making sure all triggers are initialized (all events work for active triggers). This is done by finding the last initialized trigger by inspecting the map script and checking that the events function.
2. Making sure all systems that use "enter region" and "issued order" are not interfering. This is done by disabling most/all such triggers and related systems in the map to see if it makes a difference to the execution of the other actions.
3. Inspecting the output JASS file for anomalies in produced script. Specifically looking for missing call statements of the problematic actions.
 
Status
Not open for further replies.
Top