Jump to content
Sign in to follow this  
Chief_Wiggum

Where am I going wrong with "BIS_fnc_spawnVehicle"

Recommended Posts

This is what I have in "troopDrop.sqf"

_planeType = _this select 0;
_amountOf = _this select 1;
_startingPoint = _this select 2;
_wayPoint = _this select 3;


_planes = createGroup west;

for "_i" from 1 to 3 do {
_newPlane = [(getPos _startingPoint), 0, _planeType, _planes] call BIS_fnc_spawnVehicle;

};

hint format["%1",_newPlane];

I of course have placed a "functions" module onto the map and execute the code in the init field of a gamelogic that I have placed on the map and 100m in the air:

GAMELOGIC

this setPos [getPos this select 0, getPos this select 1, 100]; null = ["C130J_US_EP1",3,this,dropZone] execVM "troopDrop.sqf";

Yet, I get nothing.

Little help? trying to make the transition between sqf and sqs.

Share this post


Link to post
Share on other sites

Function module takes a moment to be loaded/initialized.

To wait for it to be ready do this in your script before the function call:

waituntil {!isnil "BIS_fnc_init"};

Share this post


Link to post
Share on other sites

Yeeeh, Im using that paramater, no script errors :).

Here's hoping that it is just becasue the function module isn't up to speed.

Tell me, what is the difference between preProcessFile and call and spawn etc. etc. etc. Isn't execVM a bit old school?

Share this post


Link to post
Share on other sites

Spawn is same as execvm. Difference is that spawn takes code while execvm takes an eternal file.

Call is same as spawn, but doesn't create a new, separate, "thread" to run it in.

Preprocessfile just reads/loads a file into memory so it's ready to be compiled and executed.

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  

×