Difference between revisions of "Category:Oblivion XML"

936 bytes added ,  02:03, 19 December 2009
imported>JRoush
imported>JRoush
Line 19: Line 19:
XML is a general syntax - the meaning of specific elements depends entirely on the program parsing the file.   
XML is a general syntax - the meaning of specific elements depends entirely on the program parsing the file.   


The elements recognized by the Oblivion parser can be divided into three basic categories.  [[Menu Element|"Menu" Elements]] define actual objects in the menu, such as buttons or text.  [[Property Element|"Property Elements"]] are always children of Menu Elements, evaluated by Oblivion to parameters like the position or color of their parent.  [[Operator Element|"Operator" Elements]] are always the children of Property Elements, which Oblivion uses to construct algebraic expressions for the value of their parent.  Unrecognized element types will be parsed (they can be referred to by name from Operator elements and OBSE functions) provided they are well-formed.
The elements recognized by the Oblivion parser can be divided into three basic categories.  [[Menu Element|"Menu" Elements]] define actual objects in the menu, such as buttons, text, images, etcThere are only a few elements in this category, but they are repeatedly to create the complex menu structures.


Oblivion only recognizes three element [[Traits]]: "name", "src", and "trait".
[[Property Element|"Property Elements"]] are always children of Menu Elements,
defining things like the position, color, transparency, etc. of their parent.
For example, an <image> menu element might have <width> and <height> elements as children, which Oblivion will use to determine the size of the displayed image. 
 
Property elements can have literal values, written directly into the xml code. 
They can also contain mathematical "formulas" - for example the <width> property of an <image> element might contain a formula to make the image twice as wide as it is tall.  Then, if some code in the game engine (or a mod script) changes the height of the image, the game's parser will automatically use the formula to recalculate the width.  These formulas are expressed as series of [[Operator Element|"Operator" Elements]] - most basic mathematical operators like +, - , *, FLOOR, AND, etc. have a corresponding Operator Element.
 
Elements that aren't part of the Oblivion XML schema are assumed to be Property Elements.  They will be parsed by the game engine, can be referred to by name from Operator elements and OBSE script functions, and may contain Operator Elements as children.  It is common to break up long formulas by inventing an unrecognized element to hold intermediate values.
 
Oblivion only recognizes three XML [[Traits]]: "name", "src", and "trait".


=== Oblivion Menu Files ===
=== Oblivion Menu Files ===
Menu xml data is stored in the ''Oblivion\Data\Menus'' directory.  Each menu is stored in it's own file.  Oblivion reloads a menu from disk every time it is opened, so changes to the file can be seen by closing and re-opening the menu - a very useful trick for editing.  Note, however, that some menus are never closed (e.g. the HUD).  These menus can be reloaded in game using "Reload ''menuname''" [[:Category:Console Functions|console function]].
Menu xml data is stored in the ''Oblivion\Data\Menus'' directory.  Each menu is stored in it's own file.  Oblivion reloads a menu from disk every time it is opened, so changes to the file can be seen by closing and re-opening the menu - a very useful trick for editing.  Note, however, that some menus are never closed (e.g. the HUD).  These menus can be reloaded in game using "Reload ''menuname''" [[:Category:Console Functions|console function]].
Anonymous user