Jump to content
Sign in to follow this  
jarvo9

Aircraft targeting soldiers

Recommended Posts

Hey all, i'm trying to make an aircraft target or strafe a specific group of soldiers on patrol.

I've tried to use "unitname dotarget unitname;unitname dofire unitname" but it doesn't seem to work with a aircraft targeting a specific GROUP of soldiers...

Any help is welcome!

Share this post


Link to post
Share on other sites

Well, i can get the aircraft to target the invisable targets but i need it to target the actual group of soldiers. So with some creative timing i can get it to look like a straffing run on the soldiers when they are directly over the inv. object.

I would like to find a way to target a group of soldiers by an aircraft until all members are killed or are out of a specific trigger area.

Share this post


Link to post
Share on other sites
I would like to find a way to target a group of soldiers by an aircraft until all members are killed or are out of a specific trigger area.

That should be relatively pain-free.

Here's an example using the set of functions that was earlier linked to in the ITMS demo mission.

To start with, spawn an invisible target like so:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">StrafeTarget = ["Man", "West", (getpos (leader _group))] call ITMSSpawn

The type ("Man") can be changed to "Armor", "IR", or "Laser" for different weapon engagement types. This will take some trial and error.

For example, let's say you wanted to start the aircraft strafing when West enters a certain trigger.

Trigger settings:

West - Present

Condition: this

Activation: [(MyGroup)] exec "StrafeStart.sqs"

StrafeStart.sqs

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

private ["_group"]

_group = _this select 0

StrafeStart = true

StrafeTarget = ["Man", "West", (getpos (leader _group))] call ITMSSpawn

[StrafeTarget, _group] exec "TargetUpdate.sqs"

exit

When the squad enters the trigger, the boolean variable StrafeStart is set to true. An invisible target is then spawned at the squad leader's position (make sure you set up the init.sqs for the ITMSSpawn function! ), and both the target (global variable StrafeTarget) and the group are passed to script "TargetUpdate.sqs"

TargetUpdate.sqs

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

private ["_target", "_group"]

_target = _this select 0

_group = _this select 1

#loop

? (StrafeStop) : deleteVehicle _target; exit

_target setpos (getpos (leader _group))

~1

goto "loop"

exit

This will move the invisible target to the squad leader's position every second until the boolean variable StrafeStop is set to true.

At this point you can make a few triggers to control the boolean variables.

Trigger 1

Countdown: .5

Condition: StrafeStart

Activation: aircraft reveal StrafeTarget; aircraft doTarget StrafeTarget; aircraft doFire StrafeTarget

This will tell the aircraft to target the invisible target once spawned.

----------

Trigger 2

Condition: StrafeStart AND !(alive man1) AND !(alive man2) AND !(alive man3) AND !(alive man4) etc...

Activation: StrafeStop = true

This sets StrafeStop to true if all of the men die, deleting the target and ending the update script.

----------

Trigger 3

West - Not Present

Condition: StrafeStart AND this

Activation: StrafeStop = true

This last trigger would stop the script once the squad leaves.

----------

This is just an example of how you could get the effect you describe, assuming, of course, that you mean to use this at a single, pre-destined moment, with a certain group.

Hopefully this helped in some way. smile_o.gif

Share this post


Link to post
Share on other sites

Outstanding AgentFox2, your example works perfectly! Thank you very much.

This little codeing gem along with the inv. objects works great. Adds to the atmosphere of the mission.

Now my french troops on patrol walking across open feilds(in Anjou) are not only vunerable from german troops but from maurauding Fokker D VII's. Even if you manage to take cover amoungst the trees, they start throwing nades from their open cockpits....it's alittle WWI action even if the soldiers aren't actually from that era, it still is good fun.

Thanks again!

jarvo9

Share this post


Link to post
Share on other sites

Mission Editing questions belong in the mission editing forum, user missions is for the discussion of specific missions created, or being created by users.

Share this post


Link to post
Share on other sites

I've been messing with this sort of thing for my CTI CAS scripts.

A few things to keep in mind in reference to using the Invisible Targets fro Lester:  

1)If the invisible target is detroyed in the process of killing a soldier within the group,

e.g. soldier 3 in a group of 8 killed whilst adjactent to invisible target being updated to it's position also leading to the destruction of the invisible target object

the helo wil fail to attack the rest of the soldiers in the group when the invisible target is updated to the next soldiers postion.

Therefore, make sure you have a loop to check if the invisible target damage is greater than 0.5 and if it is to 'setDamage' the invisible target back to 0.

2) AgentFox2 mentioned that you can specify the Invisible target to suit the situation

e.g. change to IR target for buildings, change to IR visible infantry target for infantry

will effect the weapons the helo will use.  In opinion this is important fro asthetics/realism as you don't want a Mi24 Hind using an AT rocket against a lone infantry unit.

3) In addition to (2) the type of weapons a helo has will dramatically effect it's infantry engagement ability.

e.g. Mi28 Havoc (DKM) has a more maneuvarable cannon turrent than a Mi24Hind (BIS) = that it is more likely to engage the enemy at all.

4) Group size and helo 'knowsabout' value in relation to the invisble target also effects the helo engagement likelihood

e.g. Most of the time a KA-50 Hokum will use it's rockets to attack a group of infantry yet switch to cannon when it's a loan infantry unit despite their only being a single invisible infantry target being updated to a single infantry unit position

Why this is I do not know, as you would think the focus would be on the invisible target therefore independent on enemy group size?  Regardless I have found that it helpful to constantly update or more tot he point 'reveal' the enemy units based on a threshold 'knowsabout 'value to the helo in the same loop cycle as updating the invisible infantry target position.

5)As you mentioned you've found, 'doTarget' and 'doFire' commands in terms of engaging infantry/infantry invisible targets are a waste of time.  I've tried these in a combination with the 'fire' command etc. to use a specific weapon for attacking the infantry.  In the end I stopped trying to fight the pilot AI and just revealed, updated the invisible target and enemy units and prayed...seems to work though.

Disclaimer:

Although I've implemented this system for quite a few helo addons available out there at them moment, this has been my experience only and as such may be wrong.

If you do find a way to get the helos to make a 'realistic' strafing run I'm all ears!  At the moment, the helos do strafing flight passes but only shoot when is optimal i.e. no 'strafing' run.

Share this post


Link to post
Share on other sites
try to use FOX2_Invisible targets (based on Lester's Invisible targets) i only got the pbo, lost the readme, but its in editor/Empty FOX2_InvTargets.rar (right click,save as, its 4kb) and here is the demo mission (right click,save as, its 18kb)

Does anyone still have a donwload link for those invisible targets?

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  

×