User Tools

Site Tools


lgscript:objectsrv

ObjectSrv

BeginCreate

Create a new object in two steps.

Returns integer or nil object
Parameter integer archetype

EndCreate

Finish creating an object.

Returns boolean success
Parameter integer object

Create

Create a new object.

Returns integer or nil object
Parameter integer archetype

Destroy

Destroy an object.

Returns boolean success
Parameter integer object

Exists

Check if an object ID is valid.

Returns boolean success
Parameter integer object

SetName

Change the string that identifies an object.

Parameter integer object
Parameter string name

GetName

Get the name of an object.

Returns string or nil name
Parameter integer object

Named

Get the ID of a named object.

Returns integer or nil object
Parameter string name

AddMetaProperty

Link a metaproperty with an object.

Parameter integer object
Parameter integer metaproperty

RemoveMetaProperty

Remove one metaproperty link from an object. If the same metaproperty has been added more than once to the object, this will only remove one of the copies.

Parameter integer object
Parameter integer metaproperty

HasMetaProperty

Check if a metaproperty has been added to the object.

Returns boolean isset
Parameter integer object
Parameter integer metaproperty

InheritsFrom

Check if an object inherits the properties from an archetype or metaproperty.

Returns boolean ischild
Parameter integer object
Parameter integer archetype

IsTransient

Check if an object is transient.

Returns boolean istemp
Parameter integer object

SetTransience

Change the transient state of an object. Transient objects are not saved in mission files.

Parameter integer object
Parameter boolean istemp

Position

Get the location of an object.

Returns vector location
Parameter integer object

Facing

Get the rotation of an object.

Returns vector rotation
Parameter integer object

Teleport

Move an object to another location. At least a location or a destination object must be specified.

Parameter integer object
Parameter vector location (optional)
Parameter vector rotation (optional)
Parameter integer destination (optional)

IsPositionValid

Check if the location of an object is not in solid space.

Returns boolean isvalid
Parameter integer object

FindClosestObjectNamed

Search for a nearby object that inherits from an archetype.

Returns integer or nil object
Parameter integer marker
Parameter string archetype

AddMetaPropertyToMany

Add a metaproperty to multiple objects.

Returns integer count
Parameter integer metaproperty
Parameter string objects

RemoveMetaPropertyFromMany

Remove a metaproperty from multiple objects.

Returns integer count
Parameter integer metaproperty
Parameter string objects

RenderedThisFrame

Check if an object is being drawn.

Returns boolean isvisible
Parameter integer object
lgscript/objectsrv.txt · Last modified: 2009/08/25 22:04 (external edit)