Changing position of entity
Posted: Wed Jul 20, 2016 2:49 pm
Hey all,
First time trying to mod factorio, I'm trying to build a mod which when placing certain items (belts, walls etc) and holding a modifier (not sure if that's possible yet), it will pin the x or y position depending on the direction of the placement. See attachment, trying to avoid the top example
I've tried to approach it a few different ways but don't seem to be able to get it
- Hooked into on_put_item and tried to change event.position values (not great anyway because mutating the event)
- Hooked into on_built_entity and tried to create another entity at +1 of the event.created_entity.position.x|y but appeared to cause an infinite loop
- Tried to call event.created_entity.teleport but it after reading the documentation is appears teleport only works for the player entity
Any ideas on another approach I could try?
Thanks!
Stoosh
First time trying to mod factorio, I'm trying to build a mod which when placing certain items (belts, walls etc) and holding a modifier (not sure if that's possible yet), it will pin the x or y position depending on the direction of the placement. See attachment, trying to avoid the top example
I've tried to approach it a few different ways but don't seem to be able to get it
- Hooked into on_put_item and tried to change event.position values (not great anyway because mutating the event)
- Hooked into on_built_entity and tried to create another entity at +1 of the event.created_entity.position.x|y but appeared to cause an infinite loop
- Tried to call event.created_entity.teleport but it after reading the documentation is appears teleport only works for the player entity
Any ideas on another approach I could try?
Thanks!
Stoosh