Page 1 of 1

Creating entities programmatically

Posted: Sun Mar 27, 2016 9:35 pm
by Impatient
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

Code: Select all

local myentity = new LuaTransportLine()
or

Code: Select all

local myentity = LuaTransportLine.new()
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

Re: Creating entities programmatically

Posted: Mon Mar 28, 2016 1:58 am
by DaveMcW

Re: Creating entities programmatically

Posted: Mon Mar 28, 2016 2:42 pm
by Impatient
thanks. ... does your answer also imply, that creating entities is just possible, when placing them (programmatically) in the game world? or is this just one way to do it?