Spawning an entity
#1
Maybe it would be usefull when spawning an entity it returns the entity object/ID. for example if you spawn a mob or a pickup you get the entity object.
local Creeper = World:SpawnMob(X, Y, Z, 50)
Reply
Thanks given by:
#2
The server already does so.

Don't forget to use named constants instead of numbers (E_ENTITY_TYPE_CREEPER instead of 50)

Maybe we should rename the SpawnMob() function to SpawnMonster(), so that it corresponds with the overall naming (cMonster class)
Reply
Thanks given by:
#3
Maybe we also need a cRoot:Get():GetEntity(EntityID)
Reply
Thanks given by:
#4
Can't do. By the time you get the cEntity object, it may already have been freed by another thread in the server.

We have a cWorld::DoWithEntytiByID(), I just noticed it is not exported to Lua yet, I'll do that soon (ish Smile )
Reply
Thanks given by:




Users browsing this thread: 1 Guest(s)