News:

Do you need help?
Simutrans Wiki Manual can help you to play and extend Simutrans. In 9 languages.

tile_x is ignoring height ( coordinate z)

Started by Yona-TYT, October 20, 2018, 12:15:47 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Yona-TYT



The tile_x function does not recognize the z coordinate at all, is this an error?

I try to use "tile_x (pos.x, pos.y, pos.z +1) .is_marked ()" to prevent the use of elevated tracks, but I need the height coordinates to be working well.

Example:
    function is_work_allowed_here(pl, tool_id, pos) {
        if (tool_id==4110){
            if(tile_x(pos.x, pos.y, pos.z +1).is_marked())
                return 0 // High tracks are not allowed            else
                return null
        }
    }



Dwachs

You cannot mark non-existing tiles. If tile at given coordinate does not exist, tile_x uses the ground tile.
Parsley, sage, rosemary, and maggikraut.

Yona-TYT

I wonder if it is possible to get the coordinates of the cursor when it builds an elevated track ??.

Maybe you can distinguish between a elevated track and a normal track.
Look at the image: