Mr_Mime_1983

Veteran
Veteran
Joined
Aug 22, 2021
Messages
41
Reaction score
7
First Language
en
Primarily Uses
RMMV
I'm back again for another question thanks everyone for their patience.

I would like to make a life point system like there is in the SaGa games where you have a certain amount of lifepoints and if you lose them all you are permanently dead. And you are able to use items etc to give yourself more life points.
I'm pretty sure all this could be done with just common events and no plugins but I could be wrong I don't know so that's why I'm asking.

If this is true does anyone have the patience to clearly outline how I would go about doing this? As a side note I learn best with visual examples.

I'm pretty sure I already figured out how to display life points in the status menu I would be able to use this plugin Actor Variables (YEP).

Again thank you everyone for your patience and help.
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
3,154
Reaction score
1,865
First Language
English
Primarily Uses
RMMV
Not having played a SaGa game, and therefore not knowing its terminology, is there a difference between life points and hit points? Are you simply describing perma-death, where you run out of hit points and it's game over? Because that's the default behavior of MV.

Or are life points like extra lives, where you lose a battle and you can respawn or something instead of having to load a saved game?

I guess in order to clearly outline how to do it, you'd need to clearly outline exactly what you're asking and how you want it to work without presuming other people have played a given game (I don't think I've even heard of them :stickytongue:).
 

Mr_Mime_1983

Veteran
Veteran
Joined
Aug 22, 2021
Messages
41
Reaction score
7
First Language
en
Primarily Uses
RMMV
@ATT_Turan
OK let me explain life points to the best of my abilities. Let's say you can relive your life 10 times if you die you lose one of those numbers so you can relive your life 9 Times Now, you make a mistake and die again so now you can only live life 8 times. But a friend told you you can go down to the local store and buy your energy drink that increases your lifepoints back to 10 so now you can relive your life another 10 times again.

That's the gist of it basically.
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
3,154
Reaction score
1,865
First Language
English
Primarily Uses
RMMV
@ATT_Turan
OK let me explain life points to the best of my abilities. Let's say you can relive your life 10 times if you die you lose one of those numbers so you can relive your life 9 Times Now, you make a mistake and die again so now you can only live life 8 times. But a friend told you you can go down to the local store and buy your energy drink that increases your lifepoints back to 10 so now you can relive your life another 10 times again.

That's the gist of it basically.
...so without needing a long explanation, using terms everyone who's played a video game understands, it's extra lives >_>

However, you still did not answer my question about what you want to happen when you lose in a battle. Do you want to simply return to the map where you were when the battle started? It's pretty easy to implement this system, but you need to know what should actually happen in the game.
 

Mr_Mime_1983

Veteran
Veteran
Joined
Aug 22, 2021
Messages
41
Reaction score
7
First Language
en
Primarily Uses
RMMV
What I want to happen naturally if all four party members die can you get a game over, but if say only one party member dies they lose a life point when resurrected. and then when all life points are depleted they could never be resurrected again. and removed from the party permanently, so in a sense you can say it's hardcore mode and extra lives essentially.
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
3,154
Reaction score
1,865
First Language
English
Primarily Uses
RMMV
Alright. That's a bit more complex than the other scenario, but not really hard.

You'll need Yanfly's Buffs & States and Auto Passive States, both free plugins. You're basically using the Second Chance Tips & Tricks with a counter added in.

I am presuming from your description that each actor has their own supply of life points.

Create a new state. I'll call it Life, but it doesn't matter what you call it, don't give it an icon.

In the Life state, put the following in the note section:
Code:
<Custom Respond Effect>
if ($gameParty.inBattle() && target.hp <= 0)
{
   if (target.lifePoints>0)
    {
        // Play the revival animation.
        target.startAnimation(49);
        // Set the target's HP to 1.
        target.setHp(1);
        // Decrement life points
        target.lifePoints--;
    }
    else
   {
        // Play death animation
        target.startAnimation(65);
        // Remove actor from party
        if ($gameParty.aliveMembers().length>0)
            $gameParty.removeActor(target._actorId);
    }
}
</Custom Respond Effect>
I'm using two of the standard animations that are created in a new project. If you've changed those or don't like them, change the number to the ID of something you do like; or if you don't want any animation, delete that line.

