Hey there guys. I am trying to make a door that opens only when you have the key. The problem is that even before making the choice (yes/no), the door shows an "open" sprite until I select no in order to exit the event, where the door will then return to normal sprite of "locked". The door still opens correctly if i have the key, but i feel im missing something in my code so im asking here for assistance.
Door Problem
RPG Maker MV SupportHey there guys. I am trying to make a door that opens only when you have the key. The problem is that even before making the choice (yes/no), the door shows an "open" sprite until I select no in order to exit the event, where the door will then return to normal sprite of "locked". The door still opens correctly if i have the key, but i feel im missing something in my code so im asking here for assistance.
best way instead of choice is to use if branch with the door (basic event)
than do the following
if player has key
door opens
ELSE
you dont have a key
end
this is the very basic for locked door(s) or chests
than do the following
if player has key
door opens
ELSE
you dont have a key
end
this is the very basic for locked door(s) or chests
@ShadowDragon that has nothing to do with the problem
@Joka Your problem is caused by the automatic direction turn on action button. That is what you expect of an NPC (to turn toward you if you ask something) which is why it is automatic, but on your door sprite the direction determines how open the door looks instead of where the NPC looks to.
You need to activate "direction fix" on the event to prevent it from turning, and deactivate it by command in the moveroute you'll use to animate the door.
Additionally, your door sprites have a problem. compare them to the magic circles on the same sheet - each sprite has three frames for automated animation (by checking the walking animation). In your case that are three different colored doors or even different doors in the later case.
You will have problems selecting and animating those, so I strongly suggest to change your doors into the same three-frame-structure as the others, even if all three frames are identical.
And next time, please use the windows-integrated function to screenshot. Using a mobile to photograph your monitor results in very bad pictures that in this case didn't even show the area where you made your mistake.
Screenshot under windows:
1) press [alt]-[prtscrn] on your keyboard
2) open paint (or any other image program)
3) press [ctrl]-[V] to paste
4) save
@Joka Your problem is caused by the automatic direction turn on action button. That is what you expect of an NPC (to turn toward you if you ask something) which is why it is automatic, but on your door sprite the direction determines how open the door looks instead of where the NPC looks to.
You need to activate "direction fix" on the event to prevent it from turning, and deactivate it by command in the moveroute you'll use to animate the door.
Additionally, your door sprites have a problem. compare them to the magic circles on the same sheet - each sprite has three frames for automated animation (by checking the walking animation). In your case that are three different colored doors or even different doors in the later case.
You will have problems selecting and animating those, so I strongly suggest to change your doors into the same three-frame-structure as the others, even if all three frames are identical.
And next time, please use the windows-integrated function to screenshot. Using a mobile to photograph your monitor results in very bad pictures that in this case didn't even show the area where you made your mistake.
Screenshot under windows:
1) press [alt]-[prtscrn] on your keyboard
2) open paint (or any other image program)
3) press [ctrl]-[V] to paste
4) save
thanks, i'll try that tmr.
The "doors" in the spritesheet you've chosen are not intended to be used by that move route. Compare them with the regular doors. The regular ones have a closed door at the top, partly open next, almost fully open next, and fully open at the bottom. The doors in your image above are not like that. They will not work the way you want them to as they are not drawn/arranged with animation in mind.
(Oops - Andar already mentioned that)
(Oops - Andar already mentioned that)
I've tested the doors for my project and a new one. For some reason the new door works compared to the old one in my project. The doors are the same, image origin are the same i wonder what is wrong lol. Someone help pls.
oh wait, i think i fixed it. Any points on improving the code
?
Yeah, you're doing stuff that doesn't need to be done. The whole move route is pointless because it's only there for animation. Erase Event will get rid of the event as long as you're on the map, but if you leave the map and come back again, the door will be there again and you won't have a key. It's possible some of those commands might not run because you erase the event before running the commands.
I'd change it to this:
Then add a second page and ONLY set the Condition (above the sprite) to Self Switch A = ON. Don't make ANY other changes to that page.
You could probably even leave out the movement route on the player and let them walk through on their own.
I'd change it to this:
Code:
Text : You unlocked the door.
Play SE : Open1
Change Items: Prison Key - 1
Control Self Switches : A = ON
Set Movement Route : Player - 1 step forward
Then add a second page and ONLY set the Condition (above the sprite) to Self Switch A = ON. Don't make ANY other changes to that page.
You could probably even leave out the movement route on the player and let them walk through on their own.
Original thread: https://forums.rpgmakerweb.com/threads/door-problem.118260/