RailRoad

Place to get help with not working mods / modding interface.
User avatar
Plysken
Burner Inserter
Burner Inserter
Posts: 8
Joined: Sun May 18, 2014 4:44 pm
Contact:

RailRoad

Post 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?
The more things change, the more they stay the same --
User avatar
FreeER
Smart Inserter
Smart Inserter
Posts: 1266
Joined: Mon Feb 18, 2013 4:26 am
Contact:

Re: RailRoad

Post 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 :)
<I'm really not active any more so these may not be up to date>
~FreeER=Factorio Modding
- Factorio Wiki
- My Factorio Modding Guide
- Wiki Modding Guide
Feel free to pm me :)
Or drop into #factorio on irc.esper.net
User avatar
rk84
Filter Inserter
Filter Inserter
Posts: 556
Joined: Wed Feb 13, 2013 9:15 am
Contact:

Re: RailRoad

Post by rk84 »

Im not sure, but what if you just make smaller version of curved-rail?
Test mode
Searching Flashlight
[WIP]Fluid handling expansion
[WIP]PvP gamescript
[WIP]Rocket Express
Autofill: The torch has been pass to Nexela
User avatar
Plysken
Burner Inserter
Burner Inserter
Posts: 8
Joined: Sun May 18, 2014 4:44 pm
Contact:

Re: RailRoad

Post by Plysken »

Not bad, i'll try to make it.
The more things change, the more they stay the same --
theit8514
Inserter
Inserter
Posts: 47
Joined: Sun Apr 20, 2014 2:11 am
Contact:

Re: RailRoad

Post 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.
egomaxisum
Manual Inserter
Manual Inserter
Posts: 4
Joined: Thu May 26, 2016 9:15 am
Contact:

Re: RailRoad

Post 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
Rseding91
Factorio Staff
Factorio Staff
Posts: 14279
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: RailRoad

Post 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.
If you want to get ahold of me I'm almost always on Discord.
egomaxisum
Manual Inserter
Manual Inserter
Posts: 4
Joined: Thu May 26, 2016 9:15 am
Contact:

Re: RailRoad

Post by egomaxisum »

Too bad.
But thank you, you saved me a lot of time trying!
Post Reply

Return to “Modding help”