Lunawolfcomics

The Omega
Veteran
Joined
Feb 18, 2014
Messages
662
Reaction score
192
First Language
English
Primarily Uses
RMMV
Hey good morning everyone. Quick question for you guys. I'd like to make an event occur when a specific party member is leading. How would I do this? :)
 

Susan

Veteran
Veteran
Joined
Sep 1, 2014
Messages
2,748
Reaction score
8,348
First Language
No idea...
Primarily Uses
RMMV
If you want to try an approach that does not require an external script, you could try creating a parallel process event and enter the following script call in the 'Conditional Branch':

$game_party.members[0] == $game_actors[x]

where '0' is the position of an actor in the party (in this case, the party leader), and 'x' is the location of the actor in the database.
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,895
First Language
English
Make what event occur? Under what conditions? Just by being the leader? Does that mean the event will run constantly until the leader changes?
 

Lunawolfcomics

The Omega
Veteran
Joined
Feb 18, 2014
Messages
662
Reaction score
192
First Language
English
Primarily Uses
RMMV
Thank you everyone :) I will try it out after work.

And for example. Let's say there's a huge boulder that only your strongest party member break. The only way to break it is if this strong party member is the leader.
 

estriole

Veteran
Veteran
Joined
Jun 27, 2012
Messages
1,512
Reaction score
742
First Language
indonesian
If you want to try an approach that does not require an external script, you could try creating a parallel process event and enter the following script call in the 'Conditional Branch':

$game_party.members[0] == $game_actors[x]

where '0' is the position of an actor in the party (in this case, the party leader), and 'x' is the location of the actor in the database.
this could work... but need some change to be able to used for event condition

set one common event. make it run at parallel process

in the common event page

use change variable event command > script:

$game_party.leader.idadd wait command (30 or 60) so it won't be lag

it will store the party leader id to variable you choose.

then in event huge boulder. use the variable condition (below the switch condition)... which will activate when that variable you set in common

event equal to certain value. done without script :D . so you can create huge boulder that can be only pushed by certain member in leader position.

edit: sorry but i think i'm wrong. variable event condition only support variable equal to x or above. i think it's like the conditional branch before :D . silly me.
 
Last edited by a moderator:

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,647
Reaction score
15,742
First Language
English
Primarily Uses
RMMV
If that example is exactly what you want to do, you don't need to use a script OR a parallel process event.


Just put a Conditional Branch on the event to check who the leader is, and put your code in the If and the Else blocks depending on whether the required person is the leader or not.


I don't know if the Conditional Branch allows you to check who is in what position (or if Control Variables lets you put the leader's id into a variable which you can then use in a conditional branch) - I don't have my computer in front of me right now. If you can't find a way, use this:

Conditional Branch: Script: $game_party.leader.id == Xwhere X is the actor id of the person you're interested in (Actor 1 will be 1 - don't use leading zeros)
But if you want the event to be visible all the time and only react a certain way if a certain person is the leader, do all the processing within the event. Don't use scripts and parallel processes to check something continually, when you have an exact point in time when you need that information.
 
Last edited by a moderator:

estriole

Veteran
Veteran
Joined
Jun 27, 2012
Messages
1,512
Reaction score
742
First Language
indonesian
If that example is exactly what you want to do, you don't need to use a script OR a parallel process event.

Just put a Conditional Branch on the event to check who the leader is, and put your code in the If and the Else blocks depending on whether the required person is the leader or not.

I don't know if the Conditional Branch allows you to check who is in what position (or if Control Variables lets you put the leader's id into a variable which you can then use in a conditional branch) - I don't have my computer in front of me right now. If you can't find a way, use this:

Conditional Branch: Script: $game_party.leader.id == Xwhere X is the actor id of the person you're interested in (Actor 1 will be 1 - don't use leading zeros)But if you want the event to be visible all the time and only react a certain way if a certain person is the leader, do all the processing within the event. Don't use scripts and parallel processes to check something continually, when you have an exact point in time when you need that information.
yeah this is the right way :D . just put the 'right leader event set' in the conditional branch with else 'wrong leader event set'

why do i think the hard way :D . nice one.

if you want the graphic to change (even without the event activated) then you might need the script.

ex: there's a hidden item that can be seen when placing a 'thief' actor as leader.
 

Susan

Veteran
Veteran
Joined
Sep 1, 2014
Messages
2,748
Reaction score
8,348
First Language
No idea...
Primarily Uses
RMMV
Shaz's explanation provides the most concise script call that can be used for this checking the party leader.

I agree with Shaz that the conditional branch should be placed within the event itself if you are trying to achieve what was written in your example.

The same script call that Shaz provided can be used within a parallel process if needed, and can still achieve the example given by estriole even without an external script.

In the end, it depends on you regarding whichever method you wish to use, and how you adjust it according to your needs. ^^
 

Lunawolfcomics

The Omega
Veteran
Joined
Feb 18, 2014
Messages
662
Reaction score
192
First Language
English
Primarily Uses
RMMV
Perfect thank you Shaz it works perfectly! :)

Thank you everyone for your input :)
 

Latest Threads

Latest Profile Posts

Apparently I'm a grandpa now.

20220128_181216.jpg20220128_181227.jpg
Sales Goal of Learn RPG Maker MV at 64% now! :kaopride:
When I was in the hospital I did actually have a nurse that was funny, did all these extra nice things for me and said she liked me. So you know what that means. That will be the last time I'll hear from her.
Anyone here ever confronted a never-ending loading screen? Took me 3 hours to realize the problem was the font format :yswt:
Ah, the problems a noob runs into...

Forum statistics

Threads
118,803
Messages
1,118,827
Members
155,985
Latest member
messiahAF
Top