Home   Help Search Login Register  

Author Topic: Helo S&D waypoints not very effective!  (Read 5353 times)

0 Members and 1 Guest are viewing this topic.

Pipski

  • Guest
Helo S&D waypoints not very effective!
« on: 04 Jan 2004, 04:05:57 »
I'm back.  Is there a better way of adding CAS than using search & destroy waypoints?  I have a UH-60+MG in my mission that can be called in by radio and will then proceed to a S&D waypoint over the enemy base.  I kind of had visions of the chopper then zooming around, machine gunning enemy infantry all over the place but instead it just seems to flit around, travelling rather a long way from the waypoint and not shooting at anything!  I've noticed in the official OFP campaigns the helo's frequently fly around the place without actually attacking much too.

Is there any way I can increase the effectiveness of this CAS?  Would a support WP work better and, if so, can I put the WP on the player's starting position and assume that the helo will find the players current position rather than flying all the way back to the start?  

Quid Novi

  • Guest
Re:Helo S&D waypoints not very effective!
« Reply #1 on: 04 Jan 2004, 04:16:05 »
there are many very good CAS scripts in the editors depot (and the ECP also has CAS - I think)

your second best bet is to wait for the site to be back, your best bet is to hope some1 has the script and can post it up here for u  ;)

m21man

  • Guest
Re:Helo S&D waypoints not very effective!
« Reply #2 on: 04 Jan 2004, 04:40:45 »
The best scripts use custom gamelogics that cause any gunships in the area to brutally pound the area around the logic. Take a look at Nagual's CAS scripts :) .

Offline Sui

  • Former Staff
  • ****
    • OFPEC
Re:Helo S&D waypoints not very effective!
« Reply #3 on: 04 Jan 2004, 07:07:22 »
The reason that your helo doesn't attack the infantry, is because it can't see them...

Yes, the pilot is blind, but that's the way it is.

If you want the chopper to fire on the infantry, try the reveal command... eg.

"helo reveal _x" foreach (units group1 + units group2... etc)

Or even:

"helo reveal _x" foreach [man1, man2, man3...]

If that's too cumbersome, we can probably manage to do it via a trigger... anyway, how would that be?

Offline Burn

  • Members
  • *
Re:Helo S&D waypoints not very effective!
« Reply #4 on: 04 Jan 2004, 07:40:31 »
Quote
we can probably manage to do it via a trigger... anyway, how would that be?
Probably with the help of the list command, implemented in a small script :-\... something like...
*********************************************************
_loons = list triggername
~0.5

"helo reveal _x" foreach _loons

exit
**********************************************************
I'm not shure but something like that :-\ :P.

Pipski

  • Guest
Re:Helo S&D waypoints not very effective!
« Reply #5 on: 04 Jan 2004, 09:19:08 »
Cool!  All sound like good ideas.  I've had a look at some CAS scripts (d/l'd the SP Pack) but, while ver' impressive, they aren't quite right for this because the helo needs to land and drop off a squad of engineers once all the Ivans are dead.  I'll try using the reveal command though.  I thought that was just for AI squad leaders to assign targets to players (like in the first missions of CWC).  Didn't realise it worked for AI units too.  I reckon that oughtta work.  Cheers guys.

 8)

Pipski

  • Guest
