VR-Forces 5.1.1 Lua Function Documentation

SystemAttribute

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

This section of the Lua documentation lists the attributes that entity systems can provide in the componentSystem:getAttribute function.
See the ComponentSystem module documentation.

The "functions" listed below are not really functions; the description of each "function" gives the actual attribute name and the type of module it is found in. Also, the attributes are all "get" attributes u unless the description indicates that it is a "set" attribute.
The "function" names below have a prefix that is the type name of the controller that the attribute is defined in, followed by ":", followed by the attribute name. The controller type can be found in the "component-type" entry for a component in the sysdef files. Note that controllers derived from the given type will also have the attribute defined.

Example: aggregate-release-bomb-controller:can-be-radar-jammed()
This attribute "can-be-radar-jammed" is defined in the aggregate-release-bomb-controller. This controller is found in, for example, the aggregate-harpoon-antiship-missile.sysdef file:
(controllers)
(aggregate-antiship-missile-controller
(component-descriptor-type "aggregate-release-bomb-controller-descriptor")
(component-type "aggregate-release-bomb-controller")
...
Since the aggregate-anti-air-controller is derived from the aggregate-release-bomb-controller, systems containing the anti-air component also have this attribute defined. An example is the aggregate-sidewinder-antiair-missile.sysdef.
In Lua, the attribute value would be retrieved like this:
sidewinders = this:getSystem("Sidewinder Anti-Air Missile")
if sidewinders ~= nil then
jammable = sidewinders:getAttribute("can-be-radar-jammed")
end

To get a list of all attributes defined in Component System someSystem, use the function someSystem:getAllAttributeNames().

Function List

aggregate-anti-air-controller:max-altitude () Attribute "max-altitude"
In guided weapon systems (using an AggregateAntiAirController).
aggregate-indirect-fire-controller:allowed-postures () Attribute "allowed-postures"
In aggregate indirect fire gun systems.
aggregate-release-bomb-controller:allowed-postures () Attribute "allowed-postures"
In aggregate weapon systems (using AggregateReleaseBombController or derivative; this includes cruise missiles, anti-air missiles, and torpedoes as well as bombs).
aggregate-release-bomb-controller:can-be-radar-jammed () Attribute "can-be-radar-jammed"
In aggregate weapon systems (using AggregateReleaseBombController or derivative; this includes cruise missiles, anti-air missiles, and torpedoes as well as bombs).
aggregate-release-bomb-controller:jamming-defense-factor () Attribute "jamming-defense-factor"
In aggregate weapon systems (using AggregateReleaseBombController or derivative; this includes cruise missiles, anti-air missiles, and torpedoes as well as bombs).
aggregate-release-bomb-controller:max-range () Attribute "max-range"
In aggregate weapon systems (using AggregateReleaseBombController or derivative; this includes cruise missiles, anti-air missiles, and torpedoes as well as bombs).
aggregate-release-bomb-controller:weapon-name () Attribute "weapon-name"
In aggregate weapon systems (using AggregateReleaseBombController or derivative; this includes cruise missiles, anti-air missiles, and torpedoes as well as bombs).
aggregated-movement-actuator:blocking-obstacle () Attribute "blocking-obstacle"
Aggregated Movement Actuators.
aggregated-movement-actuator:halt-movement-for-obstacles () Attribute "halt-movement-for-obstacles"
Aggregated Movement Actuators.
aggregated-movement-actuator:is-halted () Attribute "is-halted"
Aggregated Movement Actuators.
aggregated-movement-actuator:obstacle-object-types () Attribute "obstacle-object-types"
Aggregated Movement Actuators.
aggregated-movement-actuator:time-halted () Attribute "time-halted"
Aggregated Movement Actuators.
fixed-wing-gunnery-controller:aa-breakoff-range () Attribute "aa-breakoff-range"
In fixed wing aircraft gun systems.
fixed-wing-gunnery-controller:aa-engage-range () Attribute "aa-engage-range"
In fixed wing aircraft gun systems.
fixed-wing-gunnery-controller:dive-angle () Attribute "dive-angle"
In fixed wing aircraft gun systems.
fixed-wing-gunnery-controller:entry-airspeed () Attribute "entry-airspeed"
In fixed wing aircraft gun systems.
fixed-wing-gunnery-controller:entry-altitude () Attribute "entry-altitude"
In fixed wing aircraft gun systems.
fixed-wing-gunnery-controller:strafe-range () Attribute "strafe-range"
In fixed wing aircraft gun systems.
fixed-wing-pilot-controller:max-thrust-acceleration () Attribute "max-thrust-acceleration"
In fixed-wing movement systems, for example fighters.
iff-controller:IFF-mode-values () Includes these attributes:
"mode-1-code"
"mode-2-code"
"mode-3-code"

These are GET attributes;
For IFF systems.
iff-controller:IFF-modes-on () Includes these attributes:
"system-on"
"mode-1-on"
"mode-2-on"
"mode-3-on"
"mode-C-on"
"mode-S-on"
"mode-S-is-TCAS-I"
"emergency-on"
"flash-on"

These are GET attributes;
For IFF systems.
indirect-fire-weapon:weapon-name () Attribute "weapon-name"
In indirect fire gun systems.
jammer:allowed-postures () Attribute "allowed-postures"
In jammer emitter systems.
jammer:emitter-id () Attribute "emitter-id"
In jammer emitter systems.
jammer:is-jammer-on () Attribute "is-jammer-on"
In jammer emitter systems.
jammer:jammer-type () Attribute "jamming-type"
In jammer emitter systems.
jammer:jamming-range () Attribute "jamming-range"
In jammer emitter systems.
jammer:jamming-strength () Attribute "jamming-strength"
In jammer emitter systems.
laser-guided-launcher-controller:launched-missile-name () Attribute "launched-missile-name"
In laser guided launcher systems.
missile-launcher-controller:launched-missile-name () Attribute "launched-missile-name"
In missile launcher systems.
missile-launcher-controller:missile-passed-target () Attribute "passed-target"
In launcher systems for missiles.
move-along-controller:next-route-point-index () Attribute "next-route-point-index"
In all movement systems.
munition-launch-controller:cancel-launch () Attribute "cancel-launch"
Clears out attributes set for the launch of a munition.
munition-launch-controller:launch-munition () Attribute "launch-munition"
In launcher systems for munitions that execute programmed maneuvers, for example torpedoes and cruise missiles.
munition-launch-controller:launched-munition-name () Attribute "launched-munition-name"
In launcher systems for munitions that execute programmed maneuvers, for example torpedoes, cruise missiles, and ballistic missiles.
object-sensor:clear-types-to-detect () Attribute "clear-types-to-detect"
All sensors derived from the base object sensor, including signature object sensors.
object-sensor:get-sensor-offset-attribute () Attribute "sensor-offset"
object-sensor:types-to-detect-for-task () Attribute "types-to-detect-for-task"
All sensors derived from the base object sensor, including signature object sensors.
resupply-controller:resupply-range () Attribute "resupply-range"
In resupply systems.
resupply-controller:supplies-offered () Attribute "supplies-offered"
In resupply systems.
resupply-controller:supplying-mode () Attribute "supplying-mode"
In resupply systems.
rounds-per-trigger-pull () Attribute "rounds-per-trigger-pull"
In gun controllers.
scripted-movement-controller:animation-frame () Attribute "animation-frame"
In movement systems.
surface-entity-move-along-controller:current-min-turn-radius () Attribute "current-min-turn-radius"
In surface and subsurface movement systems.
surface-entity-move-along-controller:turn-radius-for-ordered-speed () Attribute "turn-radius-for-ordered-speed"
In surface and subsurface movement systems.
surface-entity-pilot-controller:ordered-speed () Attribute "ordered-speed"
In surface and subsurface movement systems.


Functions

aggregate-anti-air-controller:max-altitude ()
Attribute "max-altitude"
In guided weapon systems (using an AggregateAntiAirController).
Provides the maximum altitude of the missile.
aggregate-indirect-fire-controller:allowed-postures ()
Attribute "allowed-postures"
In aggregate indirect fire gun systems.
Gets the list of unit tactical postures in which the system is allowed to operated. Returns a comma- delimited string of posture names.
aggregate-release-bomb-controller:allowed-postures ()
Attribute "allowed-postures"
In aggregate weapon systems (using AggregateReleaseBombController or derivative; this includes cruise missiles, anti-air missiles, and torpedoes as well as bombs).
Gets the list of unit tactical postures in which the system is allowed to operated. Returns a comma- delimited string of posture names.
aggregate-release-bomb-controller:can-be-radar-jammed ()
Attribute "can-be-radar-jammed"
In aggregate weapon systems (using AggregateReleaseBombController or derivative; this includes cruise missiles, anti-air missiles, and torpedoes as well as bombs).
Indicates whether the weapons system can be jammed with a radar jammer.
aggregate-release-bomb-controller:jamming-defense-factor ()
Attribute "jamming-defense-factor"
In aggregate weapon systems (using AggregateReleaseBombController or derivative; this includes cruise missiles, anti-air missiles, and torpedoes as well as bombs).
Provides the "defense factor" of the weapon system against Radar jamming attacks. This is an indication of the level of sophistication of the guidance system. The value is dimensionless; it is compared against the jamming strength of an attacking jammer. If they have equal value, then the hit factor of this weapon will be reduced by 1/2.
aggregate-release-bomb-controller:max-range ()
Attribute "max-range"
In aggregate weapon systems (using AggregateReleaseBombController or derivative; this includes cruise missiles, anti-air missiles, and torpedoes as well as bombs).
Provides the maximum range of the weapon.
aggregate-release-bomb-controller:weapon-name ()
Attribute "weapon-name"
In aggregate weapon systems (using AggregateReleaseBombController or derivative; this includes cruise missiles, anti-air missiles, and torpedoes as well as bombs).
Gets the display name (a string) of this weapon system. This name is taken from the weapon-name parameter. It is the table key in the Indirect-Fire-Power table in the state properties of an aggregate entity.
aggregated-movement-actuator:blocking-obstacle ()
Attribute "blocking-obstacle"
Aggregated Movement Actuators.
This attribute provider returns the name of the engineering object obstacle in the aggregate's path and causing it to halt.
aggregated-movement-actuator:halt-movement-for-obstacles ()
Attribute "halt-movement-for-obstacles"
Aggregated Movement Actuators.
This Set attribute tells the actuator to halt or not halt when encountering new obstacle objects in its path.
aggregated-movement-actuator:is-halted ()
Attribute "is-halted"
Aggregated Movement Actuators.
This attribute provider returns whether or not the actuator is currently halted due to an engineering object obstacle in the aggregate's path.
aggregated-movement-actuator:obstacle-object-types ()
Attribute "obstacle-object-types"
Aggregated Movement Actuators.
This Set attribute updates the list of object types that the actuator should consider as obstacles that will potentially cause the aggregate to halt. The list of obstacles should be a comma separated string of object types. e.g. "1:17:1:0:62:2:0:0,1:20:1:0:62:1:0:0"
aggregated-movement-actuator:time-halted ()
Attribute "time-halted"
Aggregated Movement Actuators.
This attribute provider returns time at which the actuator halted due to an engineering object obstacle in the aggregate's path.
fixed-wing-gunnery-controller:aa-breakoff-range ()
Attribute "aa-breakoff-range"
In fixed wing aircraft gun systems.
Gets the range below which the aircraft is too close to engage another aircraft, and should break off the attack.
fixed-wing-gunnery-controller:aa-engage-range ()
Attribute "aa-engage-range"
In fixed wing aircraft gun systems.
Gets the range at which the aircraft can begin firing its guns when approaching another aircraft to attack.
fixed-wing-gunnery-controller:dive-angle ()
Attribute "dive-angle"
In fixed wing aircraft gun systems.
Gets the angle at which the aircraft should dive during the strafing run. A positive angle is a pitch down.
fixed-wing-gunnery-controller:entry-airspeed ()
Attribute "entry-airspeed"
In fixed wing aircraft gun systems.
Gets the airspeed at which a strafing run should begin.
fixed-wing-gunnery-controller:entry-altitude ()
Attribute "entry-altitude"
In fixed wing aircraft gun systems.
Gets the altitude at which a strafing run should begin.
fixed-wing-gunnery-controller:strafe-range ()
Attribute "strafe-range"
In fixed wing aircraft gun systems.
Gets the range at which the aircraft should begin firing the gun during a strafing attack.
fixed-wing-pilot-controller:max-thrust-acceleration ()
Attribute "max-thrust-acceleration"
In fixed-wing movement systems, for example fighters.
Gets the maximum thrust (a number) of the movement system.
iff-controller:IFF-mode-values ()
Includes these attributes:
"mode-1-code"
"mode-2-code"
"mode-3-code"

These are GET attributes;
For IFF systems. These attributes return an integer value.
iff-controller:IFF-modes-on ()
Includes these attributes:
"system-on"
"mode-1-on"
"mode-2-on"
"mode-3-on"
"mode-C-on"
"mode-S-on"
"mode-S-is-TCAS-I"
"emergency-on"
"flash-on"

These are GET attributes;
For IFF systems. These attributes all return true if the given mode is on.
indirect-fire-weapon:weapon-name ()
Attribute "weapon-name"
In indirect fire gun systems.
Gets the display name (a string) of this weapon system. This name can be used as a parameter to the indirect fire tasks ("ffe-..."), which require a weapon name.
jammer:allowed-postures ()
Attribute "allowed-postures"
In jammer emitter systems.
Gets the list of unit tactical postures in which the system is allowed to operated. Returns a comma- delimited string of posture names.
jammer:emitter-id ()
Attribute "emitter-id"
In jammer emitter systems.
Gets the emitter system ID of the jammer. Returns an integer.
jammer:is-jammer-on ()
Attribute "is-jammer-on"
In jammer emitter systems.
Indicates whether the jamming system is on (active). Returns a boolean that is true if the jammer is on.
jammer:jammer-type ()
Attribute "jamming-type"
In jammer emitter systems.
Gets the type of the jammer, e.g. "comms" or "radar". Returns a string.
jammer:jamming-range ()
Attribute "jamming-range"
In jammer emitter systems.
Gets the maximum range of the jammer. Returns a real value.
jammer:jamming-strength ()
Attribute "jamming-strength"
In jammer emitter systems.
Gets the strength of the jammer (maximum, i.e. at range 0). Returns a real value.
laser-guided-launcher-controller:launched-missile-name ()
Attribute "launched-missile-name"
In laser guided launcher systems.
Gets the name (a string) of the missile entity that was just created/launched by the launcher weapon system.
missile-launcher-controller:launched-missile-name ()
Attribute "launched-missile-name"
In missile launcher systems.
Gets the name (a string) of the missile entity that was just created/launched by the launcher weapon system.
missile-launcher-controller:missile-passed-target ()
Attribute "passed-target"
In launcher systems for missiles.
Gets a boolean specifying whether or not the last missile fired had passed its target
move-along-controller:next-route-point-index ()
Attribute "next-route-point-index"
In all movement systems.
Gets the index of the route point that the entity is currently moving toward.
munition-launch-controller:cancel-launch ()
Attribute "cancel-launch"
Clears out attributes set for the launch of a munition. Must be called before the munition is launched else this will have no effect
munition-launch-controller:launch-munition ()
Attribute "launch-munition"
In launcher systems for munitions that execute programmed maneuvers, for example torpedoes and cruise missiles.
This Set attribute is actually a command to launch the munition. If specified, the attribute value argument is the UUID of the target of the munition.
munition-launch-controller:launched-munition-name ()
Attribute "launched-munition-name"
In launcher systems for munitions that execute programmed maneuvers, for example torpedoes, cruise missiles, and ballistic missiles.
Gets the name (a string) of the munition entity that was just created/launched by the launcher weapon system.
object-sensor:clear-types-to-detect ()
Attribute "clear-types-to-detect"
All sensors derived from the base object sensor, including signature object sensors.
An attribute to set. When this attribute is set, it clears the dynamic list of object types that the sensor should look for. The value argument in the setAttribute call should not be left out, but the value is not used. This setAttribute should be called by a task that set a list of types to detect, when that task exits.
object-sensor:get-sensor-offset-attribute ()
Attribute "sensor-offset"
object-sensor:types-to-detect-for-task ()
Attribute "types-to-detect-for-task"
All sensors derived from the base object sensor, including signature object sensors.
An attribute to set. This attribute sets a list of object types in the sensor that the sensor should look for. The sensor looks for these types in addition to the types on its input port and in its descriptor. An object type is a set of 7 integers separated by colons, e.g. "1:1:0:1:0:0:0". The value of the attribute is a string, encoding a set of types as 8-tuples separated by commas, e.g. "1:1:0:1:0:0:0, 1:2:0:10:0:0:0".
resupply-controller:resupply-range ()
Attribute "resupply-range"
In resupply systems.
Gets the maximum range at which supplies can be provide, from the center of the supplying unit. Returns a real value.
resupply-controller:supplies-offered ()
Attribute "supplies-offered"
In resupply systems.
Gets a list of the supplies this system offers, and the rate at which each supply can be provided. Returns a table of supplies. The keys are the supply names, and the values are the rates (in units/sec).
resupply-controller:supplying-mode ()
Attribute "supplying-mode"
In resupply systems.
Gets the mode in which the system provides supplies: "ground-ground", "air-ground", or "air-air". Returns a string.
rounds-per-trigger-pull ()
Attribute "rounds-per-trigger-pull"
In gun controllers.
Gets the gun descriptor value indicating how many rounds are fire for each pull of the trigger. (Automatic weapons typically have a value greater than 1.) Returns an integer.
scripted-movement-controller:animation-frame ()
Attribute "animation-frame"
In movement systems.
Gets the current frame of the animation sequence being played.
surface-entity-move-along-controller:current-min-turn-radius ()
Attribute "current-min-turn-radius"
In surface and subsurface movement systems.
Gets the current minimum turn radius for the entity. This is computed from current speed and maximum lateral acceleration. It also considers the entity's minimum turn radius parameter.
surface-entity-move-along-controller:turn-radius-for-ordered-speed ()
Attribute "turn-radius-for-ordered-speed"
In surface and subsurface movement systems.
Gets the minimum turn radius for the entity given its ordered speed. Depends on maximum lateral acceleration; it also considers the entity's minimum turn radius and maximum speed parameters. This attribute is useful when planning a route that will be followed at the ordered speed, regardless of what the current entity speed is now.
surface-entity-pilot-controller:ordered-speed ()
Attribute "ordered-speed"
In surface and subsurface movement systems.
Gets the current ordered speed for movement tasks.

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