BIS fnc garage: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "bis_fnc_" to "BIS_fnc_")
m (Text replacement - "(Optional, default {{hl|[]}})" to "(Optional, default <sqf inline>[]</sqf>)")
 
(26 intermediate revisions by 2 users not shown)
Line 6: Line 6:
|gr1= Vehicles
|gr1= Vehicles


|descr= Splendid Virtual Arsenal Garage<br><br>
|gr2= Broken Functions


'''Modes''':
|descr= Splendid&trade; Virtual Arsenal Garage.
*"Open" - Open the Arsenal
**0 (Optional): BOOL - true to open full Arsenal, with all categories and items available (default: false)


|s1= [mode,params] call [[BIS_fnc_garage]]
|s1= [mode, params] call [[BIS_fnc_garage]]


|p1= [mode,params]: [[Array]]
|p1= mode: [[String]] - (Optional, default "Open") '''case-sensitive'''. Can be "Open"; other cases are for internal use


|p2= mode: [[String]]
|p2= params: [[Anything]] - (Optional, default <sqf inline>[]</sqf>) depending on ''mode'', can be:
 
* "Open": [fullGarage, garageCentre]
|p3= params: [[Anything]]
** fullGarage: [[Boolean]] - (Optional, default [[false]])
** garageCentre: [[Object]] - (Optional, default [[objNull]]) the garage centre as vehicle; will be deleted on opening


|r1= [[Nothing]]
|r1= [[Nothing]]


|x1= <code>["Open",true] [[call]] BIS_fnc_garage;</code>
|x1= <sqf>[] call BIS_fnc_garage;</sqf>


|x2= <code>[[Magic Variables#this_2|this]] [[addAction]] ["Open Garage",{
|x2= <sqf>
player addAction ["Open Garage", {


  //Create a position 30 meters infront of the player
  // 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
// 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"];


[ "Open", [[true]] <nowiki>]</nowiki> [[call]] [[BIS_fnc_garage]];  
["Open", true] call BIS_fnc_garage;
}];
}];
</code>
</sqf>


|x3= <code>[[Magic Variables#this_2|this]] [[addAction]] ["Open Garage",{
|x3= <sqf>
player addAction ["Open Garage", {


  //Create a position 30 meters infront of the player
  // 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
// 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
// pass created vehicle to function for use as position
["Open",[ [[true]], _vehicle ]<nowiki>]</nowiki> [[call]] [[BIS_fnc_garage]];  
["Open", [true, _vehicle]] call BIS_fnc_garage;
}];
}];
</code>
</sqf>


|seealso= [[Arsenal]]
|seealso= [[BIS_fnc_arsenal]] [[Arsenal]]
}}
}}


<dl class="command_description">
{{Note
 
|user= Larrow
<dt></dt>
|timestamp= 20150531070900
<dd class="notedate">Posted on May 31, 2015 - 07:09 (UTC)</dd>
|text= Available namespace variables
<dt class="note">[[User:Larrow|Larrow]]</dt>
<sqf>missionNamespace
<dd class="note">Available namespace variables
BIS_fnc_arsenal_center // copy of BIS_fnc_garage_center
<code>missionNamespace
BIS_fnc_arsenal_fullGarage // holds param 1 of "open" statement
BIS_fnc_arsenal_center //copy of BIS_fnc_garage_center
BIS_fnc_arsenal_group // Group spawned vehicle is created in, default players group
BIS_fnc_arsenal_fullGarage //holds param 1 of "open" statement
BIS_fnc_arsenal_type // --- 0 - Arsenal, 1 - Garage
BIS_fnc_arsenal_group //Group spawned vehicle is created in, default players group
BIS_fnc_garage_center // Hold a reference to an OBJECT of where to spawn selected garage vehicle
BIS_fnc_arsenal_type //--- 0 - Arsenal, 1 - Garage
BIS_fnc_garage_centerType // ? // default selected vehicle model from config
BIS_fnc_garage_center //Hold a reference to an OBJECT of where to spawn selected garage vehicle
BIS_fnc_garage_data // Array of vehicles for garage tabs - see below
BIS_fnc_garage_centerType ?//default selected vehicle model from config
BIS_fnc_garage_turretPaths // ? // []
BIS_fnc_garage_data //Array of vehicles for garage tabs - see below
BIS_fnc_garage_turretPaths ? []


uiNamespace
uiNamespace
BIS_fnc_arsenal_cam //null if arsenal is not open else holds reference to arsenal display
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 //Default class to display
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
BIS_fnc_garage_stats // min and max values of config ["maxspeed","armor","fuelcapacity","threat"] of cfgVehicles >> crew
</code>
</sqf>


Available scripted eventHandlers
Available scripted eventHandlers
<code><nowiki>//[ namespace event is stored in, event name, passed variables ]
<sqf>
[ missionnamespace, "garageOpened", [ _display, _toggleSpace ] ]
// [namespace event is stored in, event name, passed variables]
[ missionNamespace, "garageClosed", [ displaynull, uinamespace getvariable [ "BIS_fnc_arsenal_toggleSpace", false ] ] ]
[missionNamespace, "garageOpened", [_display, _toggleSpace]]
</nowiki></code>
[missionNamespace, "garageClosed", [displayNull, uiNamespace getVariable ["BIS_fnc_arsenal_toggleSpace", false]]]
</sqf>


Structure of BIS_fnc_garage_data
Structure of BIS_fnc_garage_data
<code><nowiki>BIS_fnc_garage_data = [
<sqf>
//CARS
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 paths of classes that use above model
[
[
config.bin/CfgVehicles/C_Offroad_01_F,
config.bin/CfgVehicles/C_Offroad_01_F,
Line 97: Line 98:
]
]
],
],
[], //ARMOR
[], // ARMOR
[], //HELIS
[], // HELIS
[], //PLANES
[], // PLANES
[], //NAVAL
[], // NAVAL
[] //STATICS
[] // STATICS
]
]
</nowiki></code>
</sqf>
 
}}
</dd>


<dt><dt>
{{Note
<dd class="notedate">Posted on May 1, 2018 - 14:40 (UTC)</dd>
|user= .kju
<dt class="note">[[User:.kju|.kju]]</dt>
|timestamp= 20180501144000
<dd class="note">
|text= The above overview isn't fully correct:
The above overview isn't fully correct:


# BIS_fnc_garage_centerType returns by default the model path of the "default class" <code>gettext (configfile >> "cfgvehicles" >> _classDefault >> "model")</code> yet once a vehicle is selected it returns its class name.
# BIS_fnc_garage_centerType returns by default the model path of the "default class" <sqf>getText (configFile >> "cfgvehicles" >> _classDefault >> "model")</sqf> 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_center returns by default the player reference, yet otherwise the created vehicle object
</dd>
}}
 
</dl>

Latest revision as of 18:09, 8 November 2023

Hover & click on the images for description

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:
  • "Open": [fullGarage, garageCentre]
    • fullGarage: Boolean - (Optional, default false)
    • garageCentre: Object - (Optional, default objNull) the garage centre as vehicle; will be deleted on opening
Return Value:
Nothing

Examples

Example 1:
[] call BIS_fnc_garage;
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
Larrow - c
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_data
BIS_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 ]
.kju - c
Posted on May 01, 2018 - 14:40 (UTC)
The above overview isn't fully correct:
  1. BIS_fnc_garage_centerType returns by default the model path of the "default class"
    getText (configFile >> "cfgvehicles" >> _classDefault >> "model")
    yet once a vehicle is selected it returns its class name.
  2. BIS_fnc_garage_center returns by default the player reference, yet otherwise the created vehicle object