OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: NightJay0044 on 31 Jan 2009, 19:19:21

Title: AA soldiers targetting A10's
Post by: NightJay0044 on 31 Jan 2009, 19:19:21
Hi all I created a small script to have 4 AA soldiers to target two A10's flying by.

If someone can help please can you try and keep it how I created the script so I don't get confused.. :)..

Here is the script..

Quote
; ****************************************************************
; Script file for Armed Assault
; Created by: TODO: Author Name
; ****************************************************************

; Get the parameters given
_E1 = _this Select 0
_E2 = _this Select 1
_E3 = _this Select 2
_E4 = _this Select 3
_A1 = _this select 4
_A2 = _this select 5


_E1 reveal _A1; _E1 dotarget _A1; _E1 dofire _A1
_E2 reveal _A2; _E2 dotarget _A2; _E2 dofire _A2
_E3 reveal _A1; _E3 dotarget _A2; _E3 dofire _A2
_E4 reveal _A2; _E4 dotarget _A2; _E4 dofire _A2


Exit


I execute the mission like so;

Quote
[E1, E2, E3, E4, A1, A2] exec "Target1.sqs"

E1-E4 - east soldiers names.

A1, A2 - Thunderbolt names.

No erros show up but the soldiers dont' target the planes, solutions? Thank you.
Title: Re: AA soldiers targetting A10's
Post by: Mandoble on 31 Jan 2009, 20:27:39
Probably they are not using their AA missiles, just their assault riffles, remove them and let them with the AA weapon alone.
Title: Re: AA soldiers targetting A10's
Post by: NightJay0044 on 31 Jan 2009, 21:39:22
You'de think that would work mandoble, but it doesn't..I removed the weapon from them and it doesn't work..Man those AI's aren't very smart, lol..
Title: Re: AA soldiers targetting A10's
Post by: Mandoble on 31 Jan 2009, 21:49:04
Try forcing them to use the AA with selectWeapon command.
Title: Re: AA soldiers targetting A10's
Post by: NightJay0044 on 31 Jan 2009, 22:09:18
Yeah that didn't work either...hmm what to do..here's the script..

Quote
; Get the parameters given
_E1 = _this Select 0
_E2 = _this Select 1
_E3 = _this Select 2
_E4 = _this Select 3
_A1 = _this select 4
_A2 = _this select 5

_E1 selectweapon "STRELA"
_E2 selectweapon "STRELA"
_E3 selectweapon "STRELA"
_E4 selectweapon "STRELA"

_E1 reveal _A1; _E1 dotarget _A1; _E1 dofire _A1
_E2 reveal _A2; _E2 dotarget _A2; _E2 dofire _A2
_E3 reveal _A2; _E3 dotarget _A2; _E3 dofire _A2
_E4 reveal _A1; _E4 dotarget _A1; _E4 dofire _A1

Exit
Title: Re: AA soldiers targetting A10's
Post by: Mandoble on 31 Jan 2009, 22:12:35
Try to add waitimes between reveal, target and fire commands.
Title: Re: AA soldiers targetting A10's
Post by: NightJay0044 on 31 Jan 2009, 22:18:59
Still no go, I think we have to do something different or something..

Script;

Quote
; Get the parameters given
_E1 = _this Select 0
_E2 = _this Select 1
_E3 = _this Select 2
_E4 = _this Select 3
_A1 = _this select 4
_A2 = _this select 5

_E1 selectweapon "STRELA"
_E2 selectweapon "STRELA"
_E3 selectweapon "STRELA"
_E4 selectweapon "STRELA"

_E1 reveal _A1;
~3
_E1 dotarget _A1;
~3
_E1 dofire _A1
~3
_E2 reveal _A2;
~3
_E2 dotarget _A2;
~3
_E2 dofire _A2
~3
_E3 reveal _A2;
~3
_E3 dotarget _A2;
~3
_E3 dofire _A2
~3
_E4 reveal _A1;
~3
_E4 dotarget _A1;
~3
_E4 dofire _A1
~3
Exit


I attatched the mission if you want a quick look.. :)
Title: Re: AA soldiers targetting A10's
Post by: hoz on 31 Jan 2009, 22:38:10
If your looking for help and provide a mission as an example. Try to provide it on the intro island with minimum activity / scripts going on. First issue is you cut out about 50% or more of the people who don't have QG and might wish to help or learn from your issue. The second is to ensure no other scripts or events are causing problems.
Title: Re: AA soldiers targetting A10's
Post by: Mandoble on 31 Jan 2009, 22:58:31
Did some test, it seems that AI will fire to the A10 only if the A10 is almost over his head and flying low and slow.
Title: Re: AA soldiers targetting A10's
Post by: NightJay0044 on 31 Jan 2009, 23:35:21
Thanks though, i don't think that will work for my mission. It's for the mission I have.  I'll have to put my thinking cap on or something here soon.. :)
Title: Re: AA soldiers targetting A10's
Post by: i0n0s on 01 Feb 2009, 00:17:28
AA soldiers will only attack planes if they fly slow.

But there is also an error in your first script:
Code: [Select]
_E1 reveal _A1; _E1 dotarget _A1; _E1 dofire _A1The ';' in sqs introduces a comment. Therefore only the reveal will get executed.
Title: Re: AA soldiers targetting A10's
Post by: schuler on 01 Feb 2009, 06:45:31
nightjay , have then in a hold pos waypoint ,,,, in the open and they should assault the incoming Hogs
that and all the info above notes, walls and trees are tricky for the AI, so in sort use hold so they dont run from other AI and hide
schuler
Title: Re: AA soldiers targetting A10's
Post by: NightJay0044 on 01 Feb 2009, 12:28:47
@i0n0s~
Oh yes, I did fix that, didn't realize it at the time.


@Schuler~
Yeah that doesn't work...all I have on the map so far, it's not the Op Airstrike mission it's a sample mission to be converted to the real mission, just some testing..

all I have down is an, AA soldier, player and A10 flying by AA soldier.

So do you think it's because the AA soldiers don't target the plane because it's too fast and not low enough?
Title: Re: AA soldiers targetting A10's
Post by: Mandoble on 01 Feb 2009, 12:44:58
Just for a test, try to change the A10s by choppers.
Title: Re: AA soldiers targetting A10's
Post by: Planck on 01 Feb 2009, 16:24:14
Changing the A10', speedmode to 'Limited' helped them to fire at the A10's, but I'm guessing that isn't an ideal solution.

btw, you didn't name your A10's, so:

[E1, E2, E3, E4, A1, A2] exec "Target1.sqs"

...might not work till you name the A10's as A1 and A2.


Planck
Title: Re: AA soldiers targetting A10's
Post by: NightJay0044 on 01 Feb 2009, 19:29:05
Hi guys, tried all that, here is the sample mission from intro island below...thanks.. :)
Title: Re: AA soldiers targetting A10's
Post by: schuler on 02 Feb 2009, 03:45:13
your trigger is not activated [] exec "target1.sqs" and i dont thing the script is right
also the only real way to test it is in the mission
mando might be right to make them heli's too , but i would stick the the original plan of the mission
also guys i have seen the mission that he is making, and its very good
NJ you need to rise the height of the air craft too,,, its way to low at 20,,,, 250 would be good then we can make a nice cut scene out of it too
1 the AA soldiers need to be i a hold pos waypoint and it need to be worked on in the mission , coz thats where the bugs can be worked out too!