Difference between revisions of "03C4"

From GTAMods Wiki
Jump to navigation Jump to search
(Created page with '{{OpCode | ini = 03c4=3,set_status_text_to %1d% %2b:bar/number% %3g% | description = Displays text with numbers or a bar | p1 = variable | p2 = 0 (for n…')
 
(rewritten in new format + images + example)
Line 1: Line 1:
{{OpCode
+
{{Icon|trilogy}}
| ini        = 03c4=3,set_status_text_to %1d% %2b:bar/number% %3g%
+
<hr />
| description = Displays text with numbers or a bar
+
'''Description'''
| p1          = variable
+
: Displays an onscreen counter supporting text
| p2          = 0 (for numbers), 1 (for a bar)
+
'''Syntax'''
| p3          = GXT string
+
: 03C4: set_status_text_to [''global var''] [''int''] '[''string'']'
| game        = [[GTA 3]], [[Vice City]], [[San Andreas]]
+
'''Parameter'''
}}
+
: [''global var'']
This opcode is used for example to show health of people to cover or numbers of action (sold ice creams) done.
+
:: Global variable containing an integer value
 +
: [''int'']
 +
:: [[#Types|Type]] (0 = numbers, 1 = bar)
 +
: [''string'']
 +
:: [[GXT]] string
  
==Keywords==
+
This opcode displays a counter, either shown in numbers or as a bar. The counter need only be called once and will automatically update itself with the global variable. 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. Values outside the types will just display type 1 counter. Opcode [[0151]] removes the counter.
counter, string, bar
+
 
 +
== Types ==
 +
{| {{prettytable}}
 +
! 0 || 1
 +
|-
 +
! [[File:-03C4-0.png|250px]] || [[File:-03C4-1.png|250px]]
 +
|}
 +
 
 +
== 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.
 +
<source lang="scm">
 +
$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
 +
</source>
 +
 
 +
== See also ==
 +
* [[0150]] &ndash; counter that does not support text
 +
* [[04F7]] &ndash; counter that supports text in addition to line position
 +
 
 +
== Keywords ==
 +
counter, status, text, bar
 +
 
 +
[[Category:OpCodes]]
 +
__NOTOC__

Revision as of 23:56, 6 September 2011

GTA III Vice City San Andreas


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]
Type (0 = numbers, 1 = bar)
[string]
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 update itself with the global variable. 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. Values outside the types will just display type 1 counter. Opcode 0151 removes the counter.

Types

0 1
-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

  • 0150 – counter that does not support text
  • 04F7 – counter that supports text in addition to line position

Keywords

counter, status, text, bar