Page 1 of 1

How can I use RailPlanner

Posted: Sun Nov 03, 2024 6:05 pm
by tedrahedron
I want to build rail in ghost mode with code.
But I didn't find any API allow me to do it. The only term I found is RailPlanner.

I can only build entities like the code below. But how can I build railway turning around?

Code: Select all

    local start_position = player.position
    for i = 0, 30, 1 do 
        local current_position = start_position
        current_position.y = 1 + current_position.y
        player.surface.create_entity( {
            name="entity-ghost",
            inner_name="straight-rail",
            position = current_position,
            force = game.forces.player
        } ) 
    end