I came back to the hero map I had been working on from awhile back- there is significant evidence that the system I had been using for the respawning worked, and in fact I had done thorough testing both online and in the editor that suggests that it worked- however... It does not work at all, now. My only hint is that it may be a result of the recent patch- but I'm at a loss for what I could to do fix this. I've already tried as many of the suggestions that I could find via searching, and am feeling a bit disheartened that even the map that is currently on BNet (which I haven't changed at ALL, since I last touched it, unlike the editor version) doesn't work either.
Fair enough. I was hoping someone else had already had the same problem, heheh. No such luck I assume. Let me go grab what I have. It's sort of a mess- I never work very neatly. My friends always hate it when I do java coding, haha!
OKAY!
Let's get this explanation on the road:
When a hero dies, I save it in a variable array of units with a player and an ID (1-3, since each player can have up to 3 heroes.)
Then, when a hero of the same time enters the map again (ie has been rebuilt) and is owned by the same player, the following occurs:
I assume this unit is dead? Dead units should be automatically removed from the game, so you may be trying to remove a unit from the game that already has been.
I couldn't say, though. I can't really tell what your code is doing because I don't know what Dead Hero Array is.
There is definitely a less round-about way of doing this. Any unit that you want to be able to respawn (like a hero), give this unit a behavior with a damage response that prevents any fatal damage. At the same time that this damage response occurs, use triggers to move the hero to the respawn location, and execute any other respawn stuff you want. This way the unit also preserves any items, levels, abilities that it has already acquired.
This is a WC3 style revival system- ie the unit should appear to fully die, and then only be revived when successfully purchased at the altar.
I had this working exactly- to a tee- by setting the death time of the killed unit to -1. This made is so that the hero units were infinitely 'preserved' even when dead- and added to the Dead Hero Array. The event for the Triggering Unit is 'Unit Enters Entire Map'. Such that, when a Hero is rebuilt, they enter the map. This checks if they're the same unit type of one of the dead heroes, for the player who created the new hero, and if so, removes the 'new' one and replaces it with the freshly revived 'dead' one.
So, to answer your question, 'Triggering Unit' refers to the unit that most definitely exists. :)
The error refers to the
line. However, this worked fine before, and none of the other actions involving the hero seems to throw any 'invalid unit' errors- and even printing out the unit type of the unit in the Dead Hero Array prints out correctly- so it clearly exists.
The next thought I had was perhaps the Death Position is the problem- but then why would it be saying that it couldn't get the 'Unit' parameter?
Then I think to myself "this worked fine before, dangit."
Then I just sulk.
Any help is appreciated. :) Thank you!
I should note that through the use of transmissions, I have confirmed that the trigger fires when it should, and that I'm fairly certain that the condition works wholly as intended.
I found it- I don't think it was patch related, more likely just something silly I forgot to fix/undo when copying triggers between the different map versions.
Thanks for the help, though- helped clear my head and understand the problem more by explaining it.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I came back to the hero map I had been working on from awhile back- there is significant evidence that the system I had been using for the respawning worked, and in fact I had done thorough testing both online and in the editor that suggests that it worked- however... It does not work at all, now. My only hint is that it may be a result of the recent patch- but I'm at a loss for what I could to do fix this. I've already tried as many of the suggestions that I could find via searching, and am feeling a bit disheartened that even the map that is currently on BNet (which I haven't changed at ALL, since I last touched it, unlike the editor version) doesn't work either.
Does anyone know of a way around this patch?
@Zetal: Go
Obviously there's no way around an entire patch. There's also no way that we can help you debug without seeing some code.
@MasterWrath: Go
Fair enough. I was hoping someone else had already had the same problem, heheh. No such luck I assume. Let me go grab what I have. It's sort of a mess- I never work very neatly. My friends always hate it when I do java coding, haha!
OKAY! Let's get this explanation on the road: When a hero dies, I save it in a variable array of units with a player and an ID (1-3, since each player can have up to 3 heroes.) Then, when a hero of the same time enters the map again (ie has been rebuilt) and is owned by the same player, the following occurs:
Now, I get an error saying that it couldn't get 'unit' from the parameter, whatever that means.
@Zetal: Go
It's possible that it's referring to your action
I assume this unit is dead? Dead units should be automatically removed from the game, so you may be trying to remove a unit from the game that already has been.
I couldn't say, though. I can't really tell what your code is doing because I don't know what Dead Hero Array is.
There is definitely a less round-about way of doing this. Any unit that you want to be able to respawn (like a hero), give this unit a behavior with a damage response that prevents any fatal damage. At the same time that this damage response occurs, use triggers to move the hero to the respawn location, and execute any other respawn stuff you want. This way the unit also preserves any items, levels, abilities that it has already acquired.
This is a WC3 style revival system- ie the unit should appear to fully die, and then only be revived when successfully purchased at the altar.
I had this working exactly- to a tee- by setting the death time of the killed unit to -1. This made is so that the hero units were infinitely 'preserved' even when dead- and added to the Dead Hero Array. The event for the Triggering Unit is 'Unit Enters Entire Map'. Such that, when a Hero is rebuilt, they enter the map. This checks if they're the same unit type of one of the dead heroes, for the player who created the new hero, and if so, removes the 'new' one and replaces it with the freshly revived 'dead' one.
So, to answer your question, 'Triggering Unit' refers to the unit that most definitely exists. :) The error refers to the
line. However, this worked fine before, and none of the other actions involving the hero seems to throw any 'invalid unit' errors- and even printing out the unit type of the unit in the Dead Hero Array prints out correctly- so it clearly exists. The next thought I had was perhaps the Death Position is the problem- but then why would it be saying that it couldn't get the 'Unit' parameter? Then I think to myself "this worked fine before, dangit." Then I just sulk. Any help is appreciated. :) Thank you!
@Zetal: Go
What's the triggering event?
@MasterWrath: Go
With the trigger conditions of:
I should note that through the use of transmissions, I have confirmed that the trigger fires when it should, and that I'm fairly certain that the condition works wholly as intended.
I found it- I don't think it was patch related, more likely just something silly I forgot to fix/undo when copying triggers between the different map versions.
Thanks for the help, though- helped clear my head and understand the problem more by explaining it.