
Foxquest door that can be opened and closed endlesy solution
Today i show you a little feature that will be added in Version 0.0.4 of foxquest ;)
It took me quite a lot time to figure this solution out.
Eh.. there might be people who can do such things without any trouble, but for people like me, here is the description ^^
Problem:
Usually a door just dissapears when it get opened, by simply making the door event delete itself or change it to an event without image that can be passed. But i wanted to give the player to close the door because it's unrealisitc that the door just vanishes completly ;)
Solution:
We need an event with four pages.
The first page just let the character say that it's a door and the player get asked to open it or not. This page has no requirements, and the player won't succeed without a key or another special item in the inventory.
The second page (the first part of the image above) is now more interesting.
First off, it can only be opened when the player has the right key in the inventory (It's door 2 i forgot to rename it)
When the player has Key 2 in the inventory, there will be this event page instead of the one that says that the door is locked.
First we have the opening noise, then the movement for this door so that it not simply poofes, but opens up properly. Then the player get the message that the door got opened up by using Key 2 and a self switch for this event sends us to Event page four.
The fourth page is now an event that is still at the same point and uses the open variant of the door sprites.
!!!Important!!! Use the open variant of the door sprites, NOT NOTHING. Otherwise all that movement is senseless and the door will just re appear after the SE
. It can be passed because of the through option on the lower left corner and the direction fix option makes sure that the door will not suddenly be half opened because the event turns towards the player.
Eventpage 4 only get triggered when the player has still the key in the inventory and when the self switch b is active.
It plays again the noise, does the same movements like when it was opened, but reversed and! This is important! Deactivates the direction fix first, so that the event can move at all.
Then it basically activates self switch A and turns itself off by deactivate the self switch B
This brings the player to page three now.
We again have now the closed door, so basically the very same thing like event page 2 but without the message that the door got opened with the key and it activates the self switch B again, so that the event switches to page 4 again.
Like this, the door can be opened and closed as often as the player pleases after it got opened, by sending the event from page 3 to 4 to 3 to 4, etc
Maybe i will work later on an alternate version where the player can choose to lock the door with the key.
In short:
1: Gets triggered when the Player don't has the right item in the Inventory
Options: Walking and direction fix
Asks the player to open the door or not
Yes: The door is locked
No: The Character doesn't try to open it.
2: Gets triggered when the Player has the right item in the inventory
Options: Walking and direction fix
Opens up the door
Plays the SE for that
Tells the Player wich item was used to open up the door
Activates self switch B
3: Gets triggered when the Player has the right item in the inventory and when the self switch A is active
Options: Walking and direction fix
Opens up the door
Plays the SE for that
Activates self switch B
4: Gets triggered when the Player has the right item in the inventory and when the self switch B is active
Options: Direction fix and through (Image is the opened up door NOT NOTHING! Ohterwise there will just
magically appear a door in the frame!)
Closes the door by let the sprites move reversed
plays the SE for that
Activates self switch A
deactivates self switch B
It took me quite a lot time to figure this solution out.
Eh.. there might be people who can do such things without any trouble, but for people like me, here is the description ^^
Problem:
Usually a door just dissapears when it get opened, by simply making the door event delete itself or change it to an event without image that can be passed. But i wanted to give the player to close the door because it's unrealisitc that the door just vanishes completly ;)
Solution:
We need an event with four pages.
The first page just let the character say that it's a door and the player get asked to open it or not. This page has no requirements, and the player won't succeed without a key or another special item in the inventory.
The second page (the first part of the image above) is now more interesting.
First off, it can only be opened when the player has the right key in the inventory (It's door 2 i forgot to rename it)
When the player has Key 2 in the inventory, there will be this event page instead of the one that says that the door is locked.
First we have the opening noise, then the movement for this door so that it not simply poofes, but opens up properly. Then the player get the message that the door got opened up by using Key 2 and a self switch for this event sends us to Event page four.
The fourth page is now an event that is still at the same point and uses the open variant of the door sprites.
!!!Important!!! Use the open variant of the door sprites, NOT NOTHING. Otherwise all that movement is senseless and the door will just re appear after the SE
. It can be passed because of the through option on the lower left corner and the direction fix option makes sure that the door will not suddenly be half opened because the event turns towards the player.
Eventpage 4 only get triggered when the player has still the key in the inventory and when the self switch b is active.
It plays again the noise, does the same movements like when it was opened, but reversed and! This is important! Deactivates the direction fix first, so that the event can move at all.
Then it basically activates self switch A and turns itself off by deactivate the self switch B
This brings the player to page three now.
We again have now the closed door, so basically the very same thing like event page 2 but without the message that the door got opened with the key and it activates the self switch B again, so that the event switches to page 4 again.
Like this, the door can be opened and closed as often as the player pleases after it got opened, by sending the event from page 3 to 4 to 3 to 4, etc
Maybe i will work later on an alternate version where the player can choose to lock the door with the key.
In short:
1: Gets triggered when the Player don't has the right item in the Inventory
Options: Walking and direction fix
Asks the player to open the door or not
Yes: The door is locked
No: The Character doesn't try to open it.
2: Gets triggered when the Player has the right item in the inventory
Options: Walking and direction fix
Opens up the door
Plays the SE for that
Tells the Player wich item was used to open up the door
Activates self switch B
3: Gets triggered when the Player has the right item in the inventory and when the self switch A is active
Options: Walking and direction fix
Opens up the door
Plays the SE for that
Activates self switch B
4: Gets triggered when the Player has the right item in the inventory and when the self switch B is active
Options: Direction fix and through (Image is the opened up door NOT NOTHING! Ohterwise there will just
magically appear a door in the frame!)
Closes the door by let the sprites move reversed
plays the SE for that
Activates self switch A
deactivates self switch B
Category Designs / Tutorials
Species Unspecified / Any
Size 656 x 1280px
File Size 144.8 kB
Comments