How can I use RailPlanner

Place to get help with not working mods / modding interface.
tedrahedron
Manual Inserter
Manual Inserter
Posts: 1
Joined: Sun Nov 03, 2024 6:02 pm
Contact:

How can I use RailPlanner

Post 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
Post Reply

Return to “Modding help”