Check last Skill used by "this" actor & by specific Actor ID

Status
Not open for further replies.

Puppet Knight

Knight on a Crossbar
Regular
Joined
Aug 3, 2022
Messages
644
Reaction score
770
First Language
English
Primarily Uses
RMMZ
Evening All,

I know that I can store the Last Skill Used as a Variable, however I assume that will be the last skill overall in the battle log.

What I need to be able to do is check the last skill used by "this" actor. Essentially the current battler. As well as the ability to specifically check for an actors last skill used by Actor Id.

Anyone know how I'd tackle these? It would make for some useful bits for skill proficiency in my project.
 

TESTOSTERONE

Nosey aren't ya?
Regular
Joined
Feb 11, 2017
Messages
509
Reaction score
2,690
First Language
English
Primarily Uses
RMMV
Would having multiple variables work?
One per actor to store the last skill used id.
 

Puppet Knight

Knight on a Crossbar
Regular
Joined
Aug 3, 2022
Messages
644
Reaction score
770
First Language
English
Primarily Uses
RMMZ
Would having multiple variables work?
One per actor to store the last skill used id.
I'm willing to have the note tag look as ugly as it needs to. So long as it gets done lol.


OH WAIT. Are you gonna tell me to set it as a JS note tag on the actors to set the variable at the end of Actions o.o


Cause I'm realizing that'd work if there isn't a built in script I could use ^_^!
 

TESTOSTERONE

Nosey aren't ya?
Regular
Joined
Feb 11, 2017
Messages
509
Reaction score
2,690
First Language
English
Primarily Uses
RMMV
Yup, I think you got it. Set the corresponding variable at the end of the action, as long as your skills are unique per actor.
 

Puppet Knight

Knight on a Crossbar
Regular
Joined
Aug 3, 2022
Messages
644
Reaction score
770
First Language
English
Primarily Uses
RMMZ
Now to just figure out how to set the last skill id as a variable via script
 

Oggy

Regular
Regular
Joined
Jun 1, 2022
Messages
319
Reaction score
156
First Language
English
Primarily Uses
RMMZ
Is the skill completely VS Action Sequenced?
 

Puppet Knight

Knight on a Crossbar
Regular
Joined
Aug 3, 2022
Messages
644
Reaction score
770
First Language
English
Primarily Uses
RMMZ
Is the skill completely VS Action Sequenced?
No, that would honestly be simpler to do overall. What I want to be able to do is essentially check a universal variable to modify either the damage calc like:

if(last skill ID variable() == X){var n = 1.5}; {n=1}; (n * 10 ) + a.mtk * 2 - b.mdf * 2


^_^
 

TESTOSTERONE

Nosey aren't ya?
Regular
Joined
Feb 11, 2017
Messages
509
Reaction score
2,690
First Language
English
Primarily Uses
RMMV
Oooh that’s neat. Now what if instead of 1.5… you made the damage keep growing and growing every time the same skill is used.
 

Puppet Knight

Knight on a Crossbar
Regular
Joined
Aug 3, 2022
Messages
644
Reaction score
770
First Language
English
Primarily Uses
RMMZ
Oooh that’s neat. Now what if instead of 1.5… you made the damage keep growing and growing every time the same skill is used.
Id still need to be able to set an actor agnostic variable in the notetag! lol thats the need here D'x
 

TESTOSTERONE

Nosey aren't ya?
Regular
Joined
Feb 11, 2017
Messages
509
Reaction score
2,690
First Language
English
Primarily Uses
RMMV
I use MV and the way I’d do it is with yanfly action sequence.

Say I’m using variable 1 to store the last skill id, then at the end of the action sequence for skill id 10 for example, I’d add:

Code:
change variable 1 = 10
 

Puppet Knight

Knight on a Crossbar
Regular
Joined
Aug 3, 2022
Messages
644
Reaction score
770
First Language
English
Primarily Uses
RMMZ
That was my original plan, but that would mean having to set every single skill to an action sequence with Ifs to update the actor specific variables (god forbid its a combo move!)

If i do a straight "change variable" based on last skill ID used, it'll always check based on the last skill by anyone rather than "this" actor.


Its going to take some finagling
 

TESTOSTERONE

