vp_object_get
Method call snippet
vp_object_get(instance, id);
Gets the attributes of a single object in-world by its ID.
Parameters
These are the parameters that this method requires:
Parameter | Usage |
---|---|
VPInstance instance |
Pointer to the instance this method call is intended for |
int id |
ID of the object |
Used attributes
This method uses data set in these attributes when called:
Attribute | Usage | |
---|---|---|
VP_REFERENCE_NUMBER | Will be passed to the callback to identify for which method call it is fired |
Returns
This method returns a return code integer, which indicates whether the call was successful or errored for any reason:
Return code | Cause |
---|---|
VP_RC_SUCCESS |
Successful call (for methods that have a registered callback, it only means the request has been sent) |
VP_RC_NOT_INITIALIZED |
SDK not initialized with vp_init() yet
|
Behavior
This is a non-blocking call that requires a callback to be set for VP_CALLBACK_OBJECT_GET
. The callback will either return the object's data or an error reason code.
Caveats
This call is only useful for single objects the bot does not know about. After getting an object's data once, it should cache the result and monitor changes using VP_EVENT_OBJECT_CHANGE
.
Examples
- This method has no usage examples; please add at least one to this page