Thursday, July 1, 2010

system.create_entity

Emerson finally has the ability to create scripted entities from an executing script. This is achieved by following


           system.create_entity(Vector3d pos&)


The (presence of )new entity will be at the position specified by pos and with other default location properties. Entity creation is an asynchronous operation and will not block the running script. The script for the new entity is initialized only after the new entity is connected to space.


There are few things that need to be solved as followup of this feature:



  1. create_entity can take more arguments. 
    1. Texture
    2. Reference to existing entity
    3.  may beLocation features like orientation, velocity
    4. A script to attach to the script
  2. The addressable array for all the neighboring entities and the new entity should be updated to reflect the new entity. This can be done by adding a callback in ObjectScript and calling it when the space confirms the new entity is connected.


Screen Shots of new entities. The small cubes were created while running the "create.js" script.







1 comment:

  1. pushed the code to do the point number 2 above. Now the addressables would be updated once a confirmation from the space is received by the new entity.

    ReplyDelete