Turning on a switch (or variable) after learning a skill by leveling up a class, then turning it off

catwizard69

Villager
Member
Joined
Jul 27, 2018
Messages
16
Reaction score
0
First Language
English
Primarily Uses
RMMV
I know this is probably a noob question, but I've been spending too much time on this and perhaps someone who actually knows what they're doing can help me much easier. Basically, I have a class system based heavily on subclasses. Each character has a primary class they cannot change, but can freely switch between subclasses. levelling up certain subclasses will unlock new ones, which get new skills, etc. The issue is, subclasses won't show in things like victory aftermath or things like that, and at the minimum, I would like for the player to be notified when a new class has been unlocked. I want the player to be notified when hitting certain milestones within the subclass. My simple solution is to have a common event that is activated by a simple switch (or variable). Certain skills (or class levels) would turn said switch on, the event would run and say something like, "you have gained a job level" or "after training rogue, you have unlocked the ninja class" and then turning the switch off to be used again for another character or something (or anything to break the autorun,). I'm using a lot of Yanfly's plugins, including advanced switches, but i feel like i'm really starting to overcomplicate an issue that seems very simple. If I am going about this the wrong way, I am very open to changing my thought process. Thanks to any and all who help!!
 
Last edited:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
How do you have classes and subclasses? What plugin are you using?

$game_switches[x] = true is XP/VX/Ace talk and will not work in MV. And you can only put stuff in skill notetags to be executed when a skill is learned if you have a plugin that will do that. Putting stuff in notetags does nothing without a corresponding plugin.

So first you should state what plugins you're using, and what plugins you think will help you achieve what you're attempting (provide links, not just names), and then people will be able to give you the correct command based on what the plugin expects/does.
 

catwizard69

Villager
Member
Joined
Jul 27, 2018
Messages
16
Reaction score
0
First Language
English
Primarily Uses
RMMV
My apologies, I am using Yanfly's Class Change Core http://yanfly.moe/2015/11/27/yep-32-class-change-core/ , Subclass core http://yanfly.moe/2015/11/29/yep-34-subclass/, and advanced switches http://yanfly.moe/2018/01/19/yep-162-advanced-switches-and-variables-rpg-maker-mv/. If i could just turn switches on/off through learning skills and common events that would solve my problem.

However, i'm trying for a workaround solution as well.
I'm trying to use variables now with common events, but cannot seem to break the loop because of the way the common event is activated and the skill is learned, but once again think i am overcomplicating things, but all i really need is some sort of feedback with the subclasses. I attached my first attempt at the common event, it is activated when Actor 1 learns the skill "ninja unlock", then a conditional branch is set up. it activates, raises a variable so that it doesn't play again, then keeps looping over itself no matter what i do, because of the fact that is being activated by the fact that actor 1 has learned ninja unlock. Open to any ideas
 

Attachments

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
This event should be parallel process, not autorun.
It is conditioned by a switch, so as long as that switch is on, the event will loop continue running. You need to turn that switch off in order to stop it running.

If you just change it to parallel process, it will not "freeze" the game, however it will still be running, on every frame, for the rest of the game, unless you turn off that conditioning switch.

