EvilEngine/CNTR: Difference between revisions

m
Seil moved page Counter to EvilEngine/CNTR without leaving a redirect
Battlepedia>Seil
No edit summary
m (Seil moved page Counter to EvilEngine/CNTR without leaving a redirect)
 
(10 intermediate revisions by 2 users not shown)
Line 1:
<onlyinclude>
{{AssetInfobox
{{#vardefine:typeid|CNTR}}<nowiki/>
|subtitle=Counter
{{#vardefine:name|Counter}}<nowiki/>
|type=[[Object]]
{{#vardefine:type|[[Base]]}}<nowiki/>
|objectid=0x16
{{#vardefine:basetype|0x16}}<nowiki/>
|games=Night of 100 Frights<br>Battle for Bikini Bottom<br>The SpongeBob SquarePants Movie<br>The Incredibles<br>Rise of the Underminer}}
{{#vardefine:games|Scooby BFBB TSSM Incredibles ROTU RatProto}}<nowiki/>
{{#vardefine:sourcecode|[https://github.com/bfbbdecomp/bfbb/blob/master/src/Core/x/xCounter.h xCounter.h]}}<nowiki/>
{{#vardefine:image|}}<nowiki/>
</onlyinclude>
{{AutoAssetInfobox}}
 
A '''counter''' is ana [[Object AssetBase|objectbase asset]] that keeps track of a single number value. This value is an integer that can be in the range of -32,768 to 32,767. A counter's value is able to be modified, accessed, and reset at any time.
 
A counter can be in two (currently known) states: normal (0) and expired (1). When a counter is in normal state, its value can be freely modified with the [[#Increment|Increment]], [[#Decrement|Decrement]], and [[#Count1 - Count20|Count1 - Count20]] events. If a counter's value is ever set to 0, it becomes expired. When a counter is expired its value cannot be modified by any events until you send the [[#Reset|Reset]] event to it, which resets its state back to normal and its value back to the value initially set in the counter asset.
Line 58 ⟶ 63:
 
If a counter's resulting value from a [[#Increment|Increment]] or [[#Decrement|Decrement]] event is between 1 and 20, a Count event with the number matching the new value is sent from the counter to itself. For example, if a counter's value is 9 and [[#Increment|Increment]] is sent to it, it will send Count10 to itself.
 
{{Assets}}
{{AutoGameNavs}}
 
[[Category:Asset]]