For each actor that can be in your party, give them the following notetag:
Code:
<Passive State: x>
where x is the ID of your Life state.

In the first map of your game, create an event that's set to autorun. Add an event command of Script (third tab, bottom right) and paste in the following code:
Code:
for (var i=1; i<$gameActors.length; i++)
    $gameActors.actor(i).lifePoints=10;
You can change that number to whatever you want their starting life points to be.

Then, on the next line, add the event command Control Self Switch -> A -> On
Then the event command Erase Event (tab 2, left middle).
Give the event a second page and leave it blank except for the upper left, under conditions, check Self Switch A.

If you want to replenish them with an item, you'll need to make another blank state - it doesn't matter what you name it, don't give it an icon.

On the item, in the Effects section, give it State -> Add State -> the state you just made -> 100%

Then give it another Effect, Other -> Common Event

In that common event, add an event command of Script and paste in the following code:
Code:
for (var i=0; i<$gameParty.members().length; i++)
{
    if ($gameParty.members()[i].isStateAffected(x))
    {
        $gameParty.members()[i].removeState(x);
        $gameParty.members()[i].lifePoints=10;
        break;
    }
}
where x is the ID of the state you just made. That will cause using the item to refill their life points to 10. If you want it to do something different, change that line accordingly.

The only thing this doesn't do is give you a way to see an actor's current life points during play. You'd have to decide how you'd like that to happen and ask for help adding that in, if you want it.
 

Mr_Mime_1983

Veteran
Veteran
Joined
Aug 22, 2021
Messages
41
Reaction score
7
First Language
en
Primarily Uses
RMMV
@ATT_Turan
OMG thank you so much. I never expected someone to write code like this for me, but thank you so much you have my undying gratitude.
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
3,154
Reaction score
1,865
First Language
English
Primarily Uses
RMMV
You're welcome, but it's all pretty basic uses of those plugins. Like I said, the biggest chunk there is copy and pasted from a free example, changing one or two lines.

Let me know if anything bugs out.
 

Mr_Mime_1983

Veteran
Veteran
Joined
Aug 22, 2021
Messages
41
Reaction score
7
First Language
en
Primarily Uses
RMMV
@ATT_Turan if you could please help me again i'm trying to figure out how display the life points and the status menu of the actors. if it's not possible to display it in the status menu of each actor, i would be fine with an NPC telling each actor how many life points they have.

i really appreciate your help.
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
3,154
Reaction score
1,865
First Language
English
Primarily Uses
RMMV
i'm trying to figure out how display the life points and the status menu of the actors.
I haven't done work with editing what's displayed in the status menu. You can Google for plugins (there are a good number) and see if any of them support custom fields, or wait to see if someone who knows better drops into the thread.
i would be fine with an NPC telling each actor how many life points they have.
In the event, you'd simply make a Conditional Branch -> Actor X -> In the party
Inside that, Control Variables -> Script -> $gameActors.actor(X).lifePoints
Then Show Text and have the NPC say whatever you want, and reference the variable ID that you just set.

Repeat the above for each actor that can be in the party.
 

Mr_Mime_1983

Veteran
Veteran
Joined
Aug 22, 2021
Messages
41
Reaction score
7
First Language
en
Primarily Uses
RMMV
@ATT_Turan
Thank you so much, you've been very helpful. I can add you to the credits at the end of the game if you're ok with that.
 

Latest Profile Posts

Been playing through Skies of Arcadia again, and it really makes me wanna see someone try to implement how ship battles were done in the game into RPG Maker (or really just in general).
split.png
split view of both versions of the pocket city you traverse through. there's differences like areas only being accessible in one version of Autumn Bay. or events that only happen in one or the other.
theortically if there were a developer who spied on people's game playthroughs and changed things in real time to make it harder for them, what might be said game developer's motivation?
Hi everyone! Enjoying this nice long weekend. How are you all doing? :)
I just successfully tested having events check if specific actors are in a particular party slot and then changing image to match. This will let me make scenes take into account who is in the party at the time and arrange them accordingly - this is important since I'll have extra actors beyond current party. The script used is the same from MV and is compatible with my current core plugin setup in MZ. Thank goodness.

Forum statistics

Threads
118,433
Messages
1,115,927
Members
155,391
Latest member
dndrself
Top