Trying to run a common event to update relationship values based on actions taken in battle

Iavasechui

Veteran
Veteran
Joined
Feb 20, 2018
Messages
35
Reaction score
25
First Language
English
Primarily Uses
RMMZ
I am trying to create a common event that checks the id and target of skills when they are used to heal or protect other party member so that it increases the variable that holds their relationship number. I am having difficulty figuring out how to get this to actually work though. Also is there a way to make sure this only happens during combat so the player can't just force relationships by spamming healing outside of combat?
 

FrigidGaze

Veteran
Veteran
Joined
May 12, 2022
Messages
87
Reaction score
86
First Language
English
Primarily Uses
RMMZ
Heya!

To answer the latter part of your question, you can put this into the 'script' section of a conditional branch, and it will run the events inside if you're in a battle--and you can set an 'else' condition too for it to run different events otherwise.

Code:
$gameParty.inBattle()

And for the other part of your question, you can store the ID of the last skill used through the use of a variable, and 'game data', under the 'Last' dropdown menu. This also lets you store the last targeted ID, too.

I assume in that case you'd want an all-purpose common event that's brought up whenever one of those variable increasing skills is used, then referring to the variables that take all of those latest IDs and acts accordingly, right? Was there anything specific that you were having difficulty getting to work? Just so I can see if I can potentially help more on that front!
 
Last edited:

Iavasechui

Veteran
Veteran
Joined
Feb 20, 2018
Messages
35
Reaction score
25
First Language
English
Primarily Uses
RMMZ
I think that will work! Is there a way to have the game store the actor id who used the skill (the paladin and priest both have access to heal) so that the correct relationship gets updated? If not I can just make sure that the skills that boost relationships are unique among the characters.

Edit: I think I just found a way to do that!

Edit: Yes it worked! Thank you so much! Now I just need to set a cap on it so you can't just go into battle and spam heal a bazillion times to max friendship XD

Edit: If I use the last actor to move and last target and just set the common event to run on the skills that will boost friendship will I still need the last used skill id check?
 
Last edited:

Latest Threads

Latest Posts

Latest Profile Posts


Clarn Hold
(No storylines)
There was a tutorial on how to draw anime eyes. Just draw Among Us. So I tried.
Screenshot_107.jpg
DamageActor3_7.png added!
index.php

Making a "characters first appearance" drawing for my game. Now I just have to finish the sprite art animation for her grand entrance.​
ScreenShot_9_24_2022_7_56_24.png
New area being started today. It leads to one of the games 2 optional bosses.

Forum statistics

Threads
125,540
Messages
1,171,814
Members
164,611
Latest member
anonymouss
Top