The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Fan Games > Binary ROM Hacking
Reload this Page Does Anyone Know How to Prevent the Player from Leaving a Certain Area Without Doing a Certain Action First?

Notices
For all updates, view the main page.

Binary ROM Hacking Need a helping hand or just want to talk about binary ROM hacks? Get comments and answers to any ROM Hacking-related problems, questions or thoughts you have here.

Ad Content
Reply
 
Thread Tools
  #1   Link to this post, but load the entire thread.  
Old October 25th, 2019 (6:44 AM).
thugtality's Avatar
thugtality thugtality is offline
 
Join Date: Sep 2019
Location: Midwest, USA
Posts: 7
Hi all,

This is probably a relatively novice subject, but I'm still inexperienced with scripting. I'm struggling with writing a script at the moment that would prevent the player from leaving a mansion without first traveling through it and interacting with a certain NPC. I tried multiple variations of setting a flag when the interaction with the NPC takes place and running a flag check when trying to leave, but it freezes my game every single time without fail, no matter what flag I set.

Specifically, what I'm trying to accomplish is this:

If the player tries to leave the mansion without interacting with the NPC first, he will stop, say something along the lines of "I can't leave yet, I still have to find [insert name of old man here]", then turn around and move backwards back away from the door.

If the player has already completed the interaction, I'd like nothing to happen at all and the player to exit the mansion normally.

Does anyone have an example script I could potentially bum, or could anyone explain this to me? Your help would be greatly appreciated.

Thank you!
Reply With Quote
  #2   Link to this post, but load the entire thread.  
Old October 25th, 2019 (7:29 AM).
Avara's Avatar
Avara Avara is offline
 
Join Date: Dec 2011
Gender: Female
Nature: Relaxed
Posts: 1,305
Firstly, take a look at the following sections of XSE toot: Variables, Movements and Trigger Scripts.

What I'd do, is use a repeating trigger script containing movements and your msg at the mansion exit. Then, in the desired NPC's script, set the variable used in the trigger script to something else so that it will stop repeating and the player is free to leave. Hope this helps!
__________________
Reply With Quote
  #3   Link to this post, but load the entire thread.  
Old October 25th, 2019 (8:34 AM).
thugtality's Avatar
thugtality thugtality is offline
 
Join Date: Sep 2019
Location: Midwest, USA
Posts: 7
Oh, wow! Thanks a ton for the tutorials and the advice, I really appreciate it. I got it to work in no time with no problems at all. You're a lifesaver!
Reply With Quote
Reply

Quick Reply

Join the conversation!

Create an account to post a reply in this thread, participate in other discussions, and more!

Create a PokéCommunity Account
Ad Content

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 9:23 AM.