Jump to content

Recommended Posts

handleautodeploy.jpg

 

Story

This is a script that I wrote a few weeks ago for a friend. It's supposed to let AI's with specific backpack's deploy static weapons automatically in a combat. You can link specific backpacks with specific static weapons multiple times. This script doesn't work, if the AI is in a combat mode all the time or if the AI never gets to be in a combat mode. There are several routine integrated to avoid script errors. A description can be found inside the SQF file, how to execute the script. It's SP/MP/Dedicated and HC compatible. Have fun.

 

Content

It is a single ~80Code-Line-Big Script to let AI's with specific backpack's deploy static weapons automatically in a combat.

 

Purpose

The aim of this script is to make it easier to implement a universal script, which makes a combat with AI more interesting.

 

Download

Missions and Script on GitHub

 

ArmaHolic

Link

 

Credits

Script & Media: Rockhount

 

Examples

 

nul=[["B_Bergen_dgtl_F","B_Mortar_01_F"]] execVM "HandleAutoDeploy.sqf";

nul=[["B_Bergen_dgtl_F","B_Mortar_01_F"],["B_Bergen_mcamo_F","B_Mortar_01_F"]] execVM "HandleAutoDeploy.sqf";

nul=[["B_Bergen_dgtl_F","B_Mortar_01_F"],["B_Bergen_mcamo_F","B_Mortar_01_F"],["B_Bergen_hex_F","B_GMG_01_high_F"],["B_Bergen_tna_F","O_GMG_01_high_F"]] execVM "HandleAutoDeploy.sqf";

 

All 3 examples are possible, because there is no limit for the amount of parameters.

 

 

  • Thanks 1

Share this post


Link to post
Share on other sites

Congratulations on the script. I would like to ask if it can be used to deploy mortars or anti-missiles type TOW or similar.

 

BR

 

AtomicBoy

Share this post


Link to post
Share on other sites

You have to type the classname of the static weapon & backpack as script parameters, so you can choose whatever you want. Try it.

Share this post


Link to post
Share on other sites

Hi @rockhount,

 

Would it be possible to have this lovely script as an addon?  It would need to detect what exact backpack a soldier is wearing then choose to deploy in the correct scenario (ie it would be useless to setup a titanAA if you were being attacked by a tank).

 

As an addon I could see this being used quite extensively.

Share this post


Link to post
Share on other sites

Nope. No plans to do that now or in the future. But its open source under the MIT license, so everyone who wants can do that.

Share this post


Link to post
Share on other sites

to use the script with mortars or anti-tank misiles:

 

removeBackpackGlobal u1;u1 addBackpackGlobal "B_Bergen_dgtl_F";
nul=[["B_Bergen_dgtl_F","B_Mortar_01_F"],["B_Bergen_mcamo_F","B_Mortar_01_F"]] execVM "HandleAutoDeploy.sqf";


removeBackpackGlobal u1;u1 addBackpackGlobal "B_Bergen_dgtl_F";
nul=[["B_Bergen_dgtl_F","B_static_AT_F"],["B_Bergen_mcamo_F","B_static_AT_F"]] execVM "HandleAutoDeploy.sqf";

 

Share this post


Link to post
Share on other sites

@rockhount many thanks for replying so soon mate.  If I was skilled enough I'd love to have something like this made, as it would help to open up gameplay features via AI so much more.  Thanks for being honest.

 

Share this post


Link to post
Share on other sites

good afternoon

I have detected a possible bug, when I put two soldiers with the script to execute it, each soldier deploys 2 weapons. If I have to deploy machine guns, each soldier deploys 2 machine guns. If I have them deploy mortars, each soldier deploys 2 mortars.

Any idea where the fault may be?

BR

AtomicBoy

Share this post


Link to post
Share on other sites

Let me guess. You ran the script twice. From the description inside the SQF: "The backpacks of all existing units get scanned 10 seconds after this script has been called. If the backpack can be find in the script parameters, then the unit gets a loop as long as he lives." That means: Run the script only once for all units. You can pass infinite number of "[BackpackClassName,StaticWeaponClassName]" parameters as Arrays in one call, as you want. There is no scenario, where it's needed to call/run this script more than once.

 

Examples:

nul=[["B_Bergen_dgtl_F","B_Mortar_01_F"]] execVM "HandleAutoDeploy.sqf";

nul=[["B_Bergen_dgtl_F","B_Mortar_01_F"],["B_Bergen_mcamo_F","B_Mortar_01_F"]] execVM "HandleAutoDeploy.sqf";

nul=[["B_Bergen_dgtl_F","B_Mortar_01_F"],["B_Bergen_mcamo_F","B_Mortar_01_F"],["B_Bergen_hex_F","B_GMG_01_high_F"],["B_Bergen_tna_F","O_GMG_01_high_F"]] execVM "HandleAutoDeploy.sqf";

 

All 3 examples are possible, because there is no limit for the amount of parameters.

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

×