[15.34] renamed entities don't have a position

Place to get help with not working mods / modding interface.
Post Reply
quyxkh
Smart Inserter
Smart Inserter
Posts: 1029
Joined: Sun May 08, 2016 9:01 am
Contact:

[15.34] renamed entities don't have a position

Post by quyxkh »

Do

Code: Select all

/c script.on_event(defines.events.on_entity_renamed, function(e) game.print(e.position.x) end)
and rename a train station.

I don't see how to identify which train station was renamed if I don't have a position for it, there can be many with the old name, if I'm blindspotting on something there I'd be happy with whatever workaround I've missed.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13219
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [15.34] renamed entities don't have a position

Post by Rseding91 »

Thanks for the report but it looks like you don't understand how events actually work.

"position" is not part of that event: http://lua-api.factorio.com/latest/even ... ty_renamed

You want e.entity.position
If you want to get ahold of me I'm almost always on Discord.

quyxkh
Smart Inserter
Smart Inserter
Posts: 1029
Joined: Sun May 08, 2016 9:01 am
Contact:

Re: [15.34] renamed entities don't have a position

Post by quyxkh »

The evils of single-character variable names, I use `e` for entity in other routines so often I just didn't notice the pun here. Sorry and thanks.

Post Reply

Return to “Modding help”