OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: limmy3 on 21 Oct 2008, 23:44:16

Title: player countEnemy list triggerOne
Post by: limmy3 on 21 Oct 2008, 23:44:16
Hello there,

well since a few hours I'm trying to figure how I can use this command.
I must admit I hope virtually no experience with scripting basic.

this example is show in the COMREF:

Code: [Select]
player countEnemy list triggerOne
But unfortunate there is nothing I could work with.
I put this example in the OnActiv line of a trigger and named it triggerone.
All it did after pressing "OK" was F65S_3_1 [AI name to count the enemy]  countEnemy list triggerOne was

Code: [Select]
F65S_3_1 countEnemy list triggerOne |#|': Error Type Number, expected Nothing
I know that this matter was ask times before but I unfortunately coudn't find the right solution for me.

So if someone perhaps would like to help me.

That's what's happening:

In Lamentin (Everon) at the North side of the town is a plateau at the road.

From the lower north ridge soldiers (West) clim in direction south.
As they can't overlook the whole plateau they stop before reaching the open ground.
The groug leader advances to recon the area and should sideChat how many enemy units are
in the area (trigger 100x50).

[This part has not exactly to do with the count command.]
If the leader doesn't spott the enemy he should advance.
If the leader does spott the enemy but the enemy has not yet spotted the West he should stop count the enemy
> 6 and advance with his formation but should not attack.
If the leader does spott the enemy and the enemy has spotted the West he should attack.

Regards limmy3











Title: Re: player countEnemy list triggerOne
Post by: Walter_E_Kurtz on 24 Oct 2008, 00:20:14
The countEnemy command doesn't appear to work as one would expect. Search the forums for "countEnemy" and try the appended test mission.

My impression of the the countEnemy command is that it works much like Detected by ..., but its output is the number of enemies who consider the unit a threat to be engaged.

In the test mission, you have two radio commands: Alpha (0-0-1) will output the countEnemy of the trigger area, and Bravo (0-0-2) will list the units in the trigger area. The countEnemy number will not rise until the enemies have turned round and spotted you as a target.



Possible uses of countEnemy
You could use it for the final possibility in your attack on Lamentin, as it should give a positive number output once "the Enemy has spotted West", but you may find it easier to use knowsAbout.

It could also be used in place of a "detected by" trigger for an alarm when infiltrating as a lone-wolf, but I'm not certain it has any advantage.
Title: Re: player countEnemy list triggerOne
Post by: NightJay0044 on 24 Oct 2008, 02:18:07
Running into problem sometimes is common when it comes to OFP Command Reference.  You have to know other sorts of information in order to sometimes fully understand how to use a certain command.   

@Walter_E_Kurtz~
You know one the advantages about the "knowsabout" command is it's used for a single soldier or possibly a group.

Instead of detected by is used for detection by east in the whole area of the trigger. 

I learend another new way of editing today.   :good: