Page 1 of 1

[0.16.7] inner_name not found

Posted: Sun Dec 24, 2017 5:57 pm
by Cooldude2606
From the 0.15 to 0.16 update I went through my softmod to make it work in 0.16, many of the things changed I fixed but we are getting this error:
Key "inner_name" not found in property tree at ROOT
From what i say in the api LuaEntity.inner_name was replaced by LuaEntity.ghost_name so why is LuaSurface.can_place_entity creating problems.

My Code:

Code: Select all

if entity.name ~= 'player' then
    local entity_name = entity.name == 'entity-ghost' and entity.ghost_name or entity.name
    local ghost = {name='entity-ghost',position=entity.position,ghost_name=entity_name,direction=entity.direction,force=player.force}
    if surface.can_place_entity(ghost) then
        surface.create_entity(ghost).time_to_live = 59
    end
end
Please ask if more context is required.

Re: [0.16.7] inner_name not found

Posted: Sun Dec 24, 2017 10:14 pm
by Rseding91
LuaEntity::ghost_name is the name of the ghost entity (otherwise it just reports entity-ghost). inner_name has always been the property you have to define when using create_entity to create an entity-ghost.

Re: [0.16.7] inner_name not found

Posted: Sun Dec 24, 2017 10:24 pm
by Cooldude2606
Rseding91 wrote:LuaEntity::ghost_name is the name of the ghost entity (otherwise it just reports entity-ghost). inner_name has always been the property you have to define when using create_entity to create an entity-ghost.
In this case why is it not the same in both places. Should it not be ghost_name in both places or inner_name in both places so that it is consistent, this would make sence as i asumed that you removed inner_name and replaced it with ghost_name as they are used to describe the same property of an entity. So is it not an inconsistency that it has two names (in diffrent contexts) to describe the entity prototype inside the ghost?