- Joined
- Aug 18, 2013
- Messages
- 85
Is there a way to trigger to detect this. Let's say you lost 5 peasants in 1 minute.
Is there a way to check this?
Is there a way to check this?
This solution will overwrite timers, causing the counter to increase indefinitely and never come back down.
Just when I posted the triggers I thought about this... let me think about a solution.
Variables Legend:Name --- Type --- Initial Value:
index --- Integer --- 0 (Default)
integer --- Integer --- 0 (Default)
owner --- Integer Array (1) --- 0 (Default)
timer --- Real Array (1) --- 0 (Default)
owner_index --- Integer Array (16) --- 0 (Default)
One approach would be an Infinite Impulse Response filter of the period or frequency between deaths. Death frequency is then 1 / T where T is determined period. For example 5 peasants within 1 minute would be a frequency greater than 0.08333 Hz or a period less than 12 seconds.
The only down side of this is the mechanics of an IIR filter. The filter has to be stable for all possible input values and it must have a response function such that it does not get strange values if multiple units die at once. One logically puts a range test on the output of the filter to determine when such a kill frequency is achieved.