Jump to content
Sign in to follow this  
ToM666

global AI setting

Recommended Posts

Hi guys

The map I have made "Operation Chemo" relies for the most part on the EOS system by bangabob to provide enemy occupation.

Is there any way to globally set the variable for AI, kill, armour, accuracy etc when there is a script such as this spawning the enemy troops for you?

Share this post


Link to post
Share on other sites
Use the setSKill command inside a for allUnits loop for their skill.

Hi mate. Do you put that in a trigger?

Also, can you set accuracy in the same way. That is the biggest issue for me.

I want the AI to be skill ful just not aimbot skillfull LOL.

Share this post


Link to post
Share on other sites

You do not need a trigger, just put this in the init field of a unit:

0 = [0.2] spawn {
   while {true} do {
       sleep 10;
       {
           _x setSkill ["aimingAccuracy", (_this select 0)];
       } forEach allUnits;
   };
}

Change '0.2' to any number between 0 and 1. You only need to run this once; it will take care of all units you spawn later.

Share this post


Link to post
Share on other sites

snip did not read

Edited by cuel

Share this post


Link to post
Share on other sites
You do not need a trigger, just put this in the init field of a unit:

0 = [0.2] spawn {
   while {true} do {
       sleep 10;
       {
           _x setSkill ["aimingAccuracy", (_this select 0)];
       } forEach allUnits;
   };
}

Change '0.2' to any number between 0 and 1. You only need to run this once; it will take care of all units you spawn later.

So if I am using Bangabobs EOS. I just need to place one OPFOR soldier anywhere on the map with this code in the init field and it will ensure all AI that spawn in the activated zones have the same accuracy setting?

Would this also work if I put it in the init.sqf?

Share this post


Link to post
Share on other sites

It is probably better to figure out how to run this once for each spawned unit. Otherwise this is running every 10 seconds on every unit which is not a good idea.

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  

×