Difference between revisions of "PrintToConsole"
→Notes: Added v13 and v14 notes
imported>Haama (→Notes: Removed alias line) |
imported>Haama (→Notes: Added v13 and v14 notes) |
||
Line 11: | Line 11: | ||
* This function works in conjunction with the console function ToggleDebugText. When PrintToConsole is called while TDT is active, console messages will be visible during normal gameplay. Useful for debugging when a lot of messages need to be displayed. | * This function works in conjunction with the console function ToggleDebugText. When PrintToConsole is called while TDT is active, console messages will be visible during normal gameplay. Useful for debugging when a lot of messages need to be displayed. | ||
* [[GetInventoryObject]] and [[GetNumItems]] will also return messages to the console (1 message for each item). As the number of console lines is limited, use caution with these and PrintToConsole. | * [[GetInventoryObject]] and [[GetNumItems]] will also return messages to the console (1 message for each item). As the number of console lines is limited, use caution with these and PrintToConsole. | ||
**As of v13, '''GetInventoryObject''' and '''GetNumItems''' no longer return messages to the console. | |||
* You can increase the number of lines in the console by increasing the '''iConsoleVisibleLines''' setting in the config file, found at | * You can increase the number of lines in the console by increasing the '''iConsoleVisibleLines''' setting in the config file, found at | ||
..\Documents and Settings\"User Name"\My Documents\My Games\Oblivion\Oblivion.ini | ..\Documents and Settings\"User Name"\My Documents\My Games\Oblivion\Oblivion.ini | ||
*As of v14, several new variables types have been added: | |||
**%i - prints the formID of a reference or object | |||
**%k - prints a string representing the key associated with a DirectInput scan code | |||
**%n - prints the name of a reference or object | |||
**%r - prints a newline | |||
**%c - prints the name of a component within another object. Takes two arguments - an object (ref) and the index of the component you want to access (short). Supported object types: | |||
***Magic Item - prints the name of the nth effect item. | |||
***Faction - prints the male rank title of the nth rank. | |||
**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. | |||
**Example (note that due to wiki limitations, the MessageboxEX line has been split into two): | |||
<pre> ref refVar1 | |||
ref refVar2 | |||
short keyCode | |||
short goldCost | |||
... | |||
set refVar1 to AdrianDecanusREF | |||
set refVar2 to ShadySamREF | |||
set keyCode to GetControl 15 ; menu key, assuming 'Tab' (15) | |||
set goldCost to 500 | |||
MessageBoxEX "Press %k to summon a companion %rCost: %g gold|%n|%n|Cancel" | |||
keyCode goldCost refVar1 refVar2</pre> | |||
prints out | |||
<pre> Press TAB to summon a companion | |||
Cost: 500 gold | |||
[Adrian Decanus] | |||
[Shady Sam] | |||
[Cancel]</pre> | |||
<!--[[Category: OBSE Functions]] | <!--[[Category: OBSE Functions]] |