Global Mobilization Script Snippets: Difference between revisions
Line 124: | Line 124: | ||
[this,'gm_beacons_org',true] call gm_core_vehicles_fnc_beaconSwitch | [this,'gm_beacons_org',true] call gm_core_vehicles_fnc_beaconSwitch | ||
</sqf> | </sqf> | ||
<sqf> | |||
[this,'',true] call gm_core_vehicles_fnc_beaconSwitch | |||
</sqf> | |||
<sqf inline>true</sqf> for on, <sqf inline>false</sqf> for off. | <sqf inline>true</sqf> for on, <sqf inline>false</sqf> for off. | ||
<sqf inline>gm_beacons_org</sqf> for the orange one, and <sqf inline>gm_beacons_blu</sqf> for blue. | <sqf inline>gm_beacons_org</sqf> for the orange one, and <sqf inline>gm_beacons_blu</sqf> for blue. Leave it empty <sqf inline>''</sqf> as secondary method. | ||
To toggle beacons on a car via script: (also possible gm_beacons_orn on vehicles with orange beacon lights). | To toggle beacons on a car via script: (also possible gm_beacons_orn on vehicles with orange beacon lights). | ||
Line 142: | Line 147: | ||
Sirens off: | Sirens off: | ||
<sqf inline>[this,'CustomSoundController1',0,0.4] remoteExec ['BIS_fnc_setCustomSoundController'];</sqf> | <sqf inline>[this,'CustomSoundController1',0,0.4] remoteExec ['BIS_fnc_setCustomSoundController'];</sqf> | ||
== Use the teletype effect from the Campaign Intro == | == Use the teletype effect from the Campaign Intro == |
Revision as of 16:29, 30 April 2023
This page serves as a place to collect all smaller known script snippets (and other tricks) related to using the content of Global Mobilization
Destroy specific chunks of a house
Use this code on an invisible object nearby the house. chunk_01_hp to chunk_11_hp. But most homes only have 3-4 chunks.
Extend a vehicle's large antenna
To lower it again, set the second parameter from 1 to 0. If you want to have a slow assembly/disassembly animation, omit the last parameter that is set to true in this example.
Close the XSW-30 target searchlight on the Leopard tanks
Set the second parameter to 1 to open it again. Warning: This doesn't affect the searchlight functionality. It will shine through closed doors.
Open doors and hatches on a vehicle
// animate the M113's main rear hatch:
All doors and hatches in GM follow a unified naming standard:
<type>_<row>_<side>_source
A list of most commonly found doors and hatches:
hatch_1_1_source
hatch_1_2_source
hatch_2_1_source
hatch_2_2_source
door_1_1_source
door_1_2_source
door_2_1_source
door_2_2_source
It varies per asset, so you may have to try a few combinations until you find the right animation.
Set a vehicle's tactical sign
The syntax of the large array:
0: Pre-Icon Number
1: Pre-Icon Number Font
2: Tactical Symbol
3: Post Icon Number
4: Post Icon Number Font
For available tactical symbols browse:
"gm_tacticalSign_nato_armored"
"gm_tacticalSign_nato_armoredEngineer"
"gm_tacticalSign_nato_armoredRecon"
"gm_tacticalSign_nato_artillery"
GM flags present on a flagpole
Place an existing flagpole, and write the following into the init-field of this object:
The following flags are available from within GM:
gm_flag_au_co.paa
gm_flag_be_co.paa
gm_flag_bu_co.paa
gm_flag_ca_co.paa
gm_flag_cs_co.paa
gm_flag_cz_co.paa
gm_flag_dk_co.paa
gm_flag_fi_co.paa
gm_flag_fr_co.paa
gm_flag_gc_co.paa
gm_flag_ge_co.paa
gm_flag_gr_co.paa
gm_flag_hu_co.paa
gm_flag_ic_co.paa
gm_flag_it_co.paa
gm_flag_lu_co.paa
gm_flag_nato_co.paa
gm_flag_nl_co.paa
gm_flag_no_co.paa
gm_flag_pl_co.paa
gm_flag_po_co.paa
gm_flag_ro_co.paa
gm_flag_se_co.paa
gm_flag_sp_co.paa
gm_flag_tu_co.paa
gm_flag_uk_co.paa
gm_flag_ur_co.paa
gm_flag_us_co.paa
They are assigned via the NATO 2-Letter Nation code from STANAG 1059 7th Edition.
Find the 9th edition (which differs) here: https://en.wikipedia.org/wiki/List_of_NATO_country_codes
GE = West Germany GC = East Germany
Toggle vehicle beacons and sirens
gm_beacons_org for the orange one, and gm_beacons_blu for blue. Leave it empty '' as secondary method.
To toggle beacons on a car via script: (also possible gm_beacons_orn on vehicles with orange beacon lights).
Toggle on: [this,'gm_beacons_blu',true] call gm_core_vehicles_fnc_beaconSwitch
Toggle off: [this,'gm_beacons_blu',false] call gm_core_vehicles_fnc_beaconSwitch
Sirens on: [this,'CustomSoundController1',1,0.2] remoteExec ['BIS_fnc_setCustomSoundController'];
Sirens off: [this,'CustomSoundController1',0,0.4] remoteExec ['BIS_fnc_setCustomSoundController'];
Use the teletype effect from the Campaign Intro
1) Include this in your description.ext in class RscTitles
"\gm\gm_missions\gm_campaign_01\missions\gm_campaign_intro.gm_weferlingen_summer\resources.inc"
2)
Include this in CfgSounds:
class gm_teletype_stroke_01
{
name = "";
titles[] = {};
sound[] = { "@gm\gm_missions\gm_campaign_01\missions\gm_campaign_intro.gm_weferlingen_summer\sounds\gm_teletype_stroke_01.ogg", 3, 1, 100};
};
class gm_teletype_stroke_02 : gm_teletype_stroke_01
{
sound[] = { "@gm\gm_missions\gm_campaign_01\missions\gm_campaign_intro.gm_weferlingen_summer\sounds\gm_teletype_stroke_01.ogg", 3, 0.98, 100};
};
class gm_teletype_stroke_03 : gm_teletype_stroke_01
{
sound[] = { "@gm\gm_missions\gm_campaign_01\missions\gm_campaign_intro.gm_weferlingen_summer\sounds\gm_teletype_stroke_01.ogg", 3, 1.02, 100};
};
3) Create script called typeText.sqf.
4) Call the script via "My Text Is This" execVM "typeText.sqf". You can also make it a function and spawn it.
Using the @ character in the input text will cause a line break.
Add helmet camo to any unit
player linkItem "gm_hmd_foliage_summer_grass_01"
You can use these types:
gm_hmd_foliage_summer_grass_01
gm_hmd_foliage_summer_grass_02
gm_hmd_foliage_summer_grass_03
gm_hmd_foliage_summer_grass_04
gm_hmd_foliage_autumn_grass_01
gm_hmd_foliage_autumn_grass_02
gm_hmd_foliage_autumn_grass_03
gm_hmd_foliage_autumn_grass_04
gm_hmd_foliage_summer_forest_01
gm_hmd_foliage_summer_forest_02
gm_hmd_foliage_summer_forest_03
gm_hmd_foliage_summer_forest_04
Eject parachutists out of a vehicle
Inside "On Activation" of a waypoint for the plane (not the squad to jump out!)
Mi-2Ch Smoke Generator control
Turn On: [this] call gm_countermeasures_fnc_engine_smoke_toggle
Turn Off: [this, true] call gm_countermeasures_fnc_engine_smoke_toggle
Override Bridge Laying Restrictions
If you want to override the red indicator and deploy/pickup the bridge regardless:
Start a bridge deployment
[yourBridgeLayer] spawn gm_core_vehicles_fnc_bridge_deploy;
Once activated you can force the process into the next phase of actively deploying it via the above mentioned lines:
There may be side effects from forcing the deployment in an unsuitable location though.
Spawn a bridgelayer without bridge
Nuclear Warhead for the 2P16 Luna
To quickly change the 2P16 over to the nuclear missile use the following code to circumvent the long reload time the missile otherwise would have:
myLuna is the given variable name of the vehicle. You can use this instead when pasting this into the vehicle's init line.
Searchlight Guard Towers
To easily turn the BT-6 and BT-11 guard towers in functioning towers that scan with search lights, raise alarm and shoot flares:
Paste this code into your init.sqf:
Then go around the map in Weferlingen and place the Guard Tower Mission Context object gm_missionHelper_guardtower near any of the guard towers you wish to equip.