Difference between revisions of "User:Ceeeb/Sandbox"

From Bohemia Interactive Community
< Ceeeb
Jump to navigation Jump to search
Line 1: Line 1:
'''I'm working on figuring out the ArmA actions'''
gameLogic = a gamelogic. It seems any unit may initialize the action, irrespective of which unit it to feel the effects.
player = soldier.
= Syntax =
Parameters of scripting function 'action':
<object> action [<type>]
<object> action [<type>, <target>]
<object> action [<type>, <target>, additional parameters]
* unit = [[Object]]: pointer to the unit that should perform this action (if vehicle is given, its commander is used)
* type = [[String]]: name of action type - see below
* target = [[Object]]: target object
'''helicoptername action ["AUTOHOVER", helicoptername]'''
Toggles hovering on and off. (Only works if player is pilot)
<code>ChopperOne action ["AUTOHOVER", ChopperOne]</code>
'''["CANCELACTION", <target>]'''
unit1 action["cancelAction", unit2]
unit2 will not complete his action. note this may be useful as units seem to keep track of actions performed upon them that have not been completed, such as deactivateMine when no mine is around.
'''planename action ["CANCELLAND", planename]'''
Cancel autopilot landing for 'planename'.
<code>PlaneOne action ["CANCELLAND", PlaneOne]</code>
'''["CANCELTAKEFLAG", <target>]'''
'''unitname action ["DEACTIVATE", unit2, 0, 0, "PIPEBOMB"]'''
Soldier 'unitname' will deactivate a satchel charge that has been placed by unitname2.<br>
This happens from a distance (i.e. unitname will not walk up to the charge to deactivate it, but do it 'remotely').<br>
If unitname2 is nearby the charge when it is being deactivated it will end up back in its inventory.
<code>unit1 action ["DEACTIVATE", unit2, <object>]</code>
unit1 will play action animation, unit2 gets the satchel charge in their inventory. <object> = a live satchel charge.
'''["DEACTIVATEMINE", <target>]'''
unit1 action ["deactivateMine",unit2]
unit1 will bend down. Unit2 will deactivate the closest mine to his position within ~2m.
== DIARY ==
'''["DIARY", <target>]'''
cannot get this to do anything.
'''unitname action ["DROPMAGAZINE", (vehiclename or unitname) ,"MAGAZINENAME"]'''<br>
'''unitname action ["DROPWEAPON", (vehiclename or unitname) ,"WEAPONNAME"]''' ...drops weapon and ammo
Soldier 'unitname' will put a magazine or weapon ([[:Category: Weapons|see list]]) on the ground (Weaponholder) or into named vehicle (ammo box, car, etc.).
<code>SoldierOne action ["DROPMAGAZINE", CarOne, "AK74"]</code>
== EJECT ==
'''unitname action ["EJECT", vehiclename]'''
Soldier 'unitname' will jump out of 'vehiclename'. (Via parachute in case of planes & helicopters.)
<code>SoldierOne action ["EJECT", ChopperOne]</code>
'''unitname action ["ENGINEON", vehiclename]'''<br>
'''unitname action ["ENGINEOFF", vehicle1name]'''
Soldier 'unitname' will turn engine of 'vehiclename' either on or off.<br>
<code>SoldierOne action ["ENGINEON", ChopperOne]</code>
'''unitname action ["FIREINFLAME", firename]'''<br>
'''unitname action ["FIREPUTDOWN", firename]'''
Soldier 'unitname' will ignite ("FIREINFLAME") or extinguish ("FIREPUTDOWN") fireplace 'firename'.
<code>SoldierOne action ["FIREINFLAME", Fire1]</code>
'''["FLAPSUP", <target>]'''<br />
'''["FLAPSDOWN", <target>]'''
gameLogic action ["flapsDown",vehicle player]
AI pilots will instantly change flaps to what they think is suitable.
'''unitname action ["GETINCOMMANDER", vehiclename]'''<br />
'''unitname action ["GETINDRIVER", vehiclename]'''<br />
'''unitname action ["GETINGUNNER", vehiclename]'''<br />
'''unitname action ["GETINCARGO", vehiclename]'''<br />
'''unitname action ["GETINPILOT", vehiclename]'''
Soldier 'unitname' will be teleported next to 'vehiclename', play the entering animation, and then be assigned as either commander, driver or gunner.
<code>SoldierOne action ["GETINCOMMANDER", CarOne]</code>
== GETOUT ==
'''unitname action ["GETOUT", vehiclename]'''
Soldier 'unitname' will jump out of 'vehiclename'. (No parachute in case of planes & helicopters.)
<code>SoldierOne action ["GETOUT", ChopperOne]</code>
'''unitname action ["HANDGUNOFF", unitname]'''<br>
'''unitname action ["HANDGUNON", unitname]'''
Soldier 'unitname' will switch to primary ("handgun off") or secondary ("handgun on") weapon.
<code>SoldierOne action ["HANDGUNON", SoldierOne]</code>
== HEAL ==
'''unitname action ["HEAL", unitname2]'''
Medic 'unitname2' will teleport to 'unitname' and heal him.
<code>SoldierOne action ["HEAL", MedicOne]</code>
'''unitname action ["HIDEBODY", bodyname2]'''
Soldier 'unitname' will hide (bury) 'unitname2'.
<code>SoldierOne action ["HIDEBODY", SoldierTwo]</code>
Is soldierTwo deleted?
'''["INGAMEMENU", <target>]'''
Cant get this to work.
'''unitname action ["LADDERDOWN", building1]'''<br>
'''unitname action ["LADDERDOWN", object ID]'''<br>
'''unitname action ["LADDERUP", building1]'''<br>
'''unitname action ["LADDERUP", object ID]'''
Soldier 'unitname' will either climb up or down the ladder of a building that's either defined via name or object ID.
<code>SoldierOne action ["ladderup",object 123456]</code>
unit1 action ["ladderOnUp",waterTower,0,0]
Makes unit1 play the climb onto ladder animation, then appear on ladder 0 at position 0 on the object named waterTower. He then climbs to the top and gets off the ladder. Player will simply get on the ladder.
'''["LADDEROFF", <target>, <ladder index>]'''
player action ["ladderOFF",<anything?>]
makes player get on a non-existent ladder at his position if he happens to be in this state.
player action ["ladderOff",waterTower]
makes player get off any ladder on the waterTower object. The player will get off at his current location.
'''["LADDERONUP", <target>, <ladder index>, <ladder position>]'''<br />
'''["LADDERONDOWN", <target>, <ladder index>, <ladder position>]'''
player action ["ladderONDown",<anything?>]
makes player get on a non-existent ladder at his position.
player action ["ladderOnUp",waterTower,0,1]
Makes player get on a the top (position 1) of ladder index 0 on object named waterTower. This happens instantly over any distance. If AI is used, they will climb to the other end of the ladder and get off.
== LAND ==
'''["LAND", <target>]'''
<code>unit1 action ["LAND", PlaneOne]</code>
will toggle the landing autopilot.
'''planename action ["LANDGEAR", planename]'''
Either lowers or raises the landing gear on 'planename'.<br>
Only works if player is pilot.
<code>unit1 action ["LANDGEAR", PlaneOne]</code>
<code>unit1 action ["LANDGEARUP", PlaneOne]</code>
unit1 need not have any link to vehicle.
'''vehiclename action ["LIGHTON", vehiclename]'''<br>
'''vehiclename action ["LIGHTOFF", vehiclename]'''
Turns lights of 'vehiclename' either on or off.<br>
The lights will not stay ''on'' unless the driver is in SAFE or CARELESS mode.<br>
The lights will not stay ''off'' if the driver is in SAFE or CARELESS mode.
[[driver]] CarOne [[setBehaviour]] "safe";<br>
CarOne [[action]] ["LIGHTON", CarOne];
'''["LOADMAGAZINE", <target>, <magazine creator>, <magazine id>, <weapon name>, <muzzle name>]'''
player action ["LOADMAGAZINE", player, player, 19, 1, "ak74GL", "gp25muzzle"] - can't get this working
'''tankname action ["MANUALFIRE"]'''
Toggles manual fire mode if player is driver of vehicle.
<code>TankOne action ["MANUALFIRE"]</code>
unit1 action ["manualFire",vehicle unit2] - unit1 can be any unit.
'''["MarkEntity", <target>]'''
'''unitname action ["MOVETOCARGO", vehiclename]'''<br>
'''unitname action ["MOVETOCOMMANDER", vehiclename]'''<br>
'''unitname action ["MOVETODRIVER", vehiclename]'''<br>
'''unitname action ["MOVETOGUNNER", vehiclename]'''<br>
'''unitname action ["MOVETOPILOT", vehiclename]'''
Moves 'unitname' into cargo, commander, driver or gunner position.<br>
If that position was occupied before, the units will swap places.
<code>SoldierOne action ["MOVETODRIVER", CarOne]</code>
== NONE ==
'''["NONE", <target>]'''
'''unitname action ["NVGOGGLES", unitname]'''<br>
'''unitname action ["NVGOGGLESOFF", unitname]'''
Switch night vision goggles on/off for player.
<code>player action ["NVGOGGLES"]</code>
player action ["NVGOGGLES(OFF)",<anything>] - unit1 puts goggles on/off 2nd array element does nothing! AI will automatically put goggles on at night, but not take them off in day.
'''vehiclename action ["REARM", vehiclename2]'''
'''vehiclename action ["REFUEL", vehiclename2]'''
'''vehiclename action ["REPAIR", vehiclename2]'''
Vehiclename will receive weapons/fuel/repair from 'vehicle2' immediately and via teleportation.
<code>vehicle soldierOne action ["REARM", TruckOne]</code>
'''unitname action ["RETURNFLAG", flagname]'''
Soldier 'unitname' returns 'flagname' to base.
<code>SoldierOne action ["RETURNFLAG", FlagOne]</code>
unit2 action ["RETURNFLAG",testFlag] - unit plays action/pickup animation.
unit2 action ["RETURNFLAG", testFlag, testFlag setFlagOwner objNull] - Flag returns to pole, ArmA returns an error!
== SALUTE ==
'''unitname action ["SALUTE", unitname]'''
Soldier 'unitname' salutes, and stays in that animation.<br>
Only works in SAFE and CARELESS mode.
<code>SoldierOne action ["SALUTE", SoldierOne]</code>
'''unit2 action ["SALUTE", unit1] - makes unit1 salute. If in safe or careless mode, salute will be held, otherwise it is only momentary.
'''scudname action ["SCUD LAUNCH"]'''<br />
'''scudname action ["SCUD START"]'''<br />
'''scudname action ["SCUD CANCEL"]'''
Scudname launches or fires its missile.<br>
The launch process takes about 10.5 seconds.
<code>ScudOne action ["SCUD START"]</code>
No scud in ArmA.
'''unitname action ["SETTIMER"]'''
Soldier 'unitname' activates the timer for a satchel charge.<br>
Charge has to be places first via a unitname Fire ["pipebombmuzzle", "pipebombmuzzle", "pipebomb"] command.
<code>SoldierOne action ["SETTIMER"]</code>
unit2 action ["SETTIMER",unit1,<bombName>] - adds 30 seconds to the <bombName> countdown. unit1 and unit 2 need not have anything to do with the timebomb, nor be anywhere near it. bombname = nearestObject [bombSettingUnit,"timebomb"].
'''unitname action ["SITDOWN", unitname]'''
Soldier 'unitname' sits down.<br>
Only works in SAFE and CARELESS mode.
<code>SoldierOne action ["SITDOWN", SoldierOne]</code>
unit2 action ["SITDOWN",unit1] - unit2 does nothing (can be GL), unit1 sits down. If not safe or careless, will get straight back up.
'''unitname action ["STROKEFIST"]'''
Soldier 'unitname' performs a boxing animation.
<code>SoldierOne action ["STROKEFIST"]</code>
Can't get this to do anything. I assume this action is obsolete.
'''unitname action ["STROKEGUN"]'''
Soldier 'unitname' performs a hitting animation with his weapon.
<code>SoldierOne action ["STROKEGUN"]</code>
unit2 action ["StrokeGun",unit1] - unit2 does nothing, unit1 raises rifle to aim position if it is not already. I assume this action is obsolete.
'''["SWITCHWEAPON", <target>, <weapon index>]'''
unit2 action ["USEWEAPON",unit1,unit1,n] unit2 plays the pickup animation (can use a gamelogic). unit1 switches to the n index muzzle. Muzzle index seems to be related to order weapons are given to unit with addWeapon, 0-8 being the inherited class weapon muzzles (throw & put) although hard to predict and may include gaps??
'''unitname action ["TAKEFLAG", flag1]'''
Soldier 'unitname' takes control of 'flag1'.
<code>SoldierOne action ["TAKEFLAG", FlagOne]</code>
unit2 action ["TakeFLAG",testFlag] - Take flag from a pole only. Flag must belong to an enemy team to be taken. Unit must be very close to flagpole.
unit2 action ["TakeFLAG",testFlag,testFlag setFlagOwner unit2] - Flag is setFlagOwner to the unit. Any code at all may be entered into the 3rd array element! Returns an error!
'''unitname action ["TAKEMAGAZINE", (vehiclename or unitname), "MAGAZINENAME"]'''<br>
'''unitname action ["TAKEWEAPON", (vehiclename or unitname), "WEAPONNAME"]'''
Soldier 'unitname' takes one magazine/weapon of specified type ([[:Category: Weapons|see list]]) from  the ground (Weaponholder) or from named vehicle (ammo box, car, etc.).<br>
Transfer happens immediately and via teleportation. Unit1 plays pickup animation at its current position, no matter where 'weapon or magazine' is.
<code>SoldierOne action ["TAKEMAGAZINE", SoldierTwo, "RPGLAUNCHER"]</code>
'''["TAKEMINE", <target>]'''
unit1 action ["takeMine",unit2]
unit1 will bend down. Unit2 will take the closest mine to his position within ~2 meters.
== TALK ==
'''["TALK", <target>]'''
cant get it to do anything.
'''unitname action ["TOUCHOFF", unitname]'''
Soldier 'unitname' touches off satchel charge.
unit2 action ["TOUCHOFF", unit1] - unit1 does not have to do the action.
<code>unitname action ["TOUCHOFF", unitname]</code>
'''vehiclename action ["TURNIN", vehiclename]'''<br>
'''vehiclename action ["TURNOUT", vehiclename]'''
Crew of 'vehiclename' turns in/out (gets in and out of hatches).
<code>TankOne action ["TURNIN", TankOne]</code>
AI vehicles seem to want to immediately turn in.
'''["USEMAGAZINE", <target>, <magazine creator>, <magazine id>]'''
gameLogic action ["USEMAGAZINE", player, player,15,4] - cant get it to do anything?
== USER ==
'''["USER", <target>, <action index>]'''
gameLogic action ["USER", player, n] will execute the (n + 1)th custom (addAction) action in the players action list if it exists.
'''["USERTYPE", <target>, <action index>]'''
anyUnit action ["USERTYPE", player,n] will crash ArmA.
'''["USEWEAPON", <target vehicle>,<user of vehicle weapon>,<weapon index>]'''
unit2 action ["USEWEAPON",unit1,unit1,0] makes unit2 bend down as if dropping something, unit1 fire/use appropriate weapon if he is in a ready to fire stance? valid indexes seem to range from 0 to at least 16, depending on load carried by unit1. Strange fire effects seem to occur, eg pistol smoke fires from the rpg proxy (straight up?), rpg is readied but not fired, pistol fires from rifle proxy (rifle in hand). Different fire modes for rifle use different index. hand grenades seem to work perfectly. Weapon index seems to be related to order in which weapons are given to unit, 0-8 being the throw and put muzzles?? unit2 action ["useWeapon",truck,driver truck,0] makes a truck fire its horn.
'''unitname action ["WEAPONINHAND"]'''<br>
'''unitname action ["WEAPONONBACK"]'''
gameLogic action ["WEAPONonBack",unit1] - unit1 raises rifle. Assume animations are missing.
<!-- Here's the list with the correct syntaxes... everyone is called to update the stuff above!
["None", <target>]
["GetInCommander", <target>]
["GetInDriver", <target>]
["GetInGunner", <target>]
["GetInCargo", <target>]
["Heal", <target>]
["Repair", <target>]
["Refuel", <target>]
["Rearm", <target>]
["GetOut", <target>]
["LightOn", <target>]
["LightOff", <target>]
["EngineOn", <target>]
["EngineOff", <target>]
["SwitchWeapon", <target>, <weapon index>]
["UseWeapon", <target>, <weapon index>]
["LoadMagazine", <target>, <magazine creator>, <magazine id>, <weapon name>, <muzzle
["TakeWeapon", <target>, <weapon name>]
["TakeMagazine", <target>, <magazine type name>]
["TakeFlag", <target>]
["ReturnFlag", <target>]
["TurnIn", <target>]
["TurnOut", <target>]
["WeaponInHand", <target>, <weapon name>]
["WeaponOnBack", <target>, <weapon name>]
["SitDown", <target>]
["Land", <target>]
["CancelLand", <target>]
["Eject", <target>]
["MoveToDriver", <target>]
["MoveToGunner", <target>]
["MoveToCommander", <target>]
["MoveToCargo", <target>]
["HideBody", <target>]
["TouchOff", <target>]
["SetTimer", <target>]
["Deactivate", <target>]
["NVGoggles", <target>]
["ManualFire", <target>]
["AutoHover", <target>]
["StrokeFist", <target>]
["StrokeGun", <target>]
["LadderUp", <target>, <ladder index>, <ladder position>]
["LadderDown", <target>, <ladder index>, <ladder position>]
["LadderOnDown", <target>, <ladder index>, <ladder position>]
["LadderOnUp", <target>, <ladder index>, <ladder position>]
["LadderOff", <target>, <ladder index>]
["FireInflame", <target>]
["FirePutDown", <target>]
["LandGear", <target>]
["FlapsDown", <target>]
["FlapsUp", <target>]
["Salute", <target>]
["ScudLaunch", <target>]
["ScudStart", <target>]
["ScudCancel", <target>]
["User", <target>, <action index>]
["DropWeapon", <target>, <weapon name>]
["DropMagazine", <target>, <magazine type name>]
["UserType", <target>, <action index>]
["HandGunOn", <target>, <weapon name>]
["HandGunOff", <target>, <weapon name>]
["TakeMine", <target>]
["DeactivateMine", <target>]
["UseMagazine", <target>, <magazine creator>, <magazine id>]
["IngameMenu", <target>]
["CancelTakeFlag", <target>]
["CancelAction", <target>]
["MarkEntity", <target>]
["Talk", <target>]
["Diary", <target>]

Revision as of 05:24, 25 November 2007