Difference between revisions of "Template:OBSE Format Specifiers"

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search
imported>Scruggs
m (Template:MessageEXFormatting moved to Template:OBSE Format Specifiers: Applies to non-output functions such as SetNameEx and various string variable-related functions)
imported>Scruggs
(changed title etc)
Line 1: Line 1:
=== EX Formatting Functions ===
In addition to the format specifiers supported by Oblivion's [[Message]] and [[MessageBox]] functions, [[:Category:Oblivion Script Extender|OBSE]] functions understand additional specifiers.
These formatting specifiers will work with [[:Category:Oblivion Script Extender|OBSE]] output functions, along with the usual functions.
 


'''%r''' - Prints a carriage return, ending the current line and starting at the next.
'''%r''' - Prints a carriage return, ending the current line and starting at the next.

Revision as of 20:01, 11 August 2008

In addition to the format specifiers supported by Oblivion's Message and MessageBox functions, OBSE functions understand additional specifiers.

%r - Prints a carriage return, ending the current line and starting at the next.

%n - Prints the name of the specified reference or object.

  • In OBSE versions prior to v0014a, %n can crash if the object's name contains a percent sign.

%i - Prints the formID of the specified reference or object.

%k - Prints the name of the key for the specified DirectInput scancode, such as those used for IsKeyPressed2.

%c - Prints the specified component of the specified reference or object. Takes two arguments - a reference variable set to the spell or faction, and an index. Behaves differently depending on the passed reference:

  • Faction: Prints the nth male rank title
  • Magic Item: Prints the nth Magic Effect
  • Prior to OBSE v0015, magic effects using actor values (such as Restore Agility) would not display the specific actor value.
  • Actor values may not display correctly for non-English versions of Oblivion.

%p - Displays a pronoun based on the gender of the object parameter:

  • %po - objective (he, she, it)
  • %pp - possessive (his, her, its)
  • %ps - subjective (him, her, it)

%q - Prints a double quote character.

%a - Prints the character corresponding to the specified ASCII code. Passing codes for unprintable characters (such as 0) may have unpredictable (though occassionally) useful results. Passing the code for a percent sign will most likely crash the game as literal percent signs must come in pairs.

%v - Prints the actor value (i.e. an attribute or skill) associated with the passed actor value code.

%{...%} - Conditionally displays or omits the bracketed portion of the format string based on a boolean value. Accepts a variable - if the value of the variable is zero, all text and parameters up to the matching right bracket will be ignored. Otherwise the bracketed text will be displayed.

  • Example (should be single-line, line-breaks added for Wiki)
MBoxEX "Doom comes%{ for you%}. What will you do?
|Dig a hole, hide
%{|Find someone, offer as sacrifice|Find someone, use as shield%}
|Enjoy your final 15 minutes" bDisplay bDisplay

If bDisplay is 0 this will print out

   Doom comes. What will you do?
   [Dig a hole, hide]
   [Enjoy your final 15 minutes]

If bDisplay is 1 this will print out

   Doom comes for you. What will you do?
   [Dig a hole, hide]
   [Find someone, offer as sacrifice]
   [Find someone, use as shield]
   [Enjoy your final 15 minutes]