• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Unlimited event self switches

1,224
Posts
10
Years
  • Tired of being limited to 4 self-switches per event? This is the tutorial for you.

    Add this script as a new section above Main

    Spoiler:

    In Game_Event, replace def initialize with
    Spoiler:

    To use a custom switch, in the event check the self-switch box under conditions (which switch you use there doesn't matter), and add a comment saying which switch. Comment must be in the format
    Code:
    Switch:newswitchnamehere
    no spaces. Note that switches will be set to all lower case
    Example event
    Unlimited event self switches


    Example of event flipping the above switch
    Unlimited event self switches


    I only did minor edits to make this work with Essentials, give credit to game_guy
     
    Last edited:
    119
    Posts
    10
    Years
    • Seen Sep 1, 2023
    Looks great and is easy to use.

    One question; is it also still possible to use the regular self switches (thus not adding a comment which states the switch)?
    (I won't be using this, as I'm using a self variables script (by PK8), but it might be useful for people to know the answer to that question.)
     
    1,224
    Posts
    10
    Years
  • Looks great and is easy to use.

    One question; is it also still possible to use the regular self switches (thus not adding a comment which states the switch)?
    (I won't be using this, as I'm using a self variables script (by PK8), but it might be useful for people to know the answer to that question.)

    You absolutely can. However, you can't use multiple switches as a condition. It should also be noted that custom switches take precedence over the regular ones (if the condition is set to A and I also have a commented switch, setting that event's switch A will not activate the page, only the commented switch will).
     

    Bowlstir

    Media Arts and Game Development
    199
    Posts
    16
    Years
  • This blew my mind. And I can see where this might come in handy for me.

    Thanks.
     
    8
    Posts
    10
    Years
    • Seen May 1, 2016
    Hi, when I added this script (Which I assume I did correctly, replacing def initialize and adding UnlimitedSelfSwitches above main. Somehow I get this error messagae

    Spoiler:


    Any help fixing this so I can use this script would be hugely appreaciated. I'm using Essentials version 15+ with a few other scripts.
     

    Zeak6464

    Zeak #3205 - Discord
    1,101
    Posts
    11
    Years
  • Hi, when I added this script (Which I assume I did correctly, replacing def initialize and adding UnlimitedSelfSwitches above main. Somehow I get this error messagae

    Spoiler:


    Any help fixing this so I can use this script would be hugely appreaciated. I'm using Essentials version 15+ with a few other scripts.

    you missed a step....
    "In Game_Event, replace def initialize with"
     
    8
    Posts
    10
    Years
    • Seen May 1, 2016
    Script above main
    Spoiler:


    And replaced the def initialize in Game_Event
    Spoiler:


    and Error
    Spoiler:
     
    8
    Posts
    10
    Years
    • Seen May 1, 2016
    I'm using version Pokémon Essentials v15 with the 15.1 additional files.
     

    Maruno

    Lead Dev of Pokémon Essentials
    5,286
    Posts
    16
    Years
    • Seen May 3, 2024
    I'm using version Pokémon Essentials v15 with the 15.1 additional files.
    No you're not. Your error message says you've got a script section called Game_Map_ with an underscore at the end, but v15.1 doesn't call it that. Same goes for Particle_Engine (there's no underscore in v15.1).
     
    8
    Posts
    10
    Years
    • Seen May 1, 2016
    Ahhh, yeah works perfectly now, didn't install 15.1 correctly. Thanks for the help Mej and Maruno.
     
    51
    Posts
    9
    Years
    • Seen Jan 8, 2023
    Problem with script "More SELF_Switch"

    Hello Guys...
    I have a little problem with this script, because i don't understand how does it work...
    recently appears this message
    Spoiler:

    Can you help me????
    Thanks for all!!!!!!!!!
     
    53
    Posts
    8
    Years
  • I'm sorry that I reply in such an old thread, but I don't see the need to open up another thread, if there is already one that concerns the case.
    I try to make a puzzle that works with multiple self switches and I use a comment to rename them, so that it is a little clearer to work with (Red, Yellow and Green are much more suitable and easier to comprehend than "A", "B" and "C").
    Anyways, for this puzzle to work, I need to have one event check those self switches of other events and then proceed accordingly. Unfortunately, this does not work at the moment. I don't quite know how the event works right now, but it just activates the same switch for all the other events, which completely destroys the whole purpose of the setup.

    I tried it with conditional branches using the script "self_switch_state(10,"Green")==true". But apparently it does not work that way, since, as I said, it just brings all the events into line (for example, it makes them all red, when some should be yellow or green).
    Do I have to install other switches for it to work? Or do I have to get around with variables? In either case it would, possibly, take away valuable space and make it even more complicated.

    It would really be much more convenient if there was a way to check if, for example, event 10 has the switch "Red" active or not. Is that possible? And if so, how?

    Thank you very much for your help.
     
    1,224
    Posts
    10
    Years
  • I'm sorry that I reply in such an old thread, but I don't see the need to open up another thread, if there is already one that concerns the case.
    I try to make a puzzle that works with multiple self switches and I use a comment to rename them, so that it is a little clearer to work with (Red, Yellow and Green are much more suitable and easier to comprehend than "A", "B" and "C").
    Anyways, for this puzzle to work, I need to have one event check those self switches of other events and then proceed accordingly. Unfortunately, this does not work at the moment. I don't quite know how the event works right now, but it just activates the same switch for all the other events, which completely destroys the whole purpose of the setup.

    I tried it with conditional branches using the script "self_switch_state(10,"Green")==true". But apparently it does not work that way, since, as I said, it just brings all the events into line (for example, it makes them all red, when some should be yellow or green).
    Do I have to install other switches for it to work? Or do I have to get around with variables? In either case it would, possibly, take away valuable space and make it even more complicated.

    It would really be much more convenient if there was a way to check if, for example, event 10 has the switch "Red" active or not. Is that possible? And if so, how?

    Thank you very much for your help.

    Two problems.
    I don't know how you're using that method, since it only accepts on parameter, and it checks the self switch of the event from whence it's called.
    Secondly, custom self switches get completely downcased, so you should be checking for "green" instead.
    I made this small script that you can use instead, just add at the bottom of this script section (not inside any class)
    Code:
    def pbCheckSelfSwitchState(event_id,switch)
      key = [$game_map.map_id, event_id, switch]
      return $game_self_switches[key]
    end

    so your conditional branch would just say
    pbCheckSelfSwitchState(10,"green")
     

    Sir_Tman

    Overworked game Dev
    201
    Posts
    8
    Years
  • A Strange Error appeared

    So im testing and event where the player is transported to a diffrent map [I've changed nothing in the script] and suddenly this error appeares
    Code:
    ---------------------------
    Pokemon Treasure
    ---------------------------
    Exception: NoMethodError
    
    Message: undefined method `downcase' for nil:NilClass
    
    More Self Switches:56:in `check_custom_switch'
    
    Game_Event:22:in `nf_particles_game_map_initialize'
    
    Game_Event:22:in `each'
    
    Game_Event:22:in `nf_particles_game_map_initialize'
    
    Game_Event:20:in `each'
    
    Game_Event:20:in `nf_particles_game_map_initialize'
    
    Game_Event:20:in `each'
    
    Game_Event:20:in `nf_particles_game_map_initialize'
    
    ParticleEngine:589:in `initialize'
    
    Game_Map:64:in `new'
    It then starts appearing on 2 other map which where working fine but now display the same error. The thing is I don't know what this error is at all.

    I'm Useing Essentials v15 Unmodified.

    Edit: Its now 3 maps I just made a new one with nothing on it and I got the same Error
     
    Last edited:
    Back
    Top