VBS: Actions

From BISim Wiki
Jump to: navigation, search

Contents

Introduction

Actions are usually initiated in-game by the player, using the action menu or the command interface.
If these should be initiated from a script instead, the actions listed below can be executed via the action command, without requiring any player input.

Just like regular script commands, actions initiated this way can be performed on any unit, independently of its position, or its distance to the manipulated object (e.g. when arresting a unit via the CaptureUnit action, the arrested unit doesn't have to be within range of the arresting unit, but can be anywhere on the map).

If animations are associated with the performed action, only the "entry" animation will be executed (e.g. kneeling down to pick up a weapon). If an exit animation is required, an appropriate one has to be executed separately by the controlling script (e.g. unit playMove "AmovPercMstpSrasWrflDnon").

In cases where there is an initiating unit (the one preceding the action command, e.g. soldierOne action [...]), in addition to the performing unit (object in the argument array, e.g. soldierOne action ["takemine",soldierTwo]), these units can be different. The main purpose of doing this would be to suppress the animation played by the initiating unit, by making it a game logic.


General Syntax

unit action ["actionType", parameter(s)]

unit: Object. Can be a unit on foot, game logic, or an occupied vehicle.
"actionType": String. Action name. Not case sensitive.
parameter(s): Various data types, number and type dependent on the action used.


Actions

Animations

HandGunOn / HandGunOff

Description: Person will shoulder their rifle, and draw their handgun (or vice versa).

If the unit is in SAFE or CARELESS mode it will holster the handgun again right away, but rifle stays shouldered. Only works if the unit has a primary rifle.

Syntax: unit action ["HandGunOn", targetUnit]
  • unit - Person initiating the action.
  • targetUnit - Person who will ready their pistol.
Example: soldierOne action ["HandGunOn", soldierOne]

LadderDown / LadderUp

Description: Person will play an animation as if mounting the top (or bottom) of a ladder, then instantly teleport onto the specified ladder and position.

If the person is controlled by AI, they will automatically climb up or down the ladder, and then get off it.

Syntax: unit action ["LadderDown", targetObject, ladderNumber, positionNumber]
  • unit - Person doing the climbing.
  • targetObject - Object with a ladder.
  • ladderNumber - Number defining the desired ladder
  • positionNumber - Number defining the desired start position on the ladder (0 is normally the bottom of the ladder, and 1 the top). If a non-existing ladder number is specified, the unit will disappear.
Example: soldierOne action ["LadderDown", houseOne, 0, 1]

LadderOnDown / LadderOnUp

Description: Identical to LadderDown/LadderUp.

NVGoggles / NVGogglesOff

Description: Person will put its night-vision goggles on or off.

If unit is AI-controlled, it will revert right away back to its automatic usage, depending on the time of day.

Syntax: unit action ["NVGoggles", unit]
  • unit - Person to put its goggles on or off.
Example: player action ["NVGoggles", player]

PutWeaponOnBack

Description: Person will place its rifle on his back.

If armed with only a pistol, it will be briefly holstered, but then taken back out right away.

Syntax: unit action ["PutWeaponOnBack", unit]
  • unit - Person to put its weapon on its back.
Example: soldierOne action ["PutWeaponOnBack", soldierOne]

Salute

Description: Person will salute.

AI controlled units will only make a momentary salute, unless it is in safe or careless behaviour mode.

Syntax: unit action ["Salute", targetUnit]
  • unit - Person initiating the action.
  • targetUnit - Person to perform the salute.
Example: soldierOne action ["Salute", soldierOne]

SitDown

Description: Person will sit down on the ground if standing, or get up if already sitting.
Syntax: unit action ["SitDown", unit]
  • unit - Person who is sitting down.
Example: soldierOne action ["SitDown", soldierOne]

StrokeGun

Description: Person will raise its rifle.

AI-controlled units will only briefly perform the action, but then lower it again right away.

Syntax: unit action ["StrokeGun", unit]
  • unit - Person who will raise its weapon.
Example: soldierOne action ["StrokeGun", soldierOne]

WeaponInHand / WeaponOnBack

Description: Person will move his weapon from the safety position (lowered for rifles, holstered for handguns) to the raise position (or vice versa).

Change is persistent with player, but AI units will change back to suit their current behaviour mode. AI generally keep their rifles safe unless moving or targeting.
To circumvent this limitation, an animation can be played to have the AI perform different actions:

  • Shoulder rifle: "amovpercmstpsobkwrfldnon"
  • Hold rifle in safe (lowered) position: "amovpercmstpslowwrfldnon"

See also: fn vbs weapon on back

Syntax: unit action ["WeaponInHand", targetUnit]
  • 'unit' - Person initiating the action.
  • 'targetUnit' - Person who will raise its rifle.
Example: soldierOne action ["WeaponInHand", soldierOne]

Flags

CancelTakeFlag

Description: Cancels taking of a flag.

The unit will complete the taking/action animation, but the flag will remain attached to its current object. This action needs to be executed while the flag is being taken (which happens after the unit completes the taking/action animation) to prevent a unit taking the flag. For example, if a person is taking a flag from a flagpole, then the cancelTakeFlag action should be executed while the flag is descending the flagpole.

Syntax: unit action ["CancelTakeFlag", targetFlag]
  • unit - A unit that is currently taking a flag.
  • targetFlag' - A flag object.
Example: westSoldierOne action ["CancelTakeFlag", eastFlag]


ReturnFlag

Description: Person will kneel down, pick up a flag from a nearby dead person, and return it to its flagpole.
Syntax: unit action ["ReturnFlag", targetObject]
  • unit - Person to pick up the flag.
  • targetObject - Dead person with flag to be returned.
Example: soldierOne action ["ReturnFlag", westFlag]


TakeFlag

Description: Person will kneel down, and take control of the flag.

He must be close to the flagpole and it must belong to an enemy side.

Syntax: unit action ["TakeFlag", flag]
  • 'unit' - Person to take control of the flag.
  • 'flag' - Flag object to take control of.
Example: SoldierOne action ["TakeFlag", FlagOne]


Interactions

Explosives

Deactivate

Description: Person will kneel down, deactivate and take an active satchel charge.

To place a charge use unitname Fire ["pipebombmuzzle", "pipebombmuzzle", "pipebomb"].

(An IED cannot be disabled/disarmed via this action, but must be replaced by its inert counterpart, i.e. add "_disabled" to the class name.)

Syntax: unit action ["Deactivate", targetUnit, targetObject]
  • unit - Person initiating the action and performing the animation.
  • targetUnit - Person who will have the deactivated satchel charge added to its inventory.
  • targetObject - The armed satchel object to be deactivated (class "pipeBomb" or "timeBomb").
Examples: soldierOne action ["Deactivate", soldierOne, mySatchelCharge]
soldierOne action ["Deactivate", soldierOne, nearestObject [soldierOne, "pipeBomb"]]

DeactivateMine

Description: Person will kneel down, and deactivate any armed landmine that is within about two meters of it. The mine will stay at its location, but placed in a tilted position.
Syntax: unit action ["DeactivateMine", targetUnit]
  • unit - Person initiating the action and performing the animation.
  • targetUnit - The closest landmine to this unit will be deactivated.
Example: soldierOne action ["DeactivateMine", soldierOne]

SetTimer/StartTimer

Description: Person will set the timer on a satchel charge to 30 seconds.

If a timer is already set, this will increase the countdown time by 30 seconds. This action can be performed upon a satchel object from any distance. To place a charge use unitname Fire ["pipebombmuzzle", "pipebombmuzzle", "pipebomb"].

Syntax: unit action ["SetTimer", unit, bombObject]
  • unit - Person activating the timer.
  • bombObject - Satchel charge whose timer is set.
Example: soldierOne action ["SetTimer", soldierOne, nearestObject [soldierOne, "pipeBomb"]]

TakeMine

Description: Person will kneel down, take the closest mine (within a radius of about 2m), and put it in its inventory.
Syntax: unit action ["TakeMine", targetUnit]
  • unit - Person initiating the action and performing the animation.
  • 'targetUnit' - Person will receive the mine closest to him.
Example: gameLogic action ["TakeMine",soldierOne]

TouchOff

Description: Person will kneel down, and detonate the nearest (within 300m) satchel charge(s).

See also: setAmmoTimer

Syntax: unit action ["TouchOff", targetUnit]
  • 'unit' - Person activating the action, and performing the animation.
  • 'targetUnit' - Person whose nearest satchel will be detonated.
Example: soldierOne action ["TouchOff", soldierOne]

Fireplaces

FireInFlame / FirePutDown

Description: Ignites or extinguishes a fireplace object (from any distance).
Syntax: unit action ["FireInFlame", targetObject]
  • unit - Person initiating the action.
  • targetObject - Fireplace to be ignited/extinguished.
Example: soldierOne action ["FireInFlame", firePlaceOne]

Supplies

Rearm

Description: An occupied vehicle or person will kneel down, and resupply its ammo/magazines from any object with some ammoCargo.

The rearming vehicle/person can be any distance from the rearming object. Rearming vehicles takes some time and will be interrupted if the vehicle starts to move.

Syntax: unit action ["Rearm", reamingObject]
  • unit - Person or occupied vehicle to be rearmed.
  • rearmingObject - Object from which to rearm.
Examples: tankOne action ["Rearm", ammoTruckOne]
soldierOne action ["Rearm", ammoTruckOne]

Refuel

Description: An occupied vehicle will refuel from any object with some fuelCargo (generally a refueling truck).

The refueling object can be any distance from the vehicle. Refueling takes some time and will be interrupted if the vehicle starts to move.

Syntax: vehicle action ["Refuel", refuelingObject]
  • vehicle - Occupied vehicle to be refueled.
  • refuelingObject - Object from which to refuel.
Example: tankOne action ["Refuel", refuelTruckOne]

Repair

Description: An occupied vehicle will be repaired by an object with some repairCargo (generally a repair truck).

The repair truck can be any distance from the vehicle. Repairing takes some time and will be interrupted if the vehicle starts to move.

Syntax: vehicle action ["Repair", repairingObject]
  • vehicle - Occupied vehicle to be repaired.
  • repairingObject - Object by which vehicle is being repaired.
Example: tankOne action ["Repair", repairTruckOne]


Units

CaptureUnit

Description: Person will have his hands tied behind his back, and join the capturing unit's group.

If the captured unit was armed, it will drop its weapons onto the ground. The captured unit's captive status will be true, and its captiveNum will be 8. This action can be performed upon a target unit from any distance.

Syntax: unit action ["CaptureUnit", target]
  • unit - Person that is arresting target.
  • target - Person being arrested.
Example: westSoldierOne action ["CaptureUnit", opfor1]

Heal

Description: Instantly teleports a unit to the target medic, to be healed.

If the target unit is not a medic, the animations will still be played, but no healing occurs. If the medic is within a vehicle, no teleporting will occur and the wounded unit will only be healed if they are already within healing range (a few meters).

Syntax: unit action ["Heal", targetUnit]
  • unit - Person that is to be healed.
  • targetUnit Medic doing the healing.
Example: soldierOne action ["Heal", medicOne]

HideBody

Description: Person will kneel down and hide (bury) a body in the ground.

The body is automatically deleted within a few seconds. The person performing the action can be at any distance from the body. If the action is applied to a still living unit, the hiding will only happen when that unit dies.

Syntax: unit action ["HideBody", targetUnit]
  • unit - Person burying the body.
  • targetUnit - Dead person to be buried.
Example: soldierOne action ["HideBody", soldierTwo]

User Actions

CancelAction

Description: Cancels an action in progress.

The target unit will complete its current animation, although the action itself will not be performed.

Syntax: unit action ["CancelAction", targetUnit]
  • unit - Person initiating the action.
  • targetUnit - Person whose current action will be cancelled.
Example: soldierOne action ["CancelAction", soldierOne]

TeamSwitch

Description: Opens the team-switch dialog, to allow switching into another playable unit. Only works in single-player.
Syntax: player action ["TeamSwitch", player]
Team-switch dialog for player will be opened.
Example: player action ["TeamSwitch", player]

User

Description: Person will execute an action added via [[addAction].
Syntax: unit action ["User", targetUnit, actionID]
  • 'unit' - Person initiating the action.
  • 'targetUnit' - Person who will execute the action.
  • actionID - Action index as retured by addAction.
Example: gameLogic action ["User", soldierOne, 2]


Vehicles

Actions

AutoHover

Description: Toggles auto-hovering on and off (V1.40: Only turns auto-hovering ON.).

Will only affect player-controlled vehicles.

Syntax: activato action ["AutoHover", targetVehicle]
  • unit - Person initiating the action.
  • targetVehicle - Vehicle whose auto-hovering will be turned on.
Example: player action ["AutoHover", vehicle player]

Land / CancelLand

Description: Turns autopilot landing for an aircraft on or off, including AI controlled aircraft. The aircraft will land at the closest airfield.
Syntax: unit action ["Land", targetVehicle]
  • unit - Person initiating the action.
  • targetVehicle Vehicle to perform an autopilot landing.
Example: (driver planeOne) action ["Land", planeOne]

ManualFire / ManualFireCancel

Description: Enables/disables manual fire mode for a player unit that is driver or commander of a vehicle.
Syntax: unit action ["ManualFire", targetVehicle]
  • unit - Person initiating the action.
  • targetVehicle - Vehicle whose manual fire mode is being enabled/disabled.
Example: player action ["ManualFire", vehicle player]

Equipment

EngineOn / EngineOff

Description: Turns a vehicle's engine on or off.
Syntax: unit action ["EngineOn", targetVehicle]
  • unit - Person initiating the action.
  • targetVehicle - Vehicle whose engine is turned on or off.
Example: soldierOne action ["EngineOn", vehicle soldierOne]

FlapsUp / FlapsDown

Description: Adjusts an aircraft's flaps to the highest or lowest position.

Only has an effect on player-controlled planes.

Syntax: unit action ["FlapsUp", targetVehicle]
  • unit - Person initiating the action.
  • targetVehicle - Aircraft to have its flaps adjusted.
Example: player action ["FlapsUp", harrierOne]

LandGear / LandGearUp

Description: Lowers (or raises) the landing gear of an aircraft.

Only works on player-controlled or landed aircraft.

Syntax: unit action ["LandGear", targetVehicle]
  • unit - Person initiating the action.
  • targetVehicle - Vehicle to have its landing gear lowered/raised.
Example: planeOne action ["LandGear", planeOne]

LightOff / LightOn

Description: Turns the headlights of an empty vehicle on or off.

If the vehicle is AI-controlled (either as the lone driver, or as the commander/gunner) then the light status depends on the AI's behaviour mode ("combat" or "stealth" = lights off, any other mode = lights on).
See also: setVehicleLights.

Syntax: unit action ["LightOff", targetVehicle]
  • unit - Person initiating the action.
  • targetVehicle - Vehicle whose lights are turned on/off.
Example: player action ["LightOff", vehicle player]

MarkerLightsOff / MarkerLightsOn

Description: Turns an aircraft's marker lights on/off.
Syntax: unit action ["MarkerLightsOff", targetVehicle]
  • unit - Person initiating the action.
  • targetVehicle - Aircraft whose marker lights are turned on/off.
Example: (driver heli1) action ["MarkerLightsOff", heli1]

scudLaunch

Description: Raises the missile of a Scud vehicle (e.g. X SCUD-B TEL).
(Scud vehicles must have certain model properties set, in order to qualify as one.)
The status of this or the other scud actions can be checked via the scudState command.
In order for scud actions to work, the target vehicle must be manned.
Syntax: targetVehicle action ["scudLaunch", targetVehicle]
  • targetVehicle - Vehicle (manned) with Scud missile.
Example: scud1 action ["scudLaunch", scud1]

scudStart

Description: Scud missile will take off from the vehicle.
If this command is executed without the previous scudLaunch action, the missile will be moved to the raised position immediately, and then take off.
The missile will fly straight up into the sky, and then disappear (i.e. it will not land or detonate anywhere).
Syntax: targetVehicle action ["scudStart", targetVehicle]
  • targetVehicle - Vehicle with Scud missile.
Example: scud1 action ["scudStart", scud1]

scudCancel

Description: Lowers a raised Scud missile back onto the vehicle.
Syntax: targetVehicle action ["scudCancel", targetVehicle]
  • targetVehicle - Vehicle with Scud missile.
Example: scud1 action ["scudCancel", scud1]

Crew

Eject

Description: Person will eject from his current vehicle via parachute.

If the unit was the driver, then the vehicle will stop (or crash, in case of an aircraft). If case the vehicle wasn't airborne, the parachute will be destroyed immediately.
Units that aren't unassigned from the ejected vehicle will try to re-board it immediately. This action has a global effect when used on a local unit in multiplayer.
See also: fn_vbs_unitCanEject

Syntax: unit action ["Eject", vehicle]
  • unit - Person to be ejected.
  • vehicle - Vehicle unit is ejected from.
Example: soldierOne action ["Eject", vehicle soldierOne]

GetInCargo

Description: Instantly moves a person (who is not already in a vehicle) to the appropriate boarding position of the vehicle; after which he attempts to board the vehicle as cargo, either at the cargo position specified, or in the first available position.

If the specified position is already occupied, the person will board in the first available cargo position. If the all cargo positions are already occupied by living persons, or no cargo position exists, the boarding will fail.

Syntax: unit action ["GetInCargo", targetVehicle]
unit action ["GetInCargo", targetVehicle, positionNumber]
  • unit - Person to board vehicle.
  • targetVehicle - Vehicle to be boarded.
  • positionNumber - Cargo position index.
Examples: soldierOne action ["GetInCargo", truckOne]
soldierOne action ["GetInCargo", truckOne, 0]

GetInCommander

GetInDriver/GetInPilot

GetInGunner

Description: Instantly moves a person (who is not already in a vehicle) to the appropriate boarding position of a vehicle; after which he attempts to board the vehicle.

The boarding will fail if the position is already occupied or does not exist.

Syntax: unit action ["GetInCommander", targetVehicle]
  • unit - Person to board vehicle.
  • targetVehicle - Vehicle to be boarded.
Example: soldierOne action ["GetInCommander", tankOne]

GetInTurret

Description: Instantly moves a person (who is not already in a vehicle) to the appropriate boarding position of a vehicle, after which he attempts to board the vehicle as the specified turret user.

If the turret position is already occupied by another living person the boarding will fail. If the turret position does not exist, VBS2 may crash.

Syntax: unit action ["GetInTurret", targetVehicle, turretArray]
  • unit - Person to board vehicle.
  • targetVehicle - Vehicle to be boarded.
  • turretArray - Turret path (array) defining the turret. For example, [1] would be a vehicle's second turret, and [0, 2, 1] is the second turret of the third turret of the first turret. A vehicle's turret order is defined in its class CfgVehicles of the Config.
Examples: gunnerTwo action ["GETINTURRET", myUH60MG, [1]]
tankCommanderOne action ["GetInTurret", myT72, [0,1]]

GetOut

Description: Person will disembark from a vehicle (without a parachute in case of an aircraft).

Units that aren't unassigned from the ejected vehicle will try to re-board it immediately.

Syntax: unit action ["GetOut", targetVehicle]
  • unit - Person to disembark.
  • targetVehicle - Vehicle to disembark from.
Example: soldierOne action ["GetOut", carOne]

MoveToCargo

Description: Moves a unit to the chosen cargo position within a vehicle.

If another unit is already in that position, the units will swap positions. (possibly alternate syntax to place unit in first empty cargo position?)

Syntax: unit action ["MoveToCargo", targetVehicle, cargoPosition]
  • unit - Person to move to vehicle's cargo position.
  • targetVehicle - Vehicle unit is changing positions in.
  • cargoPosition - Cargo index to occupy.
Example: player action ["MoveToCargo", vehicle player, 2]

MoveToCommander

MoveToDriver/MoveToPilot

MoveToGunner

Description: Moves a unit to the respective position within a vehicle.

If another unit is already in that position, the units will swap positions. (MoveToDriver & MoveToPilot are identical.)

Syntax: unit action ["MoveToCommander", targetVehicle]
  • unit - Person to move to specified vehicle position.
  • targetVehicle - Vehicle unit is changing positions in.
Example: player action ["MoveToCommander", vehicle player]

MoveToTurret

Description: Moves a unit to the chosen turret position within a vehicle.

If another unit is already in that position, the units will swap positions.

Syntax: unit action ["MoveToTurret", targetVehicle, turretPath]
  • unit - Person to move to vehicle's turret position.
  • targetVehicle - Vehicle unit is changing positions in.
  • turretPath - Array defining to the desired turret position (for example, [0,1,2] refers to the third turret of the second turret of the first turret of the vehicle).
Examples: player action ["MoveToTurret", vehicle player, [0]]
player action ["MoveToTurret", vehicle player, [0,1]]

QuickEnterVehicle

Description: Player will enter a vehicle at the first free position (priority: driver, gunner, cargo).
Syntax: player action ["QuickEnterVehicle", targetVehicle]
  • player - Only works for player.
  • targetVehicle - Vehicle to be entered.
Example: player action ["QuickEnterVehicle", carOne]

TurnIn / TurnOut

Description: Person will get in and out of vehicle hatches.

Only works on AI commanders or players; other AI units' turned out status will be controlled by their behavior mode.

Syntax: unit action ["TurnIn", vehicle]
  • 'unit' - Person who will get in or out of the hatch.
  • 'vehicle' - Vehicle unit is in.
Example: soldierOne action ["TurnIn", tankOne]

Weapons / Magazines

DropMagazine (PutMagazine)

Description: Person will kneel down, and transfer the specified magazine either into another unit or vehicle, or onto the ground (creating a WeaponHolder object).

Magazines can be dropped into other units at any distance.

Syntax: unit action ["DropMagazine", receiver, "magazine"]
  • unit - Person initiating the action and performing the animation.
  • receiver - Person or vehicle who will have the magazine added to its inventory. If same as unit then magazine will be placed on the ground.
  • "magazine" - Class name (string) of the magazine to be dropped.
Examples: soldierOne action ["DropMagazine", soldierOne, "30Rnd_545x39_AK"]
soldierOne action ["DropMagazine", ammoCrateOne, "30Rnd_545x39_AK"]


DropWeapon (PutWeapon)

Description: Person will kneel down, and transfer the specified weapon and all associated magazines either into another unit or vehicle, or onto the ground (creating a WeaponHolder object).

Weapons can be dropped into other units at any distance.

Syntax: unit action ["DropWeapon", receiver, "weaponName"]
  • unit - Person initiating the action and performing the animation.
  • receiver - Person or vehicle who will have the weapon added to its inventory. If same as unit then weapon will be placed on the ground.
  • "weaponName" - Class name (string) of the weapon to be dropped.
Examples: soldierOne action ["DropWeapon", soldierOne, "AK74GL"]
soldierOne action ["DropWeapon", ammoCrateOne, "RPG7V"]


SwitchMagazine (SwitchWeapon)

Description: Person (infantry unit or vehicle gunner) will switch to the given firing mode/muzzle index.

The index is a combination of the available firing modes for all weapons the unit possesses (e.g. if both, the primary and the secondary weapon have modes "Single" & "Auto" available, selecting mode 2 would activate "Single" mode on the secondary weapon.) After the weapons, binoculars & NVGs are the available indices.
The list of firing modes only contains the weapons that are in the configuration of a unit. While the list updates when a weapon is dropped, weapons added during runtime (either via script, or by the unit picking it up) are not added to the index list, and can therefore not be selected via this action.
To change the muzzle used, it is better to use selectWeapon instead.
See also: setWeaponMode, selectWeapon, loadMagazine

Syntax: unit action ["SwitchMagazine", targetVehicle, targetUnit, mode]
  • unit - Person initiating the action.
  • targetVehicle - Vehicle or Person whose magazine selection is changed.
  • targetUnit - Person whose magazine selection is changed (same as targetVehicle for infantry units.
  • mode - Index of the firing mode/muzzle to use.
Example: gameLogic action ["SwitchMagazine", unit1, unit1, 3]

gameLogic action ["SwitchMagazine",tank1,gunner tank1,1]

TakeMagazine

Description: Person will kneel down, and take one of the specified magazines from another unit, vehicle or ammo crate.

Can be executed over any distance.

Syntax: unit action ["TakeMagazine", source, magazine]
  • 'unit' - Person to take the magazine.
  • 'magazine' - Class name of magazine to take.
  • 'source' - Person, vehicle or ammo crate to take magazine from.
Example: SoldierOne action ["TakeMagazine", SoldierTwo, "vbs2_mag_15rnd_9x19_Ball_berettaM9"]


TakeWeapon

Description: Person will kneel down, and take the specified weapon (inluding any compatible magazines) from another unit, vehicle or weapon crate.

Can be executed over any distance.

Syntax: unit action ["TakeWeapon", source, weapon]
  • 'unit' - Person taking the weapon.
  • 'magazine' - Class name of weapon to take.
  • 'source' - Person, vehicle or weapon crate to take weapon from.
Example: SoldierOne action ["TakeWeapon", SoldierTwo, "NVGoggles"]


UseWeapon

Description: One unit will kneel down, and the other one will fire the current weapon.
Does not work if weapons were switched, and requires a second unit (or GameLogic) to play the (inappropriate) animation.
Better to use "DefaultAction" setAction 1 or fire.
Syntax: gamelogic action ["UseWeapon", vehicle, unit, index]
  • 'gamelogic' - Should be GameLogic or different unit from one that's shooting (will kneel down).
  • 'vehicle' - Vehicle of firing unit, or firing unit itself.
  • 'unit' - Person firing the weapon.
  • 'index' - Index of weapon to fire (similar to SwitchMagazine).
Example: gLogic action ["UseWeapon", SoldierOne, SoldierOne, 1]
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox