-
Notifications
You must be signed in to change notification settings - Fork 24
/
SQF-EventHandlerSnippets.sublime-completions
33 lines (32 loc) · 9.52 KB
/
SQF-EventHandlerSnippets.sublime-completions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
{
"scope": "source.sqf",
"completions":
[
{ "trigger": "AnimChanged (Event handler snippet)", "contents": "addEventHandler [\"AnimChanged\", {\n _unit = arg(0); // object, event owner\n _anim = arg(1); // string, anim name, name of the /States anim class\n $1\n}];\n" },
{ "trigger": "AnimDone (Event handler snippet)", "contents": "addEventHandler [\"AnimDone\", {\n _unit = arg(0); // object, event owner\n _anim = arg(1); // string, anim name\n $1\n}];\n" },
{ "trigger": "AnimStateChanged (Event handler snippet)", "contents": "addEventHandler [\"AnimStateChanged\", {\n _unit = arg(0); // object, event owner\n _anim = arg(1); // string, anim name\n $1\n}];\n" },
{ "trigger": "Dammaged (Event handler snippet)", "contents": "addEventHandler [\"Dammaged\", {\n _unit = arg(0); // object, event owner\n _selection = arg(1); // string, selection name\n _damage = arg(2); // number, damage done\n $1\n}];\n" },
{ "trigger": "Engine (Event handler snippet)", "contents": "addEventHandler [\"Engine\", {\n _vehicle = arg(0); // object, event owner\n _engineState = arg(1); // bool, true/false when the engine is turned on/off\n $1\n}];\n" },
{ "trigger": "Fired (Event handler snippet)", "contents": "addEventHandler [\"Fired\", {\n _unit = arg(0); // object, event owner\n _weapon = arg(1); // string, weapon that was used\n _muzzle = arg(2); // string, muzzle that was used\n _mode = arg(3); // string, fire mode that was used\n _ammo = arg(4); // string, ammo that was used\n _magazine = arg(5); // string, magazine that was used\n _projectile = arg(6); // object of ammo class, projectile, namely: bullet, missile, etc.,\n $1\n}];\n" },
{ "trigger": "FiredNear (Event handler snippet)", "contents": "addEventHandler [\"FiredNear\", {\n _unit = arg(0); // object, event owner\n _firer = arg(1); // object, object which fires a weapon near the unit\n _distance = arg(2); // number, distance in meters between the unit and firer (max. distance ~69m)\n _weapon = arg(3); // string, fired weapon\n _muzzle = arg(4); // string, muzzle that was used\n _mode = arg(5); // string, current mode of the fired weapon\n _ammo = arg(6); // string, ammo used\n $1\n}];\n" },
{ "trigger": "Fuel (Event handler snippet)", "contents": "addEventHandler [\"Fuel\", {\n _vehicle = arg(0); // object, event owner\n _fuelState = arg(1); // boolean, 0 when no fuel, 1 when the fuel tank is full\n $1\n}];\n" },
{ "trigger": "Gear (Event handler snippet)", "contents": "addEventHandler [\"Gear\", {\n _vehicle = arg(0); // object, event owner\n _gearState = arg(1); // boolean, true when the gear is lowered, false when retracted\n $1\n}];\n" },
{ "trigger": "GetIn (Event handler snippet)", "contents": "addEventHandler [\"GetIn\", {\n _vehicle = arg(0); // object, event owner\n _position = arg(1); // string, can be either \"driver\", \"gunner\", \"commander\" or \"cargo\"\n _unit = arg(2); // object, unit that entered the vehicle\n $1\n}];\n" },
{ "trigger": "GetOut (Event handler snippet)", "contents": "addEventHandler [\"GetOut\", {\n _vehicle = arg(0); // object, event owner\n _position = arg(1); // string, can be either \"driver\", \"gunner\", \"commander\" or \"cargo\"\n _unit = arg(2); // object, unit that leaved the vehicle\n $1\n}];\n" },
{ "trigger": "HandleDamage (Event handler snippet)", "contents": "addEventHandler [\"HandleDamage\", {\n _unit = arg(0); // object, event owner\n _selection = arg(1); // string, name of the selection where the unit was damaged.\n // \"\" for over-all structural damage,\n // \"?\" for unknown selections.\n _damage = arg(2); // number, resulting level of damage for the selection.\n _source = arg(3); // object, the source unit that caused the damage.\n _projectile = arg(4); // string, classname of the projectile that caused inflicted the damage. (\"\" for unknown, such as falling damage.)\n $1\n}];\n" },
{ "trigger": "HandleHeal (Event handler snippet)", "contents": "addEventHandler [\"HandleHeal\", {\n _unit = arg(0); // object, event owner\n _healer = arg(1); // object, person, who acting as a medic\n _healerCanHeal = arg(2); // boolean, true when healer is corpsman\n $1\n}];\n" },
{ "trigger": "Hit (Event handler snippet)", "contents": "addEventHandler [\"Hit\", {\n _unit = arg(0); // object, event owner\n _causedBy = arg(1); // object, object that caused the damage.\n // contains the unit itself in case of collisions.\n _damage = arg(2); // number, level of damage caused by the hit\n $1\n}];\n" },
{ "trigger": "HitPart (Event handler snippet)", "contents": "addEventHandler [\"HitPart\", {\n _target = arg(0); // object, event owner, object that got injured/damaged.\n _shooter = arg(1); // object, unit that inflicted the damage. If injured by a vehicle impact or a fall the target itself is returned, or, in case of explosions, the null object. In case of explosives that were planted by someone (e.g. satchel charges), that unit is returned.\n _bullet = arg(2); // object, object that was fired.\n _position = arg(3); // position3D, position the bullet impacted (ASL).\n _velocity = arg(4); // vector3d, speed vector at which bullet impacted.\n _selection = arg(5); // array, list of strings with named selection of the object that were hit.\n _ammo = arg(6); // array, ammo info: [hit value, indirect hit value, indirect hit range, explosive damage, ammo class name] OR, if there is no shot object: [impulse value on object collided with,0,0,0]\n _direction = arg(7); // vector3d, vector that is orthogonal (perpendicular) to the surface struck. For example, if a wall was hit, vector would be pointing out of the wall at a 90 degree angle.\n _radius = arg(8); // number, radius (size) of component hit.\n _surface = arg(9); // string, surface type struck.\n _direct = arg(10); // boolean, true if object was directly hit, false if it was hit by indirect/splash damage.\n $1\n}];\n" },
{ "trigger": "Init (Event handler snippet)", "contents": "addEventHandler [\"Init\", {\n _unit = arg(0); // object, event owner, the created object\n $1\n}];\n" },
{ "trigger": "IncomingMissile (Event handler snippet)", "contents": "addEventHandler [\"IncomingMissile\", {\n _unit = arg(0); // object, object the event handler is assigned to\n _ammo = arg(1); // string, ammo type that was fired on the unit\n _whoFired = arg(2); // object, object that fired the weapon\n $1\n}];\n" },
{ "trigger": "Killed (Event handler snippet)", "contents": "addEventHandler [\"Killed\", {\n _unit = arg(0); // object, event owner\n _killer = arg(1); // object, object that killed the unit,\n // contains the unit itself in case of collisions.\n $1\n}];\n" },
{ "trigger": "LandedTouchDown (Event handler snippet)", "contents": "addEventHandler [\"LandedTouchDown\", {\n _plane = arg(0); // object, event owner\n _airportID = arg(1); // number, ID of the airport (-1 for anything else).\n $1\n}];\n" },
{ "trigger": "LandedStopped (Event handler snippet)", "contents": "addEventHandler [\"LandedStopped\", {\n _plane = arg(0); // object, event owner\n _airportID = arg(1); // number, ID of the airport (-1 for anything else).\n $1\n}];\n" },
{ "trigger": "Respawn (Event handler snippet)", "contents": "addEventHandler [\"Respawn\", {\n _unit = arg(0); // object, event owner\n _corpse = arg(1); // object, object the event handler was assigned to, aka the corpse/unit player was previously controlling.\n $1\n}];\n" },
{ "trigger": "WeaponAssembled (Event handler snippet)", "contents": "addEventHandler [\"WeaponAssembled\", {\n _unit = arg(0); // object, event owner\n _weapon = arg(1); // object, object of the assembled weapon.\n $1\n}];\n" },
{ "trigger": "WeaponDisassembled (Event handler snippet)", "contents": "addEventHandler [\"WeaponDisassembled\", {\n _unit = arg(0); // object, event owner\n _primaryBag = arg(1); // object, first backpack object which was weapon dissasembled into...\n _secondaryBag = arg(2); // object, second backpack object which was weapon dissasembled into...\n $1\n}];\n" },
{ "trigger": "MPHit (Event handler snippet)", "contents": "addEventHandler [\"MPHit\", {\n _unit = arg(0); // object, event owner\n _causedBy = arg(1); // object, object that caused the damage. Contains the\n // unit itself in case of collisions.\n _damage = arg(2); // number, Level of damage caused by the hit\n $1\n}];\n" },
{ "trigger": "MPKilled (Event handler snippet)", "contents": "addEventHandler [\"MPKilled\", {\n _unit = arg(0); // object, event owner\n _killer = arg(1); // object, object that killed the unit. Contains the\n // unit itself in case of collisions.\n $1\n}];\n" },
{ "trigger": "MPRespawn (Event handler snippet)", "contents": "addEventHandler [\"MPRespawn\", {\n _unit = arg(0); // object, event owner\n _corpse = arg(1); // object, object the event handler was assigned to,\n // aka the corpse/unit player was previously controlling.\n $1\n}];\n" }
]
}