Page 1 of 1

LUA code, what does "entity" mean?

Posted: Mon Mar 02, 2009 6:50 pm
by Fiodis
In LUA terms, what does Entity mean? The doc says it's props and objects, but in the teleporter tut the code says:

Code: Select all

OnEnterRegion(
function(regIn,character)
MoveEntityToNode(character,"TeleportNode")
end,
"TeleportRegion"
)
ActivateRegion("TeleportRegion")
The MoveEntityToNode line is, I think, what moves the player. But the player isn't a prop or object. Is he?

Re: LUA code, what does "entity" mean?

Posted: Mon Mar 02, 2009 7:00 pm
by Null_1138
I'm not a Lua expert, but Dictionary.com says:
Dictionary wrote:something that has a real existence
So I guess anything that exists and has form.

Re: LUA code, what does "entity" mean?

Posted: Mon Mar 02, 2009 7:12 pm
by Fiodis
Something in the dictionary isn't always the same in LUA.

Re: LUA code, what does "entity" mean?

Posted: Mon Mar 02, 2009 7:20 pm
by YaNkFaN
i'm taking a wild guess on this one but an entity is something that has a mesh...i'm not a 100% sure i know it includes players and i know it doesn't include things like lights so yea just a guess

Re: LUA code, what does "entity" mean?

Posted: Tue Mar 03, 2009 6:09 pm
by Fiodis
So "OnEntityDamage (entity, damager)" with "entity" being a player/character/unit is a valid function?