First, thank you for your reply!
Let me explain what I'm trying to do:
I'm using
Yanfly's Enhanced TP to have various classes have their own TP mode.
My issue with the plugin is, that I can not set a classes TP mode with notetags. Only an actors.
That's why I need a way to check the class ID on game start, to manually set the TP mode.
And I need it to work for the editors test battles too.
I've set this code up, so far:
Code:
for (var i = 1; i < 5; i++) {
let a = $gameActors.actor(i);
switch(a._classId) {
case 1: console.log("Actor "+i+" is Class ID "+a._classId+": "+a.currentClass().name);
if (a.skills().contains($dataSkills[102]) && a._tpMode !== 1) { console.log("Specifically a Titan!"); a.setTpMode(1); console.log("TP Mode 1 set"); } else { console.log("TP Mode already set to 1"); }
if (a.skills().contains($dataSkills[103]) && a._tpMode !== 2) { console.log("Specifically a Wrath!"); a.setTpMode(2); console.log("TP Mode 2 set"); } else { console.log("TP Mode already set to 2"); }
if (a.skills().contains($dataSkills[104]) && a._tpMode !== 2) { console.log("Specifically a Weapons!"); a.setTpMode(2); console.log("TP Mode 2 set"); } else { console.log("TP Mode already set to 2"); }
break;
case 2: console.log("Actor "+i+" is Class ID "+a._classId+": "+a.currentClass().name);
if (a._tpMode != 3) { a.setTpMode(3); console.log("TP Mode 3 set");} else { console.log("TP Mode already set to 3"); }
break;
}
}
First I tried to use this code on battle start. With
Yanfly's Base Troop Events. But for some reason it doesn't update any TP modes, although the TP mode ID of the battler changes in the developer tools.
So I tried to let this script run on game start instead.
But I get this error:
Uncaught TypeError: Cannot read property 'actor' of null
What can I do?
Oh and I would also be very thankful if someone could tell me how I can use the TP mode notetags for the classes too. I think it should'nt be too hard to implement this, but I failed.
