Jump to content
Sign in to follow this  
Taurus

conditional waitUntil?

Recommended Posts

tried the wiki example<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_i = 0; waitUntil {_i = _i + 1; _i >= 100};

Returns: GENERIC ERROR blabla...

i access the .sqf with

apa = [someUnit] call compile preprocessFile "wontWork.sqf";

also

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_unit = _this;

waitUntil{alive _unit};

Wont work either.

I imagined the "waitUntil" to check

alive _unit == false,

try(wait) again...

alive _unit == true,

WOOT!

and then exec the rest of teh script...

using a .sqs instead

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">@alive _unit

does halt the code banghead.gif

Share this post


Link to post
Share on other sites
tried the wiki example<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_i = 0; waitUntil {_i = _i + 1; _i >= 100};

i access the .sqf with

apa = [someUnit] call compile preprocessFile "wontWork.sqf";

This is wrong. waitUntil works only in a script (asynchronous execution). You need to use not call, which is synchronous, but spawn or execVM.

Share this post


Link to post
Share on other sites

notworthy.gif

This is VERY comforting to know that the developers looks into this forum smile_o.gif

but, mr Suma

http://community.bistudio.com/wiki/waitUntil

Description:

Suspend execution of function or SQF based script until condition is satisfied.

What am I missing?

I'll go for spawn then, as execVM should not be used on scripts that will be executed many times(as far as I've read on this forum)

Share this post


Link to post
Share on other sites

afaik you can also use call, but not out of a sqs script. So calling a sqf containing waitUntil or sleep out of a sqf should not cause an error.

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  

×