Changing classes based on an item

justalazygamer

Villager
Member
Joined
Jun 20, 2017
Messages
9
Reaction score
1
First Language
English
Primarily Uses
RMMV
I am new to RPG Maker so I am still trying to get a handle on some things.

I created an event with conditional branches which correctly changes classes based on the equipped item. I currently have that event being called in "rpg_scenes" on all equipment changes using "$gameTemp.reserveCommonEvent(1);" which does not run the event while a menu is open.

Is there an easy way for the equipment menu to still be open after the event runs so values are all updated? I thought I might be able to force it with the SceneManager to go to map then to previous scene quickly but even that did not work.
 

justalazygamer

Villager
Member
Joined
Jun 20, 2017
Messages
9
Reaction score
1
First Language
English
Primarily Uses
RMMV
if(this.actor().equips()[5] == null){ //default
this.actor().changeClass(5, true);
}
else{
if(this.actor().equips()[5].id == 5){//hero
this.actor().changeClass(1, true);
}
if(this.actor().equips()[5].id == 6){//warrior
this.actor().changeClass(2, true);
}
}

Working with it I was able to figure out class change with equipment that works in the menu. My new problem is that I can't seem to find a way to keep HP and MP from going to the max after the class change instead of staying at the previous value.
 
Last edited:

Zarsla

Veteran
Veteran
Joined
Jan 23, 2015
Messages
710
Reaction score
228
First Language
English
Primarily Uses
var currentHP = this.actor().hp;
var currentMP = this.actor().mp;
you're code
this.actor().setHp(currentHP);
this.actor().setMp(currentMP);
 

justalazygamer

Villager
Member
Joined
Jun 20, 2017
Messages
9
Reaction score
1
First Language
English
Primarily Uses
RMMV
var currentHP = this.actor().hp;
var currentMP = this.actor().mp;
you're code
this.actor().setHp(currentHP);
this.actor().setMp(currentMP);
This is still keeping their hp at max after the class change.
 

Zarsla

Veteran
Veteran
Joined
Jan 23, 2015
Messages
710
Reaction score
228
First Language
English
Primarily Uses
so you did this?

var currentHP = this.actor().hp;
var currentMP = this.actor().mp;
if(this.actor().equips()[5] == null){ //default
this.actor().changeClass(5, true);
}
else{
if(this.actor().equips()[5].id == 5){//hero
this.actor().changeClass(1, true);
}
if(this.actor().equips()[5].id == 6){//warrior
this.actor().changeClass(2, true);
}
}

this.actor().setHp(currentHP);
this.actor().setMp(currentMP);
 

justalazygamer

Villager
Member
Joined
Jun 20, 2017
Messages
9
Reaction score
1
First Language
English
Primarily Uses
RMMV
so you did this?

var currentHP = this.actor().hp;
var currentMP = this.actor().mp;
if(this.actor().equips()[5] == null){ //default
this.actor().changeClass(5, true);
}
else{
if(this.actor().equips()[5].id == 5){//hero
this.actor().changeClass(1, true);
}
if(this.actor().equips()[5].id == 6){//warrior
this.actor().changeClass(2, true);
}
}
I found the problem appears to be related to the yanfly equip plugin I was using to make the equip menu look better. I will have to dive into that when I get the chance to find the cause.

Thank you for your help.
 

Zarsla

Veteran
Veteran
Joined
Jan 23, 2015
Messages
710
Reaction score
228
First Language
English
Primarily Uses
Happy to Help :)
 

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,570
Latest member
fgfhdfg
Top