Jump to content
Sign in to follow this  
{USI}_Zombie

how to make it wait

Recommended Posts

I need the halo script command to wait until after the player clicks on the map, but everything I have tried won't make it wait, so, advice please.

_text = "Choose your parachute location\nPress M for map and then single click for jump position\n";
TitleText [_text,"Plain"];
onMapSingleClick "player setPos _pos; onMapSingleClick """";";
[player, 2000] exec "ca\air2\halo\data\Scripts\HALO_init.sqs";
if (true) exitWith {};

Share this post


Link to post
Share on other sites

Try this:

onMapSingleClick "player setPos _pos; setPosDone=0";
waitUntil {setPosDone == 0};

"setPosDone" is only a variable and can be replaced by another. ;)

Share this post


Link to post
Share on other sites
I need the halo script command to wait until after the player clicks on the map, but everything I have tried won't make it wait, so, advice please.

_text = "Choose your parachute location\nPress M for map and then single click for jump position\n";
TitleText [_text,"Plain"];
onMapSingleClick "player setPos _pos; onMapSingleClick """";";
[color="Red"]waitUntil{!visibleMap};[/color]
[player, 2000] exec "ca\air2\halo\data\Scripts\HALO_init.sqs";

The above added code will wait till the map is closed before starting HALO.

Share this post


Link to post
Share on other sites

Thanks, both of you gave me something I could try,

@indeedpete, already tried that and couldn't make it work

@kylania you got me in the right direction. I am calling this script from an addaction. What you posted didn't work as written because when the script is called, the map is already not visiblewhich meant the halo script would kick in right away,...so my solution, inelegant as it is:

_text = "Choose your parachute location\nPress M for map and then single click for jump position\n";
TitleText [_text,"Plain"];
onMapSingleClick "player setPos _pos; onMapSingleClick """";";
waituntil {visiblemap};
if (visibleMap) then {hint "\n\n\n\n Click for drop location"};
waitUntil{!visibleMap};
[player, 2000] exec "ca\air2\halo\data\Scripts\HALO_init.sqs";
if (true) exitWith {};

Now I need to make this pull all the player's AI squadmates along with...I think I can, I think I can....and search the forums on how to get the removeaction to work since the on deac line in the trigger isn't cutting it:p

Thanks again, I never noticed that visiblemap command in the comref!

Share this post


Link to post
Share on other sites

OK, this is working along so far:

_text = "Choose your parachute location\nPress M for map and then single click for jump position\n";
TitleText [_text,"Plain"];
onMapSingleClick "{_x setPos _pos} forEach (units Group Player); onMapSingleClick """";";
waituntil {visiblemap};
if (visibleMap) then {hint "\n\n\n\n Click for drop location then close the map"};
waitUntil{!visibleMap};
[player, 2000] exec "ca\air2\halo\data\Scripts\HALO_init.sqs";
if (true) exitWith {};

I want the ai in my squad to halo as well and that isn't working. I tried several variations like this:

_text = "Choose your parachute location\nPress M for map and then single click for jump position\n";
TitleText [_text,"Plain"];
onMapSingleClick "{_x setPos _pos} forEach (units Group Player); onMapSingleClick """";";
waituntil {visiblemap};
if (visibleMap) then {hint "\n\n\n\n Click for drop location then close the map"};
waitUntil{!visibleMap};
_jumpers = units group player;
[_jumpers, 2000] exec "ca\air2\halo\data\Scripts\HALO_init.sqs";
if (true) exitWith {};

and this causes errors in the halo_init.sqf and nobody HALO's...so...ideas?

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  

×