BIS fnc garage: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "<code> *([^<|{]*) *<\/code>" to "<sqf>$1</sqf>") |
Lou Montana (talk | contribs) m (Text replacement - "\{\{ *cc*\| *([^}]+) *\}\}" to "// $1") |
||
Line 25: | Line 25: | ||
|x2= <code>player addAction ["Open Garage", { | |x2= <code>player addAction ["Open Garage", { | ||
// create a position 30 meters infront of the player | |||
_pos = player getPos [30,getDir player]; | _pos = player getPos [30,getDir player]; | ||
// create empty helipad at the position and save it in the global variable BIS_fnc_garage_center | |||
BIS_fnc_garage_center = createVehicle ["Land_HelipadEmpty_F", _pos, [], 0, "CAN_COLLIDE"]; | BIS_fnc_garage_center = createVehicle ["Land_HelipadEmpty_F", _pos, [], 0, "CAN_COLLIDE"]; | ||
Line 37: | Line 37: | ||
|x3= <code>[[player]] [[addAction]] ["Open Garage", { | |x3= <code>[[player]] [[addAction]] ["Open Garage", { | ||
// create a position 30 meters infront of the player | |||
_pos = [[player]] [[getPos]] [30, [[getDir]] [[player]]]; | _pos = [[player]] [[getPos]] [30, [[getDir]] [[player]]]; | ||
// create empty helipad at the position | |||
_vehicle = [[createVehicle]] [ "Land_HelipadEmpty_F", _pos, [], 0, "CAN_COLLIDE"]; | _vehicle = [[createVehicle]] [ "Land_HelipadEmpty_F", _pos, [], 0, "CAN_COLLIDE"]; | ||
// pass created vehicle to function for use as position | |||
["Open", [<nowiki/>[[true]], _vehicle]] [[call]] [[BIS_fnc_garage]]; | ["Open", [<nowiki/>[[true]], _vehicle]] [[call]] [[BIS_fnc_garage]]; | ||
}]; | }]; | ||
Line 56: | Line 56: | ||
|text= Available namespace variables | |text= Available namespace variables | ||
<code>missionNamespace | <code>missionNamespace | ||
BIS_fnc_arsenal_center | BIS_fnc_arsenal_center // copy of BIS_fnc_garage_center | ||
BIS_fnc_arsenal_fullGarage | BIS_fnc_arsenal_fullGarage // holds param 1 of "open" statement | ||
BIS_fnc_arsenal_group | BIS_fnc_arsenal_group // Group spawned vehicle is created in, default players group | ||
BIS_fnc_arsenal_type | BIS_fnc_arsenal_type // --- 0 - Arsenal, 1 - Garage | ||
BIS_fnc_garage_center | BIS_fnc_garage_center // Hold a reference to an OBJECT of where to spawn selected garage vehicle | ||
BIS_fnc_garage_centerType ? | BIS_fnc_garage_centerType ? // default selected vehicle model from config | ||
BIS_fnc_garage_data | BIS_fnc_garage_data // Array of vehicles for garage tabs - see below | ||
BIS_fnc_garage_turretPaths ? | BIS_fnc_garage_turretPaths ? // [] | ||
uiNamespace | uiNamespace | ||
BIS_fnc_arsenal_cam | BIS_fnc_arsenal_cam // null if arsenal is not open else holds reference to arsenal display | ||
BIS_fnc_arsenal_toggleSpace ? | BIS_fnc_arsenal_toggleSpace ? | ||
BIS_fnc_garage_defaultClass | BIS_fnc_garage_defaultClass // Default class to display | ||
BIS_fnc_garage_stats | BIS_fnc_garage_stats // min and max values of config ["maxspeed","armor","fuelcapacity","threat"] of cfgVehicles >> crew | ||
</code> | </code> | ||
Available scripted eventHandlers | Available scripted eventHandlers | ||
<code> | <code>// [namespace event is stored in, event name, passed variables] | ||
[<nowiki/>[[missionNamespace]], "garageOpened", [_display, _toggleSpace]] | [<nowiki/>[[missionNamespace]], "garageOpened", [_display, _toggleSpace]] | ||
[<nowiki/>[[missionNamespace]], "garageClosed", [<nowiki/>[[displayNull]], [[uiNamespace]] [[getVariable]] ["BIS_fnc_arsenal_toggleSpace", [[false]]]]] | [<nowiki/>[[missionNamespace]], "garageClosed", [<nowiki/>[[displayNull]], [[uiNamespace]] [[getVariable]] ["BIS_fnc_arsenal_toggleSpace", [[false]]]]] | ||
Line 80: | Line 80: | ||
Structure of BIS_fnc_garage_data | Structure of BIS_fnc_garage_data | ||
<code>BIS_fnc_garage_data = [ | <code>BIS_fnc_garage_data = [ | ||
// CARS | |||
[ | [ | ||
//model | //model | ||
"\a3\soft_f\offroad_01\offroad_01_unarmed_f", | "\a3\soft_f\offroad_01\offroad_01_unarmed_f", | ||
// config paths of classes that use above model | |||
[ | [ | ||
config.bin/CfgVehicles/C_Offroad_01_F, | config.bin/CfgVehicles/C_Offroad_01_F, | ||
Line 94: | Line 94: | ||
] | ] | ||
], | ], | ||
[], | [], // ARMOR | ||
[], | [], // HELIS | ||
[], | [], // PLANES | ||
[], | [], // NAVAL | ||
[] | [] // STATICS | ||
] | ] | ||
</code> | </code> |
Revision as of 11:02, 13 July 2022
Description
- Description:
- Splendid™ Virtual Arsenal Garage.
- Execution:
- call
- Groups:
- VehiclesBroken Functions
Syntax
- Syntax:
- [mode, params] call BIS_fnc_garage
- Parameters:
- mode: String - (Optional, default "Open") case-sensitive. Can be "Open"; other cases are for internal use
- params: Anything - (Optional, default []) depending on mode, can be:
- Return Value:
- Nothing
Examples
- Example 1:
- Example 2:
player addAction ["Open Garage", { // create a position 30 meters infront of the player _pos = player getPos [30,getDir player]; // create empty helipad at the position and save it in the global variable BIS_fnc_garage_center BIS_fnc_garage_center = createVehicle ["Land_HelipadEmpty_F", _pos, [], 0, "CAN_COLLIDE"]; ["Open", true] call BIS_fnc_garage; }];
- Example 3:
player addAction ["Open Garage", { // create a position 30 meters infront of the player _pos = player getPos [30, getDir player]; // create empty helipad at the position _vehicle = createVehicle [ "Land_HelipadEmpty_F", _pos, [], 0, "CAN_COLLIDE"]; // pass created vehicle to function for use as position ["Open", [true, _vehicle]] call BIS_fnc_garage; }];
Additional Information
- See also:
- BIS_fnc_arsenal Arsenal
Notes
-
Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note
- Posted on May 31, 2015 - 07:09 (UTC)
-
Available namespace variables
missionNamespace BIS_fnc_arsenal_center // copy of BIS_fnc_garage_center BIS_fnc_arsenal_fullGarage // holds param 1 of "open" statement BIS_fnc_arsenal_group // Group spawned vehicle is created in, default players group BIS_fnc_arsenal_type // --- 0 - Arsenal, 1 - Garage BIS_fnc_garage_center // Hold a reference to an OBJECT of where to spawn selected garage vehicle BIS_fnc_garage_centerType ? // default selected vehicle model from config BIS_fnc_garage_data // Array of vehicles for garage tabs - see below BIS_fnc_garage_turretPaths ? // [] uiNamespace BIS_fnc_arsenal_cam // null if arsenal is not open else holds reference to arsenal display BIS_fnc_arsenal_toggleSpace ? BIS_fnc_garage_defaultClass // Default class to display BIS_fnc_garage_stats // min and max values of config ["maxspeed","armor","fuelcapacity","threat"] of cfgVehicles >> crew
Available scripted eventHandlers// [namespace event is stored in, event name, passed variables] [missionNamespace, "garageOpened", [_display, _toggleSpace]] [missionNamespace, "garageClosed", [displayNull, uiNamespace getVariable ["BIS_fnc_arsenal_toggleSpace", false]]]
Structure of BIS_fnc_garage_dataBIS_fnc_garage_data = [ // CARS [ //model "\a3\soft_f\offroad_01\offroad_01_unarmed_f", // config paths of classes that use above model [ config.bin/CfgVehicles/C_Offroad_01_F, config.bin/CfgVehicles/B_G_Offroad_01_F ], "\a3\soft_f\mrap_02\mrap_02_gmg_f", [ config.bin/CfgVehicles/O_MRAP_02_gmg_F ] ], [], // ARMOR [], // HELIS [], // PLANES [], // NAVAL [] // STATICS ]
- Posted on May 01, 2018 - 14:40 (UTC)
-
The above overview isn't fully correct:
- BIS_fnc_garage_centerType returns by default the model path of the "default class" yet once a vehicle is selected it returns its class name.
- BIS_fnc_garage_center returns by default the player reference, yet otherwise the created vehicle object
- BIS_fnc_garage_centerType returns by default the model path of the "default class"