implementing armor mechanic

0 favourites
  • 15 posts
  • 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.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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...

  • 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).

  • 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:

    dropbox.com/s/61nu9bv9f92p57r/last%20light.capx

  • 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?

  • Hey are you pinning the armor onto the character. If so, have to consider a Ghouls and Goblins aproach to armor damage?

  • nooo...there is no graphic artwork yet.

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

  • 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.

    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.

  • 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.

  • GeometriX oh, nice formula, I'm sorry, sometimes I get distracted when I work, anyway thanks for clearing that!

  • GeometriX

    OH MY <img src="smileys/smiley35.gif" border="0"> CRIST!! ITS SO <img src="smileys/smiley35.gif" border="0"> EASY!!

    it's exactly what i wanted how i wanted it ,somehow i though the objects in a family would inherit the specific value of the family and that you couldn't change on a object by object base.

    thank you so much

    dropbox.com/s/63bzyts5gbwfbx5/index.html

    check it out(and tell me if it even loads i'm not sure how to work sending these things out yet)

    Joannesalfa

    lol hadn't even concidered that ,thankfully GeometriX solved that problem as well before i even realised it :D

  • My pleasure :)

    That isn't loading. If you want to share your exported project, then you need to take the entire folder created by export html and place it in your Public folder in Dropbox, then share the link to index.html.

  • GeometriX that's what i did... i think, is the folder it creates automaticly public?

    i found no way to tell if such setting even exist ,only about sharing the folder with other specific people by email or something...

    it only tells me it should work

  • The individual files that you link to will be public, but it won't operate as a web server, which is what is needed for this.

    I see that Dropbox doesn't automatically create the Public folder these days. Not sure what their thinking is, but click here to create one in your profile. Then you drag the entire exported html folder into the Public folder, share the index.html link and you should be good to go.

  • man i'd have given up on this program without you and all the info on the site a long time a go

    should work now:

    dl.dropboxusercontent.com/u/198319749/New%20project/index.html

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)