Page 1 of 1

RailRoad

Posted: Sun May 18, 2014 5:01 pm
by Plysken
Hello,

I'm trying to create my first mod. This is a mod on the railroad tracks, I want to create a new type of rail: switches.

It is already possible to do in the game but there is a space between the rails is 4 spaces. I wish to do without space.
What we have in game :
Image

What i want to create :
Image

I encounter an error when launching the game with the mod, I have the error:

"Error while loading prototype "switch-leftrail": "switch" isinvalid rail bendind type"

I found nothing on the "bending type" on the forum and on the net, I know that the error is there, but I confess I do not know what to do.

What do you need to help me?

Re: RailRoad

Posted: Sun May 18, 2014 6:01 pm
by FreeER
Plysken wrote:I found nothing on the "bending type"
The bending type must be either "straight" or "turn" (meaning it's a straight piece of track or that it has turn(s) in it), honestly the noticeable difference in the lua prototype is that the "turn" bending type allows for a secondary collision box....

I had to look at the game's C++ code to find if there were any other types (and I only barely know C++), so...if you need more help than that here I may not be able to help you further...(you'd probably need to pm one of the devs to get further information and perhaps in the end make an interface request), but I hope that helps a bit :)

Re: RailRoad

Posted: Sun May 18, 2014 9:22 pm
by rk84
Im not sure, but what if you just make smaller version of curved-rail?

Re: RailRoad

Posted: Mon May 19, 2014 6:02 pm
by Plysken
Not bad, i'll try to make it.

Re: RailRoad

Posted: Thu May 29, 2014 1:15 am
by theit8514
I experimented with this a bit today, but have had no luck. It appears that the collision box has no correlation to the position of the track:

Image

As you can see above, the collision box for the curved end was changed (this is secondary_collision_box) to 0.1,0.1,0.1,0.1, but the aspects of the track movement did not change. The train continued to be able to traverse the track. The collision box only applies to what can be clicked on the track.

Re: RailRoad

Posted: Thu May 26, 2016 10:03 am
by egomaxisum
Hey Plysken!

I've actually had exactly the same idea you did and I've been working on it for a few days. I just found this thread now and I was wondering if any progress has been made?

If someone else has a better overview of the code could you please tell me where to find the file that specifies rail track behaviour?

Thanks

Re: RailRoad

Posted: Thu May 26, 2016 3:35 pm
by Rseding91
Rail track behavior isn't defined in the Lua entity definition. The Lua entity definition just gives the bounding boxes/health/mining result/pictures.

The current rail system doesn't support what this thread was trying to do - you won't get it working through a mod.

Re: RailRoad

Posted: Thu May 26, 2016 4:36 pm
by egomaxisum
Too bad.
But thank you, you saved me a lot of time trying!