I'm working on a project that involves a squad system, and I want to be able to make it so the squad leaders are the last to die in a squad. At the moment I simply make them invulnerable, the only problem is that then they don't display any health.
A) Is there anyway to continue displaying a health stat even though the unit is set to invulnerable,
B) if not does anyone have any idea's about how to go about ensuring the squad leaders are the last units to die in a squad?
This will solve both 1 and 2 since the captain doesn't need to be invulnerable and, as long as there are at least 2 units in the squad (including the captain,) the captain's health will be restored every time it falls below 10%.
Hmm I'll have to try that, If it works even if the captain takes more than 10 damage from a single shot then this will be AMAZING.
Only problem is that units might be wasting shots into a target that can't die, I'm worried that a player will try to focus down the squad leader and all his units will die without doing anything productive.
what if when that triggers, for a split second you set him to invulnrable, and then back, that would effectively break targetting on the captain wouldn't it?
if- Captain Life(current) < (triggering damage amount)
then
if(Number of Living Units in (Captains Squad) > 0) The captain himself is not included in the squad
then - Unit - Set (triggering unit) life to 1.0
Only problem is the unit is responding to the fatal damage and being killed before the trigger resets his health.
:O I think that's what Duck said, but some how how you said it makes more sense, I'll try that,
PS the Ressult of the damage dealing reseting is the same pretty much, if the unit takes more than "Limmit percent" damage in a single burst it will still die.
Another thing you could do is distribute damage to the other units in the squad until they all die. For example, when the captain gets attacked and there are other units in the squad, set his HP to 100%, split the triggering damage amount by the number of units in the squad - 1, apply that amount of damage to each squad units besides the captain. This won't help if the damage amount is greater than the captain's max HP.
To get around that problem, use a buff that prevents fatal damage and apply it to your captain.
Hmm, I like this idea, but i'm REALLY new to modifying the data and making abilities and buffs and things. I've only gotten as far as I have with the squad system cause the triggers are like programming, the data is till a little foreign to me.
Do you think that would work if the damage is greater than the captains Current HP? like he has 1 hp left, and takes 10 damage?
Thanks for your input everyone, I'm really surprised at how quick the community is to respond @_@
I have a working system where the squad leader is invulnerable until his squad has been killed, I'll work on changing the behavior later but theres plenty to do else where. after I clean up the rest of the triggers I can post the map if anyone's interested in looking at the squad system.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Hey all, this is my first post here,
I'm working on a project that involves a squad system, and I want to be able to make it so the squad leaders are the last to die in a squad. At the moment I simply make them invulnerable, the only problem is that then they don't display any health.
A) Is there anyway to continue displaying a health stat even though the unit is set to invulnerable,
B) if not does anyone have any idea's about how to go about ensuring the squad leaders are the last units to die in a squad?
The easiest way via triggers is something like this:
This will solve both 1 and 2 since the captain doesn't need to be invulnerable and, as long as there are at least 2 units in the squad (including the captain,) the captain's health will be restored every time it falls below 10%.
@BasharTeg: Go
Hmm I'll have to try that, If it works even if the captain takes more than 10 damage from a single shot then this will be AMAZING.
Only problem is that units might be wasting shots into a target that can't die, I'm worried that a player will try to focus down the squad leader and all his units will die without doing anything productive.
what if when that triggers, for a split second you set him to invulnrable, and then back, that would effectively break targetting on the captain wouldn't it?
Hey new guy.
One way to do it would be using behavior negating all damage and suppressing units threat (data way)
Create new buff
//all incoming damage is negated
//makes it impossible to use unit as target to abilities (such as attack)
//enemy attacks leader only if there are no other targets around (auto attack)
Edit: you can also check Fatal in Damage Response+. It will make leader invulnerable only to fatal damage. (data is so much fun =D)
At the moment I'm trying
if- Captain Life(current) < (triggering damage amount) then if(Number of Living Units in (Captains Squad) > 0) The captain himself is not included in the squad then - Unit - Set (triggering unit) life to 1.0
Only problem is the unit is responding to the fatal damage and being killed before the trigger resets his health.
Remove the invul flag from your hero.
Make a behaviour with the invul flag instead.
Add behaviour to hero.
:O I think that's what Duck said, but some how how you said it makes more sense, I'll try that,
PS the Ressult of the damage dealing reseting is the same pretty much, if the unit takes more than "Limmit percent" damage in a single burst it will still die.
Edit- I see it now i'm retarded >.<
Another thing you could do is distribute damage to the other units in the squad until they all die. For example, when the captain gets attacked and there are other units in the squad, set his HP to 100%, split the triggering damage amount by the number of units in the squad - 1, apply that amount of damage to each squad units besides the captain. This won't help if the damage amount is greater than the captain's max HP.
To get around that problem, use a buff that prevents fatal damage and apply it to your captain.
@BasharTeg: Go
Hmm, I like this idea, but i'm REALLY new to modifying the data and making abilities and buffs and things. I've only gotten as far as I have with the squad system cause the triggers are like programming, the data is till a little foreign to me.
Do you think that would work if the damage is greater than the captains Current HP? like he has 1 hp left, and takes 10 damage?
;-)
Thanks for your input everyone, I'm really surprised at how quick the community is to respond @_@
I have a working system where the squad leader is invulnerable until his squad has been killed, I'll work on changing the behavior later but theres plenty to do else where. after I clean up the rest of the triggers I can post the map if anyone's interested in looking at the squad system.