Page 2 of 2

Re: Zelda Style Heart Bar- how to do?

Posted: Sun Feb 03, 2008 7:55 pm
by darksmaster923
arkanus thats pretty easy.
first you have 2 attributes in the player.ini

Code: Select all

[health]
initial = 100
low = 0
high = 0

[armor]
initial = 100
low = 0
high = 0


then in the enemy script during the attack order you have it check if player has armor var like

Code: Select all

if(GetAttribute(shield, "Player") > 0)
you make it damage the shield var

Re: Zelda Style Heart Bar- how to do?

Posted: Mon May 12, 2008 12:29 pm
by ardentcrest
QOD been looking for the link for "The Legend Of Okkora"

seen it in the gallery is it ready yet or have you stoped working on it ?

Re: Zelda Style Heart Bar- how to do?

Posted: Mon May 12, 2008 1:50 pm
by QuestOfDreams
I've stopped working on it, it would have been a full time job to realize the project the way I imagined it and I just don't have the time. I'm now working in a team on a point & click adventure instead (not RF based), which will be released this summer. We'll present it at the Games Convention in Leipzig in August and you will be able to download it for free from the web then.
Broken Sword 2.5

Shield

Posted: Mon May 12, 2008 7:06 pm
by Graywolf
ArKanuS wrote: I would like to have like a shield (like health) which when runs out starts affecting your health but if you wait awhile the shield recharges but your health stays the same?
For this, I'd suggest setting up a seperate damage manager.

First thing, keep the player from running out of health as mentioned above(set low to 1). Next, set the high and initial to.. Let's go with 1000. Now, add 2 attributes, real_health and shield, both low=0, high=100, initial=100.

Now, create a dummy pawn, no render, no collision, drop to a low level order. This pawn needs to do these things:

1. Get the player's "health" attribute, and subtract this from 1000. Store it in a variable... We'll call it CUR_DAMAGE. This let's us know how much damage the player took. Also, get the current value of "shield", and store it in CUR_SHIELD.
2. Now, we check if CUR_DAMAGE is greater than CUR_SHIELD. If so, we set "shield" to 0, and modify "real_health" by CUR_DAMAGE - CUR_SHIELD. If not, we just modify "shield" by -CUR_DAMAGE.
3. Next, we check if "real_health" is less than 1, and if so, kill the player(setting "health" to zero should do it, but maybe not... I'm not sure offhand. Anyone know for sure? Might be a problem with the low being 1...)
4. Next, to regenerate the shield. We need a variable for regeneration, and a counter system, like so:

Code: Select all

if(COUNTER > REGEN_RATE)
{
ModifyAttribute("player", "shield", 1);
COUNTER = 0;
}
else
{
COUNTER = COUNTER +1;
}
Please excuse me if I made any parameter errors, I don't have docs handy... (Are the HTML docs on-site? If so, anyone got a link?)

5. Last off, we set "health" back to 1000.

Well, that's the general gist of it... Or, at least, the best approach I can think of.

Re: Zelda Style Heart Bar- how to do?

Posted: Wed May 14, 2008 2:13 am
by ArKanuS
Thanks, Graywolf.

Nice necro of the thread ardentcrest
/sarcasm