ObjectService
Noir.Services.ObjectService: NoirService
A service for wrapping SW objects in classes.
Load saved objects.
Used internally. Do not use in your code.
Run code that would normally be ran when an object is loaded.
Used internally. Do not use in your code.
Parameters
object
: NoirObject
Run code that would normally be ran when an object is unloaded.
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>
Registers an object by ID.
Parameters
object_id
: integer_preventEventTrigger
: boolean|nil
Returns
NoirObject|nil
Returns the object with the given ID.
Parameters
object_id
: integer
Returns
NoirObject|nil
Removes the object with the given ID.
Parameters
object_id
: integer
Spawn an object.
Parameters
objectType
: SWObjectTypeEnumposition
: SWMatrix
Returns
NoirObject|nil
Spawn a character.
Parameters
outfitType
: SWOutfitTypeEnumposition
: SWMatrix
Returns
NoirObject|nil
Spawn a creature.
Parameters
creatureType
: SWCreatureTypeEnumposition
: SWMatrixsizeMultiplier
: number|nil - Default: 1
Returns
NoirObject|nil
Spawn an animal.
Parameters
animalType
: SWAnimalTypeEnumposition
: SWMatrixsizeMultiplier
: number|nil - Default: 1
Returns
NoirObject|nil
Spawn an equipment item.
Parameters
equipmentType
: SWEquipmentTypeEnumposition
: SWMatrixint
: integerfloat
: integer
Returns
NoirObject|nil
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
: booleanparentVehicleID
: integer|nilexplosionMagnitude
: number - The size of the explosion (0-5)
Returns
NoirObject|nil
Spawn an explosion.
Parameters
position
: SWMatrixmagnitude
: number - 0-1
Last updated