Jump to content
  • 0

Doors, Gates, and NPC Passage. Am I doing it wrong?


Ogreleg

Question

Hello. It's been awhile so I stopped in to check out all the sweet new Intersect progress. I tested several things that were keeping me from utilizing the engine the way I wanted and almost all of them have been fixed so I'm pretty excited to jump back in. I'm still having trouble with one part in particular though.

I need doors or gates that can be opened/closed to restrict or allow access from both players and NPCs. In theory, this should be very simple but in practice, I don't know what's going wrong. Getting it to work for players is no problem but the NPCs have been stubborn for years now and I just can't get it to work.

I tried having an event "Door" that uses a conditional branch for a global variable as 0 for closed and 1 for open with one page showing the door and the other page a blank image with "passable" checkmarked. This, however, only made NPCs able to walk through the door whether it was closed or open. It's almost like the "passable" flag is getting read on both event pages even though it's only set on one.

I tried having the "Door" event execute a Move Route to grant/restrict "Walkthrough" depending on whether the door was open or closed but this yielded no results.

I tried having the "Door" event use only one page, only existing at all on the condition that the variable is 0 for closed but then the NPCs won't walk through the tile where the event is located, whether it meets the conditional branch or not.

I tried having the "Door" event physically move out of the way and into an adjacent wall via Move Route, like an automatic sliding door, but even with the event physically out of the way the NPCs still path around the door opening as if it were still there.

I also toyed with the idea of using other NPCs to represent the door, spawning in a neutral "door" NPC but there's no way to reliably Despawn a particular NPC. I only see options to Despawn all NPCs. (This idea actually worked well for destructible/repairable walls though, in case anyone needs that)

Now here's the weird part... Sometimes it works.
It's very rare but every once in a while one of these methods will work for like 1 play session. You open the door and NPCs pass through. You close it and they path around. But then the next time I check, it's back to not working. Has anyone else successfully created a door-like event that works for both Players and NPCs?

Thanks for your time!

 

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

How are you wanting players to open the doors? self switches work great for simple open/close doors. I can show you how to set them up if needed.

 

 

Edit: Oh I see what you mean now. My npcs will not pass over door events as well but players can just fine. hmm wonder if this is intentional or a bug. 

Link to comment
Share on other sites

  • 0

That doesn't seems to be something that the engine can do (or it's bug and it should do it). If it's not a bug, the only way you could do that is by switching your npc to an event with the npc's sprite and set it as 'ignore npc avoids' when the door is open.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...