Jump to content
Sign in to follow this  
avibird 1

Can you order units to engage only one kind of units during a mission!

Recommended Posts

OK this is my current problem. I have a mission that you need to make you way to a dock area after you take out your target for the Extraction Point. Your team needs to commandeer some boats to make it back to the carrier fleet. I have a trigger setup a few hundred meters off the beach to bring in gunships to help the boats to reach the fleet. OPFOR has 6 boat patrols between the docks and the fleet. When the choppers move in when the trigger is set off they take out one or two boats but then fly inland to engage what ever armor is left inland from the mision.

My questions is can I setup the choppers to attack the OPFOR boats first. I need the choopers to take out most of the patrol boats if the team is going to make it back to the fleet. Any help would be great. Thanks AVIBIRD. Can you order units to engage only one kind of units during a mission!

Share this post


Link to post
Share on other sites

You definitely can. Some ideas: write an "observer"-script or fsm (as you prefer) and make sure your choppers have the correct targets assigned (doTarget/commandTarget). Or you could check the current target of the chopper with assignedTarget and check if it's ok, if not, order a cease fire and move back, reassign a better target or something...

If you're modeling this setup so that the choppers already are aware of these boats, you migh write a simple seak-and-destroy script, hunting one unit/boat in a definded array, until every boat is dead, while reassigning the target, once the current target is dead... some checks and some loops {while (alive _currentBoat)} do { kill-it }.. and you should be set.

If you want, you can check my RUBE library and try RUBE/ai/ai_taskHunt.fsm, though that might be overkill. :)

Guess you need to try what works best for your scenario.

Share this post


Link to post
Share on other sites
You definitely can. Some ideas: write an "observer"-script or fsm (as you prefer) and make sure your choppers have the correct targets assigned (doTarget/commandTarget). Or you could check the current target of the chopper with assignedTarget and check if it's ok, if not, order a cease fire and move back, reassign a better target or something...

If you're modeling this setup so that the choppers already are aware of these boats, you migh write a simple seak-and-destroy script, hunting one unit/boat in a definded array, until every boat is dead, while reassigning the target, once the current target is dead... some checks and some loops {while (alive _currentBoat)} do { kill-it }.. and you should be set.

If you want, you can check my RUBE library and try RUBE/ai/ai_taskHunt.fsm, though that might be overkill. :)

Guess you need to try what works best for your scenario.

Hey that is great but I have no clue how to write a script to make it work. If you could help me out that would be great. A simple seak-and-destroy script that will hunt one unit/boat in a definded array, until every boat is dead:yay:

PS anyone else that knows how to make this script. Thanks.

Share this post


Link to post
Share on other sites
Hey that is great but I have no clue how to write a script to make it work.

Well, noone is going to write scripts for you. Either you learn to do your stuff or... well, you don't. :)

I'm afraid, this might be too confusing already for a guy that has "no clue how to write a script", in that case never mind. But if you're still with me, you could try the following:

Make sure the RUBE library is in your mission directory. Load it in init.sqf (which also loads the BIS function library, so there's no need to put that module down in the editor) like this:

// load RUBE function library
[] call (compile preprocessFileLineNumbers "RUBE\init.sqf");
waitUntil{!(isnil "RUBE_fnc_init")};

And then, at the desired point in your mission, probably in some other file/script, you may launch the taskHunt fsm:

     _fsm = [
        ["group", _group], // group
        ["targets", _targets], // object, array of objects or group
        ["trackingMode", (random 0.75)]
        //["onContact", _onContact],
        //["onTargetInSight", _onTargetInSight],
        //["onFailure", _onFailure],
        //["onSuccess", _onSuccess]
     ] execFSM "RUBE\ai\ai_taskHunt.fsm";

Where _group is a reference to the group of the hunters (eg. the group of your choppers) and _targets is the array with references to your boats or again simply the group of these boats (if they are all in the same group). As for the trackingMode: 0.0 is slow tracking without knowledge, while 1.0 is fast tracking with simulated assistance/good knowledge of the targets. And the commented-out options are code-event-handlers you might want to use.

For further detail you need to look at that fsm in the fsm-editor.

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  

×