Re: Bugs Reports & Technical Help
Originally Posted by
Jurand of Cracow
@Gigantus:
- declare / inc_ - the script will ready declare first, and only after a few goes through the script, when it comes to the slave faction, it will read the inc_. I think it's safe.
Declaring after processing counter: I presume so - it will certainly fail in the first turn. Bit of a bummer if it's a monitor that's supposed to fire at game start or is turn sensitive, so rather avoid this situation. In a battle script it will lead to a total failure.
Increasing the wrong type of counter: it will only ever query\read (I_EventCounter) the default zero result like for any unprocessed event counter - unless somewhere else there is a monitor that increases the actual even counter with inc_event_counter and doesn't increase the regular\undeclared counter (inc_counter) of the same name which you would query\read as I_CompareCounter anyhow.
The small difference in the 'increase' and 'set' command of event counters and regular counters provides very effective pitfalls, the above is such a case:
inc_counter - changes the value of a 'regular' counter by a set amount, counter needs to be declared
set_counter - changes the value of a 'regular' counter to a set amount, counter needs to be declared
inc_event_counter - changes the value of a event counter by a set amount, declaring not required
set_event_counter - changes the value of a event counter to a set amount, declaring not required
I_EventCounter - queries the value of a event counter
I_CompareCounter- queries the value of a 'regular' counter
The above is the reason why you really, really should avoid to use the same name for both types of counters. Or drink unending cups of coffee.
Last edited by Gigantus; November 26, 2020 at 12:43 AM.