Hey, been working on my natural selection map and I have now started on the custom armor system.
Like many FPS games, NS has a system such that, in general:
Armor can absorb, at maximum, 70% of the incoming damage.
Each point of armor will absorb 2 points of damage.
I have attempted to use Shields as the "armor", since SC2's armor concept seemed more difficult to work with.
My attempt at a trigger seems to work, except for a major caveat: any unit with full health that is attacked will receive double damage on the first attack. Any subsequent attacks work properly. Even a unit without any shields (maximum shields = 0) will take double damage on the first damage it receives, and then normal damage after.
The best way to see this in action is:
Attack a full health/shields marine with a zergling. It will die in 1 hit.
Attack a marine with another marine for 1 attack. Now have a zergling attack the marine. Notice that the marine will not die, but rather take the damage that would be expected.
Your unit must be forced to take no damage to begin with. Once the trigger is called, it's too late to change how much damage was taken, hence the near-double damage for the first hit.
Edit: I think I understand now. You mean that the "make triggering unit take no damage" is permanent, not merely active for the scope of the trigger, which is why it has to activate once before it works properly.
The trigger fires AFTER damage was taken, so the "Take no damage" action wont work for the first time the trigger runs because the damage was already taken and you cant change the past. What you have to do is have a seperate trigger that picks all units and makes them take no damage, and have a trigger which fires when a unit is created and make it take no damage either (use conditions so that the trigger doesn't affect missiles or other units you dont want)
Armor can absorb, at maximum, 70% of the incoming damage.
Pretty sure there are some weapons that penetrate the shields by a factional value. Ask around.... this would be a value on one of the damage effects
Im pretty damn sure theres a way in "data" to set how much of the incoming damage will be applied to shields. Or you might be able to create a behavior that applies a portion of the incoming damage to shields to the unit as well.
The only real problems would be that in some cases the values change.
Heavy armor marines absorb 95% of the damage with armor, and alien's armor absorb percentage is dependent upon the number of hives (70, 80, 90%).
In addition, aliens with 3 hives absorb 2.5 damage per armor point.
I see those factors causing a lot of maintenance headaches if using any sort of shield penetration values on effects. Here I have every damage source all captured in a single location, and it appears to be working well now.
Well most of that can be done with advanced use of behaviors.
Im sure it works well in testing. Triggers get a little messy though with 14 players and a crazy ammount of damage sources.
It also limits your ability to handle Upgrades/ damage over time/ any type of damage from a spell or other source/. Basically youd have do rewrite the trigger every time you want a new kind of damage added to the game.
Right, trigger performance is a concern, and if it impacts the map then I will definitely have to go for the purely data editor approach.
The pros of this single trigger set is that it captures all damage from all effects (spell, melee, ranged), which works in the context of the map, since in Natural Selection even something like Acid Spores (what might be considered a spell) is reduced by armor the same way as a bullet or a claw swipe would be.
The data editor approach would work best if there was an explicit "Shield absorb %"{default 1 in sc2core} and "Shield point absorb"{also default 1 in sc2core} or some similar values on a behavior or unit. If there is something like that I was unable to find it.
Setting a shield piercing fraction for each damage effect in the game, in addition to the logic behind cases such as 70 vs 80 vs 90 vs 95% absorption, seems to me like a tonnnn of work.
Right, trigger performance is a concern, and if it impacts the map then I will definitely have to go for the purely data editor approach.
Do you have a hundred marines in this map, constantly shooting at each other with machine guns?
No?
Then you're fine, performance-wise :)
However, I suggest one change.
Instead of making a trigger that turns every unit invulnerable when it's attacked, it's better to just make them invulnerable once.
The first trigger will make all your pre-placed units invulnerable, while the second trigger will make all units which spawn take no damage (no matter if they are built, summoned or created via trigger).
It's less performance eating, because units are not constantly re-made invulnerable.
Hey, been working on my natural selection map and I have now started on the custom armor system.
Like many FPS games, NS has a system such that, in general:
I have attempted to use Shields as the "armor", since SC2's armor concept seemed more difficult to work with.
My attempt at a trigger seems to work, except for a major caveat: any unit with full health that is attacked will receive double damage on the first attack. Any subsequent attacks work properly. Even a unit without any shields (maximum shields = 0) will take double damage on the first damage it receives, and then normal damage after.
The best way to see this in action is:
Here is the trigger:
Here is a small test scenario that I threw together: download test map shields_as_armor_test.sc2map
If anyone can help out with this I would appreciate it!
Your unit must be forced to take no damage to begin with. Once the trigger is called, it's too late to change how much damage was taken, hence the near-double damage for the first hit.
@DarkRevenantX: Go
I don't understand what you mean.
Edit: I think I understand now. You mean that the "make triggering unit take no damage" is permanent, not merely active for the scope of the trigger, which is why it has to activate once before it works properly.
I see, thank you.
The trigger fires AFTER damage was taken, so the "Take no damage" action wont work for the first time the trigger runs because the damage was already taken and you cant change the past. What you have to do is have a seperate trigger that picks all units and makes them take no damage, and have a trigger which fires when a unit is created and make it take no damage either (use conditions so that the trigger doesn't affect missiles or other units you dont want)
@scmapcritic: Go
Ok, working with the above information, I merely added a second trigger:
Conditions:
Actions:
And that fixed it. Thanks!
why are you doing this with triggers?
@SouLCarveRR: Go
Do you have an alternative approach? I am open to alternatives. That is the only way that was visible to me.
@SouLCarveRR: Go
The only real problems would be that in some cases the values change.
Heavy armor marines absorb 95% of the damage with armor, and alien's armor absorb percentage is dependent upon the number of hives (70, 80, 90%).
In addition, aliens with 3 hives absorb 2.5 damage per armor point.
I see those factors causing a lot of maintenance headaches if using any sort of shield penetration values on effects. Here I have every damage source all captured in a single location, and it appears to be working well now.
@scmapcritic: Go
Well most of that can be done with advanced use of behaviors.
Im sure it works well in testing. Triggers get a little messy though with 14 players and a crazy ammount of damage sources.
It also limits your ability to handle Upgrades/ damage over time/ any type of damage from a spell or other source/. Basically youd have do rewrite the trigger every time you want a new kind of damage added to the game.
Well good luck.
@SouLCarveRR: Go
Right, trigger performance is a concern, and if it impacts the map then I will definitely have to go for the purely data editor approach.
The pros of this single trigger set is that it captures all damage from all effects (spell, melee, ranged), which works in the context of the map, since in Natural Selection even something like Acid Spores (what might be considered a spell) is reduced by armor the same way as a bullet or a claw swipe would be.
The data editor approach would work best if there was an explicit "Shield absorb %"{default 1 in sc2core} and "Shield point absorb"{also default 1 in sc2core} or some similar values on a behavior or unit. If there is something like that I was unable to find it.
Setting a shield piercing fraction for each damage effect in the game, in addition to the logic behind cases such as 70 vs 80 vs 90 vs 95% absorption, seems to me like a tonnnn of work.
Do you have a hundred marines in this map, constantly shooting at each other with machine guns?
No?
Then you're fine, performance-wise :)
However, I suggest one change.
Instead of making a trigger that turns every unit invulnerable when it's attacked, it's better to just make them invulnerable once.
So I suggest you make two triggers:
The first trigger will make all your pre-placed units invulnerable, while the second trigger will make all units which spawn take no damage (no matter if they are built, summoned or created via trigger).
It's less performance eating, because units are not constantly re-made invulnerable.