Can I make a cart follow the rail?

galun

Villager
Member
Joined
Jul 21, 2015
Messages
11
Reaction score
1
Primarily Uses
Do anyone know if there is a good way to make a cart follow a rail? I've been googling but I can't find much about it. I want to push it along the rails one or two blocks at the time, I can push the cart around fine, but I can't find a way to force it to stay on the rails.

I also wan to be able to push it from behind and have it go around corners without me having to stand directly behind it. Is this possible? Maybe somebody know of a tutorial dealing with something like this?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,674
First Language
German
Primarily Uses
RMMV
There are several ways - but none easy.


Basically you need to determine the path or the position to preselect the possible moves for the select move route.


If you can give more details about what you want and how large/complex the railpath will become, we can give more specific advice.
 

galun

Villager
Member
Joined
Jul 21, 2015
Messages
11
Reaction score
1
Primarily Uses
It's not gonna be much bigger than this, not very complicated.

railway.png

Here I've tried to mar some of the problem areas. I can make the switch work though as long as I find out how to make it stick to the rail.

railwayproblems.png 

I suppose my biggest problem is that I can push the cart off the rails and the cart gets stuck in the corners. Not sure how to explain it better.

It's okay if the solution is complicated, I don't know how to write ruby scrips yet, but I can use them if someone else have written them already. I'd prefer a non scripting solution, but if it's the only way that's okay.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,674
First Language
German
Primarily Uses
RMMV
In that case I suggest you use Yanfly's restrict region script and make the borders of the rail with the region number set for "no movement by events". That way the regular passability still counts for the player.


(I don't have the link ready, search that script on the master script list)


And in the move route of the cart you set the move for "away from player" instead of a specific direction. That should allow the event to move to the side if the direct away is blocked (I haven't tested it however)
 

galun

Villager
Member
Joined
Jul 21, 2015
Messages
11
Reaction score
1
Primarily Uses
The script helped, at least it stays on the path now so thanks for that. The other thing did not work though, I don't have the move path set to a specific direction, just "away from player". If I have the "Skip If Cannot Move" on then it does nothing when it hits the wall, if I turn that off it actually freezes the game as soon as it hits a wall.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,674
First Language
German
Primarily Uses
RMMV
too bad - I hoped it would be able to slide.

Can you post a screenshot of the event? that might help solve the remaining issues
 

galun

Villager
Member
Joined
Jul 21, 2015
Messages
11
Reaction score
1
Primarily Uses
The event is becoming a bit more complicated than I wanted it now. I figured out a way to work around the getting stuck thing, but it requires 2 two switches and two parallel events for each turn. Maybe just one switch if I use a variable. Anyway, this is what I have now, this gets past the first two collisions one directions.

EventScreen.png 

Might not be so easy to see from the screen, but basically when the cart hits a collision point an event running parallel turns on a switch that tells it to move a few steps till it hits another event running parallel that turns the switch off again. Not very clean, wish there was another way to do it.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,862
Messages
1,017,047
Members
137,569
Latest member
Shtelsky
Top