OnObjectUpdate: Difference between revisions

From NPC for VCMP 0.4 Servers
Jump to navigation Jump to search
(Created page with "{{Welcome|desc=Called when one of object's position, rotation, alpha is updated or it is moved.| params=<source>( objectId, updatetype)</source> <poem>::objectId : The ID of the object ::updatetype : See below <source>( AlphaUpdate=0, PositionUpdate=1, RotationToUpdate=2, MoveToUpdate=3, TrackingBumpsShots=4)</source> </poem>| relfuncs=*OnObjectDestroyed *OnObjectUpdate *IsObjectStreamedIn }}")
 
No edit summary
Line 5: Line 5:
<source>( AlphaUpdate=0, PositionUpdate=1, RotationToUpdate=2, MoveToUpdate=3, TrackingBumpsShots=4)</source>
<source>( AlphaUpdate=0, PositionUpdate=1, RotationToUpdate=2, MoveToUpdate=3, TrackingBumpsShots=4)</source>
</poem>|
</poem>|
example=<source lang="lua">
function OnObjectUpdate(id, type)
{
if(type==3)
{
print("The object "+id+ " is in motion");
}
}
</source>|
relfuncs=*[[OnObjectDestroyed]]
relfuncs=*[[OnObjectDestroyed]]
*[[OnObjectUpdate]]
*[[OnObjectUpdate]]
*[[IsObjectStreamedIn]]
*[[IsObjectStreamedIn]]
}}
}}

Revision as of 09:11, 14 November 2023


Description:
Called when one of object's position, rotation, alpha is updated or it is moved.


Parameters:

( objectId, updatetype)

objectId : The ID of the object
updatetype : See below

( AlphaUpdate=0, PositionUpdate=1, RotationToUpdate=2, MoveToUpdate=3, TrackingBumpsShots=4)


Return Values:
This function does not return any specific values.


Example

function OnObjectUpdate(id, type)
{
if(type==3)
{
print("The object "+id+ " is in motion");
}
}

Related Functions

The following functions may be helpful as they relate to this function in one way or another.