Home   Help Search Login Register  

Author Topic: Helo S&D waypoints not very effective!  (Read 5094 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.