Block party from access if party member(s) are dead.

Morrigan01

Villager
Member
Joined
Nov 30, 2017
Messages
7
Reaction score
3
First Language
English
Primarily Uses
RMMV
I've looked, but I can't seem to find an answer to this:

So I want it where the player will be blocked from entering specific places if a party member is dead. They have to revive the party member first before they will be allowed in. It's easy to check if one party member is dead by just checking their individual state, and just using a conditional statement, but I'm trying to find a way to check the state of everyone in the party at once to see if they have the death state . . . or, more specifically, if two or more have the death state. (The party will have a total of 3 people, with a 4th sometimes joining in for a time, and then leaving. If the main party member dies, it'll just be a Game Over and I already have that set up).

Also, is there any way to track how long a party member has had the death state for? I would love to set up a time-limit for reviving a dead party member, or even just have a thing where one of their stats will be lowered a bit if you wait to long to revive them (like their Agility will go down 1 or something).
 

BitBrosGames

*Keeps ruminating*
Veteran
Joined
Jan 11, 2019
Messages
120
Reaction score
94
First Language
Spanish
Primarily Uses
RM2k3
I haven't used MV, but you could:
Set a boolean to false.
Check if character A is in the party. If so, check if A is dead or not.
If A is dead, then set the boolean to true.
If the boolean is true, it's over. Call the routine where the heroes don't get permission.
If the boolean is false, pass on to the next one.
Check if B... etc.
Once you've finished, if the boolean is false, they're allowed in.

About the other thing, you could do it via code. For example, have a two attributes for each character where one of them is whether they are dead or not, another with the moment they were killed (use play time for that).
Now you have to add a few lines everytime a hero is killed setting the value to "dead" in the former and putting the time in the latter, and check and compare that time whenever a hero is revived.
 

Morrigan01

Villager
Member
Joined
Nov 30, 2017
Messages
7
Reaction score
3
First Language
English
Primarily Uses
RMMV
Okay, I was able to set up the first part of my question via Switches (which I assumed was the MV version of Booleans) and some "IF" statements. So thanks @BitBrosGames it worked just like I wanted.

I'm, still trying to figure out how to work out the second part. Were you saying I should write a script? Because I'm not really good at that.
 

Aloe Guvner

Walrus
Veteran
Joined
Sep 28, 2017
Messages
1,628
Reaction score
1,115
First Language
English
Primarily Uses
RMMV
I'm trying to find a way to check the state of everyone in the party at once to see if they have the death state . . . or, more specifically, if two or more have the death state.
You can also do Control Switches with the "script" option and put
Code:
$gameParty.deadMembers().length >= 2
That would turn a switch ON if there are 2 or more dead party members.
 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
5,624
Reaction score
5,104
First Language
English
Primarily Uses
RMVXA
For the second part, if you want to track how many turns in battle have passed, reserve a Variable for each party member. Make a Troop Event that runs each turn of every battle (set scope to Turn, and condition to a Switch that is always On). In that Troop Event, check (using Conditional Branch) whether each member is dead. If so, increase their Variable by 1, and do whatever other processing you need to. If NOT, then set their Variable back to 0.

If you need to check how long it's been outside of battle, that's a bit trickier. I would probably create a Common Event that is always running (by making its condition a Switch that's always On), and having it run every X seconds (by adding a Wait command to the end of the Event, where the Wait is equal to 60 * X). Inside that event, you want to do the same checks as the above: check whether each member is dead; increase their variable by 1 and do appropriate processing, or set to 0.
 

Morrigan01

Villager
Member
Joined
Nov 30, 2017
Messages
7
Reaction score
3
First Language
English
Primarily Uses
RMMV
Thanks @Wavelength! I've modified your suggestion just a bit, since I have a custom in-game clock already created, (there are 26 hours in-game for the world) and I want the death of characters to match the in-game time, so I just gave each character a similar clock that will trigger and begin to run when a Switch turns ON when they have a death state using a Base Troop Event. Same thing with outside of battle, using Common Events. And the clocks will reset when the Switch is OFF.

Anyway, thanks everyone! Now I can have death having some consequences in my game.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,849
Messages
1,016,977
Members
137,563
Latest member
cexojow
Top