• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Our weekly protagonist poll is now up! Vote for your favorite Trading Card Game 2 protagonist in the poll by clicking here.
  • 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.

Parallel Processing and the Pause Menu

  • 189
    Posts
    15
    Years
    • Seen Jun 12, 2024
    Hey all,
    I've been working on an eventing system by which that little glowy arrow indicating a building's exit appears. To do so, I've made the exit event two pages, both Parallel Processed. The first page doesn't do much, it just checks the player's location and if it's the tile next to the exit then SelfSwitch A is turned on.

    The second page is a tiny bit more complex. It runs a check for if the player is trying to move in the direction of the exit from the aforementioned location, and if true, enacts a series of commands to warp the player appropriately. Naturally this page has the glowing arrow as its sprite. Obviously, both pages loop, so I put a Wait: 1 frame at the end to throttle them.

    Problem is, when I'm using this event, it still performs the checks and warps players even if the Pause Menu is open. I had a look in the scripts and found something in PokemonMessages and PokemonField called pbGlobal(Un)Lock, which appears to stop (and restart) the execution of events.

    I hence tried to put that in PokemonPauseMenu, but whenever I do it chucks an error upon calling the menu. I assume my lack of coding experience is the source of the problem, so if someone could guide me to the correct way of implementing such a feature, I would be most thankful.

    Cheers, Jim.
     
    Hey all,
    I've been working on an eventing system by which that little glowy arrow indicating a building's exit appears. To do so, I've made the exit event two pages, both Parallel Processed. The first page doesn't do much, it just checks the player's location and if it's the tile next to the exit then SelfSwitch A is turned on.

    The second page is a tiny bit more complex. It runs a check for if the player is trying to move in the direction of the exit from the aforementioned location, and if true, enacts a series of commands to warp the player appropriately. Naturally this page has the glowing arrow as its sprite. Obviously, both pages loop, so I put a Wait: 1 frame at the end to throttle them.

    Problem is, when I'm using this event, it still performs the checks and warps players even if the Pause Menu is open. I had a look in the scripts and found something in PokemonMessages and PokemonField called pbGlobal(Un)Lock, which appears to stop (and restart) the execution of events.

    I hence tried to put that in PokemonPauseMenu, but whenever I do it chucks an error upon calling the menu. I assume my lack of coding experience is the source of the problem, so if someone could guide me to the correct way of implementing such a feature, I would be most thankful.

    Cheers, Jim.

    Hm...I can't put my finger on the code but. There is on that locks the menu..I would have to look into the game but I know there was one.
     
    Try this instead.

    Make 2 events, 1 on the tile before the door and the other on the "exit", which I will assume is black space...

    Eventid[1] (or tile before exit)
    No Graphic,
    Player Touch Trigger, (maybe event touch I forget which one is best used here)
    Conditional Branch;
    If player facing down
    SetMoveRoute: change graphic eventid[2] to the arrow
    else
    SetMoveRoute: change graphic eventid[2] to none.

    Eventid[2] (or tile on black space)
    No Graphic,
    No Trigger,
    No Event.

    OR Another way to do this is set 1 event on the black space and:

    Eventid[1] (or tile on black space)
    Page 1,
    No Graphic,
    Player Touch Trigger, (maybe event touch I forget which one is best used here)
    Conditional Branch;
    If player facing down
    SetTempSwitch"A"=On
    else
    Nothing

    Page 2,
    Arrow graphic,
    move route; Custom; probably, right, down, left, up... Or however you have your charset made,
    set frequency speed to 4,
    Player Touch Trigger,
    Conditional Branch;
    If player facing down
    Teleport
    else
    SetTempSwitch"A"=Off

    There are numerous ways to do this effect, you can try your most favoured, but this is the basics of it... Also to stop the player using the menu there is actually a menu disable button on the event, I think it's on page 3... Just remeber to enable it if player faces another direction or is teleported.

    Hope this helps
     
    Thanks for the help, Nickaloose, but I think you misunderstand the problem. The problem is not that the player can open the menu (which they should be able to do), but rather that the event still runs the warp procedure even if the pause menu is being accessed, hence why I was trying to use the pbGlobalLock thing.

    Say the player is at the tile next to the warp, they open the menu and attempt to scroll down, the menu will scroll as usual but they will also warp, the latter of which I don't want. If it would help, I could post the event pages and whatnot?
     
    Okay maybe I'm still a little confused...

    How I read this is, you're facing the tile with the warp... U pause the game... Press down and the player warps anyway...

    If it's paused how does it warp?

    Maybe I can't help you haha!
     
    I believe that he means that the parallel process is still running even though the start menu is activated. If you post the event pages, I might be able to help you get it sorted out.
     
    Yes, that is precisely what I meant. Here are the event pages.

    Spoiler:


    I figured I could use the pbGlobalLock script to stop events from executing while the menu was open, but I don't know how to work that into PokemonPauseMenu.

    Is there a script that checks if the pause menu is open? If so I could make a conditional branch with the Script condition: !menuopen or whatever and put the stuff in there, right?
     
    You're doing exactly what I thought you were doing... You're only trying to get an arrow to appear at the exit aren't you? You only want to use parellel process when you need something to keep being checked, like you did on page 1... Page 2 will keep playing over and over until you tell it to stop, so the menu will cause no stop what-so-ever... Try using my method before you reject it... Your way is odd... Easier is better...

    On another note, page 2 can be a touch trigger.
     
    Yeah, but as it is it performs the check for location still, and reverts to the no-graphic state if the player moves away. If the second page were touch trigger, it would prevent the warp while menu is open, but the arrow would be permanently on once it was activated. Hence the location check in the else branch.
     
    Yeah, but as it is it performs the check for location still, and reverts to the no-graphic state if the player moves away. If the second page were touch trigger, it would prevent the warp while menu is open, but the arrow would be permanently on once it was activated. Hence the location check in the else branch.

    Perhaps you could do as Nickalooose said, make it a touch trigger, but just place another event before this one, that also performs a location check, and from there and set it to globally turn self switch A of the arrow event off. There is a call script that will let you turn control switches off from other events within a single map, but I forgot what it was, and I am trying to hunt it down. Alternatively you could create a regular control switch to do the job of self switch a.
     
    Back
    Top