0.14.21 - Not possible to disable hitbox on a locomotive
Posted: Wed Jan 04, 2017 10:49 pm
I'm new to developing Factorio mods and amidst what is basically zero documentation as to modding trains, I've come across an issue with bounding boxes. Apparently it's not possible to set . This is being said by someone who has no idea what the coordinates mean, but I naturally assumed that setting them to 0 would disable the collision box.
If this is done, the following error appears:
![Image](https://puu.sh/tbmwm/c3b5b550af.png)
Now, this makes me assume that there is no way to disable collision boxes at all. Additionally, I do not know which fields are safe to delete (I've been working using the base mod and electric vehicles as my primary references), since there is seemingly no documentation that I am aware of to explain.
Anyways, if someone could inform me how to disable collision between a train and all entities, that would be very helpful. If someone could point me to full documentation for all fields in a train prototype/metatable?/object? that would also be helpful. Finally, I'm confused as to how inheritance works in Factorio modding - in data:extend() in entity.lua, when we add a nested object into the parameter table, does that object inherit all fields of the type by default (and can we therefore delete some and end up defaulting to the originals) or are we supposed to include all the fields that we'd like to have in the final object?
Thank you.
P.S. I've worked with Lua before, but I switched to Moonscript almost immediately afterwards, so I'm unfamiliar with Lua's Prototyping and Metatable system.
Code: Select all
collision_box = {{0, 0}, {0, 0}}
If this is done, the following error appears:
![Image](https://puu.sh/tbmwm/c3b5b550af.png)
Now, this makes me assume that there is no way to disable collision boxes at all. Additionally, I do not know which fields are safe to delete (I've been working using the base mod and electric vehicles as my primary references), since there is seemingly no documentation that I am aware of to explain.
Anyways, if someone could inform me how to disable collision between a train and all entities, that would be very helpful. If someone could point me to full documentation for all fields in a train prototype/metatable?/object? that would also be helpful. Finally, I'm confused as to how inheritance works in Factorio modding - in data:extend() in entity.lua, when we add a nested object into the parameter table, does that object inherit all fields of the type by default (and can we therefore delete some and end up defaulting to the originals) or are we supposed to include all the fields that we'd like to have in the final object?
Thank you.
P.S. I've worked with Lua before, but I switched to Moonscript almost immediately afterwards, so I'm unfamiliar with Lua's Prototyping and Metatable system.