Teleport to selected position does not work correctly

Place to get help with not working mods / modding interface.
User avatar
WIZ4
Fast Inserter
Fast Inserter
Posts: 209
Joined: Thu Apr 07, 2016 1:36 pm
Contact:

Teleport to selected position does not work correctly

Post by WIZ4 »

I want to teleport 2 tiles from the object. But I teleport far beyond the object. Why? The same thing if you teleport to the player

Code: Select all

/c game.player.teleport(game.player.selected.position.x+2) 
My native language is russian. Sorry if my messages are difficult to read.
Bilka
Factorio Staff
Factorio Staff
Posts: 3470
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Teleport to selected position does not work correctly

Post by Bilka »

You are not specifying a y position.

/c game.player.teleport({game.player.selected.position.x+2,game.player.selected.position.y}) should work
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
User avatar
WIZ4
Fast Inserter
Fast Inserter
Posts: 209
Joined: Thu Apr 07, 2016 1:36 pm
Contact:

Re: Teleport to selected position does not work correctly

Post by WIZ4 »

Bilka wrote:You are not specifying a y position.

/c game.player.teleport({game.player.selected.position.x+2,game.player.selected.position.y}) should work
Yes, it work! Thank you
My native language is russian. Sorry if my messages are difficult to read.
Post Reply

Return to “Modding help”