VR-Forces 5.2 Lua Function Documentation

threatLevelUtil

(For high level concepts about how to use Lua to write scripted tasks, please see VR-Forces User's Guide.)


Threat Level Utilities

Summary

Provides functions that rank entity entity types an a threat level scale. The threat scores are coded directly into the lua file. To view the scores, open the threadLevelUtil.lua file.

Usage

require "threatLevelUtil"

Function List

determineLifeformThreatLevel (entityTypeString) Find the threat score for a lifeform type.
determinePlatformThreatLevel (entityTypeString) Find the threat score for a platform type.
determineThreatLevel (entityTypeString) Find the threat score for an entity type.


Functions

determineLifeformThreatLevel (entityTypeString)
Find the threat score for a lifeform type. Higher values are more threating.

Parameters:

  • entityTypeString: (string) An entity type enumeration for a lifeform, e.g. "3:1:222:11:5:30:6"

Return values:

  1. (integer) Threat score from 0-100 that represents the threat level.
  2. (boolean) True if passed in type was a lifeform type.
determinePlatformThreatLevel (entityTypeString)
Find the threat score for a platform type. Higher values are more threating.

Parameters:

  • entityTypeString: (string) An entity type enumeration for a platform, e.g. "1:1:255:1:1:0:0"

Return values:

  1. (integer) Threat score from 0-100 that represents the threat level.
  2. (boolean) True if passed in type was a platform type.
determineThreatLevel (entityTypeString)
Find the threat score for an entity type. Both platform and lifeform threat levels are returned (at least one will be zero).

Parameters:

  • entityTypeString: (string) An entity type enumeration for a simulated object, e.g. "1:1:255:1:1:0:0"

Return values:

  1. (integer) The platform threat level
  2. (integer) The lifeform threat level

Copyright© 2025 MAK Technologies, Inc. All rights reserved.