pebxcvi's picture
update
ee7329c
Raw
History Blame Contribute Delete
5.31 kB
1.2 Active .28
1.2.1 Active.GetEntity .28
1.2.2 Active.GetMaxSaveDataSize .29
1.2.3 Active.IsMoving .29
1.2.4 Active.IsSafeVolumelntersected .30
1.2.5 Active.IsSaveDataAccess .30
1.2.6 Active.IsUpright .31
1.2.7 Active.LoadData .31
1.2.8 Active.SaveData .32
Active
Active.GetEntity
Brief
Returns the entity for the active item model.
Definition
! Entity Active.GetEntity()
Arguments
None
Return Values
The entity for the active item model.
Description
Returns the entity for the active item model so other entities can attach themselves to it or query it such as its position.
Examples
j e = Active.GetEntity()
See Also
� Entity.GetPosition
Active.GetMaxSaveDataSize
Brief
Returns the maximum size for the save data allowed for this object.
Definition
! number Active.GetMaxSaveDataSize()
Arguments
None
Return Values
The maximum size in bytes.
Description
Gets the maximum size in bytes of the save data for this object. Any attempt to save or read beyond this will generate an error. This value is
guaranteed not to decrease between revisions, and will be at least 4096 bytes.
Examples
! local maxSize = Active.GetMaxSaveDataSize()
See Also
None
Active. IsMoving
Brief
Returns true if the active item is currently being moved.
Definition
! boolean Active.IsMoving()
Arguments
None
Return Values
Returns true if the active item is being moved, or false if it has been placed.
Description
Indicates whether the active item is moving or placed.
Examples
! myActiveAnimationEnabled = Active.IsMoving()
See Also
None
Active. IsSafeVolumelntersected
Brief
Returns true if the active item's safe volume is currently obstructed by another furniture item.
Definition
! Entity Active.IsSafeVolumelntersected()
Arguments
None
Return Values
True if the active item's safe volume is obstructed, or false if not.
Description
Indicates whether the active item's safe volume is currently intersected by any furniture items.
Examples
! g_miniGameDisabled = Active.IsSafeVolumelntersected()
See Also
None
Active. IsSaveDataAccess
Brief
Returns true if this instance is allowed to save data and false otherwise.
Definition
! boolean Active.IsSaveDataAccess()
Arguments
None
Return Values
true if this instance is allowed to save data and false otherwise.
Description
The only instance that can save data is the owner of the apartment.
Examples
if Active.IsSaveDataAccess() == true then
me = MemoryContainer.Create( Active.GetMaxSaveDataSize() )
Active.LoadData( me )
end
See Also
None
Active. Isllpright
Brief
Returns true if the active item is currently upright.
Definition
1 boolean Active.IsUpright()
Arguments
None
Return Values
Returns true if the active item's safe volume is upright, or false if not.
Description
Indicates whether the active item is currently upright, that is, if it is considered to be in the correct orientation to be usable.
Examples
! g_miniGameDisabled = not Active.IsUpright()
See Also
None
Active.Load Data
Brief
Copies the Active's save data into the supplied memory container.
Definition
void Active.LoadData(MemoryContainer memContainer, int size = Active.GetMaxSaveDataSize (), int offset
= 0 )
Arguments
memContainer - The memory container to load into.size - Number of bytes to obtain.offset - Offset in bytes into the memory container at which to
store the data.
Return Values
None.
Description
All actives have an allocated save data area which will be persistent across loads of the same object instance. Each instance has a separate save
data area. Note that an active should not rely on specific data being present in the save data (as the user may delete their Home save data at any
time) and thus actives should be able to recognise and handle the case where no save data is present. When an Active is created all of its save
data is set to zero.
Examples
local memContainer = MemoryContainer.Create(Active.GetMaxSaveDataSize())
Active.LoadData(memContainer)
if (memContainerGetUintl6(0) == 48879) then � OxBEEF
print('Save data is valid found the beef')
g_mySize = memContainerGetFloat32(4)
end
See Also
None
Active.SaveData
Brief
Copies the data from the supplied memory container into the Active's save data area and requests it to save.
Definition
Active.SaveData(MemoryContainer memContainer, number size = Active.GetMaxSaveDataSize(), int offset =
0 )
Arguments
memContainer - The memory container to obtain the data from.size - Number of bytes to obtain.offset - Offset in bytes into the memory container
at which to start reading data.
Return Values
None.
Description
All actives have an allocated save data area which will be persistent across loads of the same object instance. Each instance has a separate save
data area. Note that an active should not rely on specific data being present in the save data (as the user may delete their Home save data at any
time) and thus actives should be able to recognize and handle the case where no save data is present.
Note If size is not specified and your memory container is bigger than the maximum save data size an error will occur to catch accidental data
truncation.
Examples
local memContainer = MemoryContainer.Create(8)
memContainerSetUintl6(0, 48879) � OxBEEF, tags our data as valid
memContainerSetFloat32(4, mySize) � save our current size so we can keep growing next time
Active.SaveData(memContainer, 8)
See Also
None