Difference between revisions of "03C4"

From GTAMods Wiki
Jump to navigation Jump to search
m
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
{{Icon|trilogy}}
+
__NOTOC__
<hr />
+
{{OpCode
'''Description'''
+
| games      = {{Icon|t}}
: Displays an onscreen counter supporting text
+
| command    = DISPLAY_ONSCREEN_COUNTER_WITH_STRING
'''Syntax'''
+
| description = Displays an onscreen counter supporting text
: 03C4: set_status_text_to [''global var''] [''int''] '[''string'']'
+
| syntax1    = 03C4: set_status_text_to [''global var''] [''int''] '[''string'']'
'''Parameter'''
+
| p1t        = [''global var'']
: [''global var'']
+
| p1d        = Global variable containing an integer value
:: Global variable containing an integer value
+
| p2t        = [''int'']
: [''int'']
+
| p2d        = Counter display ([[#Counter displays|see below]])
:: [[#Types|Type]] (0 = numbers, 1 = bar)
+
| p3t        = [''string'']
: [''string'']
+
| p3d        = [[GXT]] key
:: [[GXT]] string
+
}}
  
This opcode displays a counter, either shown in numbers or as a bar. The counter need only be called once and will automatically associate and update itself with the global variable. Counters only support global variables storing integer values. For type 1 bar, the length of the empty bar represents values between 0 and 100. Values outside the range will either underfill or overfill the empty bar. There are only two types of counters. Any values not 0 will just display type 1 counter. Additional counters cannot be displayed until the existing counter is removed. Opcode [[0151]] removes the counter.
+
This opcode displays a counter, either shown in numbers or as a bar. The counter need only be called once and will automatically associate and update itself with the value stored in the global variable. Counters only support global variables storing integer values. For type 1 bar, the length of the empty bar represents values between 0 and 100. Values outside the range will either underfill or overfill the empty bar. Additional counters cannot be displayed until the existing counter is removed. Opcode [[0151]] removes the counter.
  
== Types ==
+
== Counter displays ==
{| {{prettytable}}
+
Both of these counters are from Vice City, both with a value of 100.
! 0 || 1
+
{|class="wikitable center-col-1 center-col-2"
 +
!0 ||{{hint|1|or any value other than 0}}
 
|-
 
|-
! [[File:-03C4-0.png|250px]] || [[File:-03C4-1.png|250px]]
+
|COUNTER_DISPLAY_NUMBER ||COUNTER_DISPLAY_BAR
 +
|-
 +
|[[File:-03C4-0.png|250px]] ||[[File:-03C4-1.png|250px]]
 
|}
 
|}
  
 
== Example ==
 
== Example ==
 
The following example, using Sanny Builder, will create a full bar counter. Pressing the CAMERA key will deplete the bar. A number is displayed at the bottom of the screen to view the exact value of the bar. Once depleted, the counter disappears.
 
The following example, using Sanny Builder, will create a full bar counter. Pressing the CAMERA key will deplete the bar. A number is displayed at the bottom of the screen to view the exact value of the bar. Once depleted, the counter disappears.
<source lang="scm">
+
<syntaxhighlight lang="scm">
 
$100 = 100
 
$100 = 100
 
03C4: set_status_text_to $100 1 'DUMMY'
 
03C4: set_status_text_to $100 1 'DUMMY'
Line 43: Line 46:
 
     end
 
     end
 
end
 
end
</source>
+
</syntaxhighlight>
  
 
== See also ==
 
== See also ==
* [[0150]] &ndash; counter that does not support text
+
* {{Icon|3}} {{Icon|VC}} [[0150]], counter that does not support text
* [[04F7]] &ndash; counter that supports text in addition to line position
+
* {{Icon|VC}} {{Icon|SA}} [[04F7]], counter that supports text in addition to line position
  
 
== Keywords ==
 
== Keywords ==
 
counter, status, text, bar
 
counter, status, text, bar
  
[[Category:OpCodes]]
+
[[Category:Code Snippets]]
__NOTOC__
 

Latest revision as of 11:11, 10 November 2016

GTA III Vice City San Andreas DISPLAY_ONSCREEN_COUNTER_WITH_STRING


Description
Displays an onscreen counter supporting text
Syntax
03C4: set_status_text_to [global var] [int] '[string]'
Parameter
[global var]
Global variable containing an integer value
[int]
Counter display (see below)
[string]
GXT key

This opcode displays a counter, either shown in numbers or as a bar. The counter need only be called once and will automatically associate and update itself with the value stored in the global variable. Counters only support global variables storing integer values. For type 1 bar, the length of the empty bar represents values between 0 and 100. Values outside the range will either underfill or overfill the empty bar. Additional counters cannot be displayed until the existing counter is removed. Opcode 0151 removes the counter.

Counter displays

Both of these counters are from Vice City, both with a value of 100.

0 1
COUNTER_DISPLAY_NUMBER COUNTER_DISPLAY_BAR
-03C4-0.png -03C4-1.png

Example

The following example, using Sanny Builder, will create a full bar counter. Pressing the CAMERA key will deplete the bar. A number is displayed at the bottom of the screen to view the exact value of the bar. Once depleted, the counter disappears.

$100 = 100
03C4: set_status_text_to $100 1 'DUMMY'

while true
    wait 10
    if
        00E1:   key_pressed 0 13
    then
        $100 -= 1
        01E5: text_1number_highpriority 'NUMBER' $100 10 ms 1
        if
            0 >= $100
        then
            0151: remove_status_text $100
            break
        end
    end
end

See also

  • GTA III Vice City 0150, counter that does not support text
  • Vice City San Andreas 04F7, counter that supports text in addition to line position

Keywords

counter, status, text, bar