Difference between revisions of "Message"
imported>DragoonWraith (→Description: DisplaySeconds parameter seems to be ignored) |
imported>Bruneauinfo m (added messageboxex) |
||
(9 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | |||
== Description == | == Description == | ||
'''Syntax:''' | '''Syntax:''' | ||
Message "Message text", [var1], [var2], DisplaySeconds | Message "Message text", [var1], [var2], DisplaySeconds | ||
Line 7: | Line 7: | ||
Message "This is a Message" | Message "This is a Message" | ||
Message "You have %.0f hours to complete your task.", GameHour, 10 | Message "You have %.0f hours to complete your task.", GameHour, 10 | ||
Displays a message on the screen. | |||
'''Example:''' | |||
Message "There are %.0f arrows and %.0f shields in the crate.", BowVar, ShiledVar, 10 | |||
Up to 9 variable names can also be passed into the Message. These are displayed in the order they are used as parameters. The message must specify how the variable is to be displayed. | Displays: There are 3 arrows and 6 shields in the crate. | ||
==Notes== | |||
*The DisplaySeconds parameter is supposed to set how long the message will be displayed for, and it must be an integer (or else the script will fail to compile, stating that it must be in integer), however testing seems to indicate that the parameter has absolutely no effect whatsoever on how long the message is actually displayed. If you have successfully set a message to display for longer or shorter than the default time, please mention it in the [[Talk:Message|talk]] page! | |||
*Up to 9 variable names can also be passed into the Message. These are displayed in the order they are used as parameters. The message must specify how the variable is to be displayed. | |||
== Displaying Variables == | == Displaying Variables == | ||
{{ | {{MessageFormatting}} | ||
====Examples==== | |||
===Examples=== | |||
Message "Var1:% 5.2f / Var2:% 5.2f" Var1 Var2 | Message "Var1:% 5.2f / Var2:% 5.2f" Var1 Var2 | ||
'''"Var1: 123.45 / Var2: -123.45"''' | Displays: '''"Var1: 123.45 / Var2: -123.45"''' | ||
Message "Var1:%05.2f / Var2:%05.2f" Var1 Var2 | Message "Var1:%05.2f / Var2:%05.2f" Var1 Var2 | ||
'''"Var1: 00123.45 / Var2:-00123.45"''' | Displays: '''"Var1: 00123.45 / Var2:-00123.45"''' | ||
Message "Var1:%+-5.0f / Var2:%+-5.0f" Var1 Var2 | Message "Var1:%+-5.0f / Var2:%+-5.0f" Var1 Var2 | ||
'''"Var1:+123 / Var2:-123 "''' | Displays: '''"Var1:+123 / Var2:-123 "''' | ||
Message "Var1:% .3e / Var2:% .3e" Var1 Var2 | Message "Var1:% .3e / Var2:% .3e" Var1 Var2 | ||
'''"Var1: 1.234E+2 / Var2:-1.234E+2"''' | Displays: '''"Var1: 1.234E+2 / Var2:-1.234E+2"''' | ||
==See Also== | ==See Also== | ||
[[MessageBox]] | * [[MessageEx]] | ||
[[ | * [[MessageBox]] | ||
* [[MessageBoxEx]] | |||
* [[PrintToConsole]] | |||
* [[Message Spam]] for usage and preventing other messages from showing | |||
[[Category: Functions]] | [[Category:Functions]] | ||
[[Category: | [[Category:Functions (CS)]] | ||
[[Category:Functions (CS 1.0)]] | |||
[[Category:Output Functions]] | |||
[[Category:Output Functions (CS 1.0)]] |
Latest revision as of 15:08, 15 December 2010
Description[edit | edit source]
Syntax:
Message "Message text", [var1], [var2], DisplaySeconds
Example:
Message "This is a Message" Message "You have %.0f hours to complete your task.", GameHour, 10
Displays a message on the screen.
Example:
Message "There are %.0f arrows and %.0f shields in the crate.", BowVar, ShiledVar, 10
Displays: There are 3 arrows and 6 shields in the crate.
Notes[edit | edit source]
- The DisplaySeconds parameter is supposed to set how long the message will be displayed for, and it must be an integer (or else the script will fail to compile, stating that it must be in integer), however testing seems to indicate that the parameter has absolutely no effect whatsoever on how long the message is actually displayed. If you have successfully set a message to display for longer or shorter than the default time, please mention it in the talk page!
- Up to 9 variable names can also be passed into the Message. These are displayed in the order they are used as parameters. The message must specify how the variable is to be displayed.
Displaying Variables[edit | edit source]
Formatting notation[edit source]
%.2f - This means format the variable with 2 decimal places.
%.0f - This will format the variable with 0 decimal places, so is the normal choice for integers.
%5.0f - The number in front of the point specifies the minimum width of the number. In this case, there will always be enough space in front of the number for 5 digits:
Number 12 wins Number 1234 wins
Formating switches[edit source]
The following formatting switches can be used in Oblivion. Put them in any sequence right after the '%'
Switch | Function |
---|---|
+ | Display + in front of positive numbers |
<Space> | Leave a leading space in front of positive numbers |
- | Use left-aligned formation instead of right alligned. |
0 | The filling-char used for formatting is '0' instead of ' ' |
Other Functions[edit source]
%g - This usually works just like "%.0f", displaying 0 decimal places. When the number is 1000000 or larger, though, the game displays it in scientific notation (1E+006)
%.3e - Shows numbers in scientific notation (123000 = 1.23E+005)
%% - Use this to display a percent-sign in the message
Examples[edit | edit source]
Message "Var1:% 5.2f / Var2:% 5.2f" Var1 Var2
Displays: "Var1: 123.45 / Var2: -123.45"
Message "Var1:%05.2f / Var2:%05.2f" Var1 Var2
Displays: "Var1: 00123.45 / Var2:-00123.45"
Message "Var1:%+-5.0f / Var2:%+-5.0f" Var1 Var2
Displays: "Var1:+123 / Var2:-123 "
Message "Var1:% .3e / Var2:% .3e" Var1 Var2
Displays: "Var1: 1.234E+2 / Var2:-1.234E+2"
See Also[edit | edit source]
- MessageEx
- MessageBox
- MessageBoxEx
- PrintToConsole
- Message Spam for usage and preventing other messages from showing