Page MenuHomeFeedback Tracker

"triggerTimeoutCurrent" never equals setTriggerTimeout
Closed, ResolvedPublic

Description

If you set trigger timeout to 5 seconds with setTriggerTimeout and then read it on each trigger check this is what you get

-1
4.5
4
3.5
3
2.5
2
1.5
0.999
0.499
-1
-1
-1
...

expected

5
4.5
4
3.5
3
2.5
2
1.5
0.999
0.499
-1
-1
-1
...

currentTriggerTimeout should be set to the set timeout especially because setTriggerTimeout can randomise the timeout.

setTriggerTimeout [min, mid, max, interuptible] if you give different values to min mid max the currentTriggerTimeout should get the resulting randomised value the trigger timeout will be set to.

Details

Legacy ID
2938520784
Severity
None
Resolution
Won't Fix
Reproducibility
Always
Category
Scripting
Steps To Reproduce

run this on client

_tr = createTrigger ["EmptyDetector",[0,0,0]];
_tr setTriggerTimeout [5,5,5,false];
_tr setTriggerStatements [
'player sidechat str (triggerTimeoutCurrent thisTrigger); true',
'',
''
];

Event Timeline

Killzone_Kid edited Additional Information. (Show Details)
Killzone_Kid set Category to Scripting.
Killzone_Kid set Reproducibility to Always.
Killzone_Kid set Severity to None.
Killzone_Kid set Resolution to Won't Fix.
Killzone_Kid set Legacy ID to 2938520784.May 7 2016, 5:39 PM
Bohemia added a subscriber: AD2001.Dec 22 2013, 3:02 PM

I have revisited some code I wrote before triggers got "improved" quite recently. Pre "improvement" trigger with timeout set to 10 was counting

-1,
10,
9.5,
9,
8.5...

and not

-1,
9.5,
9,
8.5...

as seen on this vid http://www.youtube.com/watch?v=de3mMKrMFqE

I've edited the title. The issue here is that triggerTimeoutCurrent actually never equals set timeout since recent trigger "improvement":

  • spawn {

_tr = createTrigger ["EmptyDetector",[0,0,0]];
_tr setTriggerTimeout [1,1,1,false];
_tr setTriggerStatements ["true","hint 'TT done'",""];
_time = time + 3;
while {true} do {

		if (triggerTimeoutCurrent _tr == 1) exitWith {player sidechat "TTC == 1"};
		if (time > _time) exitWith {player sidechat "TTC is never 1"};

};
};

The trigger timeout set to 1 second and the result is that triggerTimeoutCurrent is never 1: "TTC is never 1"

Changing to won't fix. The problem is that countdown is considered started only when trigger condition evaluates to true, but if triggerTimeoutCurrent is part of this condition (like in the repro), then it is like putting the carriage before the horse.

Mass-closing all resolved issues not updated in the last month.

Please PM me in BI Forums (http://forums.bistudio.com/member.php?55374-Fireball) if you feel your bug was closed in error.