Hey Sc2Mapster folk, been wracking my brain on this for a couple days, I need a building that can be damaged, all the way to 1hp, but cannot be destroyed. The idea is this building once reduced to 1 HP triggers an event, while the building itself can then be repaired ending that event.
Think disabling the controls to a big metal gate, and having to send SCV's over to fix it so the gate can close again.
I've messed around with various flags, not destroyable and invulnerable, but either the building can still be destroyed, or it can't be damaged at all :( help!
Potential solution is do it with triggers, though you might want to set the health amount a little higher so as not to accidentally destroy the building. Then again the trigger may be fast enough ;)
another potential solution is to work it kinda like the thor, so once it's "destroyed" it changes to an invulnerable unit that has a countdown to repair itself. Then maybe just find a way to require an scv present to work? You could have a trigger disabling the ability while an scv is not near the gate, then enable it when one gets close enough. then just trigger it to stop the scv from doing anything while the gate repairs.
Could also use the Valerian 05a - Prevent Hero Death Behavior, assuming that works on buildings. There's also some Behaviors like "Odin Don't Die", which I am not sure what they do.
Thank you all for the suggestions, I ended up using a mix of them :D
I used the Valerian behavior, which causes the building to become "incapacitated" then after a short duration adds some health back. I then used a trigger to monitor the building health and open/close the door as needed. Everything works well, just need to fiddle with animations, thanks again guys.
Hey Sc2Mapster folk, been wracking my brain on this for a couple days, I need a building that can be damaged, all the way to 1hp, but cannot be destroyed. The idea is this building once reduced to 1 HP triggers an event, while the building itself can then be repaired ending that event.
Think disabling the controls to a big metal gate, and having to send SCV's over to fix it so the gate can close again.
I've messed around with various flags, not destroyable and invulnerable, but either the building can still be destroyed, or it can't be damaged at all :( help!
@SicJake: Go
Potential solution is do it with triggers, though you might want to set the health amount a little higher so as not to accidentally destroy the building. Then again the trigger may be fast enough ;)
@currydevil: Go
another potential solution is to work it kinda like the thor, so once it's "destroyed" it changes to an invulnerable unit that has a countdown to repair itself. Then maybe just find a way to require an scv present to work? You could have a trigger disabling the ability while an scv is not near the gate, then enable it when one gets close enough. then just trigger it to stop the scv from doing anything while the gate repairs.
Could also use the Valerian 05a - Prevent Hero Death Behavior, assuming that works on buildings. There's also some Behaviors like "Odin Don't Die", which I am not sure what they do.
Thank you all for the suggestions, I ended up using a mix of them :D
I used the Valerian behavior, which causes the building to become "incapacitated" then after a short duration adds some health back. I then used a trigger to monitor the building health and open/close the door as needed. Everything works well, just need to fiddle with animations, thanks again guys.
simple way is to modify the hp regeneration rate of your unit in the data editor (uses percentage value).
put 100 and also increase the max hp/ starting hp if the unit is a weakling
chicken!!!