Change class with an item?

CrazyCrab

Veteran
Veteran
Joined
Mar 5, 2014
Messages
950
Reaction score
403
First Language
Polish
Hi everyone,

I'm trying to let the player change the class of the actor that an item is used on, but I'm really unsure about how I can do that with common event, as I'd need to somehow know which actor the item is being used on...

Any ideas?

Thanks!
 

Bloodmorphed

Dungeon Fanatic
Veteran
Joined
Sep 17, 2012
Messages
1,466
Reaction score
144
First Language
English
Primarily Uses
There is a way to do this through events, but... it would be so chalk full of conditional branches your better off doing a simple script to do it.

Also, do you want it to be based on the weapon, or weapon type?
 

CrazyCrab

Veteran
Veteran
Joined
Mar 5, 2014
Messages
950
Reaction score
403
First Language
Polish
Hmm I see...

I wanted to have a simple consumable item - for example ''Royal Crest'' used on someone changed their class to ''Knight'' etc.

I'd use something else, but given how my characters are ''randomly'' generated I want the player to be able to change the class afterwards to suit their playstyle better.
 

Bloodmorphed

Dungeon Fanatic
Veteran
Joined
Sep 17, 2012
Messages
1,466
Reaction score
144
First Language
English
Primarily Uses
Ohhh that, you can do that easily. I thought you meant weapon, hold on a second.

EDIT: This seems to be harder then I though, thought I could do it with only 1 or 2 lines of script, but the way I thought I could do it is not working, I may need a bit more time lol
 
Last edited by a moderator:

Another Fen

Veteran
Veteran
Joined
Jan 23, 2013
Messages
564
Reaction score
275
First Language
German
Primarily Uses
What you could do is let the item add an invisible state which you can track (and remove) within the common event.

Using a script might be easier though, as you might save forking for every possible actor... :)

Edit: Uhh, I used this trick in the previous makers a lot, but in VXAce a dead character is automatically immune to state infliction and there is no way to get around that without scripting. So there might be a problem after all, if you don't prevent occurrance of this case.
 
Last edited by a moderator:

Bloodmorphed

Dungeon Fanatic
Veteran
Joined
Sep 17, 2012
Messages
1,466
Reaction score
144
First Language
English
Primarily Uses
What you could do is let the item add an invisible state which you can track (and remove) within the common event.
Thats one way to do it. Lol

Probably the most simple way.

EDIT:

You can use this script

$game_party.target_actor.change_class(number, true or false)
What this does is it saying change the class to (number) and keep exp (true or false)

$game_party.target_actor.change_class(2, true)

This line would say change the Actors class to ID 2 (in my case its monk from default) and to keep the current EXP
 
Last edited by a moderator:

CrazyCrab

Veteran
Veteran
Joined
Mar 5, 2014
Messages
950
Reaction score
403
First Language
Polish
Thats one way to do it. Lol

Probably the most simple way.

EDIT:

You can use this script

$game_party.target_actor.change_class(number, true or false)What this does is it saying change the class to (number) and keep exp (true or false)

$game_party.target_actor.change_class(2, true)

This line would say change the Actors class to ID 2 (in my case its monk from default) and to keep the current EXP
Worked just fine, thanks! :)

That said, when changing class the actor didnt get all the previous skills (as in lv 1 skills when reseting to lv 1)...

Is there a way to automatically learn all possible skills (as in the skills that your level is high enough for) somehow?
 

Bloodmorphed

Dungeon Fanatic
Veteran
Joined
Sep 17, 2012
Messages
1,466
Reaction score
144
First Language
English
Primarily Uses
Really? You should get the skills that are set inside your class. So if your level 1, then change your class your still level 1 with that specific classes level skills. I thought thats how that should work, let me test it out.

As your doing this at the start of your game, you can use this:

$game_party.target_actor.learn_skill(id)

where id is the skill number. If you want them to have access to changing their class all the time and keep their levels let me know. You'd have to it differently, and maybe with a full script :/
 
Last edited by a moderator:

CrazyCrab

Veteran
Veteran
Joined
Mar 5, 2014
Messages
950
Reaction score
403
First Language
Polish
Nah, I can just add the skills manually, don't worry - they'll always change to level one, so there won't be too many skills to add.

Afterwards I guess that leveling will add skills as usual.

Again, thanks a ton for your help, I really appreciate it :)
 

Bloodmorphed

Dungeon Fanatic
Veteran
Joined
Sep 17, 2012
Messages
1,466
Reaction score
144
First Language
English
Primarily Uses
No problem :)

I'm learning scripting so doing small things like this helps me a lot. Finding what methods do what, etc etc

EDIT:

Oh and you will have to remove the current skills they have, else they will have access to all skills previously learned.
 
Last edited by a moderator:

CrazyCrab

Veteran
Veteran
Joined
Mar 5, 2014
Messages
950
Reaction score
403
First Language
Polish
Oh and you will have to remove the current skills they have, else they will have access to all skills previously learned.
Completely forgot about that, how would I do that since any class can change to any class? Go through the list and ''forget'' all the possible skills?

Would take quite a bit of time, is there a more efficient way perhaps? Like checking the previous class so I just forget those skills maybe?
 

Bloodmorphed

Dungeon Fanatic
Veteran
Joined
Sep 17, 2012
Messages
1,466
Reaction score
144
First Language
English
Primarily Uses
Okay, so it took me a good time to figure this out, probably around 30-40 minutes. But I found out a way to do it, I'm not sure if its the best way.. but... here it is

$game_party.target_actor.skills.each do |skill|id = $game_party.target_actor.skills[0].id$game_party.target_actor.forget_skill(id)end
You will want this before you learn your skills, because it will delete every single you skill you have.

So something like this:

$game_party.target_actor.skills.each do |skill|id = $game_party.target_actor.skills[0].id$game_party.target_actor.forget_skill(id)end$game_party.target_actor.change_class(2, true)$game_party.target_actor.learn_skill(16)
I did it before changing the class as well, just because. Lol
 

CrazyCrab

Veteran
Veteran
Joined
Mar 5, 2014
Messages
950
Reaction score
403
First Language
Polish
Wow, thanks a lot! 

This will save me a lot of time :)
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,862
Messages
1,017,049
Members
137,569
Latest member
Shtelsky
Top