[VXAce] How to obtain class notetags

Hey all!
I've been working on a simple script that makes it so a character's class changes depending on which class_id it points to via notetags;

so let's say the notetag inside the current class is simply:
<promo:1>

I obtain the actor_id and with it obtain its current Class, I do so as Actors can promote multiple times:

#actid -> actor id
#cid -> class id
@currentclass = $game_actors[@actid].class_id
@cregex = /<promo:s*>/i

#change class
@cid = $data_classes[@currentclass].note =~ @cregex ? $1.to_i : 0
$game_actors[@actid].change_class(@cid)

But I have a problem when I get to to populating @cid (undefined method 'features' for Nil:nil class), and I'm pretty sure there are way better methods than this one too but that's not what matters right now;
thank you for reading!

(not using any plugins, only vanilla VXAce)
The problem is that you haven't fully learned how to use regular expressions properly. Plus, there is no class 0 anyway...

Your regex should actually be written the following way: /<promo🙁\d+)/i

Once again I need to remind you of the fact that there is no class 0 at all.
for what little I know, I don't think the regex itself is the problem, as I used a similiar, if not an exact same one for another read-notes thing but from the actor, and it works perfectly;

by the way, what do you mean by class 0? I don't think I ever mentioned a class 0 here, but I might have made a mistake without noticing lol

the mentioned regex that works (I used it to edit the game_actors script to add a value):

regex = /<startpoints (.*)>/i
@lvpoints = $data_actors[@actor_id].note =~ regex ? $1.to_i : 0


it works updates and works fine, so I was just thinking how I could just- extrapolate the notetag in the class instead, I thought just doing "$data_classes[X].note" would work but apparently no

Your regex should actually be written the following way: /<promo🙁\d+)/i
Woah! Just tried, you were right! It works perfectly now!
Thank you so much, the issue has been solved!
regex that works
You can always test here

Original thread: https://forums.rpgmakerweb.com/threads/vxace-how-to-obtain-class-notetags.173706/