Charas-Project
Game Creation => Requests => RPG Maker Programming => Topic started by: Linkforce on June 14, 2005, 09:11:53 PM
-
Well, I'm up to my first dungeon, and I'm trying to make a sytem of switches. For example:
Three switches on the floor. One is pushed in, and two are not. There are two rocks that can be moved. So, how do i make it that when the rock is on the button, it gets pushed down, and one gets pushed up. That way, you have to put both rocks on both switches?
Edit: Not related, but I have another problem. WhenI get to thw World Map, my sprite turns blank...but in the menu, the hero is there...and I have no event on the map. 0_o Please help with this too if you can. :D
-
wow, the trailer was cool :P, but how in the world u do that :|, amazing...if u could explain my ... go ! lol :P good job
-
....um thanks......but thats not the issue on hand....lol......?
-
aww too bad...
-
Can't anyone please help me out?
-
You'll have to use coordinates.
First, make the switch a "Parallel Process" event. Then, using two variables (Switch-X and Switch-Y), get the X and Y coordinates of the switch. Next, have two more variables (Rock-X and Rock-Y) get the coordinates of the rock. Then, use two Conditional Branches to compare the X and Y values; if they're the same, turn a switch ON.
Codewise:
<>Variable Operation: Var[0218:Switch-X] Set, Switch X Coord
<>Variable Operation: Var[0219:Switch-Y] Set, Switch Y Coord
<>Variable Operation: Var[0220:Rock-X] Set, Rock X Coord
<>Variable Operation: Var[0221:Rock-Y] Set, Rock Y Coord
<>Branch if Var[0218:Switch-X] is Var[0220]
|<>Branch if Var[0219:Switch-Y] is Var[0221]
||<>Switch Operation: Switch[0018:Rock On Switch] ON
||<>
|<>Else Handler
||<>Switch Operation: Switch[0018:Rock On Switch] OFF
||<>
|<>End
|<>
<>Else Handler
|<>Switch Operation: Switch[0018:Rock On Switch] OFF
|<>
<>End
<>
Then repeat with the other switch (You'll need to change the variables).
EDIT: And to move the rock, just create a "Touched By Hero" event that Moves Away From Hero when activated. Also, make sure to create a Proceed With Movement command right afteer the Move Event.
-
Great, thanks for the help! But when I get the rock onto the switch, it just freezes....and to make the door open I just use another switch right?
-
Hmm, if it freezes, you might want the switch "Rock On Switch" to activate a second page in the switch event that does nothing.
And yeah, with the other switch, just use the same code but different variables and switches.
-
Can you or someone thouroughly explain this, because I am quite stupid when it comes to Variables. I just need to know what to change when I put that code into my second and third switch.