Jump to content
Sign in to follow this  
killerwhale

Dropping Bombs

Recommended Posts

error.jpg

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

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

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 leader

2)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

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

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

Will work if your aim is to put all the units in the group into a vehicle smile_o.gif

Share this post


Link to post
Share on other sites
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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×