Re:Helo S&D waypoints not very effective!
« Reply #6 on: 04 Jan 2004, 11:21:30 »
Ah.  Have done as suggested and it's certainly helped in so far as the chopper now stays in the area it should and actively sniffs out targets.  However, it still doesn't shoot them!  I've also revealed all the targets to the gunner as well (which oughtta be unnecessary but hell, can't hurt right?) but that hasn't helped.  Is it some kind of problem with the UH60, what with it having a door-mounted MG?  That'd be a shame `cause it'd look swell doing orbits and raining down fiery death!  Is there no way I can persuade these guys to open up?

Offline DrStrangelove

  • Members
  • *
  • Mr.Creative
Re:Helo S&D waypoints not very effective!
« Reply #7 on: 04 Jan 2004, 11:28:58 »
Maybe also add   helo doTarget _x; helo doFire _x;  to the code ?

Pipski

  • Guest
Re:Helo S&D waypoints not very effective!
« Reply #8 on: 04 Jan 2004, 11:33:55 »
Won't that lead to him engaging them all in strict sequence?  Might lack spontaneity if so.  Also, will he have the wits not to go loopy if ordered to engage someone who's already dead?  Tell you what, I'll try it and thereby answer my own questions!

Offline Burn

  • Members
  • *
Re:Helo S&D waypoints not very effective!
« Reply #9 on: 04 Jan 2004, 12:23:31 »
Try to continue the previous script that I posted (if that was what you used and\or it worked :-\) right before the exit command by adding doTarget, doFire and count commands.
Something like this:
=====================================================
"helo reveal _x" foreach _loons
~0.5


#Update

_loons = list triggername

_loonleft = count units _loons

~1

; check if theres any loonies left to kill
? (_loonleft == 0) : goto "Done"

;target the 1'st loon in the trigg array...
helinameg dotarget _loons select 0
~1

;...and kill him
helinameg dofire _loons select 0

;get healh status on first loon in the array
_health = getDammage _loons select 0

;Stop the script and wait until loon is dead.
@ _health == 0

; number of loonies -1
_loonleft = loonleft_ - 1

goto "Update"

#Done
exit

=====================================================
I'm very unsure if this will work but do give it a shot, will ya. ;)
...As I still concider myself as a n00b scripter, I take no responsobility if your computer should blow up, your dog commits suicide (or any other pets for that matter) during the testing of this script... have fun. ;D  :P   :-*

Pipski

  • Guest
Re:Helo S&D waypoints not very effective!
« Reply #10 on: 04 Jan 2004, 14:13:48 »
Tried adding doTarget and doFire.  Also tried out Bizon's script (tx for that, I appreciate the work you put in there!) but neither worked.  (Although I'm not really au fait with scripting yet and may have made a boob somewhere on that.  I guessed that helinameg was meant to be my helo's unit name.  The rest pretty much made sense too, though I couldn't work out the need for _loons=list triggername if the trigger was going to exec the script?).  I got all excited at 1st `cause it looked like the helo was actually shooting at people until I realised that it was actually getting shot at instead!  Maybe I should forget CAS and just napalm the *******!

Offline Burn

  • Members
  • *
Re:Helo S&D waypoints not very effective!
« Reply #11 on: 04 Jan 2004, 14:58:10 »
Oh... damn, I forgot to explain a few things to ya...
First the helinameg is the name of the chopper but leave the g out when you type the name... the "g" stands for gunner...
put, either C, G or D in front of the original name in your scripts to give the comand to:

C = Commander

G = Gunner

D = Driver

And also...
Quote
though I couldn't work out the need for _loons=list triggername if the trigger was going to exec the script?
triggername = the name of the trigger
and the list command lists all the units in that named trigger dependin on what side the trigger activates "WEST"=west "EAST" is east and so forth... Just name the trigger and exec the script. In on activation type:

[] exec "Whatever_you_want_to_call_the_script.sqs"

exec it however you want and the helo should start killing everyone that activated that trigg one by one... well we can allways hope.

Sorry for being unclare, and for my bad scripting ;D
If some scripting guru feels generous, feel free to make a proper script. :cheers:

Quote
I got all excited at 1st `cause it looked like the helo was actually shooting at people until I realised that it was actually getting shot at instead!
:oROFLMAO :P :beat:

Pipski

  • Guest
Re:Helo S&D waypoints not very effective!
« Reply #12 on: 04 Jan 2004, 16:53:59 »
Ah, that makes more sense now.  :)  However I cannot get it to work!  Have tried every permutation and combination I can think of to coax some life out of it but without joy.  (btw, is it supposed to be _loonleft = loonleft_ -1 rather than _loonleft = _loonleft -1?  Not that it matters as I can't get the darned thing to engage at all, never mind going on a killing spree!)  Most recently I tried ditching the trigger altogether and exec'ing the .sqs from the s&d waypoint (also tried with guard and move wp's, no difference).  I decided I didn't want the helo to slay absolutely everyone in the base after all `cause that would make things a bit easy for the player.  The (slightly modified to account for this) .sqs reads as follows:

_loons = [Crewski, Crewski2, Pilotski1, Pilotski2, Pilotski3, Gunnerski1, MGski, Gruntski, RPGski, AAski, Medicski, Grenadeski, Officerski, Soldierski, Soldierski2]

"GBlackhawk reveal _x" forEach _loons

