Jump to content
Sign in to follow this  
_qor

evaluate attack intensity?

Recommended Posts

Hey there,

I want to create a script which evaluates the intensity of an attack, for example on an airbase.

Depending on the result, various countermeasures should get executed.

So I would handle this with the detected by function. Counting every detected enemy force would give a realistic image of what friendly AI is aware of the enemy.

I am trying with countEnemy, but the return value is always 0 although the AI attacks the enemies.

Besides, how to use this not for a single unit but for a whole side?

thanks for any help! :)

Edited by _qoR

Share this post


Link to post
Share on other sites

Great idea and script, but I guess this leads to the wrong direction.

The script evaluates where units die. But actually I need the information BEFORE they die.

If 20 enemy units attack, these 20 units would be a threat to the base although they cant be shot and the script wouldnt execute.

What about the countEnemy code? Why is the returned value alway 0?

Share this post


Link to post
Share on other sites

countEnemy counts the amount of enemies in an array and returns a number.

_enemyCount = player countEnemy allUnits; // allUnits return a list (array) of all units
player sideChat format ["%1", _enemyCount]; // print _enemyCount (number)

Edited by Iceman77

Share this post


Link to post
Share on other sites
countEnemy counts the amount of enemies in an array and returns a number.

Right, so I still dont get why using this code

hint format ["%1", guy1 enemyCount list trigger1];

my returned number is alway 0.

I created a group of enemies in the area of trigger1 and let guy1 move towards them, expecting it returns 3 or 4 when guy1 detected them.

Share this post


Link to post
Share on other sites

for one, you have the command wrong...

it's countEnemy, not enemyCount

Right, so I still dont get why using this code
hint format ["%1", guy1 enemyCount list trigger1];

my returned number is alway 0.

I created a group of enemies in the area of trigger1 and let guy1 move towards them, expecting it returns 3 or 4 when guy1 detected them.

hint format ["%1", guy1 countEnemy list trigger1];

Share this post


Link to post
Share on other sites

Big sorry! I just wrote it down in a hurry, ingame code was correct.

Problem was, that I didnt set the trigger to get activated by OPFOR!

So having the code running, I tried a bit and it turns out that there already is kinda build in evaluation.

At least AI share their knowledge about enemies to friendly units. So if they have a GUARD waypoint, they will move towards those enemies - regardless of that, they get the shared information.

And apparently AI arranges enemies to which has been detected first and prioritizes the first detected.

Great stuff, didnt know that! Gonna keep trying this out...

Edited by _qoR

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  

×