Home   Help Search Login Register  

Author Topic: Quick count list question.  (Read 1534 times)

0 Members and 1 Guest are viewing this topic.

Offline laggy

  • Members
  • *
  • "Behold a pale horse"
Quick count list question.
« on: 09 May 2009, 15:26:42 »
Setup:

All editor placed (triggers and units).

Trigger #1 - BLUFOR present, repeatedly, named goodguys.

Trigger #2 - OPFOR present, repeatedly, named badguys.

Trigger#3 - count list goodguys > count list badguys
OnAct: ending = true

Question:

Is there a risk that different players get different counts, causing the mission to end too early on some computers?

Global triggers are coordinated I know, but the reason I ask is the memory of OFP where a trigger "NOT PRESENT" would activate prematurely on clients if the trigger was counting AI (local to the server). You simply had to count on the server. The problem with using "AND isServer" in condition is if the count should include ALL from i.e one side: players + local AI + non local AI.

Worried  :confused:



« Last Edit: 09 May 2009, 15:28:19 by laggy »
And I looked and beheld a pale horse and his name that sat on him was Death and Hell followed with him.

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: Quick count list question.
« Reply #1 on: 10 May 2009, 03:42:56 »
A trigger list incorporates all units regardless of locality, so I don't think that is your issue. There are, however, may reasons why triggers could count differently on different computers or in different situations.

Triggers are only updated, and their conditions checked, every 0.5 seconds. I'm pretty sure that this timing is not exactly in sync on each machine, and that, since objects can be in different places on different machines (the difference caused by desync) it is reasonable to assume that sometimes different machines have different things inside their triggers at the same time. Generally, this isn't a massive problem, but if a trigger causes a critical event (such as ending the mission) it can be best to do this on the server and broadcast the results.

A possible related issue is that a manned vehicle only counts one in your example, so if 3 soldiers get into a humvee, they will only count one. In case there are vehicles in your mission, you need to count the total people in each crew of each vehicle:
Code: (condition counting all the living crew; true if goodguys outnumber badguys) [Select]
total = 0; { total = total + { alive _x } count (crew _x) } forEach goodguys; { total = total - { alive _x } count (crew _x) } forEach badguys; total > 0
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline laggy

  • Members
  • *
  • "Behold a pale horse"
Re: Quick count list question.
« Reply #2 on: 10 May 2009, 10:49:53 »
Quote
A trigger list incorporates all units regardless of locality
Great to know, never got a really clear answer to this before, thanks a lot.
Quote
if 3 soldiers get into a humvee, they will only count one
That explains many "random" effects back since the OFP days  :P

Much obliged,

Laggy
And I looked and beheld a pale horse and his name that sat on him was Death and Hell followed with him.