#Update

~1

? (_loonleft == 0) : goto "Done"

GBlackhawk dotarget _loons select 0
GBlackhawk dofire _loons select 0
_health = getDammage _loons select 0
@ _health == 0

_loonleft = loonleft_ -1

goto "Update"

#Done
exit

It's activated from the wp with [] exec blackhawktargets.sqs in the On Activation box.  But the stupid `copter just sits still and waits for me to get annoyed and plink it with a LAW.  `Tis most perplexing and vexatious!
« Last Edit: 04 Jan 2004, 16:55:15 by Pipski »

Offline Burn

  • Members
  • *
Re:Helo S&D waypoints not very effective!
« Reply #13 on: 04 Jan 2004, 21:02:53 »
Eerrmm...  :P *coughs* ...I noticed some small errors in your script there...
It's these litle things ya know ::) ;D
Quote
"GBlackhawk reveal _x" forEach _loons
should be:
"BlackhawkG reveal _x" forEach _loons
Quote
btw, is it supposed to be _loonleft = loonleft_ -1 rather than _loonleft = _loonleft -1?
It's: _loonleft = _loonleft -1 ...sorry for that... typo. :-[ :beat:

Ok, as I said before: It's these little things, that keep testing your patiense. And that is one thing that you got to have a lot of to learn ofp scripting ::)... trust me, I know;D. And I've only scratched the surface :o.

And if there's any more unclaryties don't hesitate to ask ;)...

Pipski

  • Guest
Re:Helo S&D waypoints not very effective!
« Reply #14 on: 05 Jan 2004, 14:33:21 »
Cheers mateyboots.  Well you're right about one thing, I've amassed a helluva lot more knowledge about scripts than I had before, thanks to working on this one!  Still not working right.  Thanks for the corrections but despite working on this one damned waypoint for the last two days I still can't fix it.  I've even tried replacing the UH60 with an AH1 in case that made a difference (it didn't) and changing the mission from dawn to mid-afternoon in case the extra light helped (it didn't).  As a result of corrections/further exploration the script is currently:

_loons = _this select 0


#Update

~1

? (_loonsleft == 0) : goto "Done"

"BlackhawkG reveal _x" forEach _loons

if alive _loons then BlackhawkD dotarget _loons select 0
if alive _loons then BlackhawkG dotarget _loons select 0
if alive _loons then BlackhawkG dofire _loons select 0
if NOT (Alive _loons) then _loonsleft = _loonsleft - 1

goto "Update"

#Done
exit

And it is triggered by the following (in the On Activation window of the S&D waypoint):

[Crewski, Pilotski1, Pilotski2, Pilotski3, Gunnerski1, MGski, Gruntski, RPGski, AAski, Medicski, Grenadeski, Officerski, Soldierski, Soldierski2] exec "Blackhawktargets.sqs"

One thing I am curious about is the _loonsleft line.  I couldn't find `left' in the scripting command reference guide (you know, the big alphabetical one) but am I right in assuming you can use it for any array?  And does the script as it stands automatically deduct item 0 from the list using _loonsleft-1 when the target's been killed, so that the previous item 1 becomes the new item 0?  

Anyway, for the time being, given the pilot's lack of enthusiasm for the business of war, I intend to short-circuit the whole business by having the UH60 join the players team upon arriving.  That way the player can direct it to attack whomsoever he wants.  I'll see if I can get them to at least do that.

Offline Burn

  • Members
  • *
Re:Helo S&D waypoints not very effective!
« Reply #15 on: 05 Jan 2004, 14:50:37 »
Quote
One thing I am curious about is the _loonsleft line.  I couldn't find `left' in the scripting command reference guide (you know, the big alphabetical one) but am I right in assuming you can use it for any array?  And does the script as it stands automatically deduct item 0 from the list using _loonsleft-1 when the target's been killed, so that the previous item 1 becomes the new item 0?
No see I used that _loonsleft-1 line with the count command that counted the units in the trigger that was listed in the _lonsleft array, and when there was no more units in the array the script would exit... ::) atleast that was the idea ;D :P

see, this [a,b,c,d,e,f] is an array

then I defined it as an local variable to ease scripting like so: _loonsleft = [a,b,c,d,e,f]

the array becomes _loonsleft.

