tripwiremanaged Lua Interface¶
get¶
Get a pointer to the TripwireManaged object
- Arguments:
- any ptr Pointer to Module object
- Returns:
- tripwiremanaged ptr Pointer to casted TripwireManaged object
Example
ptr = tripwiremanaged:.get(ptr)
getConfig¶
Get the configuration object for the plugin
Arguments:
- Returns:
- table obj Map with configurations
Example
obj = tripwiremanaged:.getConfig()
saveConfig¶
Save the configuration object for the plugin
- Arguments:
- any ptr Pointer to TripwireManaged object
- table new_config Map with configurations
Example
tripwiremanaged:.saveConfig(ptr,new_config)
getName¶
Get the plugin name
Arguments:
- Returns:
- string name Plugin Name
Example
name = tripwiremanaged:.getName()
setConfigContainer¶
Sets the Instance container that has the Tripwire configurations
- Arguments:
- any ptr Pointer to TripwireManaged object
- string node Path for the Tripwire configuration inside instance state dictionary
- Returns:
- boolean success Operation success
Example
success = tripwiremanaged:.setConfigContainer(ptr,node)
checkTripwires¶
Check for targets inside zones, call onTripwireCheck with the provided type, call onWireTripped
- Arguments:
- any ptr Pointer to TripwireManaged object
- table args Arguments to send with onTripwireCheck (table with type entry)
- string[] tripwires [Optional] list of zones to check {wireId1, wireId2, ...}
- Returns:
- table tripwires_trip vector of vectors { {track_id, tripwire_id}, ... }
Example
tripwires_trip = tripwiremanaged:.checkTripwires(ptr,args,tripwires)
createTripwire¶
Create a new Tripwire
- Arguments:
- any ptr Pointer to TripwireManaged object
- string name Tripwire name
- string type Tripwire type
- table shape Table with array of points that make the Tripwire shape
- number[] color Color values (Array with 3 values)
- Returns:
- string id ID for the new Tripwire
Example
id = tripwiremanaged:.createTripwire(ptr,name,type,shape,color)
getTripwireIds¶
Get a list of current Tripwire id's
Arguments:
- Returns:
- string[] ids vector
with Tripwire id's
Example
ids = tripwiremanaged:.getTripwireIds()
getTripwireById¶
Get a Tripwire with a specific id
- Arguments:
- any ptr Pointer to TripwireManaged object
- string Tripwire id
- Returns:
- table trip Object representing Tripwire
Example
trip = tripwiremanaged:.getTripwireById(ptr,Tripwire)
getTripwires¶
Get a list of current tripwires
- Arguments:
- any ptr Pointer to TripwiredManaged object
- Returns:
- table tripwires table
Example
tripwires = tripwiremanaged:.getTripwires(ptr)
saveTripwire¶
Save a Tripwire with a specific id
- Arguments:
- any ptr Pointer to TripwireManaged object
- string Tripwire id (if ID is not registered, it will create a new TW on the ID)
- table wire Object representing Tripwire
- Returns:
- boolean ok Object saved
Example
ok = tripwiremanaged:.saveTripwire(ptr,Tripwire,wire)
deleteTripwireById¶
Delete a Tripwire with a specific id
- Arguments:
- any ptr Pointer to TripwireManaged object
- string Tripwire id
Example
tripwiremanaged:.deleteTripwireById(ptr,Tripwire)
updateTripwireShape¶
Set a new tripwire shape for a specific tripwire
- Arguments:
- any ptr Pointer to TripwireManaged object
- string wireid Id of the tripwire to change shape
- table shape Table with array of points that make the Tripwire shape
Example
tripwiremanaged:.updateTripwireShape(ptr,wireid,shape)
updateTripwireColor¶
Set a new tripwire color for a specific tripwire
- Arguments:
- any ptr Pointer to TripwireManaged object
- string wireid Id of the tripwire to change color
- number[] color New color values (Array with 4 values)
Example
tripwiremanaged:.updateTripwireColor(ptr,wireid,color)
updateTripwireName¶
Set a new tripwire name for a specific tripwire
- Arguments:
- any ptr Pointer to TripwireManaged object
- string wireid Id of the tripwire to change name
- string name New name
Example
tripwiremanaged:.updateTripwireName(ptr,wireid,name)
updateTripwireType¶
Set a new tripwire type for a specific tripwire
- Arguments:
- any ptr Pointer to TripwireManaged object
- string wireid Id of the tripwire to change type
- string type New type
Example
tripwiremanaged:.updateTripwireType(ptr,wireid,type)
updateTripwireHits¶
Set a the total_hits property for a specific tripwire
- Arguments:
- any ptr Pointer to TripwireManaged object
- string wireid Id of the tripwire to change type
- number hits Total hits to set
Example
tripwiremanaged:.updateTripwireHits(ptr,wireid,hits)
updateTripwireDirection¶
Set a new tripwire direction for a specific tripwire
- Arguments:
- any ptr Pointer to TripwireManaged object
- string wireid Id of the tripwire to change direction
- string dir New direction
Example
tripwiremanaged:.updateTripwireDirection(ptr,wireid,dir)
isLineTripping¶
Check if a line crosses any tripwire
- Arguments:
- any ptr Pointer to TripwireManaged object
- number[] pt1 Point 1 of line to check (Array with 2 values)
- number[] pt2 Point 2 of line to check (Array with 2 values)
- Returns:
- string[] ids list of tripwire ids that match the condition
Example
ids = tripwiremanaged:.isLineTripping(ptr,pt1,pt2)
clearTripwires¶
Clears all zones
Arguments:
Example
tripwiremanaged:.clearTripwires()