Nosey aren't ya?
Regular
Joined
Feb 11, 2017
Messages
509
Reaction score
2,690
First Language
English
Primarily Uses
RMMV
Turns out MV already stores the last skill used for each actor, MZ probably does too:

Code:
$gameActors.actor(1).lastBattleSkill()
 

Puppet Knight

Knight on a Crossbar
Regular
Joined
Aug 3, 2022
Messages
644
Reaction score
770
First Language
English
Primarily Uses
RMMZ
Already got the JS Note Tag going to store skill ID as variable going:

<JS Post-End Action> $gameVariables.setValue(11, $gameTemp.lastActionData(0)); </JS Post-End Action>

This is set as an Actor Note tag on each party member so it tracks after each turn (the variable is different fpr each actors). Going to set a post battle Common Event that sets the variables back down to 0 at the end of battle so they aren't stacking damage based on the last battles last attack used.


What I'm trying to sort out now is a way to run at the beginning of each actors turn to run a common event that sets variable I'll be using in the damage calculation. Im thinking a passive state
 

TESTOSTERONE

Nosey aren't ya?
Regular
Joined
Feb 11, 2017
Messages
509
Reaction score
2,690
First Language
English
Primarily Uses
RMMV
If you are using a Base Troop plugin, you could set it as a troop event on your base troop:

1686322188240.png
 

Puppet Knight

Knight on a Crossbar
Regular
Joined
Aug 3, 2022
Messages
644
Reaction score
770
First Language
English
Primarily Uses
RMMZ
Last edited:

Puppet Knight

Knight on a Crossbar
Regular
Joined
Aug 3, 2022
Messages
644
Reaction score
770
First Language
English
Primarily Uses
RMMZ
Was overthinking this! Just gonna have an additional notetag for each Actor that sets the variable!

So each actor will essentially get their own form of:
<JS Pre-Start Action> $gameVariables.setValue(15, $gameVariables.value(11)); </JS Pre-Start Action> <JS Post-End Action> $gameVariables.setValue(11, $gameTemp.lastActionData(0)); </JS Post-End Action>


All that's left to work out is the Damage Formula.


What I want to work it out as is:

If variable 15 = (this skills ID) var n = 1.5, else, var n = 1.5. Proceeded by regular damage calc of

10 * n + a.mat * 2 - b.mdf * 2


The idea being that consecutive use of the same skill will have an increased hit.

What I have is :

if(v[15] === 99){var n = 3};{var n = 1} 10 * n + a.mat * 2 - b.mdf * 2


But the damage remains the same each consecutive attack.


Anyone thoughts?


Perhaps it should be Pre-Start turn instead of Pre Start Action?

Got it with help on discord. I was missing an else -_-

Corrected Set up to Store Last Used Skill ID Per Actor using BattleCore VS:


Actor Note Tags
<JS Pre-Start Action> $gameVariables.setValue(15, $gameVariables.value(11)); </JS Pre-Start Action> <JS Post-End Action> $gameVariables.setValue(11, $gameTemp.lastActionData(0)); </JS Post-End Action>

Damage Formula for Skill to check consecutive use.
if(v[15] === this.item().id){var n = 3;}else{var n = 1;} 10 * n + a.mat * 2 - b.mdf * 2
 
Last edited:

Ms Littlefish

Time Traveling Victorian Vampire
Global Mod
Joined
Jan 15, 2014
Messages
8,075
Reaction score
11,674
First Language
English
Primarily Uses
RMMV
This thread is being closed due to being solved. If you would like it reopened, report it to let us know. Thank you!
 
Status
Not open for further replies.

Latest Threads

Latest Posts

Latest Profile Posts

The terrifying online threats I shield my precious RM’ers from. BULK FRIDGE MAGNETS.

IMG_0501.jpeg
Was sick with a fever... slowly getting better.
I HATE SEOs! I do not want to add Reddit to every single search in order to find helpful content posted by actual humans.
bandicam 2023-10-02 09-53-18-106.png
Yanka is one of my dearly loved characters. And not only because she can perform the look of "puss in boots")))) Spy, infiltrator, kind-hearted with a soft spot for one Crimson Knight.
Just completed another cutscene. Huge one for the story. I'm so enthusiastic about where this game is going.

Forum statistics

Threads
134,985
Messages
1,252,628
Members
177,882
Latest member
ashbutler
Top