Quote
Anyway, for the time being, given the pilot's lack of enthusiasm for the business of war, I intend to short-circuit the whole business by having the UH60 join the players team upon arriving.  That way the player can direct it to attack whomsoever he wants.  I'll see if I can get them to at least do that.
Hope that works out for ya. :D But I'll try to work something my self to see if I can't get this damn script to work or atleast create a workaround. ;) And hey, on the positive side atleast you've learnt something of this... so atleast you wont walk out of this empty handed :D ;D. Good luck m8. 8)

Pipski

  • Guest
Re:Helo S&D waypoints not very effective!
« Reply #16 on: 05 Jan 2004, 15:01:35 »
lol, I'm a numpty, I missed out the `count' command line when I first typed the script!  I shall pop it in and see if it makes a difference (though it shouldn't affect the attack aspects until the first loon is dead anyway).  So _loonsleft is a counting mechanism ... but in that case what prompts the script to move on from killing loon0 to killing loon1, 2 etc. ?  `Cause after it cycles back to #update it gets orders to doTarget _loons select 0.  Won't that make it keep on trying to slot the same dude?

Offline Burn

  • Members
  • *
Re:Helo S&D waypoints not very effective!
« Reply #17 on: 05 Jan 2004, 15:09:11 »
no. U see the line: _loons select 0?!
remember that I told u that _loons was an array?!
well what select 0 does is that it selects the first element in an array. 0 = first, 1= second etc...
did that clarify things alitle :)?!?...
Sorry for not explaining this erlier ;D.


Pipski

  • Guest
Re:Helo S&D waypoints not very effective!
« Reply #18 on: 05 Jan 2004, 15:19:53 »
 ???  Right, I get that bit.  Select 0 makes it select the 0th (i.e. first) unit in the array.  But what makes it select the 1st (i.e. second) unit in the array in this script?  After select 0 has made the script run doTarget and doFire on the first unit the array, it cycles back to #update and runs that bit again.  

Update

~1

? (_loonleft == 0) : goto "Done"

GBlackhawk dotarget _loons select 0
GBlackhawk dofire _loons select 0
_health = getDammage _loons select 0
@ _health == 0

_loonleft = loonleft_ -1

goto "Update"

But when it runs it again, when it comes to `dotarget _loons select 0' how does it know not to try and reselect the first element in the array again (the one that it's already killed?  Supposedly.  If the sods were actually up to killing anything!)?

Sorry for the endless stream of questions but I get the feeling that if I can get my head `round the one script then I should hereafter be able to get my head `round pretty much all of them!  btw, is this kind of scripting at all similar to Perl?

Offline Burn

  • Members
  • *
Re:Helo S&D waypoints not very effective!
« Reply #19 on: 05 Jan 2004, 15:33:42 »
Quote
Right, I get that bit.  Select 0 makes it select the 0th (i.e. first) unit in the array.  But what makes it select the 1st (i.e. second) unit in the array in this script?
I was hoping that tis would do that:

#Update

_loons = list triggername

_loonleft = count units _loons

...every time when a soldier in the arry is killed the arry should shange and make the chopper target another unit, because of this "update" every time the script loops...
Quote
Sorry for the endless stream of questions but I get the feeling that if I can get my head `round the one script then I should hereafter be able to get my head `round pretty much all of them!
Don't you worry about that, that's what the forums are for, ask away ;D ;)
Quote
btw, is this kind of scripting at all similar to Perl?
LOL :D... I would't really know as, besides OFP scripting the only scripting language I know is CNC scripting... ya know those BIG computer operated metal prosessing machines (or whatever the hell theyr'e called in english).   ::) :P
« Last Edit: 05 Jan 2004, 15:39:30 by Bizon »

Pipski

  • Guest
Re:Helo S&D waypoints not very effective!
« Reply #20 on: 05 Jan 2004, 15:46:31 »
Of course it would!  I get it.  Although ... hang on, that would work fine if the .sqs was executed by a trigger, say an "East" "present" trigger.  `Cause after a loon died they wouldn't show up to that trigger - being no longer present.  But seeing as I've got a list of entities triggering mine, [Crewski, RPGski et al.], will that still work?  My .sqs is triggered by the units listed in the On Activation box of the waypoint.  If one of them is dead will they be automatically ignored by the exec command?  And removed from the array if they get killed after it's exec'd?

Pipski

  • Guest
