MZ [Class Change System VisuStella MZ] Actor multiclass ID in battle

Hi, (sorry for my english, not my native langage)

The plugin Class Change System by VisuStella give the possibility to get the data of classes and multiclasses that an actor has with :
actor.multiclasses()
- This returns an array of all of the multiclasses an actor has.
- This includes the actor's primary class.

actor.multiclass(x)
- This returns the class data (not ID) of whatever class the actor has
in x multiclass slot.
- An x value of 1 would yield the primary class.

actor.multiclassId(x)
- This returns the class ID (not data) of whatever class the actor has
in x multiclass slot.
- An x value of 1 would yield the primary class's ID.

I have an issue when I set a skill who use an Event to have one of the active actor's multiclass in a variable.
Instead of having the ID of the multiclass, the return is zero.
As the description above says, I use the code actor.multiclassId(x) (with x equal to the desired multiclass).

I tested several variations using codes I found in the sheet RPG MAKER MV / MZ Script Calls but I haven't been able to find a solution (if there is one).
Am I missing something obvious?
I use the code actor.multiclassId(x) (with x equal to the desired multiclass).

I tested several variations using codes I found in the sheet RPG MAKER MV / MZ Script Calls but I haven't been able to find a solution (if there is one).
What exactly did you use in the event, and what exactly are you trying to get the skill to do? Without knowing exactly what you typed, I can't tell you much about what you did. 0 is the default value you'll get from reading variables inside the engine, so if you did something to set the variable and it gives you a 0, it's likely there was some kind of error.

just to be sure, when you put this in the script box for the control variables event command, does this do anything for you?
Code:
$gameParty.members()[0].multiclassId(1)
(Forgive my english google translate)
Thx for your reply.

What exactly did you use in the event, and what exactly are you trying to get the skill to do?

Screenshot_1.png

  • 1 -> I use a variable to get the current Tier 3 multiclass's ID of the active actor in battle (Tier 3 multiclass named 'Posture').
  • 2 -> The result allows me, thanks to a conditional branch, to display a choice (3) wich change according to the actor's Posture.
Ex : If actor have Posture 'Défense', the choice 'Défense' is disabled.

Screenshot_3.png
Screenshot_2.png


This is a work in progress, but the goal is to be able to change Posture once per turn, without being able to re-equip the same posture.
(Inspired by the way roles work in FF13)

just to be sure, when you put this in the script box for the control variables event command, does this do anything for you?
Code:
$gameParty.members()[0].multiclassId(1)

This script works. Before I didn't have the choices that appeared.
The problem here is that the result is only based on the leader if I understand correctly.
I did some tests with the code BattleManager._subject. but the results were all zero.

I probably wasn't doing things right.

I know that the Core Engine by VisuStella has a plugin command that allows you to do more complex things.
CoreEngine_Update89_Command2.png







(It's in the plugin description)









Would it be more useful to use this?
I did some tests with the code BattleManager._subject. but the results were all zero.
By the time common events run, I believe BattleManager._subject would have already been cleared. SInce MZ does record data like the last actor to act, you could use the control variables command to get the id of the last actor and then use the same variable to save the multiclass id of the actor with that id.

Im skipping a step here, but try this
Code:
$gameActors.actor($gameTemp._lastActionData[2]).multiclass(3)

Would it be more useful to use this?
I wouldn't be able to tell you. My knowledge of VS plugins pretty much only extends to the questions i see people ask about them. I don't use them myself 🤣
By the time common events run, I believe BattleManager._subject would have already been cleared. SInce MZ does record data like the last actor to act, you could use the control variables command to get the id of the last actor and then use the same variable to save the multiclass id of the actor with that id.
This is what I understood from doing research.

Im skipping a step here, but try this
Code:
$gameActors.actor($gameTemp._lastActionData[2]).multiclass(3)
Screenshot_Result1.png


Here is the result.
(It's just a text box with :
CurrentActorPosture = \V[5] )







I wouldn't be able to tell you. My knowledge of VS plugins pretty much only extends to the questions i see people ask about them. I don't use them myself 🤣
I find their work really good 🙂

As for the command plugin, it would allow to create a more advanced script to have the desired result in the variable.

Screenshot_PluginCommand1.png

Description on the website:

Variable: JS Block
- Pick a variable ID and value to alter through JS.
- Allows JS block code for variable ID and operand.
- Functions like RM2k3's Variable Pointers.

Variable ID:
- This is the target variable to alter.
- You may use JavaScript.
- ie: $gameVariables.value(1)

Operation Type:
- What operation do you wish to use for this Plugin Command?

Operand Modifier:
- Value to be used in calculating the target variable.
- You may use JavaScript.
- ie: $gameVariables.value(1)


Would doing some extra calculations help make it work?

Sorry to ask, I've never done any coding.
Here is the result.
(It's just a text box with :
CurrentActorPosture = \V[5] )
ah, my bad there. i meant to type
Code:
$gameActors.actor($gameTemp._lastActionData[2]).multiclassId(3)
, not multiclass. The latter returns the entire class, but you just want the id.
Code:
$gameActors.actor($gameTemp._lastActionData[2]).multiclassId(3)
, not multiclass. The latter returns the entire class, but you just want the id.
...I didn't notice that it wasn't multiclassId.
It work better now !

Thank you very much for your help!
Now I'm going to try to finish this 😀

Just to be sure, does this script return the active actor's id?
$gameActors.actor($gameTemp._lastActionData[2])
Just to be sure, does this script return the active actor's id?
$gameActors.actor($gameTemp._lastActionData[2])
It wouldn't be completely accurate to say it's the active one, but it'll generally be true. It's really the last actor to act, starting from the start of their action.
The distinction matters depending on your battle system. For example, in an ATB system, if actor A acts and now it's actor B's turn but they haven't acted yet, then the script would get you actor A even though actor B is the active actor.
OK 🙂

Thanks for the explanation!

EDIT - Rather like this to have the ID:
$gameActors.actor($gameTemp._lastActionData[2]).actorId()
$gameActors.actor($gameTemp._lastActionData[2]).actorId()
That'll work to get their id, but it's a redundant script.
$gameTemp._lastActionData[2] Already returns the id of the last actor to act, and the control variables window already has an option to get the id of the last actor to act.
That'll work to get their id, but it's a redundant script.
$gameTemp._lastActionData[2] Already returns the id of the last actor to act, and the control variables window already has an option to get the id of the last actor to act.
Tested and approved !
$gameTemp._lastActionData[2] works very well.

the control variables window already has an option to get the id of the last actor to act.
That's true, but I use OTB's instant use from Battle System - OTB by VisuStella for my skill, and when I tested using the option to have the Id of the last actor to act, the result was zero. There may be some kind of conflict.

Spoiler: Instant Use-Related Notetags
<OTB Instant>
<OTB Instant Use>
<OTB Instant Cast>

- Used for: Skill, Item Notetags
- Allows the skill/item to be used immediately without consuming a turn.

Original thread: https://forums.rpgmakerweb.com/threads/class-change-system-visustella-mz-actor-multiclass-id-in-battle.178844/