Noob Question: Armor

Hello!

I’ve just started playing with the creation system of Story Nexus and I’m liking it so far, so much potential to go in so many different ways! =) I couldn’t help but try to make something myself.

So I’m making a fantasy flavored exploration game, and I wanted to put in an armor type item. Ideally, &quotdamage&quot would apply to the armor before the player, so if there anyway to set up an if/then test to effect their armor quality if they have it, and their health quality if they do not? I need it to effect one or the other, not both.

Thanks.

You need to use a rich effect for this. So, if you’ve got three qualities: health, armour and damage, the easiest thing to do is to use a formula such as this to change their health:

[q:armour]-[q:damage]

The only problem here is that if the armour was greater than the damage, it could actually improve their health; you’d just have to make sure that that situation never arises. Of course, you could do something such as scale the benefit the armour gives, etc.

This method would also block all damage with enough armour, and never damage the armour. If you want to make it so that damage effects armour and then health, you’d really need to make two branches for every situation where the character is attacked, one set to minimum armour one and the other set to maximum armour zero, both hidden when the criterion is not met, so the player only sees one at a time.

stares at post in sleep deprived manner
The following may be incoherent, please don’t laugh too loud or long.

I generally fear rich effects, though I hear they’re awesome. (I just don’t like them as if they don’t work, I find it harder to work out why.) If the above works for you, whoop. If you want something technically simple, but maybe requiring more work with the wording, perhaps:

I stared at this wondering whether there would be a really simple way to do this using one quality where the various elements would be shown in the wording rather than in having several qualities. If you had a base stat of Health that didn’t change, and this was supplemented by armour (equipable), then damage could just chip away at that stat. The key would be in change levels, and what you called the overall health stat, as it would have to be something that could cater for: health no armour or health with armour or health with armour where the armour bonus is used up.

But I think this would restrict every character to the same base health stat.
E.g. Base ‘Wellbeing’ = 100, equipping armour adds 10, damage just comes off the wellbeing stat. Bad things happen at levels of wellbeing less than X.

Of course - this wouldn’t really treat the armour as armour - you wouldn’t be left with a damaged piece that you could repair - its stat bonus would remain the same. So really it would just be coming off health under the armour, a health buffed by armour.

Curses. That means the above is nonsense. Perhaps if picking up armour just auto healed a bit and ‘used up’ the armour - that would be another clumsy workaround. But. Meh.
edited by babelfishwars on 8/10/2014

I love rich tests and effects! It’s rare for me to have a branch that doesn’t use them! ;)

However, regarding the above, I strongly suspect that the only way to have a system where your armour could be damaged and destroyed is simply to have two branches, for with and without armour - no rich tests or effects needed.

Edit! Scratch that. You could have two effects on the same branch:

health -= armour - damage
armour -= damage * scaler

So your armour absorbs the damage but then gets damaged itself. The scaler would be optional.
edited by cyberpunkdreams on 8/10/2014

[quote=cyberpunkdreams]health -= armour - damage
armour -= damage * scaler[/quote]

… minus equals? How does that even work. :-S
Health = the negative of the result of …
brain falls out

This is why I don’t play with clever things.

Don’t suppose anyone’s aware of a good blog post/bit on rich tests/effects? The bit in the guide isn’t the most detailed. If anyone were bored and wanted to write a primer, I’d read it. hint hint

[quote=cyberpunkdreams]Edit! Scratch that. You could have two effects on the same branch:

health -= armour - damage
armour -= damage * scaler
[/quote]

So, if you have 100 health, 10 armour, and get hit for 20 damage, your health will be
health = 100 - (10-20)=100-10+20=110?
Did getting hurt for 20 points just heal you 10 points?
(I think you meant “health -= damage - armor”)

Also, you would want branches for “damage <= armour” and “damage > armour”.
Otherwise getting hit for 10 points with 20 armour will do “health = 100 - (10-20) = 110” instead of “health = 100 - (0)”.
Possibly even another branch for “armour=0”, because you might want armour to always prevent certain negative effects of being hit.

“A -= B” is shorthand for “A = A-B” (assign the result of “A-B” back to A).

[quote=xKiv][quote=cyberpunkdreams]Edit! Scratch that. You could have two effects on the same branch:

health -= armour - damage
armour -= damage * scaler
[/quote]

So, if you have 100 health, 10 armour, and get hit for 20 damage, your health will be
health = 100 - (10-20)=100-10+20=110?
Did getting hurt for 20 points just heal you 10 points?
(I think you meant &quothealth -= damage - armor&quot)

Also, you would want branches for &quotdamage <= armour&quot and &quotdamage > armour&quot.
Otherwise getting hit for 10 points with 20 armour will do &quothealth = 100 - (10-20) = 110&quot instead of &quothealth = 100 - (0)&quot.
Possibly even another branch for &quotarmour=0&quot, because you might want armour to always prevent certain negative effects of being hit.

&quotA -= B&quot is shorthand for &quotA = A-B&quot (assign the result of &quotA-B&quot back to A).[/quote]

ALL IS REVEALED.

Thanks. (Also: interesting.)

Aye, for the record, StoryNexus doesn’t support -= or +=, as far as I know; I was just using shorthand. I’ve been thinking about writing a guide to StoryNexus in general, focusing on bugs and workarounds, easy ways to get things done, gotchas, etc. Some more detail on rich stuff could go in there. My main problem is that I have a coding background, so it’s hard for me to see it and explain it from the point of view of someone who doesn’t.

Anyway, yes, if armour exceeds damage you would end up giving the person health in that scenario - I did mention that, but I think it should be possible to design a game where damage was always greater than armour. If you did, then things become simple:

Health = Health - ( Damage - Armour )
Armour = Armour - ( Damage * ArmourDamageScaler )

So, if Health = 100, Armour = 20, Damage = 30 and ArmourDamageScaler = 0.1, after the attack you end up with,

Health = 90
Armour = 17

If you didn’t want to design a system where damage always exceeded armour, then I think it would be best just to have separate branches for with and without armour and forget about rich effects. It ends up being a bit more work, but not too much, as you can copy and paste branches.

As a person with a very limited coding background who wants to see more StoryNexus guides in existence, I would be willing to beta it for you if you did write it, and point out areas that need further or simpler explanation.

Thanks! I’ll give it some thought and it will probably happen. I’m working towards the release of my StoryNexus game at the moment though, so that’s taking priority at the moment. I could at least start with some rough notes though…

The guide is a goodish start, but isn’t up-to-date. What I’d find useful (having worked out the basics through just doing it) would be:

  • a note of known bugs/issues (and any workarounds people have found) - so that I know when it’s SN and not me.
  • more detailed discussion of rich effects, common mistakes people make, situations where can use and so on.

Don’t know if it’s worth doing an SN guide from scratch, since there already is the main one. But flagging out of date areas and so on…

I agree, doing a guide from scratch would be the road to madness! I was thinking along the lines of tips and tricks, bugs and how to work around them, etc.

This would make me happy. And everything’s about me being happy.