Re:Helo S&D waypoints not very effective!
« Reply #21 on: 05 Jan 2004, 17:31:24 »
Right, one big step forward, two steps back!  For a start I think I might know why the script didn't seem to be making an humongous difference to the choppers behaviour - it wasn't actually being run!  The `On Activation' box for waypoints only seems to be run when the vehicle moves on to the next wp and I had the exec command on the On Activation box of a waypoint that isn't left until all the loons are dead!  Therefore, it wasn't being run until all the targets were slotted anyway!  Have moved it to the wp before and it's being run now.

However, I keep getting errors with it.  This line seems to give it problems:
"BlackhawkG reveal _x" forEach _loons
... and I can't see why.  As far as I can tell the format is correct.  

If there is an error with a script is the rest of the script still run or does it abandon the script altogether?

Also, I can't seem to get the helo to join my team.  Have been typing BlackhawkG join group phil (where phil is the name of the player unit), which has worked fine for ground units.  Blackhawk join (without the G/D)doesn't work either.  Is it because the gunner/driver were created together with the Blackhawk as one unit, rather than me creating an empty Blackhawk and two pilots and bundling the pilots into it?  

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Helo S&D waypoints not very effective!
« Reply #22 on: 05 Jan 2004, 18:09:53 »
I'm no scripter and I haven't looked at this in detail but it looks like you're missing a line before the loop starts:-

_loonsleft = count units group _loons

Syntax not guaranteed and that may not even be what you need.  

_loonsleft is just a local variable.    If you can't find a command in the command ref, then it doesn't exist.

(I've just noticed that you've deleted your earlier reply and replace it with this new one)

If a script gets an error in general the script will pack up and go home.

For vehicles you have to get the crew to join your group individually.   Don't forget the square brackets [ ]

forEach requires an array so _loons should be an array.   If _loons is a group then it should be

... forEach units _loons

You are correct, the on activation box in waypoints fires when the waypoint is completed, not when the unit arrives there.
Plenty of reviewed ArmA missions for you to play

Pipski

  • Guest
Re:Helo S&D waypoints not very effective!
« Reply #23 on: 05 Jan 2004, 18:29:04 »
Cheers Mac.  I'm actually quite proud of myself `cause I managed to straighten out the script problem I was having (all to do with arrays instead of objects).  I have also added a move waypoint exclusively for the purposes of activating the script.  The waypoint after it is the S&D one so, in theory, the helo will activate the script at the move waypoint and, upon completing it, fly to the S&D.  At the mo' when it reaches the move waypoint it just stops there and hovers.  If it wasn't executing the script it would move on so it must be running it, it's just not doing much!  For some reason the doTarget and doFire aren't happening.  The activating code is [Crewski, MGski, RPGski et al.] exec Blackhawkstargets.sqs.  The script as it stands at the moment is:

_loonsleft = count _this               (i.e. total number of targets)

#Update

