Entity dimensions

Place to get help with not working mods / modding interface.
Post Reply
User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3700
Joined: Tue May 13, 2014 11:06 am
Contact:

Entity dimensions

Post 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.

User avatar
L0771
Filter Inserter
Filter Inserter
Posts: 516
Joined: Tue Jan 14, 2014 1:51 pm
Contact:

Re: Entity dimensions

Post 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

Post Reply

Return to “Modding help”