Home   Help Search Login Register  

Author Topic: Counting % of dead  (Read 801 times)

0 Members and 1 Guest are viewing this topic.

Crassus

  • Guest
Counting % of dead
« on: 08 Mar 2004, 18:56:24 »
Thanks to Macguba, I've gotten further along in setting up this trigger.
The trigger:
Code: [Select]
Name: Finns
Activation: Resistance
Present
Condition: this
On Activation: FinnStart = count thislist; hint format ["Do you see %1 Finns?", count thislist]


And in a separate script:
Code: [Select]
; just to confirm that the script is called
~3
hint format ["I see %1 Divers.", count list Finns]


#loop
? count list Finns < (count finnStart)/2: goto "dead"
~0.5
goto "loop"


#dead
hint "They're dead."
~1
theyreDead = true


And the ending trigger:
Code:
End #1
Condition: theyreDead

I'm getting the error msg:
Code: [Select]
"? count list Finns < (count finnStart)/|#|2: goto "dead": Error count: Type number, Expected Array"
Now, why would an array be expected since I'm comparing two solid numbers: the number of live Finnish Divers at the time of the count,  and the number of live Divers at the very beginning of the mission? ???

I'm attempting to score and end the mission for the player when 50% of the Finns holding the player's objective are dead.

Hope you can help.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Counting % of dead
« Reply #1 on: 08 Mar 2004, 19:25:11 »
"? count list Finns < (count finnStart)/|#|2: goto "dead": Error count: Type number, Expected Array"

The clue is always where the # is.    Finnstart is already a number - you don't have to count it again.

? count list Finns < finnStart/2: goto "dead"
Plenty of reviewed ArmA missions for you to play