Difference between revisions of "014E"

From GTAMods Wiki
Jump to navigation Jump to search
(Created page with '{{OpCode | ini = 014E=1,%1d% (III), 014E=2,%1d% %2d% (VC, SA) | description = Displays a timer | p1 = Global variable, that contains time in miliseconds | p2 …')
 
(page updates)
Line 1: Line 1:
{{OpCode
+
[[File:014E.png|thumb|right|014E in action in Vice City]]
| ini        = 014E=1,%1d% (III), 014E=2,%1d% %2d% (VC, SA)
+
{{Icon|trilogy}} '''DISPLAY_ONSCREEN_TIMER'''
| description = Displays a timer
+
<hr />
| p1          = Global variable, that contains time in miliseconds
+
'''Description'''
| p2          = Count down (1) or up (0) (VC, SA)
+
: Displays an onscreen timer
| game        = [[GTA 3]], [[Vice City]], [[San Andreas]]
+
'''Syntax'''
}}
+
: {{Icon|3}} 014E: set_timer_to [''global var'']
 +
: {{Icon|VC}} {{Icon|SA}} 014E: set_timer_to [''global var''] type [''int'']
 +
'''Parameter'''
 +
: [''global var'']
 +
:: Global variable containing the time in milliseconds
 +
: [''int'']
 +
:: Timer direction (see below)
  
This creates a timer. When the timer reaches zero, it disappears.
+
This opcode displays an onscreen timer. In GTA III the timer only counts down but since Vice City timers can also count up. You must use a global variable. Using an integer value crashes the game and a local variable produces no timer. The value of the global variable is stored in milliseconds but the format of the display is MM:SS. The value of the global variable will be constantly updated by the timer and the timer itself can be updated by assigning a value to the global variable. When counting down, at 10 seconds the timer will produce a noise every second. Once the timer finishes counting down, it will be cleared from the screen. Only one timer can be displayed at a time. Attempting to display another timer while the current timer is in effect will not produce an additional timer. Due to the limitation of the format of the timer, the timer will not display properly above 99:99 but will still keep accurate count.
  
[[Sanny Builder]] example:<source lang="scm">
+
{| class="wikitable"
$cd = 6000 //6000 ms = 6 seconds
+
! Direction || Enum
014E: set_timer_to $cd type 1 //countdown
+
|-
</source>
+
| 0 || TIMER_UP
 +
|-
 +
| 1 || TIMER_DOWN
 +
|}
  
==Keywords==
+
== Keywords ==
timer
+
set, display, onscreen, timer
 +
 
 +
== See also ==
 +
* [[014F]], clears onscreen timer
 +
* [[0396]], freezes onscreen timer
 +
* [[03C3]], displays timer with string
 +
 
 +
[[Category:OpCodes]]

Revision as of 22:42, 7 February 2015

File:014E.png
014E in action in Vice City

GTA III Vice City San Andreas DISPLAY_ONSCREEN_TIMER


Description

Displays an onscreen timer

Syntax

GTA III 014E: set_timer_to [global var]
Vice City San Andreas 014E: set_timer_to [global var] type [int]

Parameter

[global var]
Global variable containing the time in milliseconds
[int]
Timer direction (see below)

This opcode displays an onscreen timer. In GTA III the timer only counts down but since Vice City timers can also count up. You must use a global variable. Using an integer value crashes the game and a local variable produces no timer. The value of the global variable is stored in milliseconds but the format of the display is MM:SS. The value of the global variable will be constantly updated by the timer and the timer itself can be updated by assigning a value to the global variable. When counting down, at 10 seconds the timer will produce a noise every second. Once the timer finishes counting down, it will be cleared from the screen. Only one timer can be displayed at a time. Attempting to display another timer while the current timer is in effect will not produce an additional timer. Due to the limitation of the format of the timer, the timer will not display properly above 99:99 but will still keep accurate count.

Direction Enum
0 TIMER_UP
1 TIMER_DOWN

Keywords

set, display, onscreen, timer

See also

  • 014F, clears onscreen timer
  • 0396, freezes onscreen timer
  • 03C3, displays timer with string