Page 1 of 1

Entity dimensions

Posted: Sat Nov 15, 2014 7:20 am
by DaveMcW
Is there an easy way to get the dimensions of a building LuaEntity?

I could hard-code a table of them all, but that's not very compatible with other mods.

Re: Entity dimensions

Posted: Sun Nov 16, 2014 4:17 am
by L0771
I don't know what you want, but game.entityprototypes have a list of all entities, return a prototype
maybe with a for, you can take a specific entity

Code: Select all

for _,v ipairs(game.entityprototypes)}
  if v.name = [name] then
    [collision_box] = v.collision_box
    [collision_mask] = v.collision_mask
    [selection_box] = v.selection_box
  end
end