• 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.

[Eventing Question] Calling scripts during move routes

172
Posts
7
Years
    • Seen Sep 6, 2022
    I was just curious if anyone knows. But when you set a move route for an event it gives you the option to put a script in along with the movement. What kind of scripts work with set move route? Because I?ve tried a few random things and every time I do it gives me an error. I just thought it could be useful for having characters do things without it having to be a part of an event.
     

    Ego13

    hollow_ego
    311
    Posts
    6
    Years
  • It means any script you can think of that also works in field. So obviously you wont be able to trigger any battling scripts though you could start a wild battle in the middle of a move route
     
    172
    Posts
    7
    Years
    • Seen Sep 6, 2022
    It means any script you can think of that also works in field. So obviously you wont be able to trigger any battling scripts though you could start a wild battle in the middle of a move route
    Yeah, that?s what I?m asking. Like what are the commands that do and don?t work? Because the ones I have tried don?t work. It might been that I didn?t format them correctly if they need to be called differently when being used during move routes but I?m not sure.
     

    Ego13

    hollow_ego
    311
    Posts
    6
    Years
  • There is no list that anyone could give you. It is literally there to call script from within an event. If it works or not just depends on the script itself. Also it's hard to say anything about the script that you have tried because we dont know which ones that are and what error messages you get.

    An example of script call tha should work would be
    Code:
    pbSetSelfSwitch(event,swtch,value,mapid=-1)
    Note that you would need to replace the arguments
     
    172
    Posts
    7
    Years
    • Seen Sep 6, 2022
    There is no list that anyone could give you. It is literally there to call script from within an event. If it works or not just depends on the script itself. Also it's hard to say anything about the script that you have tried because we dont know which ones that are and what error messages you get.

    An example of script call tha should work would be
    Code:
    pbSetSelfSwitch(event,swtch,value,mapid=-1)
    Note that you would need to replace the arguments

    so wait, in that example then would the normal self switch script not work? the one that's like
    Code:
    pbSetSelfSwitch(63,"C",true)
    because ive never seen it with the mapid added before. because in my normal events I use the script I just pasted on here, but for an event that's moving or something outside of a script, would adding the map id afterwards make it work?
    because I just tried one with the script I pasted and it doesn't work during a move route. only during an event. so what do I add for the map id? just the id, or any XY cords?
     

    Ego13

    hollow_ego
    311
    Posts
    6
    Years
  • so wait, in that example then would the normal self switch script not work? the one that's like
    Code:
    pbSetSelfSwitch(63,"C",true)
    because ive never seen it with the mapid added before. because in my normal events I use the script I just pasted on here, but for an event that's moving or something outside of a script, would adding the map id afterwards make it work?
    because I just tried one with the script I pasted and it doesn't work during a move route. only during an event. so what do I add for the map id? just the id, or any XY cords?

    If you set a self switch for an event on the same map you just leave out the arguemtn just like you did before. the mapid=-1 just ensures that the script wont crash if no mapid is given. Kinda like a default parameter


    You said you tried it with that script but it didnt work: Then what happened? Did you get an error? Did just do nothing?

    Generally speaking there is a chance that some or most scripts won't work because of how the move route is handled. But you wont know if you dont try (or unless you figure out how this actually works)
     
    172
    Posts
    7
    Years
    • Seen Sep 6, 2022
    If you set a self switch for an event on the same map you just leave out the arguemtn just like you did before. the mapid=-1 just ensures that the script wont crash if no mapid is given. Kinda like a default parameter
    so its not actually needed for it to work properly?


    You said you tried it with that script but it didnt work: Then what happened? Did you get an error? Did just do nothing?
    I got an error.
    Spoiler:

    Generally speaking there is a chance that some or most scripts won't work because of how the move route is handled. But you wont know if you dont try (or unless you figure out how this actually works)
    and yeah, that's why I made this thread. because im trying to figure out how it actually works. since apparently its not as simple or as versatile as other scripts within normal events.
     
    Last edited:

    Ego13

    hollow_ego
    311
    Posts
    6
    Years
  • so its not actually needed for it to work properly?
    No it's not. As long as the event is on the same map, just use it as you did before


    Huh, okay seems that this script call indeed is different. I thought it'd be the same. So from what I see from your error message this script call from within the moveroute is meant to use scripts from the Game_Event Script Section. Check out that section and then you actually do get a "list" of script that you can use.
     
    • Like
    Reactions: Poq
    Back
    Top