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)
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)