Home   Help Search Login Register  

Author Topic: Booleans in Arrays won't fire triggers  (Read 638 times)

0 Members and 1 Guest are viewing this topic.

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Booleans in Arrays won't fire triggers
« on: 26 May 2005, 22:32:31 »
I want to use a script to fire one of several triggers.  I am using arrays to store boolean values as:

Code: [Select]
DogSound = [false,false]
I have a script that sets:
Code: [Select]
DogSound set [_i,false]or
Code: [Select]
DogSound set [_i,true]depending on certain conditions.
_i is an appropriate value

I have the following in the condition field of a trigger:
Code: [Select]
DogSound select 0
The problem I have is the trigger does not fire after a
Code: [Select]
DogSound set [0,true]
I have been at this all day and am becoming fuddled.  Can anyone tell me what I am doing wrong?

I have tried to fool it by putting:
Code: [Select]
(DogSound select 0) == truein the condition field of the trigger - but I get an error.
« Last Edit: 26 May 2005, 22:35:30 by THobson »

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Booleans in Arrays won't fire triggers
« Reply #1 on: 27 May 2005, 00:11:25 »
Is it possible that the element extracted from the array is a string?
Plenty of reviewed ArmA missions for you to play

Offline Fragorl

  • Coding Team
  • Former Staff
  • ****
Re:Booleans in Arrays won't fire triggers
« Reply #2 on: 27 May 2005, 01:44:20 »
nope, because that would cause an error.

do you have the trigger set to countdown, or a non-zero timeout value? Although I doubt that would be it.

you have tried testing it, eg with

a radio trigger
onactiv= DogSound set [0,true]

another radio trigger
onactiv= hint format["%1",DogSound select 0]

finally, are you sure that the trigger isn't firing, but without visible effect? In fairness if you've been testing then you will have checked that.

Perplexing...

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Booleans in Arrays won't fire triggers
« Reply #3 on: 27 May 2005, 06:56:01 »
Fragorl.  I did as you suggested and the radio method works, :cheers: so it clearly not a problem with the trigger.  I am now off to look in to the code of my script.  It might just be a stupid typing error.

EDIT:  I am now totally confused.  In the script I have a message to tell me when the value is set and in the trigger I have a message to tell me it has fired.  I have touched nothing overnight, last night I was getting the message from the script only, this morning I am getting both.  I haven't even restarted OFP, I was doing an overnight soak test of the misson so it has been running all this time

In otherwords it is working :) but I have no idea what the problem was last night :-[ and I have changed nothing in the meantime.  Honest.
« Last Edit: 27 May 2005, 07:08:47 by THobson »