Jump to content

Recommended Posts

There is a bit of chatter about BIS_fnc_garage in the forums but not much to go on. It is "completely" unsupported at this time? Has anyone had any luck getting it to work in a useful fashion? Right now it populates the vehicle on your head which is pretty debilitating.

I love Arsenal and the Garage looks to be just as useful... minus the negative of killing you when your tank spawns on top of you.

Share this post


Link to post
Share on other sites
There is a bit of chatter about BIS_fnc_garage in the forums but not much to go on. It is "completely" unsupported at this time? Has anyone had any luck getting it to work in a useful fashion? Right now it populates the vehicle on your head which is pretty debilitating.

I love Arsenal and the Garage looks to be just as useful... minus the negative of killing you when your tank spawns on top of you.

There was another post a few minutes ago near the top,

you need to create an empty helipad named BIS_fnc_garage_center, or you can simply pass the variable name to the function when you want to call it, as shown below.

BIS_fnc_garage_center needs to be given an object of where you want your vehicles to be created.

this addaction ["<t color='#1C56D3'>Garage</t>",{
_pos = [ player, 30, getDir player ] call BIS_fnc_relPos;
BIS_fnc_garage_center = createVehicle [ "Land_HelipadEmpty_F", _pos, [], 0, "CAN_COLLIDE" ];
["Open",true] call BIS_fnc_garage;
}];

OR

this addaction ["<t color='#1C56D3'>Garage</t>",{
_pos = [ player, 30, getDir player ] call BIS_fnc_relPos;
spawnSpot = createVehicle [ "Land_HelipadEmpty_F", _pos, [], 0, "CAN_COLLIDE" ];
["Open",[ true, spawnSpot ]] call BIS_fnc_garage;
}];

Share this post


Link to post
Share on other sites

Nice... thanks.

Hope BIS polishes this one up and makes it useful (whitelist/blacklist, etc...)

Thanks Larrow... and Austin for the redirect.

Share this post


Link to post
Share on other sites
Hope BIS polishes this one up and makes it useful (whitelist/blacklist, etc...)

It may already do. I only quickly read though the garage function in the function viewer to see if it had something to set the position (which was quiet near the top ), there were other variables in there as well stored in mission/ui namespace, needs reading through to see what is available didnt really get to far into the ui part where all the selections happen.

Share this post


Link to post
Share on other sites

Getting there

//Open garage with vehicle spawn position
this addaction [ "<t color='#00FF00'>Garage</t>",{
_pos = [ player, 30, getDir player ] call BIS_fnc_relPos;
BIS_fnc_garage_center = createVehicle [ "Land_HelipadEmpty_F", _pos, [], 0, "CAN_COLLIDE" ];
["Open",true] call BIS_fnc_garage;
}, [], 1, true, true, "", "isNull cursortarget"];


//Open garage to edit vehicle your looking at
this addaction [ "<t color='#FF0000'>Edit Vehicle</t>",{
BIS_fnc_garage_center = cursorTarget;
uinamespace setvariable ["bis_fnc_garage_defaultClass", typeOf cursorTarget ];
["Open",true] call BIS_fnc_garage;
}, [], 1, true, true, "", "!( isNull cursortarget ) "];


//Open garage with custom vehicle list
this addaction [ "<t color='#0000FF'>CustomGarage</t>",{
BIS_fnc_garage_data = [
	[
		'\a3\soft_f\mrap_01\mrap_01_unarmed_f',
		[ ( configFile >> 'cfgVehicles' >> 'B_MRAP_01_F' ) ]
	]
];
_pos = [ player, 30, getDir player ] call BIS_fnc_relPos;
BIS_fnc_garage_center = createVehicle [ "Land_HelipadEmpty_F", _pos, [], 0, "CAN_COLLIDE" ];
["Open",true] call BIS_fnc_garage;
h = [] spawn {
	waitUntil { isNull ( uinamespace getvariable ["BIS_fnc_arsenal_cam",objnull] ) };
	BIS_fnc_garage_data = nil;
};
}, [], 1, true, true, "", "isNull cursortarget"];

Does as an rough example, need to do some fine tuning :D lol

Quick example for displaying only the vehicles of the players side in the garage

_allowCiv = false;

