Jump to content
Sign in to follow this  
Maff

BIS_fnc_spawnVehicle spawning underground issue

Recommended Posts

I am having an issue with BIS_fnc_spawnVehicle spawning my AA guns underground.

I have used BIS_fnc_spawnVehicle many times in missions ad have never had this issue.

I have swapped the AA guns with various vehicles and the exact same thing happens.

When I hijack the driver via MCC and drive a few metres the vehicle moves to ground level.

The Caches spawn on ground level before they are moved to their building positions.

I am working on Zargabad and using ACE mods.

I am lost. Any help appreciated.

Edit: Using createVehicle has the same issue. Why are the caches spawning on ground level but not the AA?

Could this be an issue with Locations?

//init.sqf

waituntil {!isnil "bis_fnc_init"};


_SideHQ = createCenter resistance;
_group = createGroup resistance;
West setFriend [resistance, 0];
resistance setFriend [West, 0];


[] execVM "MissionSetup.sqf";


//MissionSetup.sqf

waituntil {!isnil "bis_fnc_init"};


_TOWNpos = nearestObjects [[0,0,0], ["LocationLogic"], 10000];

for "_x" from 1 to 4 do {
_SelectTOWNpos = _TOWNpos select floor(random(count _TOWNpos));
_TOWNpos = _TOWNpos - [_SelectTOWNpos];
_cache = createVehicle ["LocalBasicAmmunitionBox", getPos _SelectTOWNpos, [], random(359), "NONE"];
sleep 1;
[_cache,1000,4] execVM "someBuildingPos.sqf";
sleep 1;
}; 


_AApos = nearestLocations [[0,0,0], ["FlatArea"], 10000];

for "_x" from 1 to 2 do {
_SelectAApos = _AApos select floor(random(count _AApos));
_AApos = _AApos - [_SelectAApos];
//_AA = createVehicle ["ZU23_TK_INS_EP1", getPos _SelectAApos, [], random(359), "NONE"]; // Same issue!
_AA = [getPos _SelectAApos, random(359), "ZU23_TK_INS_EP1", resistance] call BIS_fnc_spawnVehicle;
sleep 1;
}; 

Edited by Maff
Added further info.

Share this post


Link to post
Share on other sites

Try

for "_x" from 1 to 2 do {
_SelectAApos = _AApos select floor(random(count _AApos));
_AApos = _AApos - [_SelectAApos];
[color="#FF0000"]_SelectAApos = getPos _SelectAApos;[/color]
_AA = [[color="#FF0000"]_SelectAApos[/color], random(359), "ZU23_TK_INS_EP1", resistance] call BIS_fnc_spawnVehicle;
[color="#FF0000"](_AA select 0) setPosATL [_SelectAApos select 0, _SelectAApos select 1, 0];[/color]
sleep 1;
};

Share this post


Link to post
Share on other sites

A-HA! It worked. Brilliant!

I just finished spam-pasting game logics all over Zargabad to get around the problem. You've saved me the tedious task of looking for 100 flat areas to move them to. Many thanks.

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
Sign in to follow this  

×