CORE88

Warper
Member
Joined
May 7, 2022
Messages
3
Reaction score
1
First Language
English
Primarily Uses
N/A
Hello World,

Forgive me if this question has already been answered, I am new to RPG Maker. I am trying to use Variables and Common Events to accomplish a monster evolution event using an item that calls on a common event. In the common event, I am trying to have logic get the SELECTED party member's ID that is not predetermined in the party. I see Game Data has only predetermined slots to assign. Is there a way I can use a script to find a selected party member's ID, such as
"$gameParty.members()[p]._actorId" ; where [p] can be changed to something else other than a set position in the party? Perhaps there is a better way to do this...

I thank you in advance for your help.
 

Attachments

  • Screenshot 2022-05-21 110337.png
    Screenshot 2022-05-21 110337.png
    97.7 KB · Views: 6

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
5,009
Reaction score
3,182
First Language
English
Primarily Uses
RMMV
Hello!

The trick to doing this in events is that common events in the Effects of Items and Skills run after the item has resolved everything it does - at that point, the game doesn't know who you used it on (which is of varying truth depending on whether you're using this in battle or the menu, but this way is guaranteed to work).

The common workaround is:
1 - Make a State that doesn't do anything

2 - In the Effects of the item, apply that state

3 - Make conditionals that look at each party member and say "If this actor has my new state on, set my variable to their actor ID" (you could make this part smaller with a script call, if you know JavaScript)

4 - Remove the state from that actor

5 - End the conditional and do the rest of your event on that actor ID.
 

CORE88

Warper
Member
Joined
May 7, 2022
Messages
3
Reaction score
1
First Language
English
Primarily Uses
N/A
Hello!

The trick to doing this in events is that common events in the Effects of Items and Skills run after the item has resolved everything it does - at that point, the game doesn't know who you used it on (which is of varying truth depending on whether you're using this in battle or the menu, but this way is guaranteed to work).

The common workaround is:
1 - Make a State that doesn't do anything

2 - In the Effects of the item, apply that state

3 - Make conditionals that look at each party member and say "If this actor has my new state on, set my variable to their actor ID" (you could make this part smaller with a script call, if you know JavaScript)

4 - Remove the state from that actor

5 - End the conditional and do the rest of your event on that actor ID.
This was tremendously helpful, thank you for taking the time and helping me understand how to use states to imitate a script call. I am not too familiar with Java; yet I am trying to exercise the programming part of my brain. For now I will use the engine while I attempt to understand java script. Thank you again.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
36,719
Reaction score
9,878
First Language
German
Primarily Uses
RMMV
I am not too familiar with Java;
familiarity with Java won't help you anyway, because no maker currently uses any Java.

There is a saying among programmers: Java is to Javascript as ham is to hamster.

or in other words: they have nothing to do with each other but the same letters at the beginning of the word.

And whenever someone new to programming mixes that up, it needs to be pointed out before you learn the wrong language and get confused because nothing works.
 

CORE88

Warper
Member
Joined
May 7, 2022
Messages
3
Reaction score
1
First Language
English
Primarily Uses
N/A
familiarity with Java won't help you anyway, because no maker currently uses any Java.

There is a saying among programmers: Java is to Javascript as ham is to hamster.

or in other words: they have nothing to do with each other but the same letters at the beginning of the word.

And whenever someone new to programming mixes that up, it needs to be pointed out before you learn the wrong language and get confused because nothing works.

You just saved me a lot of trouble. My ignorance on the matter is apparent. Thank you for clarifying. I saw in a previous post that in order to best understand programming, you need to focus on logic structures, otherwise you run the risk of knowing tricks without understanding reason. I'm sure I can say that we newbies appreciate the feedback you provide.
 

Latest Threads

Latest Posts

Latest Profile Posts

Custom slip rates and custom ailment durations for enemies really opens up the floodgates for status effect use. I can have Poison and Time Stop affect bosses without it breaking their balance! Finally, a healthy middle ground.

(Especially after I cooked up a thing that prevents you from re-applying deadly states more than once in specific occassions.)
Voice.gif
The Voice... They usually show up to talk to you about leaving your mark on the world, which is one of the major themes of my game... How will you be remembered by society.
The only time my brother shows me any kind of support is by liking or LOL my Facebook Comments.
I finally finished the Coliseum for my game. Love how it looks. Credits for the assets goes to Kokoro Reflections, @Starbird_Resources, and @megumi014.
Colossuem.png

Forum statistics

Threads
124,522
Messages
1,164,204
Members
163,357
Latest member
UniverseOwO
Top