What is the best way to "kill" a unit and then revive it later, assuming that unit has learned abilities that need to be retained? I know there is a heroic revival system of sorts in place, but it seemed over complicated for what I wanted. My current method is simply hiding the unit in question, spawning and then killing a dummy unit of the same type on top of it for death animation, then teleporting it to it's revival point to be unhidden later. My method also works because my game does not used damage as death is collision based. Is there a simpler/more efficient method for this?
My second question is marking a unit with a custom flag ie the previous example marking if a unit is "dead" or not. Would it be better to simply save the value as a boolean, or mark the unit with a behavior? I currently have a record holding values for all players and each player only has a single unit. Players[i].unit.isDead == false vs UnitHasBehavior(unit, "dead") == false. I know it is subtle, but I'm wanting to check conditions like this multiple times a second for multiple players.
Thanks for any help.
TLDR SOLUTION: Setting a unit's death time to -1 in the data editor allows you to use the revive unit function freely in the trigger editor. You may also need to change the unit revive type in data editor if you are not using premade units. Thanks TyaStarcraft.
You can use the event trigger "dialog item is used" to detect when a player clicks a button. Then you just add a conditional to test for which button is clicked (or even a switch statement), and use event player to run actions for the respective player only. I'm just getting into UI development myself so I'm not sure the most efficient way of setting up the trigger, but that is the basic premise.
Edit - I now see this is a few months old, but simple questions with simple answers like this are insanely useful for anyway getting started.
Turns out the issue was just my own ignorance. Figure I'll post the answer on the off chance someone else runs into this.
It was as simple as not realizing I had the "View Raw Data" option turned on before I created my triggers, and then inadvertently turning it off again without realizing it. I basically just named all the triggers in the wrong view.
Everything I've modified in the data editor has the prefix "Escape - " so all custom stuff should be easily searchable.
I'll add this to the editor issues forum at some point today. I was hoping it was a known issue that had some simple remedy, but of course that would just be too easy.
I'm pretty new to the editor, but I have some background with programming so I feel I'm catching on fairly quickly. I have been working on a test map over the course of a few days, and yesterday I ran into a very big issue. At some point while working on the map (I'm uncertain exactly when it happened), every single custom trigger I've made had it's name reset to "Untitled [Element] 001".
This issue is also effecting local variables which is now shown in the screenshot.
Oddly enough all the triggers still work in this state. When I create a new element, the name will still default to "Untitled [Element] 001" and subsequent elements after that will increment correctly. Manually renaming them doesn't cause issues; the names will once again save properly.
So I'm just looking for some insight into how this happened and how I can avoid it in the future. I'm fine with manually fixing the issue this time, but were it to happen later on when I have a lot of the map done, I would be in a pretty bad spot. Thanks for any feedback.
0
What is the best way to "kill" a unit and then revive it later, assuming that unit has learned abilities that need to be retained? I know there is a heroic revival system of sorts in place, but it seemed over complicated for what I wanted. My current method is simply hiding the unit in question, spawning and then killing a dummy unit of the same type on top of it for death animation, then teleporting it to it's revival point to be unhidden later. My method also works because my game does not used damage as death is collision based. Is there a simpler/more efficient method for this?
My second question is marking a unit with a custom flag ie the previous example marking if a unit is "dead" or not. Would it be better to simply save the value as a boolean, or mark the unit with a behavior? I currently have a record holding values for all players and each player only has a single unit. Players[i].unit.isDead == false vs UnitHasBehavior(unit, "dead") == false. I know it is subtle, but I'm wanting to check conditions like this multiple times a second for multiple players.
Thanks for any help.
TLDR SOLUTION: Setting a unit's death time to -1 in the data editor allows you to use the revive unit function freely in the trigger editor. You may also need to change the unit revive type in data editor if you are not using premade units. Thanks TyaStarcraft.
0
You can use the event trigger "dialog item is used" to detect when a player clicks a button. Then you just add a conditional to test for which button is clicked (or even a switch statement), and use event player to run actions for the respective player only. I'm just getting into UI development myself so I'm not sure the most efficient way of setting up the trigger, but that is the basic premise.
Edit - I now see this is a few months old, but simple questions with simple answers like this are insanely useful for anyway getting started.
0
Turns out the issue was just my own ignorance. Figure I'll post the answer on the off chance someone else runs into this.
It was as simple as not realizing I had the "View Raw Data" option turned on before I created my triggers, and then inadvertently turning it off again without realizing it. I basically just named all the triggers in the wrong view.
0
There is only one locale on the list, it is checked, and it is titled "English (US) <enUS>".
Here is a pastebin of the TriggerStrings.txt: http://pastebin.com/SXSMdXUi
Pretty much everything with a seemingly proper name (InitMap, u, p, unit, testnum, etc) was added or renamed after the bug occured.
Map Download: Link Removed: http://www.mediafire.com/download/13y23mx58eprop3/EscapeMap.SC2Map
Everything I've modified in the data editor has the prefix "Escape - " so all custom stuff should be easily searchable.
I'll add this to the editor issues forum at some point today. I was hoping it was a known issue that had some simple remedy, but of course that would just be too easy.
0
I'm pretty new to the editor, but I have some background with programming so I feel I'm catching on fairly quickly. I have been working on a test map over the course of a few days, and yesterday I ran into a very big issue. At some point while working on the map (I'm uncertain exactly when it happened), every single custom trigger I've made had it's name reset to "Untitled [Element] 001".
Here is a screenshot showing the issue: http://i.imgur.com/yTeWD1M.png
This issue is also effecting local variables which is now shown in the screenshot.
Oddly enough all the triggers still work in this state. When I create a new element, the name will still default to "Untitled [Element] 001" and subsequent elements after that will increment correctly. Manually renaming them doesn't cause issues; the names will once again save properly.
So I'm just looking for some insight into how this happened and how I can avoid it in the future. I'm fine with manually fixing the issue this time, but were it to happen later on when I have a lot of the map done, I would be in a pretty bad spot. Thanks for any feedback.