tophe 69 Posted March 9, 2007 If I put: unit move (house buildingpos 2) How will I tell him to do next order when he is there? I'm looking for something like: ? unit moveFinished : hint "there!" I hope you understand what I'm after. Thank you. Share this post Link to post Share on other sites
Väinämöinen 0 Posted March 9, 2007 How about this? waitUntil {UnitReady unit;hint "there!"} http://community.bistudio.com/wiki/waitUntil http://community.bistudio.com/wiki/unitReady Share this post Link to post Share on other sites
tophe 69 Posted March 9, 2007 Thank you! It works... But I had to switch from making SQS-scripts to SQF. Haaaard... double-newbie. I wonder how I do a loop in SQF Share this post Link to post Share on other sites
MuadDib 0 Posted March 10, 2007 if Im not mistaken SQF is more C like, therefore while/for loops should work just as well right? or am I way off track? Share this post Link to post Share on other sites
5133p39 16 Posted March 10, 2007 Be careful when using move commands in build-up areas, sometimes the AI gets stuck and UnitReady won't return true even after hours (bug #2101) Share this post Link to post Share on other sites
Big Dawg KS 6 Posted March 10, 2007 Thank you!It works... But I had to switch from making SQS-scripts to SQF. Haaaard... double-newbie. I wonder how I do a loop in SQF Â First, why the hell would you have to switch? The commands work in both syntaxes. Second, why would you need a loop for it? (That was a rhetorical question, you wouldn't need one). In SQF, waitUntil pauses the script until the condition is met (the condition being UnitReady unit), in SQS it would be: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">@unitReady unit And it would also pause the script until the condition is met. Share this post Link to post Share on other sites
tophe 69 Posted March 10, 2007 I couldn't get the command to work in SQS. It also says in the Biki that the waitUntil command is only for SQF. Anyway.. the problem is clearly related to the bug mentioned above. To bad... Then my idea isn't doable Share this post Link to post Share on other sites
Big Dawg KS 6 Posted March 11, 2007 I couldn't get the command to work in SQS.It also says in the Biki that the waitUntil command is only for SQF. Anyway.. the problem is clearly related to the bug mentioned above. To bad... Then my idea isn't doable  You didn't read my post well enough. I know waitUntil is for SQF, but I also said that there's an SQS equivalent, if you noticed: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">@unitReady unit The @ pauses the SQS script until the condition unitReady unit is met. Share this post Link to post Share on other sites
crashdome 3 Posted March 11, 2007 while everything you have said is true.. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">@unitReady _unit has been deemed to unreliable in OFP. Whether it is same in ArmA or not... I do not know. I forget who may have the stated the exact reason why, but I only remember it because I had a HUGE system which would just flop dead on me for no apparent reason. Once I read the reasons behind why you wouldnt want to use the above, it totally made sense why my system was not working. Anyways, now i am hoping to use more FSMs for my system because that is essentially what they are made for... determining different states of the AI they are currently running through. [EDIT] Aha... here is the post that talked about it: http://www.flashpoint1985.com/cgi-bin....itready Share this post Link to post Share on other sites
TiGGa 0 Posted March 11, 2007 I would do it like this: waitUntil {moveToCompleted unit or moveToFailed unit}; or even better: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">waitUntil {moveToCompleted unit or moveToFailed unit or !alive unit}; if (!alive unit) exitWith {}; Share this post Link to post Share on other sites
tophe 69 Posted March 11, 2007 Thank you TiGGa.. I will try your suggestion. Uning waitUntil {unitready _Unit} acctually works very good. Until the bug kicks in. But I will try TiGGa's idea and see if it works better. Share this post Link to post Share on other sites
tophe 69 Posted March 11, 2007 Too bad.. TiGGa's sollution didn't work either. The unit doesn't return that it completed the task nor that it has failed. It goes to it's position correctly and then holds the script. I will try adding some sort of timeout condition.. Any ideas? Share this post Link to post Share on other sites