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

Discussion in 'RPG Maker MV' started by catwizard69, Jan 15, 2019 at 5:59 AM.

  1. catwizard69

    catwizard69 Villager Member

    Messages:
    13
    Likes Received:
    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: Jan 15, 2019 at 7:29 AM
    #1
  2. Shaz

    Shaz Veteran Veteran

    Messages:
    36,334
    Likes Received:
    10,362
    Location:
    Australia
    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.
     
    #2
  3. catwizard69

    catwizard69 Villager Member

    Messages:
    13
    Likes Received:
    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
     

    Attached Files:

    #3
  4. Shaz

    Shaz Veteran Veteran

    Messages:
    36,334
    Likes Received:
    10,362
    Location:
    Australia
    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.
     
    #4
  5. MushroomCake28

    MushroomCake28 Great Sorcerer Ainz Ooal Gown-sama Veteran

    Messages:
    697
    Likes Received:
    1,100
    Location:
    The singularity
    First Language:
    English
    Primarily Uses:
    RMMV
    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: Jan 15, 2019 at 7:39 AM
    #5
  6. catwizard69

    catwizard69 Villager Member

    Messages:
    13
    Likes Received:
    0
    First Language:
    English
    Primarily Uses:
    RMMV
    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.
     
    #6
  7. catwizard69

    catwizard69 Villager Member

    Messages:
    13
    Likes Received:
    0
    First Language:
    English
    Primarily Uses:
    RMMV
    Thanks! I'll mess around with that.
     
    #7
  8. MushroomCake28

    MushroomCake28 Great Sorcerer Ainz Ooal Gown-sama Veteran

    Messages:
    697
    Likes Received:
    1,100
    Location:
    The singularity
    First Language:
    English
    Primarily Uses:
    RMMV
    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
     
    #8

Share This Page