implementing armor mechanic

Get help using Construct 2

Post » Wed Jul 31, 2013 8:44 pm

i want to make pretty much this:

normal damage - armor = damage taken


maybe by making it so that when an arrow hits a certain family(of enemies) it checks for its armor value(of an specific enemy not the family becouse i want the widest range of diferent values for armor possible) and subtract by it.

right now i can only make this mechanic by creating one event for each interaction of arrow with enemy which leaves me unable to make easy balance changes becouse if i want to change how much damage the arrow deals i'll have to change it on a sh*t ton of events.
B
4
Posts: 24
Reputation: 248

Post » Wed Jul 31, 2013 9:25 pm

do you have a variable set up for the damage the arrow deals regardless of any armor?
if you have that subtracted from e.g. the enemies health on impact (taking armor into account by subtraction/division or whatever), you could just manipulate the damage variable on the arrow for balancing and it should work...

hope this helps...
B
8
S
1
Posts: 3
Reputation: 643

Post » Wed Jul 31, 2013 9:46 pm

I'm sure there are plenty of ways to go about it but here's mine. I use armour values for enemies and armour piercing for player attacks. My event looks like this:

PlayerAttacks On collision with Enemies -> Subtract max(0,PlayerAttacks.Damage-max(0,Enemies.Armour-PlayerAttacks.ArmourPiercing)) from Enemies.Hitpoints

If you don't have armour piercing (although I do recommend it - it makes for some fun diversity in weapons) , then the expression would just be max(0,PlayerAttacks.Damage-Enemies.Armour).
B
57
S
15
G
11
Posts: 912
Reputation: 12,606

Post » Wed Jul 31, 2013 10:09 pm

zhajym:
thats kinda the way i've been doing it i think.

GeometriX:
damn, i really don't know any about expressions , but i'll try to learn about these you showed me and implement them( and post any doubts about them i can't work out on my own)

here is what i've been doing so far (also i want to show off the nifty cooldown system i found away to creat ,is not organised but works like a charm:

https://www.dropbox.com/s/61nu9bv9f92p57r/last%20light.capxMustacheGolem2013-07-31 22:22:21
B
4
Posts: 24
Reputation: 248

Post » Wed Jul 31, 2013 10:46 pm

okay fried, i don't think that souves my problem using:

max(0,PlayerAttacks.Damage-Enemies.Armour)

i still have to tell it a specific enemy or family of enemies all with the same armour value to be calculated ,which is kinda limited.
sinse to have different armour values i need more events.

is there no expression to tell it to: say there is a family called "enemies" there we have zombie skeleton and orc.

they all have different armour values.

so i kinda want an event to after i tell it "PlayerAttacks On collision with Enemies " calculate the damage being subtracted by the armour of an specif kind of enemy ,but for all enemies even the ones with different values for armour, in one event.

i'm asking tomuch of C2 aren't i?
B
4
Posts: 24
Reputation: 248

Post » Thu Aug 01, 2013 12:13 am

Hey are you pinning the armor onto the character. If so, have to consider a Ghouls and Goblins aproach to armor damage?
B
15
S
5
G
2
Posts: 164
Reputation: 3,082

Post » Thu Aug 01, 2013 1:18 am

nooo...there is no graphic artwork yet.

you mean exploding into nakedness? i don't think thats i'm trying to achieve...lol

B
4
Posts: 24
Reputation: 248

Post » Thu Aug 01, 2013 6:47 am

[QUOTE=MustacheGolem] i want to make pretty much this:

normal damage - armor = damage taken


maybe by making it so that when an arrow hits a certain family(of enemies) it checks for its armor value(of an specific enemy not the family becouse i want the widest range of diferent values for armor possible) and subtract by it.

right now i can only make this mechanic by creating one event for each interaction of arrow with enemy which leaves me unable to make easy balance changes becouse if i want to change how much damage the arrow deals i'll have to change it on a sh*t ton of events.
[/QUOTE]


Don't use

normal damage - armor = damage taken

Because it's a bad practice, what happens when the armor is bigger than damage? it retuns to add more hp of enemy.

It needs to add some conditions to prevent adding extra HP. I don't remember which is formula... Let me see I can do it, it would return 1 damage if armor is more than damage.
B
97
S
35
G
29
Posts: 3,139
Reputation: 28,361

Post » Thu Aug 01, 2013 11:30 am

@Joannesalfa, that's why I suggested he use max(0,PlayerAttacks.Damage-Enemies.Armour). That will never remove less than zero hitpoints.

MustacheGolem, you need to set the family itself to have those instance variables - that's the beauty of families. That way, anything within the family gets its own instance of that variable. So, your enemies family itself could have hitpoints and armour, for example, but when you put each enemy on the layout, you can specify individual hitpoints and armour values for each.

B
57
S
15
G
11
Posts: 912
Reputation: 12,606

Post » Thu Aug 01, 2013 11:42 am

@GeometriX oh, nice formula, I'm sorry, sometimes I get distracted when I work, anyway thanks for clearing that!Joannesalfa2013-08-01 11:59:03
B
97
S
35
G
29
Posts: 3,139
Reputation: 28,361

Next

Return to How do I....?

Who is online

Users browsing this forum: zsoldiers and 4 guests