ObjectService
Noir.Services.ObjectService: NoirService
A service for wrapping SW objects in classes.
Noir.Services.ObjectService:_LoadObjects()Load saved objects.
Used internally. Do not use in your code.
Noir.Services.ObjectService:_OnObjectLoad(object)Run code that would normally be ran when an object is loaded.
Used internally. Do not use in your code.
Parameters
object: NoirObject
Noir.Services.ObjectService:_OnObjectUnload(object)Run code that would normally be ran when an object is unloaded.
Used internally. Do not use in your code.
Parameters
object: NoirObject
Registers an object by ID.
Used internally. Use :GetObject() to retrieve an object instead.
Parameters
object_id: integer_preventEventTrigger: boolean|nil
Returns
NoirObject
Removes the object with the given ID.
Used internally. Do not use in your code.
Parameters
object: NoirObject
Overwrite saved objects.
Used internally. Do not use in your code.
Parameters
objects: table<integer, NoirSerializedObject>
Get saved objects.
Used internally. Do not use in your code.
Returns
table<integer, NoirSerializedObject>
Save an object to g_savedata.
Used internally. Do not use in your code.
Parameters
object: NoirObject
Remove an object from g_savedata.
Used internally. Do not use in your code.
Parameters
object_id: integer
Get all objects.
Returns
table<integer, NoirObject>
Returns the object with the given ID.
Parameters
object_id: integer
Returns
NoirObject
Spawn an object.
Parameters
objectType: SWObjectTypeEnumposition: SWMatrix
Returns
NoirObject
Spawn a character.
Parameters
outfitType: SWOutfitTypeEnumposition: SWMatrix
Returns
NoirObject
Spawn a creature.
Parameters
creatureType: SWCreatureTypeEnumposition: SWMatrixsizeMultiplier: number|nil - Default: 1
Returns
NoirObject
Spawn an animal.
Parameters
animalType: SWAnimalTypeEnumposition: SWMatrixsizeMultiplier: number|nil - Default: 1
Returns
NoirObject
Spawn an equipment item.
Parameters
equipmentType: SWEquipmentTypeEnumposition: SWMatrixint: integerfloat: integer
Returns
NoirObject
Spawn a fire.
Parameters
position: SWMatrixsize: number - 0 - 10magnitude: number - -1 explodes instantly. Nearer to 0 means the explosion takes longer to happen. Must be below 0 for explosions to work.isLit: boolean - Lights the fire. If the magnitude is >1, this will need to be true for the fire to first warm up before exploding.isExplosive: booleanparentBody: NoirBody|nilexplosionMagnitude: number - The size of the explosion (0-5)
Returns
NoirObject
Spawn an explosion.
Parameters
position: SWMatrixmagnitude: number - 0-1
Last updated