RM2K3 - NEED HELP MOVING ROCK OVER TERRAIN
Posts
Pages:
1
So this is what I have:


(the speed is just to make the movement look a little nicer haha)
Unobstructed, it works perfectly fine. However, the goal is to force the Rock over terrain that the player can't cross (in this case it's a river) in order to activate a pressure plate on the other side. What would I have to do?
Thank you very much in advance!


(the speed is just to make the movement look a little nicer haha)
Unobstructed, it works perfectly fine. However, the goal is to force the Rock over terrain that the player can't cross (in this case it's a river) in order to activate a pressure plate on the other side. What would I have to do?
Thank you very much in advance!
haha "The Rock"
You would need a way for the rock to tell what is in front of it. This can be done with X,Y coordinates or Terrain ID.
I will make an example project some time tonight and upload it for you. I need to go out to eat first!
You would need a way for the rock to tell what is in front of it. This can be done with X,Y coordinates or Terrain ID.
I will make an example project some time tonight and upload it for you. I need to go out to eat first!
author=MakoInfused
You need to use the "through" (or "phasing mode") command inside of that move event.
Ah!! It worked perfectly! Thank you very, very much!!! :^)
But then the rock can be pushed through any solid tile and maybe even end up stuck in a wall. If that's fine, then I won't bother with that example project heh If you want to know how to push a rock over a river but not a tree, let me know ^.^;
Will possession of the Force Staff always cause the rock to move exactly four tiles?
author=TrihanYes that was the plan. Link_2112 helped me get it so that it would only phase through a certain type of terrain (water, etc) and behave like a physical object when that terrain isn't in its path.
Will possession of the Force Staff always cause the rock to move exactly four tiles?
So I guess now the answer is really "Yes, unless there is something in the way." Which I guess works out better, haha.
Have a conditional branch that checks which direction the boulder is being pushed in. Turn on a switch then check the terrain for each tile four places in that direction from the boulder's position. If it's a passable type and the switch is on, increment a variable by 1. If it's not, turn the switch off. Then have a loop that moves the boulder one space in the pushed direction and decrements the variable by 1, with a conditional branch that breaks the loop if the variable's value is 0.
Basically what you'll end up with is an event that only moves the boulder as many spaces as it has passable terrain in which to do so.
Basically what you'll end up with is an event that only moves the boulder as many spaces as it has passable terrain in which to do so.
If you're going to have it loop a movement of 1 space at a time, it might be better to check 1 space in front and move ahead if it's passable or stop if it's not. Increment the var by 1 if it moves, to a max of 4, or stop everything and reset if it can't move forward.
My way will do that. It will figure out how many spaces it can move ahead and then do so. Fair enough your way is probably going to be more efficient.
Your way would be better if you needed to determine that there is enough room to move, and you need a certain amount of space before moving at all. But for a simple move cycle, it's a bit of extra unnecessary work.
author=Trihan
Have a conditional branch that checks which direction the boulder is being pushed in. Turn on a switch then check the terrain for each tile four places in that direction from the boulder's position. If it's a passable type and the switch is on, increment a variable by 1. If it's not, turn the switch off. Then have a loop that moves the boulder one space in the pushed direction and decrements the variable by 1, with a conditional branch that breaks the loop if the variable's value is 0.
Basically what you'll end up with is an event that only moves the boulder as many spaces as it has passable terrain in which to do so.
A lot of that went over my head, haha. Truthfully, I haven't even touched loops yet so I don't really know how to go about making them work in the way you described...
While Link_2112's method works the way I had intended, I'd still love to see the actual script of your example, if that's not too much trouble! I'm very much a visual learner and seeing another method would help a ton.
I went into rm2k3 to make up a practical implementation so I could take a screenshot of the code, but now that I look at it my method is probably overly complex and Link's is far superior. ^_^
I came up with this

This event is set to Action Key and the label/jump to label 1 is what creates the loop. Jumping to label 2 breaks the loop.

This event is set to Action Key and the label/jump to label 1 is what creates the loop. Jumping to label 2 breaks the loop.
@Trihan: Thanks, anyway!
@Link_2112: What the heckie. I get it but I think I prefer your other way, haha.
@Link_2112: What the heckie. I get it but I think I prefer your other way, haha.
Yeah, that's pretty much what I had Link. It seemed like a good way to do it until I actually started putting the code in.
Pages:
1















