XML:DPge

From OniGalore
Revision as of 11:46, 1 February 2009 by Paradox-01 (talk | contribs) (and clearing a bit stuff)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

DPeg: diary page

general notes

  • See HERE if you don't know how to convert an oni file into XML and vice versa.
  • DPge*.oni are global. (They can be found in edition/GameDataFolder/level0_...)
  • A diary page can be read for first time when player enters the level linked its page by <LevelNumber> tag.
  • An IGPA instance here will make Oni crash. But <PageNumber> let you create more diary pages for a day.
  • The game can load at most 60 DPge instances. 32 DPge instances exist in original game.


XML structure

Think of "instances" (#N) as file sections, they go from 1 to N. 0 is the header (it defines the file type, here "DPge").

Every DPge contains one instance of type IGPG.
Every IGPG contains two instances of type IGSA.
Every IGSA contains a number of instances of type IGSt.
IGPG means a page
IGSA means a (text) string array
IGSt means a (text) string


example on original file "DPgelev_19_pg_01":

#0 (DPge instance) links to #1 (IGPG instance)
#1 (IGPG instance) links to #4 and #5 (IGSA instances)
#2 (unknown placeholder, only presented in original files) (can be ignored)
#3 (unknown placeholder, only presented in original files) (can be ignored)
#4 (IGSA instance) links to #7 (IGSt instance)
#5 (IGSA instance) links to #6 (IGSt instance)


XML tags and options

WPge instance tags

<LevelNumber> (page can be read for first time when player enters this level)
<PageNumber> (diary page number)
<IsLearnedMove>
0 (normal page)
1 (Displays message "New combat move learned. (F1)" Can be avoided with BSL command "ui_suppress_prompt = 1")
<Page> (link to IGPG instance)

IGPG instance tags

<Font> (defines the font in case it isn't defined in the IGSt instance; the style is bold by default)
<Family>
TSFFTahoma
<Style>
Normal
Bold
Italic
<Color> (RGB range, e.g. <Color>255 0 77</Color>)
<Size> (10 and 12 are usually used)
<Image> (links to a TXMP or PSpc file)
<Text1> (links to an IGSA instance)
<Text2> (links to an IGSA instance (hint field))

IGSA instance tags

<Strings>
<Link> (links to an IGSt instance)

IGSt instance tags

<Font>
<Family>
TSFFTahoma
<Style>
Normal
Bold
Italic
<Color>
<Size>
<Flags> (Every IGSt can use own properties. The <Flag> tag let you enable these. Add "Size" when you want to get a new font size, add "Color" when you want to get a new font color, etc..)
Family
Style
Color
Size
<Text> (contains the actual text but can also create a bare paragraph)


example

DPge_preview.png
<?xml version="1.0" encoding="utf-8"?>
<Oni Version="0.9.34.0">
   <Instance id="0" type="DPge">
       <LevelNumber>19</LevelNumber>
       <PageNumber>1</PageNumber>
       <IsLearnedMove>1</IsLearnedMove>
       <Page>#1</Page>
   </Instance>

You can display a little image if you use the image tag in the IGPG instance. (Either non-animated TXMP or PSpc.)

   <Instance id="1" type="IGPG">
       <Font>
           <Family>TSFFTahoma</Family>
           <Style>Bold</Style>
           <Color>255 127 0</Color>
           <Size>12</Size>
           <Flags>Family Style Color Size</Flags>
       </Font>
       <Image>TXMPLevel19move</Image>
       <Text1>#4</Text1>
       <Text2>#5</Text2>
   </Instance>
   <Instance id="4" type="IGSA">
       <Strings>
           <Link>#7</Link>
       </Strings>
   </Instance>
   <Instance id="5" type="IGSA">
       <Strings>
           <Link>#6</Link>
       </Strings>
   </Instance>

A space between the text tags (<Text> </Text>) can produce a new paragraph. The import ignores that so far but you can fix it by writing "<Text xml:space="preserve"> </Text>". (Not used in this example.)

   <Instance id="6" type="IGSt">
       <Font>
           <Family>TSFFTahoma</Family>
           <Style>Bold</Style>
           <Color>191 191 191</Color>
           <Size>10</Size>
           <Flags>Family Style Color Size</Flags>
       </Font>
       <Text>When standing in front of an armed opponent, press FORWARD + KICK. Disarm your opponent with a kick to the face!!</Text>
   </Instance>
   <Instance id="7" type="IGSt">
       <Font>
           <Family></Family>
           <Style>Normal</Style>
           <Color>0 0 0 0</Color>
           <Size>0</Size>
           <Flags></Flags>
       </Font>
       <Text>Stepping Disarm</Text>
   </Instance>
</Oni>