Jump to content
gc8

Garage custom vehicles

Recommended Posts

Hi

I'm trying to use the garage but can't make it show custom vehicle list. This is what I tried:

_vehicle = createVehicle [ "Land_HelipadEmpty_F", getmarkerpos "laRochelle", [], 0, "CAN_COLLIDE" ]; 
BIS_fnc_garage_center = _vehicle;

BIS_fnc_garage_data = [
    //CARS
    [
        //model
        "\a3\soft_f\offroad_01\offroad_01_unarmed_f",
        //config paths of classes that use above model
        [
         ( configFile >> 'cfgVehicles' >> 'C_Offroad_01_F' ),
         ( configFile >> 'cfgVehicles' >> 'B_G_Offroad_01_F' )

        ],
        "\a3\soft_f\mrap_02\mrap_02_gmg_f",
        [
            ( configFile >> 'cfgVehicles' >> 'O_MRAP_02_gmg_F' )
        ]
    ],
    [],        //ARMOR
    [],        //HELIS
    [],        //PLANES
    [],        //NAVAL
    []        //STATICS
];


["Open",false] call BIS_fnc_garage;

 

Any ideas what's wrong?

 

thx!

Share this post


Link to post
Share on other sites

A lot has changed with Arsenal/Garage since I wrote that snippet. I really do not feel like going through all the code again to work out why, but this should be enough to force it to work.

_vehicle = createVehicle [ "Land_HelipadEmpty_F", screenToWorld[ 0.5, 0.5 ], [], 0, "CAN_COLLIDE" ]; 
BIS_fnc_garage_center = _vehicle;

[ missionNamespace, "garageOpened", {
	params[ "_display", "_toggleSpace" ];
	
	missionNamespace setVariable [ "bis_fnc_garage_data", [
	    //CARS
	    [
	        //model
	        "\a3\soft_f\offroad_01\offroad_01_unarmed_f",
	        //config paths of classes that use above model
	        [
	         ( configFile >> 'cfgVehicles' >> 'C_Offroad_01_F' ),
	         ( configFile >> 'cfgVehicles' >> 'B_G_Offroad_01_F' )

	        ],
	        "\a3\soft_f\mrap_02\mrap_02_gmg_f",
	        [
	            ( configFile >> 'cfgVehicles' >> 'O_MRAP_02_gmg_F' )
	        ]
	    ],
	    [],        //ARMOR
	    [],        //HELIS
	    [],        //PLANES
	    [],        //NAVAL
	    []        //STATICS
	] ];
		
	{
		lbClear ( _display displayctrl (960 + _forEachIndex));
	}forEach bis_fnc_garage_data;
	
	missionNamespace setVariable [ "bis_fnc_garage_centerType", "\a3\soft_f\offroad_01\offroad_01_unarmed_f" ]; //Make first car in data default selection, LB are sorted once data has been added so not first car in garage list
	
	["ListAdd",[_display]] call BIS_fnc_garage;
	
}] call BIS_fnc_addScriptedEventHandler;

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

TBH you would be better off writing your own vehicle spawner UI, than trying to force BI's implementation to do something it was not particularly designed to do. Plus things wont break when BI change things.

  • Like 3
  • Thanks 2

Share this post


Link to post
Share on other sites

Hi Larrow,

 

If possible can you help me with a few things :

 

  1. set a predefined direction for the vehicle to face when spawned;
  2. enable spawned vehicles to take damage ;
  3. clear the spawn area of a spawned vehicle;
  4. and prevent vehicles from being spawned and stacked on top of each other.

 

Or if anyone can help me with this or point me in the right direction, many thanks.

Edited by Feenx sama
I've figured out how to create # 3 successfully.

Share this post


Link to post
Share on other sites

@Feenx sama,

I don't know the answers to any of your questions because I'm not @Larrow
1. check this out, Position Relative
2. Something like 
{ _vehicle allowDammage true; } forEach _vehicle; // untested, I'm not sure
3. If you mean to move objects out of the way, instead I suggest something like:
selectBestPlaces or isFlatEmpty or findEmptyPosition
4. number 3 should solve this, too

Again, I don't know the answers but this is where'd I'd look. Other members might be able to elaborate or correct my pitiful attempt to help.

Share this post


Link to post
Share on other sites
2 hours ago, wogz187 said:

@Feenx sama,

I don't know the answers to any of your questions because I'm not @Larrow
1. check this out, Position Relative
2. Something like 
{ _vehicle allowDammage true; } forEach _vehicle; // untested, I'm not sure
3. If you mean to move objects out of the way, instead I suggest something like:
selectBestPlaces or isFlatEmpty or findEmptyPosition
4. number 3 should solve this, too

Again, I don't know the answers but this is where'd I'd look. Other members might be able to elaborate or correct my pitiful attempt to help.

Thanks, I'm down to 3 tasks now but I'll check these out!

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

×