Difference between revisions of "PrintToConsole"
Jump to navigation
Jump to search
→Notes: Better Example
imported>Haama (→Notes: Added v13 and v14 notes) |
imported>Haama (→Notes: Better Example) |
||
Line 24: | Line 24: | ||
**Also, you can now use up to 20 variables. | **Also, you can now use up to 20 variables. | ||
**Additional format specifiers used by the C function printf() may work as well. Due to the fact that integer script variables are stored as floats, using %0x to display hexadecimal notation may not display the expected output. | **Additional format specifiers used by the C function printf() may work as well. Due to the fact that integer script variables are stored as floats, using %0x to display hexadecimal notation may not display the expected output. | ||
**Example | **Example: | ||
<pre> ref refVar1 | <pre> ref refVar1 | ||
short keyCode | short keyCode | ||
short goldCost | short goldCost | ||
... | ... | ||
set refVar1 to AdrianDecanusREF | set refVar1 to AdrianDecanusREF | ||
set keyCode to GetControl 15 ; menu key, assuming 'Tab' (15) | set keyCode to GetControl 15 ; menu key, assuming 'Tab' (15) | ||
set goldCost to 500 | set goldCost to 500 | ||
PrintToC "Press %k to summon companion %n %rCost: %g gold" keyCode refVar1 goldCost</pre> | |||
prints out | prints out | ||
<pre> Press TAB to summon | <pre> Press TAB to summon companion Adrian Decanus | ||
Cost: 500 gold | Cost: 500 gold</pre> | ||
<!--[[Category: OBSE Functions]] | <!--[[Category: OBSE Functions]] |