Temporarily Limit Interactions?

Started by SilverSpook, Mon 01/02/2016 06:08:00

Previous topic - Next topic

SilverSpook

Hi, I have a part of the game when the player character is being choked by another character.  You can still click on things and use inventory items (this part of the game involves figuring a way out), but you should not be able to interact with anything that isn't right next to the player. 

For example, if you click the door while being choked it should say, "I can't do that right now!"  Or if you try to pick up a hammer that's across the room it says, "I can't get to it!"  However if you click the character on top of you then you can interact with them.

Is there a way to make interactions with all hotspots, objects, and characters in the room temporarily redirect to a "Can't do that!" event?

I was thinking of putting a boolean in each and every hotspot, object, character's every interaction to check if you're being choked or not, but I was thinking there might be a simpler way, thanks!

monkey0506

Quote from: SilverSpook on Mon 01/02/2016 06:08:00I was thinking of putting a boolean in each and every hotspot, object, character's every interaction to check if you're being choked or not, but I was thinking there might be a simpler way, thanks!

You're sort of on the right track. You'd want a single global boolean, not a separate one for each interaction. Then, instead of checking it in every single interaction script available at that moment, you can check it in your on_mouse_click function. If the boolean is true, then redirect to the "Can't do that!" event function. Otherwise, call ProcessClick as normal. ;)

SMF spam blocked by CleanTalk