Creating entities programmatically

Place to get help with not working mods / modding interface.
Post Reply
User avatar
Impatient
Filter Inserter
Filter Inserter
Posts: 883
Joined: Sun Mar 20, 2016 2:51 am
Contact:

Creating entities programmatically

Post 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


User avatar
Impatient
Filter Inserter
Filter Inserter
Posts: 883
Joined: Sun Mar 20, 2016 2:51 am
Contact:

Re: Creating entities programmatically

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

Post Reply

Return to “Modding help”