Increasing variables when item is used on specific party member.

mkrudesign

Veteran
Veteran
Joined
Jun 11, 2019
Messages
44
Reaction score
4
First Language
English
Primarily Uses
RMMV
I'm attempting to create a system where "affection" increases when an item is used on a party member. I got the idea to have the item cause a common event that increases the affection variable whenever it's is used, but the problem is, the variable will increase even if the item is used on another party member.

Does anyone know of a clever way to implement this so it only affects the character it's used on?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
38,500
Reaction score
10,916
First Language
German
Primarily Uses
RMMV
you need to check which actor it is used on before increasing the variable.

one way to do this is have the item apply an invisible target state and then use conditional branch for checking which actor has the state and react before removing the state.
 

mkrudesign

Veteran
Veteran
Joined
Jun 11, 2019
Messages
44
Reaction score
4
First Language
English
Primarily Uses
RMMV
you need to check which actor it is used on before increasing the variable.

one way to do this is have the item apply an invisible target state and then use conditional branch for checking which actor has the state and react before removing the state.
That doesn't appear to be working for me. I've set the item to add the hidden state to the enemy as well as trigger a common event which checks that the user is in the party and if they have the state. if those are checked it adds the variable then removes the state. When I use the item from the menu it kicks me back to the game and no progress seems to occur. Am I missing something?


Edit: I figured it out. I have a separate event that triggers a conversation once the variable reaches a certain number, but a switch needs to be turned on for it to occur. I fixed it by turning the switch on at the start of the common event that plays when you use an item. The switch is then set to turn off.

Thank you. Your idea worked!
 
Last edited:

Latest Threads

Latest Posts

Latest Profile Posts


3d Yandere RPG maker game by labylin
With this map, I tried to emulate a Gameboy Color/Advance style.
Hacknet's a hypocritical game.
It's a game about hacking... that's been made in Net framework and the code was left unobfuscated.
So it's a game about hacking that's vulnerable to hacking.
The irony. :p
My message count stands at 999. I was going to ask if I get anything special for hitting 1,000 but then I looked at the post count of some other people who shall remain nameless. Now I don't feel special anymore. I need to either start posting a lot more or wipe my tears away and just focus on my game. Hopefully my keyboard is waterproof. ;_;

Forum statistics

Threads
131,766
Messages
1,223,169
Members
173,533
Latest member
joeyidc
Top