It really is not a good way to go. A switch that can be turned on when the skill is first learned, run the event, then turn the switch off again is what you're after. I would be surprised if there wasn't a plugin out there (possibly one of Yanfly's) that will let you turn on a switch the moment a skill is learned, and not check again.
 

MushroomCake28

KAMO Studio
Global Mod
Joined
Nov 18, 2015
Messages
3,729
Reaction score
4,682
First Language
English
Primarily Uses
RMMZ
Just slight precision here, $game_switches[x] is the VX and VX Ace (XP too I think, not sure since I haven't used XP a lot). In MV it's acutally $gameSwitches.value(x)

EDIT: Sorry, didn't see that Shaz already addressed that issue.
 
Last edited:

catwizard69

Villager
Member
Joined
Jul 27, 2018
Messages
16
Reaction score
0
First Language
English
Primarily Uses
RMMV
How do you have classes and subclasses? What plugin are you using?

$game_switches[x] = true is XP/VX/Ace talk and will not work in MV. And you can only put stuff in skill notetags to be executed when a skill is learned if you have a plugin that will do that. Putting stuff in notetags does nothing without a corresponding plugin.

So first you should state what plugins you're using, and what plugins you think will help you achieve what you're attempting (provide links, not just names), and then people will be able to give you the correct command based on what the plugin expects/does.
My apologies, I am using Yanfly's Class Change Core http://yanfly.moe/2015/11/27/yep-32-class-change-core/ , Subclass core http://yanfly.moe/2015/11/29/yep-34-subclass/, and advanced switches http://yanfly.moe/2018/01/19/yep-162-advanced-switches-and-variables-rpg-maker-mv/. I'm trying to use variables now with common events, but cannot seem to break the loop because of the way the common event is activated and the skill is learned, but once again think i am overcomplicating things, but all i really need is some sort of feedback with the subclasses. I attached my first attempt at the common event, it is activated when Actor 1 learns the skill "ninja unlock", then a conditional branch is set up. it activates, raises a variable so that it doesn't play again, then keeps looping over itself no matter what i do, because of the fact that is being activated by the fact that actor 1 has learned ninja unlock. Open to any ideas
This event should be parallel process, not autorun.
It is conditioned by a switch, so as long as that switch is on, the event will loop continue running. You need to turn that switch off in order to stop it running.

If you just change it to parallel process, it will not "freeze" the game, however it will still be running, on every frame, for the rest of the game, unless you turn off that conditioning switch.

It really is not a good way to go. A switch that can be turned on when the skill is first learned, run the event, then turn the switch off again is what you're after. I would be surprised if there wasn't a plugin out there (possibly one of Yanfly's) that will let you turn on a switch the moment a skill is learned, and not check again.
Yes, I've been looking for a long time for something that would do just that without overcomplicating my job system (for the player, that is), and haven't yet.
 

catwizard69

Villager
Member
Joined
Jul 27, 2018
Messages
16
Reaction score
0
First Language
English
Primarily Uses
RMMV
I know this is probably a noob question, but I've been spending too much time on this and perhaps someone who actually knows what they're doing can help me much easier. Basically, I have a class system based heavily on subclasses. Each character has a primary class they cannot change, but can freely switch between subclasses. levelling up certain subclasses will unlock new ones, which get new skills, etc. The issue is, subclasses won't show in things like victory aftermath or things like that, and at the minimum, I would like for the player to be notified when a new class has been unlocked. I have seen codes like $game_switches[x] = true , although i'm not sure where to put that code within the skill notetags so that it will activate right when it is learned. I want the player to be notified when hitting certain milestones within the subclass. My simple solution is to have a common event that is activated by a simple switch (or variable). Certain skills (or class levels) would turn said switch on, the event would run and say something like, "you have gained a job level" or "after training rogue, you have unlocked the ninja class" and then turning the switch off to be used again for another character or something (or anything to break the autorun,). I'm using a lot of Yanfly's plugins, including advanced switches, but i feel like i'm really starting to overcomplicate an issue that seems very simple. If I am going about this the wrong way, I am very open to changing my thought process. Thanks to any and all who help!!
Just slight precision here, $game_switches[x] is the VX and VX Ace (XP too I think, not sure since I haven't used XP a lot). In MV it's acutally $gameSwitches.value(x)
Thanks! I'll mess around with that.
 

MushroomCake28

KAMO Studio
Global Mod
Joined
Nov 18, 2015
Messages
3,729
Reaction score
4,682
First Language
English
Primarily Uses
RMMZ
Another little precision lol (since in VX Ace you could use $game_switches[x] to get and set a value):

Code:
$gameSwitches.value(x);      // to get the value of the switch #x
$gameSwitches.setValue(x); // to set the value of the switch #x
 

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

Latest Threads

Latest Profile Posts

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'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:

Forum statistics

Threads
105,855
Messages
1,017,007
Members
137,563
Latest member
MinyakaAeon
Top