New account registration is temporarily disabled.

HOW CAN I MAKE MY CHARACTER DIE WHEN NOT IN A BATTLE?

Posts

Pages: 1
So I have a couple areas where the player gets to hunt animals for furs and skins so he/she can craft them into valuable items that aid other skills or can be sold for quite large sums of money.

When a player fails to catch an animal, usually it results in the player getting bit/hit/etc. by the animal once which takes off a constant amount of HP. When I mean constant, I mean unchanging, like if it hits 20, then it would hit 20 every other time.

This is where my dilemma comes into play. Apparently, my player's HP REFUSES to go below 1 outside of a battle, making the player technically INVINCIBLE. I would expect there to have to be a tweak in a part of the script for it to let me die outside of battle.

Thank you for your time.
There's no need to script for that. Most makers have a checkbox that says (likely not with these words) " Hp reduction can kill target".
Just tick that on and you're set.
Or, in case there's a maker with that feature disabled, make a conditional branch like this:

Set Variable "CHAR X HP", Character "X" Hp.
Set Variable "CHAR X HP" subtract (insert ammount of damage here, in this case, 20)
>If variable "CHAR X HP" is equal or less than 0, apply status "Death". (Or if you want a game over, that's where it goes! =D)
>Else case
Reduce Character X Hp by (insert ammount of damage here, in this case, 20)

<3
when you ask for help make sure to let people know which maker you are using
Sorry, I keep forgetting to put which game maker i'm using. It's XP.

Also, @JosephSeraph, thanks for that - I could use that as a last resort if there's nothing else that can simply switch KO on/off like you said before.
Checking the box that says 'Allow Knockout in Battle' should work, looking at the Change HP script. Basically, if that isn't checked, it bottoms out your HP at 1. If it's checked, it lets you set the value to whatever you want, including possibly killing the actor.

If that doesn't work, check the script Interpreter 6. On mine, it's around line 119, command_311. That's the script that runs when you use Change HP in an event. Line 127 in mine reads:

if @parameters == false and actor.hp + value <= 0
actor.hp = 1

After that, add before the else:
elsif actor.hp + value <= 0 and $game_temp.in_battle == false
actor.hp += value

That'll add a second check to see if you're not in battle and if the value change will set your HP below 0.
Pages: 1