Creating entities programmatically
Posted: Sun Mar 27, 2016 9:35 pm
hi again!
i need another help with creating entities programmatically. what i mean by this is the following:
in control.lua i want to create an entity programmatically on runtime. lets say an entity of type LuaTransportLine. is there a way like
or
i read the lua reference manual, but it seems, a new operator does not exist. (javascript also uses prototyping when used oo-style, but still has a new operator).
and if there is a way to do it, how is this entity handled by the game engine? if it was not created by placing it in the game world.
thanks
i need another help with creating entities programmatically. what i mean by this is the following:
in control.lua i want to create an entity programmatically on runtime. lets say an entity of type LuaTransportLine. is there a way like
Code: Select all
local myentity = new LuaTransportLine()
Code: Select all
local myentity = LuaTransportLine.new()
and if there is a way to do it, how is this entity handled by the game engine? if it was not created by placing it in the game world.
thanks