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,504
Reaction score
10,922
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

World building was one of the main reasons i got in to game dev, but geeez, it eats up the time... This is a WIP from today before i call it a night.. maybe 80% finished.
maps.png
Dial_000_f002_show.jpg
Wohoo, its finished. It took some time but slowly I get used to this retro 90s anime style.
Now I just have to finish the other 37 frames. for the first dialogue... oh lord, what have I done :LZSlol:
(and if you are confused: yes, I place various eastereggs about other great cyberpunk games/videos/books that I like in my game ;) )
Has anyone watched the movie "Tiny Toons: How I Spent My Summer Vacation"? It is a cartoon and it is freaking hilarious. We watched that movie so many times when our kids were growing up. Thankfully it has a lot of adult humor to keep the adults entertained that the kids don't really get.
Here's some more weapon icons for the Wastes I've finished recently. Some are mine, some are icons that @Ninjakillzu originally made (the AK variants, the Thompson, the Glock, the M16 variants), but edited by me with permission.
1686428693206.png1686428742838.png
Still working on balance issues for my almost-out Cube Trail demo... Boss balance is no joke.

Forum statistics

Threads
131,778
Messages
1,223,297
Members
173,559
Latest member
Kitty_Chan123
Top