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,055
Reaction score
3,211
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,740
Reaction score
9,886
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

I may or may not be slightly crazy. Since I couldn’t find anything to renumber generator parts files that works on Linux, I’m scripting something up to run via terminal that’ll do the job. (Face is done (and was a fustercluck-and-a-half), and I’m taking a well-earned break before tackling SV, TV, TVD, and Variation. @.@)
I fixed my little itch.io issue... apparently filenames are case-sensitive. After I renamed the file IconSet.png instead of Iconset.png, it worked. I changed it back and forth a few times just to confirm this.

I'm gonna go beat my head against the wall now.

and an original idea of people having alter egos is back... finally.
Another camping area.
I just found out somebody pirated my 3,99$ game. I spent over a year making it and somebody just publish it for free a week after early access released.

I should be glad, cuz if they pirate you, that means your game has to be good, but im not. I barely sold any copy. Didn't get any info from most of the sites I wrote.

Forum statistics

Threads
124,642
Messages
1,164,926
Members
163,466
Latest member
nnl94
Top