Home   Help Search Login Register  

Author Topic: Counting  (Read 832 times)

0 Members and 1 Guest are viewing this topic.

bigcheese

  • Guest
Counting
« on: 24 Jan 2004, 21:22:30 »
how would i go about counting all the people on a particular side and listing there names

also how do you find out what inventory a person has using scripts

thanks in advance

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Counting
« Reply #1 on: 25 Jan 2004, 02:25:19 »
Make a trigger covering the whole map.  Activation east present or whatever.    In the on activation box you need something like

[thislist] exec "myscript.sqs"

Syntax not guaranteed, but in principle this will pass the array thislist (which is an array of all the units that would activate the trigger) to your script, where you can play with them as you will.   Use the command count to count them.

Or directly in the on activation field:-

hint format ["East loons - %1", count thislist]


For kit use commands:-

weapons
magazines
ammo
hasweapon
Plenty of reviewed ArmA missions for you to play

bigcheese

  • Guest
Re:Counting
« Reply #2 on: 26 Jan 2004, 18:37:26 »
Sorry,

I forgot to mention that the script im using relies on the fact that you dont have to put a trigger down,

I think i remember a while back that there is already a default trigger that is on every map that covers the whole map - can anyone remember what its called - if not is there a command that does it.

Thanks

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Re:Counting
« Reply #3 on: 26 Jan 2004, 22:45:02 »
well without using a trigger, what you could do is create an array for all west players and all east players

eg lets say its a 24 player game

E_array = [E1,E2,E3,E4,E5,E6,E7,E8,E9,E10,E11,E12]
W_array = [W1,W2,W3,W4,W5,W6,W7,W8,W9,W10,W11,W12]

E1, would be the name you gave to one of the east units in the editor view

you could then count how many units are alive in each array

remove all elements of the array that are not alive
resize the array
and then return the list of all name _x in the array


if you needed to do this further into the mission than right at the very start, then you would have to update the arrays every time a player respawns, remove the older elements of the array that the dead player element became and replace itr with the newer element

See kegety's spectator script for some ideas on what the script lines look like to do some of this

I know its a bit vague, but without specifics as to when and why you need to do this, then the answers are vague
« Last Edit: 26 Jan 2004, 22:45:57 by Terox »
Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:Counting
« Reply #4 on: 26 Jan 2004, 23:29:27 »
Quote
I think i remember a while back that there is already a default trigger that is on every map that covers the whole map - can anyone remember what its called - if not is there a command that does it.

 :o wow - u must have encountered one of the greatest news
in OFP's history, and then you can't remember it anymore  >:(

nah - forget it, there's no such a "default trigger", as you could
be sure BIS would have been using it in some of their maps, if
there were one.

The most cpu friendly way is to put the guys manually into arrays, as there wouldn't be a large trigger, stressing cpu and
even harder: network performance.

For the "lazy" ppl (forgive me that u lazy ppl u  ;D ), there's still
the other method, where you have a large trigger to capture
everybody into an array.

~S~ CD
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:Counting
« Reply #5 on: 27 Jan 2004, 11:34:19 »
Quote
For the "lazy" ppl (forgive me that u lazy ppl u   ), there's still
the other method, where you have a large trigger to capture
everybody into an array.

m lazy :P nd proud of it ;) ;D

 ::)

nywayz i think dat if u make da triger a 1 tamer (once thingy)

den even tho it wil use lotsa CPU 1 time - it wil take bout 0.5 sec (or less ::)) nd den stop efectin ? if so den it isnt dat CPU stresin :P or do da triger continue efectin after it done it job ? ny1 got answer ?

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:Counting
« Reply #6 on: 27 Jan 2004, 14:06:16 »
nywayz i think dat if u make da triger a 1 tamer (once thingy)

den even tho it wil use lotsa CPU 1 time - it wil take bout 0.5 sec (or less ::)) nd den stop efectin ? if so den it isnt dat CPU stresin :P or do da triger continue efectin after it done it job ? ny1 got answer ?
I'd like to know the answer to this as well...

Me and my crappiest computer of all time need every single lag reducing gimmick there is...  :(
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:Counting
« Reply #7 on: 27 Jan 2004, 19:24:56 »
I don't think so for the reason that:

You can always access the list of a trigger (one timer or not).

You should be able to test it that way:

Create a large trigger, and make it a one timer.
Now make da condition: true, so that it shoots right from
start.

Now start a script, and make a display for anything inside
that trigger's list, which hasn't been in there when the mission
started.

Now find a way to check the time, it took from the display
command 'till the display was shown.

If it takes long, we can assume that the trigger list get's
created new.

If there's no time-delay, then the trigger list may have been
updated instantly. (that's my theory btw).

btw - i forgot to mention, that when testing that, it would
be required that there's no current active condition, waiting
for something inside the trigger list.
Just start a script by radio-gaga or so.

~S~ CD
« Last Edit: 27 Jan 2004, 19:26:09 by Chris Death »
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:Counting
« Reply #8 on: 27 Jan 2004, 20:26:08 »
i think it wont update didnt test tho (nd not gonna do :P)

btw

Quote
Now make da condition: true

look

he said da :P ;) ::)

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:Counting
« Reply #9 on: 27 Jan 2004, 21:18:30 »
Updating does it for sure, the quessy is only:

Does it update instantly, or does it update upon request?

Dat technique is used very often in multiplay games, to
check areas for somebody's presence or absence.

If you gonna display the list of a trigger, you will always
see the actual list, containing all objects matching to the trigger's activation conditions like: west present (not the condition field i mean).

Sorry, but it wasn't even me, who said that such triggers
eat alot of performance, it's been da man: SUMA

Quote
it's been da man: SUMA

 :-X oops i did it again  ;D

~S~ CD
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Re:Counting
« Reply #10 on: 27 Jan 2004, 22:40:17 »
The command  "@"
and triggers

are basically very fast looping scripts, that check to see if their conditions have been met

The speed of their loop check is dependant on the fps i believe

so unless it is absolutely necessary, always use a looping script, even a ~0.1 wait period is less stressful on a cpu than either triggers or @ commands

ideally script loops should be 0.5 or slower, not contain too many lines in the loop, certainly no commented out lines, and there is nothing that can be done with a trigger that cant be done with a script

as Chris said, use an array for your list of players

Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:Counting
« Reply #11 on: 28 Jan 2004, 04:13:49 »
If you gonna display the list of a trigger, you will always
see the actual list, containing all objects matching to the trigger's activation conditions like: west present (not the condition field i mean).

i think dat in MP u use ;ots timer trigz 4 dat (one timer - lots timer ::)) not one timer - but i never needed dat so i cant realy tel ya - so did u try it ? or... ? :P

Quote
Does it update instantly, or does it update upon request?

dats rights - nd i need str8 answe 4 dat ;) ;D

but ma guess is request - nd in da MP thingyit updates upon request : wen i use lots timer it keeps updating

@ terox - i know dat... 4 vey long time (im scripter 4 about 2 yrz i shud know som  thigz bout wat i do ;)) ;D dats not wat we talkin bout :P ;D

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Re:Counting
« Reply #12 on: 29 Jan 2004, 17:50:24 »


@ terox - i know dat... 4 vey long time (im scripter 4 about 2 yrz i shud know som  thigz bout wat i do ;)) ;D dats not wat we talkin bout :P ;D

LCD OUT

apologies, it wasn't aimed at you, sorry u thought it was
Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123