Home   Help Search Login Register  

Author Topic: trigger delay  (Read 917 times)

0 Members and 1 Guest are viewing this topic.

borrowed soap

  • Guest
trigger delay
« on: 10 Jul 2003, 23:25:10 »
if i put a 1 second delay on a trigger in its min/max/mid field, does it then have a polling interval of 1.5 seconds instead of its normal 0.5? i know the delay will change when effects occur with the trigger, but i am wondering if it also changes the amount of times the cpu asks whether the trigger requirements have been active.

*added*
i dont think it will.  it must ask whether the condition has been met Before it delays, else it would not synch with other commands and scripts, etc.   not sure tho
« Last Edit: 11 Jul 2003, 00:01:53 by borrowed soap »

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:trigger delay
« Reply #1 on: 11 Jul 2003, 00:24:57 »
need I answer anymore?  ;D
Not all is lost.

gadolinite

  • Guest
Re:trigger delay
« Reply #2 on: 11 Jul 2003, 05:26:55 »
Are you thinking of timeout triggers, I can read between the lines and see that this this is what you are attempting?

I have tried to use timeouts, and have had some luck.  I do not know the actual purpose.

What I would do is use a 'delay script' that is executed at the trigger and perform the action after the time is up within the script.
just an example, modify to your own standards:

; counter = 3
_counter = 3
; loop label
#loop
; subtract 1 form counter
_counter = _counter - 1
; one second delay
~1
; if counter not equal to zero goto label "loop"
?_counter != 0 : goto "loop"

<perform action here>

exit
 
« Last Edit: 11 Jul 2003, 05:30:22 by gadolinite »

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:trigger delay
« Reply #3 on: 11 Jul 2003, 10:43:35 »
well that whole thing is the same as just putting a script like this

Code: [Select]
~3
<perform action here>
exit

but you could do it like this, and execute it with [delay_you_want] exec "delay.sqs"

Code: [Select]
_delay = _this select 0
~_delay
<perform action here>
exit

but that's all just like using the timeout option in the trigger which you're using to execute the script in the first place.

When using the triggers 'timeout' option (for example min=1 max=1 mid=1) the trigger waits exactly the amount of time you choose before it executes it's 'on activation field'. So therefore and because triggers check themselves for conditions every 0.5 seconds it could take from 1 to 1.5 seconds for it to execute it's 'on activation' field.
Not all is lost.

borrowed soap

  • Guest
Re:trigger delay
« Reply #4 on: 11 Jul 2003, 21:48:04 »
thx for the replies.
i was trying to compare the lag from a trigger (.5 sec polling interval (or whatever its called)) to that of a script with a ~delay.
i have been led to believe that a script loop running at ~1 is of course less lag (less operations) than a delay of ~.5 from a trigger, and this is good when there is no need for such a quick loop.
then i wondered if the min/max/mid determination could offset the  .5 second polling interval, thus eliminating the need to write out a script for the trigger to save on 'looptime'.
just a question i came upon while trying to limit any potential lag issues on an island-wide mission im playing with.
 8)