AI count ?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

AI count ?

aggelon
Hello,

I'd like to add the count of alive AI (bandit, survivors) in my debug monitor.

How to do that ? Which command line ?

Thank you.
Reply | Threaded
Open this post in threaded view
|

Re: AI count ?

Haleks
Hey, how are you doing dude? ;)
For your debug monitor, it's gonna be tricky : you would need to count alive units for each side - West side usually being the friendlies, and East side for hostiles/bandits.
Problem is (in Factions anyway) : bandits can be East side as well as "GUER" side - and zeds also are GUER side...
Meaning that you can easily count alive survivors - but for the bandits it's gonna be complicated...

Anyway, here's a code for a usefull debug monitor (can't remember where I found it) :
//Let Zeds know
[player,4,true,(getPosATL player)] spawn player_alertZombies;

/*
Change the UID's below to match those of you and your admin(s)
Your admins will get the advanced version of your debug monitor,
while your regular users will get the cut down version.
*/

if ((getPlayerUID player) in ["11111","22222"]) then {
         
          hintSilent parseText format ["
        <t size='0.95' font='Bitstream' align='left' >[%18]</t><t size='0.95' font='Bitstream' align='right'>[FPS: %10]</t><br/>
        <t size='0.95' font='Bitstream' align='center' color='#FFBF00'>Survived %7 Days</t><br/>
        <t size='0.95' font='Bitstream' align='left' >Players: %8</t><t size='0.95 'font='Bitstream' align='right'>Within 500m: %11</t><br/>
        <t size='0.95' font='Bitstream' align='left' >Vehicles:</t><t size='0.95' font='Bitstream'align='right'>%13(%14)</t><br/>
        <t size='0.95' font='Bitstream' align='left'>Air: %16</t><t size='0.95' font='Bitstream'align='right'>Sea: %23</t><br/>
        <t size='0.95' font='Bitstream' align='left' >All Bikes: %15</t><t size='0.95' font='Bitstream'align='right'>Cars: %17</t><br/>
        <t size='0.95' font='Bitstream' align='left' >Zombies (alive/total): </t><t size='0.95' font='Bitstream' align='right'>%20(%19)</t><br/>
        <t size='0.95' font='Bitstream' align='left' color='#FFBF00'>Zombies Killed: </t><t size='0.95' font='Bitstream' align='right'>%2</t><br/>
        <t size='0.95' font='Bitstream' align='left' color='#FFBF00'>Headshots: </t><t size='0.95' font='Bitstream' align='right'>%3</t><br/>
        <t size='0.95' font='Bitstream' align='left' color='#FFBF00'>Murders: </t><t size='0.95' font='Bitstream' align='right'>%4</t><br/>
        <t size='0.95' font='Bitstream' align='left' color='#FFBF00'>Bandits Killed: </t><t size='0.95' font='Bitstream' align='right'>%5</t><br/>
        <t size='0.95' font='Bitstream' align='left' color='#FFBF00'>Humanity: </t><t size='0.95' font='Bitstream' align='right'>%6</t><br/>
        <t size='0.95' font='Bitstream' align='left' color='#FFBF00'>Blood: </t><t size='0.95' font='Bitstream' align='right'>%9</t><br/>
        <t size='0.95' font='Bitstream' align='left' >GPS: %22</t><t size='0.95' font='Bitstream' align='right'>DIR: %24</t><br/>
        <t size='0.95'font='Bitstream'align='center' >%21</t><br/>",
        (name player),
        (player getVariable['zombieKills', 0]),
        (player getVariable['headShots', 0]),
        (player getVariable['humanKills', 0]),
        (player getVariable['banditKills', 0]),
        (player getVariable['humanity', 0]),
        (dayz_skilllevel),
        (count playableUnits),
        r_player_blood,
        (round diag_fps),
        (({isPlayer _x} count (getPos vehicle player nearEntities [["AllVehicles"], 500]))-1),
        viewdistance,
        (count([6800, 9200, 0] nearEntities [["StaticWeapon","Car","Motorcycle","Tank","Air","Ship"],25000])),
        count vehicles,
        (count([6800, 9200, 0] nearEntities [["Motorcycle"],25000])),
        (count([6800, 9200, 0] nearEntities [["Air"],25000])),
        (count([6800, 9200, 0] nearEntities [["Car"],25000])),
        (gettext (configFile >> 'CfgVehicles' >> (typeof vehicle player) >> 'displayName')),
        (count entities "zZombie_Base"),
        ({alive _x} count entities "zZombie_Base"),
        (getPosASL player),
        (mapGridPosition getPos player),
        (count([6800, 9200, 0] nearEntities [["Ship"],25000])),
        (round(getDir player))
];

} else {

hintSilent parseText format ["
        <t size='1.20' font='Bitstream' align='center' color='#00CC00'>%1</t><br/>
        <t size='0.95' font='Bitstream' align='center' >[%10]</t><br/>
        <t size='1.15' font='Bitstream' align='center' color='#FFCC00'>Survived %7 Days</t><br/><br/>
        <t size='1.15' font='Bitstream' align='left' color='#FFBF00'>Zombies Killed: </t><t size='1.15' font='Bitstream' align='right'>%2</t><br/>
        <t size='1.15' font='Bitstream' align='left' color='#FFBF00'>Headshots: </t><t size='1.15' font='Bitstream' align='right'>%3</t><br/>
        <t size='1.15' font='Bitstream' align='left' color='#FFBF00'>Murders: </t><t size='1.15' font='Bitstream' align='right'>%4</t><br/>
        <t size='1.15' font='Bitstream' align='left' color='#FFBF00'>Bandits Killed: </t><t size='1.15' font='Bitstream' align='right'>%5</t><br/>
        <t size='1.15' font='Bitstream' align='left' color='#FFBF00'>Blood: </t><t size='1.15' font='Bitstream' align='right'>%6</t><br/><br/>
        <t size='1.15' font='Bitstream' color='#5882FA'>Tinyurl.com/DAYZ487</t><br/>",
        (name player),
        (player getVariable['zombieKills', 0]),
        (player getVariable['headShots', 0]),
        (player getVariable['humanKills', 0]),
        (player getVariable['banditKills', 0]),
        r_player_blood,
        (dayz_skilllevel),
        (count entities "zZombie_Base"),
        ({alive _x} count entities "zZombie_Base"),
        (gettext (configFile >> 'CfgVehicles' >> (typeof vehicle player) >> 'displayName'))
];};
It counts the number of alive zeds : I reckon you could modify it easily enough to count survivors - with a bit of googling. ;)
Tip : In Factions, "survivor" is a string, so it should work if you change
        (count entities "zZombie_Base"),
        ({alive _x} count entities "zZombie_Base"),
to :
        (count entities "survivor"),
        ({alive _x} count entities "survivor"),
I didn't test it though...
Reply | Threaded
Open this post in threaded view
|

Re: AI count ?

Haleks
I just realised : "bandit" should be a string too...
I'll do some tests whenever I have time, and share the code here if I come up with something working.
Reply | Threaded
Open this post in threaded view
|

Re: AI count ?

aggelon
Hi dude ;)

Well, the oher formula you gave me works :

For the survivors count : (({alive _x && ( !(_x isKindOf "zZombie_Base")) && side _x == west} count entities "Man")-1)

I added a -1 at the end of this count because our own character is inside the 'survivors' count.

I can't make work the formula for bandits, so my workaround is :

((count allUnits)-({alive _x && ( !(_x isKindOf "zZombie_Base")) && side _x == west} count entities "Man"))

i.e. count all the AI/human units in the game, then subtracts the number of survivors :P

Thanks again, man  *\o/*
Reply | Threaded
Open this post in threaded view
|

Re: AI count ?

Haleks
You're welcome buddy! ;)