killerwhale 1 Posted October 29, 2007 i am new to scripting and still experimental so dont laugh at me, this is the script below and above is the error I am experiencing. this is SQF script. Quote[/b] ]Pilot1 moveindriver plane;pilot1 doMove getpos ASTarget; pilot1 dotarget ASTarget; pilot1 dowatch ASTarget; if (plane distance ASTarget < 1500) then { ~5.2 plane FlyInHeight 90; plane setpos [(getpos _plane select 0),(getpos _plane select 1),100] ~1.05 plane fire "BombLauncher" ~0.1 plane fire "BombLauncher" ~0.6 plane fire "BombLauncher" ~0.1 plane fire "BombLauncher" ~0.6 plane fire "BombLauncher" ~0.1 plane fire "BombLauncher" plane SetSpeedMode "normal" ~3 plane FlyInHeight 600; pilot1 doMove getpos Dummy; pilot1 dotarget Dummy; }; Share this post Link to post Share on other sites
bob1787 0 Posted October 29, 2007 more semicolons? <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">Pilot1 moveindriver plane; pilot1 doMove getpos ASTarget; pilot1 dotarget ASTarget; pilot1 dowatch ASTarget; if (plane distance ASTarget < 1500) then { ~5.2; plane FlyInHeight 90; plane setpos [(getpos _plane select 0),(getpos _plane select 1),100]; ~1.05; plane fire "BombLauncher"; ~0.1; plane fire "BombLauncher"; ~0.6; plane fire "BombLauncher"; ~0.1; plane fire "BombLauncher"; ~0.6; plane fire "BombLauncher"; ~0.1; plane fire "BombLauncher"; plane SetSpeedMode "normal"; ~3; plane FlyInHeight 600; pilot1 doMove getpos Dummy; pilot1 dotarget Dummy; }; Share this post Link to post Share on other sites
killerwhale 1 Posted October 29, 2007 and where do the semicolons go? be more specific Share this post Link to post Share on other sites
nastros 0 Posted October 29, 2007 hes just shown you its in the quote Share this post Link to post Share on other sites
killerwhale 1 Posted October 29, 2007 Thanks for your effort, but the problem still exists. same error Share this post Link to post Share on other sites
bob1787 0 Posted October 30, 2007 "~" don't exist in SQFs apparently, you need to use sleep x instead, that should be about it. little demo mission http://opression.no-ip.info/Bomb_It.Intro.rar Share this post Link to post Share on other sites
killerwhale 1 Posted October 31, 2007 all failed, but this worked below! Share this post Link to post Share on other sites
killerwhale 1 Posted November 3, 2007 Can someone help me with 2 questions? 1) In a script, how do I give a waypoint to a squad of soldiers without having to write each and every unit in the squad, for example, Quote[/b] ] man1 domove getpos dest;man2 domove getpos dest I dont want to do this, I want to give the squad leader the waypoint so they all follow the leader2)lets say there are 30 enemy units, i wanted a code that counts them so that when they're down to 15, re-inforcements can arrive for them. Thanks in advance Share this post Link to post Share on other sites
NeoArmageddon 957 Posted November 4, 2007 1) <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">wp = group man1 addWaypoint [getpos dest,0]; man1 must be the leader of the group/squad. 2) Create a trigger over the enemys (Activation: "Side you want to count") -> name the trigger (example: easttrigger). In your script you need this: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">waituntil {(count easttrigger)<=15}; reenforcement=true; ... Share this post Link to post Share on other sites
zonekiller 174 Posted November 6, 2007 try sleep 1.05; instead of ~1.05; replace ~ with sleep Share this post Link to post Share on other sites
killerwhale 1 Posted November 7, 2007 ok guys, thanks for the help, I have everything fixed. I was wondering if this code works with ArmA Quote[/b] ]mygroup = group this;"_x moveincargo vehiclename" foreach units mygroup Share this post Link to post Share on other sites
jasono 0 Posted November 7, 2007 Will work if your aim is to put all the units in the group into a vehicle Share this post Link to post Share on other sites
Maddmatt 1 Posted November 7, 2007 ok guys, thanks for the help, I have everything fixed. I was wondering if this code works with ArmA Quote[/b] ]mygroup = group this;"_x moveincargo vehiclename" foreach units mygroup You must use { and } for code in ArmA. So it should be <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">mygroup = group this;{_x moveincargo vehiclename} foreach units mygroup The inverted commas (") are now only used for text strings. Or instead of creating an unnecessary global variable: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">{_x moveincargo vehiclename} foreach units (group this) Share this post Link to post Share on other sites