_loons = _this select 0                 (so _loons=1st thing in array, right?)
_health = getDammage _loons    (and it's health becomes _health)
~1                                                (wait a second)

? (_loonsleft == 0) : goto "Done" (once all targets dead go to the end)

Blackhawk reveal _loons              (so he knows where the suckers are)

BlackhawkD dotarget _loons        (driver should target him)
BlackhawkG dotarget _loons        (so should gunner)
BlackhawkG dofire _loons             (then ventilate him)
@ _health ==0                              (until his health is zero?)
_loonsleft = _loonsleft - 1             (whereupon loonsleft is reduced)

goto "Update"                               (and the whole business recommences)

#Done
exit

The bit I'm really not sure about is @ _health == 0.  Will the gunner actually repeat firing until the loon is dead or will he just fire once and then wait for the guys health to reach zero by some other means?

Other than that I can't see any reason why it wouldn't work great.

Offline Burn

  • Members
  • *
Re:Helo S&D waypoints not very effective!
« Reply #24 on: 06 Jan 2004, 00:34:58 »
This script works because I tested it myself, pretty damn sweet to se the mg on the uh-60 actually fire for once :D. Theres one thing that needs to be change IMO, and that is the movement... the helo just hovers at one spot until the unit is dead and the moves to the next... it would be cool to make it hover in circles around the target. Maby I'll do that later ;)

And sorry for the late reply :P... (wus watching a movie I dl'd :))

heres the script...
=====================================================
You need a helicopter named helo and a trigger named trigg.
Set the trigger up to be activated by the anemy, and you can make the trigg any type you want...
in the trigg's on activation field put [] exec "killer.sqs"
then make a text file named killer.sqs
=====================================================
*****************           killer.sqs      ***************************
=====================================================
copy the following code into the text file...
=====================================================
heli setbehaviour "careless"
heli setspeedmode "limited"

_loons = list trig

"helo reveal _x" foreach _loons

~0.5

#Update

_loonleft = count _loons

~1

? (_loonleft == 0) : goto "Done"

_dude = _loons select 0

heli domove [(getpos _dude select 0),(getpos _dude select 1)+20]
~1
heli flyinheight 10

heli dotarget _dude
~5

heli dofire _dude

~2

heli domove [(getpos _dude select 0),(getpos _dude select 1)+20]

_health = getDammage _dude

@ _health == 0

_loonleft = loonleft_ - 1

_loons = list trig

goto "Update"

#Done
exit
=====================================================
cheers m8 8)

[edit]
Any probs or q's please ask. If you don't get it to work I could host a samplemission for you. ;D

oh and the fly in height is to alter the flight-height in meters, to help the nearly blind gunner spot his enemies... change the value (10) if the helo crashes or you culd even try to remove it if nessecary :-X

[edit#2]
oh and remember to make the trigger as large as you need the area of available CloseAirSupport to be, I.e. the HOSTILE area...
And one final thing, it isn't possible to setpos or camCreate a trigger is it ???
If that was possible, you could make a smaller trigg, and setPos it with onMapSingleClick command... so you could divert the chopper to ANY hostile spot on the map just by clickin' on it :D... But for now just place the triggers over desiered hotSpots (yes you can make more than one ;D) and makem' radio triggers so you can activate them when desired ;)
« Last Edit: 06 Jan 2004, 05:08:21 by Bizon »

Pipski

  • Guest
Re:Helo S&D waypoints not very effective!
« Reply #25 on: 06 Jan 2004, 12:04:49 »
Jeepers Biz, this script is the biz!  (As good as anything by BIS!)  Works like a dream.  

I suspect the reason the previous ones didn't was the flyinheight.  Stupid command reference says the accepted values are 50-200!  It works fine at 10 or 15 but at 20 the copter starts having trouble locating its targets and tends to just sit still trying to work out where they are.  This is a bit of a bugger as at 15m I now have to rejig the mission to keep the daft ha'porth out of the trees   ::).  Still, I'm pretty sure I can manage that just by shifting the triggers around.  

The other bijou problemette is that he's now so lethal that I have to find a way of getting the player to take some loons out the old fashioned way, rather than letting the helo do all the work!  (This is not a complaint though, that bit's easy.  As it stands if there's an enemy AA or even an MGer they very quickly take the chopper down.)  It would be handy though if there were a way of setting the trigger to only detect certain loons, rather than "present" "East"?  

The only line in the script that foxes me is the second heli domove.  The first one is before the dotarget and dofire and will put the chopper in a good position to slap the loon, then it appears again after the dofire but before the getDammage.  I can't work out why it's needed but it seems to be vital because without it the copter only engages one loon and then freezes.  ???

Anyways, many thanks for the script, I will probably spend the rest of the morning sitting watching it in action!  And maybe writing a no fly zone script to keep the swine away from the foliage!

Cheers!   8)

Offline Burn

  • Members
  • *
Re:Helo S&D waypoints not very effective!
« Reply #26 on: 06 Jan 2004, 19:06:58 »
Thanks :)

If you're havin' trouble with the chopper crashing all the time try removing the flyInHeight command, and alter the following line...

heli domove [(getpos _dude select 0),(getpos _dude select 1)+20 ]

Change the number 20 to a higher number. It will make the chopper move further away from the target anabeling him to target him more easily... I think ;D.

Quote
The other bijou problemette is that he's now so lethal that I have to find a way of getting the player to take some loons out the old fashioned way, rather than letting the helo do all the work!
lol ;D

Quote
It would be handy though if there were a way of setting the trigger to only detect certain loons, rather than "present" "East"?
try changin it to detected by west... that way the helo only attacks loons any given west soldier knows about ;)

You may alter the script in any way you like, to fit your needs :joystick:

happy editing m8  :cheers:

[edit]
The script still has many limitations, bugs and atleast one typo ::)
I'll fix that later... but right now I don't have the time. C ya l8r :-* ;D
« Last Edit: 06 Jan 2004, 22:32:26 by Bizon »

zorbasphere

  • Guest
Re:Helo S&D waypoints not very effective!
« Reply #27 on: 24 Jan 2004, 00:29:20 »
Hi, I tried killer.sqs, and i have a BAS DAP called heli ,a tank called loon and a tank called dude but it aint working. Whats the correct way to use this? Please help Ive been loking for this for a long time, and now Im so close... :-\

1. does the heli need waypoints?

Whats the deal with loons and dudes here? Which is what? Is a dude the subordinate unit in a "loon" group? Or how does this work?

My error is Error Type Any: Expected Number
« Last Edit: 24 Jan 2004, 00:38:10 by zorbasphere »

Pipski

  • Guest
Re:Helo S&D waypoints not very effective!
« Reply #28 on: 24 Jan 2004, 01:48:15 »
OK, I used it by having a wp (`Move') in the area I wanted the helo to go hunting in.  In the `On Activation' box I had a condition (called CAS) made true (CAS=true).  Then I put a trigger with CAS in the Condition box.  In the On Activation box of the trigger I put [] exec "killer.sqs".  (Sorry if this is all pretty obvious to you already, just want to be sure I don't miss anything out!).  

Therefore, the helo flies to its Move wp, CAS becomes true which activates the trigger and fires the script.  In my experience the helo then flies around looking for targets (with variable success) until all are dead, whereupon the script ends and it proceeds to its next wp (which is where my editing problems begin!   :'( ).  

[NB:  The script is presented above has an error in it:

_loonleft = loonleft_ - 1

should be _loonleft = _loonleft -1

so if you just copied and pasted that might be causing your problem?

re:  Dude vs Loon.  Bizon could probably explain this better but let's have a stab at it.  When the trigger containing [] exec "killer.sqs" goes off it feeds an array into the script.  e.g. if the trigger is set to `East' `Present' then the array will contain the names of all East units in the area set by the trigger's radius.  This array is called _loons.  
The first unit in this array (i.e. in the zeroth (for mathematicians and programmers) / first (for the rest of us) position) is designated as _dude thanks to this line:

_dude = _loons select 0

Thereafter when the script refers to _dude it is talking about the first unit to appear in the list generated by the trigger.  So getting _dude's position is the same as getting the first enemy units position, and so on.  The script cycles so that once a _dude has been targetted and killed the array as drawn up fresh.  As that unit will no longer be `present' (being dead) it won't appear again and the unit in the zeroth position will be a different one.  When there are no units left the line

? (_loonleft == 0) : goto "Done"

ends the looping and goes to the final bit of the script that ends it.  

Hope that explains it to some degree!  (As you can see from the length of this thread it took some time for me to get to grips with it  ;) ).

I'd say that if you want to see how the script should work you can go to www.freewebs.com/mistletoe and d/l the mission I put it in, but it's still not working perfectly as regards the helo.  If you want to try it then v1.02 is better than 1.03 for seeing the script in action (in 1.02 the script works fine, it's just the helo doesn't land when it should).  Hopefully next week or thereabouts 1.04 will be out and fully operational.


zorbasphere

  • Guest
Re:Helo S&D waypoints not very effective!
« Reply #29 on: 24 Jan 2004, 16:24:01 »
That sounds great, Ill try it.
But the reason I want to eve use it is for a very open & large map..the idea is to get the choppers to stop hover, acquire & and fire from very far away, as they would realistically, not go charging into a firezone with million dollar choppers)
ill give it a try and let you know

Offline Burn

  • Members
  • *
Re:Helo S&D waypoints not very effective!
« Reply #30 on: 24 Jan 2004, 19:23:59 »
I do have an updated script sitti'n on my HD, I was in the middle of finishing beta testing when all of a sudden, POOFF... i got the stupid idea to make my very first addOn SOLO, as I need a good mercenary unit for one of the hundreds of missions i'm NEVER IN HELL are gona finish. But I'll try to complete this shamefull attempt at a script as fast as I can. If ofcourse this computer you'd think was made at the 18'th century don't give up on me before that. ;D ...Oh, well back to the salt mine :P