XML:OPge: Difference between revisions

From OniGalore
Jump to navigation Jump to search
(quite similiar to txtc)
 
m (fixing a confusion)
Line 34: Line 34:
'''OPge instance tags'''
'''OPge instance tags'''
: <LevelNumber> (the page won't show up if this tag has the wrong number)
: <LevelNumber> (the page won't show up if this tag has the wrong number)
: <Pages> (defines the number of pages, be aware of it for BSL command "objective_set")
: <Pages> (link to IGPA instance)


'''IGPA instance tags'''
'''IGPA instance tags'''
: <Pages>
: <Pages> (every link represents a page, be aware of it for BSL command "objective_set")
:: <Link> (links to an IGPG instance)
:: <Link> (links to an IGPG instance)



Revision as of 12:31, 18 January 2009

OPge: objective page

general notes

  • See HERE if you don't know how to convert an oni file into XML and vice versa.
  • OPge are level specific.
  • Objective pages can be called via BSL command "objective_set page_number" or "objective_set page_number silent".


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 "OPge").

Every OPge contains one instance of type IGPA.
Every IGPA contains a number of instances of type IGPG.
Every IGPG contains a number of instances of type IGSA.
Every IGSA contains a number of instances of type IGSt.
IGPA means a page array (think of it as a little book)
IGPG means a page
IGSA means a (text) string array
IGSt means a (text) string
Take care of the structure and the cake is yours.


example on "OPgelevel_21.xml":

#0 (OPge instance) links to #1 (IGPA instance)
#1 (IGPA instance) links to #2 (IGPG instance)
#2 (IGPG instance) links to #3 and #7 (IGSA instances)
#3 (IGSA instance) links from #4 up to #6 (IGSt instances)
#7 (IGSA instance) links to #8 (IGSt instance)


XML tags and options

OPge instance tags

<LevelNumber> (the page won't show up if this tag has the wrong number)
<Pages> (link to IGPA instance)

IGPA instance tags

<Pages> (every link represents a page, be aware of it for BSL command "objective_set")
<Link> (links to an 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 (see example at instance #5))


example

OPge_preview.png
<?xml version="1.0" encoding="utf-8"?>
<Oni Version="0.9.30.0">
   <Instance id="0" type="OPge">
       <LevelNumber>21</LevelNumber>
       <Pages>#1</Pages>
   </Instance>
   <Instance id="1" type="IGPA">
       <Pages>
           <Link>#2</Link>
       </Pages>
   </Instance>

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

<Text2> is used for the hint field -- see screenshot ("page 1B - hint text").

   <Instance id="2" type="IGPG">
       <Font>
           <Family></Family>
           <Style>Normal</Style>
           <Color>0 0 0 0</Color>
           <Size>0</Size>
           <Flags></Flags>
       </Font>
       <Image>TXMPmc_big_ware_room</Image>
       <Text1>#3</Text1>
       <Text2>#7</Text2>
   </Instance>

Instance number 5 has a space between the text tags (<Text> </Text>) to produce a new paragraph. The import ignores that so far but you can fix it by writing "<Text xml:space="preserve"> </Text>".

   <Instance id="3" type="IGSA">
       <Strings>
           <Link>#4</Link>
           <Link>#5</Link>
           <Link>#6</Link>
       </Strings>
   </Instance>
   <Instance id="4" type="IGSt">
       <Font>
           <Family></Family>
           <Style>Normal</Style>
           <Color>191 0 0</Color>
           <Size>0</Size>
           <Flags>Color</Flags>
       </Font>
       <Text>page 1A - caption</Text>
   </Instance>
   <Instance id="5" type="IGSt">
       <Font>
           <Family></Family>
           <Style>Normal</Style>
           <Color>0 0 0 0</Color>
           <Size>0</Size>
           <Flags></Flags>
       </Font>
       <Text xml:space="preserve"> </Text>
   </Instance>
   <Instance id="6" type="IGSt">
       <Font>
           <Family></Family>
           <Style>Normal</Style>
           <Color>0 0 0 0</Color>
           <Size>0</Size>
           <Flags>Style</Flags>
       </Font>
       <Text>page 1A - text</Text>
   </Instance>
   <Instance id="7" type="IGSA">
       <Strings>
           <Link>#8</Link>
       </Strings>
   </Instance>
   <Instance id="8" type="IGSt">
       <Font>
           <Family></Family>
           <Style>Normal</Style>
           <Color>0 0 0 0</Color>
           <Size>0</Size>
           <Flags>Style</Flags>
       </Font>
       <Text>page 1B - hint text</Text>
   </Instance>
</Oni>