kuwahara<ANZAC> 0 Posted April 2, 2007 im a script noob and have VERY limited knolage on scripting. can someone please help me add a condition to this script if its possible? what i am hoping to do is: run this on init> <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _injured = _this select 0 _injured setCaptive true _injured switchMove "AdthPknlMstpSrasWlnrDnon_1" _injured DisableAI "move" _injured SetDammage 0.8 removeAllWeapons _injured _injured addAction ["ACTIONTEXT", "scriptname.sqs"] the condition i want is> i dont want the 'add action' visable untill a trigger sets T1=true im not even sure if its posable.. plz help me.. Share this post Link to post Share on other sites
fasad 1 Posted April 3, 2007 This is forum is about "OFP mission editing & scripting" <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">@(condition) will halt the script until condition returns true, then continue onto the next line. This might or might not work for ArmA. If not, look into waitUntil. Your topic title asks about if/then condition, which is not quite what you are after, but obviously possible. Good Luck Share this post Link to post Share on other sites
AgentJonathan 0 Posted April 4, 2007 i wanted to know, does @ mean condition of presence? PLEASE TELL ME YES. yea cuz i have been wondering since I first got into basic editing... Share this post Link to post Share on other sites
fasad 1 Posted April 4, 2007 No. @ is a script command. It has nothing to do with condition of presence. @ will halt the script until the condition in the brackets afterward returns true. I'm not sure how often it checks or if it will stop waiting after a given time (and if so what happens). example : <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">;myScript.sqs _object = _this select 0 @((_object distance player) =< 100) player setDamage 1 this script will kill the player when he gets within 100 meters of the object passed to the script. Share this post Link to post Share on other sites
Metal Heart 0 Posted April 4, 2007 Usually when the precision isn't neccessary, you should use a loop instead of @ because @ checks the condition as fast as it can, like every frame or maybe even faster. With slow loops the condition will use much less cpu as in: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_object = _this select 0 #wait ~2 ?(_object distance player) > 100: goto "wait" player setDamage 1 Share this post Link to post Share on other sites
hardrock 1 Posted April 4, 2007 I suggest you to read these three articles to learn more about this topic: http://community.bistudio.com/wiki/SQS_syntax http://community.bistudio.com/wiki/SQF_syntax http://community.bistudio.com/wiki/Control_Structures Share this post Link to post Share on other sites