The RPG Maker Resource Kit
Other Game Creation => Program Troubleshooting => Topic started by: skyrune83 on July 22, 2007, 08:15:08 PM
-
I'm trying to make a hole that opens and closes automatically. I have that created. But I am having trouble figuring out how to program it so that "If Player is on Hole WHEN fully opened, player falls down."
-
I haven't done many things like that but what you need to do is to make sure then when the hole is closed its below hero and you can walk on it, and that you need an On touch event ( Not entirely sure whats its called for me its On Hero Touch) Where a fork condition that if switch- Opened Trap- or whatever you name it- is on then play sound effect falling and teleport where he would fall. Not 100% sure this will work but I'll test it on an RPG and Post back later...
-
You shouldn't waste a good switch just for this. What you should do is that if the hole is closed, it just simply waits and then turns on a self-switch after a certain amount of time. Then, make a second event page working on that self-switch which will work as Ryan1010100 said or however you want it. Oh wait... it can't turn back then. Okay. You should have two variables HeroX and HeroY and if it = the event location, then you should do conditional branches and after, some wait commands and the self switch off. Using two variables is worse than 1 switch but HeroX and HeroY should be put in a game because they have many uses.
-
Ah never though of that Sorry bout the possible waste of a switch ;)
-
Thanks a lot! Using map coordinates was the key.
Here's what I did, for reference:
Event : Parallel Process (1 page)
Begin Loop
Change Hole graphic (Make bigger)
Assign X coordinate
Assign Y coordinate
If X = hole coordinate
If Y = hole coordinate
Character falls
Change Hole graphic (Make smaller)
End Loop
There are some Wait times in there too, and when the hole is large, it is better to assign and check the cooridnates multiple times.
-
Add Resolved on the topic ?