_vehicleData = [
//OPFOR
[
	[],	//CARS
	[],	//ARMOUR
	[],	//HELIS
	[],	//PLANES
	[],	//NAVAL
	[]	//STATICS
],
//BLUFOR
[	
	[],	//CARS
	[],	//ARMOUR
	[],	//HELIS
	[],	//PLANES
	[],	//NAVAL
	[]	//STATICS
],
//INDEPENDENT
[	
	[],	//CARS
	[],	//ARMOUR
	[],	//HELIS
	[],	//PLANES
	[],	//NAVAL
	[]	//STATICS
],
//CIVILIAN
[	
	[],	//CARS
	[],	//ARMOUR
	[],	//HELIS
	[],	//PLANES
	[],	//NAVAL
	[]	//STATICS
]
];


_vehicleDataTypes_enum = [
[ "car", "carx" ],
[ "tank", "tankx" ],
[ "helicopter", "helicopterx", "helicopterrtd" ],
[ "airplane", "airplanex" ],
[ "ship", "shipx", "sumbarinex" ]
];

_fnc_getVehicleDataTypeIndex = {
_type = toLower _this;
_return = -1;
{
	if ( _type in _x ) exitWith {
		_return = _forEachIndex;
	};
}forEach _vehicleDataTypes_enum;

_return
};

_defaultCrew = gettext (configfile >> "cfgvehicles" >> "all" >> "crew");
"
_cfgPath = _x;
_simulType = getText ( _cfgPath >> 'simulation' );
_simulIndex = _simulType call _fnc_getVehicleDataTypeIndex;
if ( ( tolower ( getText ( _cfgPath >> 'vehicleClass' ) ) isEqualTo 'static' ) ) then {
	_simulIndex = 5;
};

if ( getnumber (_cfgPath >> 'scope') == 2 && {gettext (_cfgPath >> 'crew') != _defaultCrew} && { _simulIndex >= 0 }  ) then {

	_side = getNumber ( _cfgPath >> 'side' );
	_model = getText ( _cfgPath >> 'model' );

	_sides = [ _side ];
	if ( _allowCiv && { _side isEqualTo 3 }  ) then {
		_sides = _sides + [ 0, 1, 2 ];
	};

	{

		_tmpSide = _vehicleData select _x;
		_tmpTypes = _tmpSide select _simulIndex;

		_index = ( _tmpTypes find _model );
		if ( _index >= 0 ) then {
			_index = _index + 1;
			( _tmpTypes select _index ) pushback _cfgPath;
		}else{
			_tmpTypes pushback _model;
			_tmpTypes pushback [ _cfgPath ];
		};
	}foreach _sides;

};

"configClasses ( configFile >> "CfgVehicles" );


player addAction [ "<t color='#0000FF'>Custom Garage</t>",{

BIS_fnc_garage_data = ( _this select 3 ) select ( side player call BIS_fnc_sideID );

_pos = [ player, 30, getDir player ] call BIS_fnc_relPos;
_spawnPos = createVehicle [ "Land_HelipadEmpty_F", _pos, [], 0, "CAN_COLLIDE" ];


[ "Open", [ true, _spawnPos ] ] call BIS_fnc_garage;

}, _vehicleData ];

Edited by Larrow

Share this post


Link to post
Share on other sites

That's superb Larrow.

 

 

I wonder, is it possible to disable the crew part of the UI?

 

Oh, and add fade to black, skip time and fade in when you close it?  :P

Share this post


Link to post
Share on other sites

I'm trying to make use of the solution @Larrow posted, specificly the one to edit vehicles. 

The only difference is that I'm trying to make it work for vehicles that are in a defined Area like "nearestObjects [[11782.3,2642.29],[],12.5]" for example.

Any chance someone can help ? 

Share this post


Link to post
Share on other sites

When i use

				_e = curatorSelected select 0 select 0;
				BIS_fnc_garage_center = _e;
				uinamespace setvariable ["bis_fnc_garage_defaultClass", typeOf _e];
				["Open",true] call BIS_fnc_garage;

in Debug Console in Multiplayer . After Closing the Garage, Chat inbox completely disappears .

Share this post


Link to post
Share on other sites
On 5/25/2015 at 11:50 PM, austin_medic said:

There was another post a few minutes ago near the top,

you need to create an empty helipad named BIS_fnc_garage_center, or you can simply pass the variable name to the function when you want to call it, as shown below.

Hey there!

helped me a lot, huge thanks,


but when I access the garage it seems like some vehicles are missing

I am a newbie in scripting and all but any help would be greatly appreciated.

Share this post


Link to post
Share on other sites
5 hours ago, Legion___ said:

some vehicles are missing

 

What vehicles?

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×