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
759
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
496
Reaction score
2,572
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
759
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
496
Reaction score
2,572
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
759
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
315
Reaction score
155
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
759
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
496
Reaction score
2,572
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
759
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
496
Reaction score
2,572
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
759
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
496
Reaction score
2,572
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
759
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
496
Reaction score
2,572
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
759
First Language
English
Primarily Uses
RMMZ
Last edited:

Puppet Knight

Knight on a Crossbar
Regular
Joined
Aug 3, 2022
Messages
644
Reaction score
759
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,016
Reaction score
11,501
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 Profile Posts

1696004095642.png
...and now he even makes resources, too! xD
OMG Y'all. I found an alternate Google Drive I 100% forgot I had. All my crusty old game files from 2014 (when I signed up) are in there. When I like...maybe actually make a prototype thread it's gonna be so much fun taking everyone down my memory lane.
We are at the finish line!!! Thank you COMMUNITY!!!
GameCompletion.jpg
Well, my cat died. Just had a feeling something was off, and went to check.
Someone abandoned her a while ago when she was pregnant, and she wandered into my yard.
Took her to the vet, and did all the usual stuff, making sure she had all the shots and no one was looking for her.
She had the kittens. I kept 1, and found a home for the rest. (Continued because of the limit)
Most disappointing adult event: buying a house that no one comes to on Halloween.

Most redeeming adult event: having a kid to take out trick-or-treating again.

Forum statistics

Threads
134,902
Messages
1,251,740
Members
177,719
Latest member
nestharon
Top