XML:WPge
Jump to navigation
Jump to search
WPeg: weapon page
- See HERE if you don't know how to convert an oni file into XML and vice versa.
- WPge*.oni are global. (They can be found in edition/GameDataFolder/level0_...)
- A weapon page can be read for first time when player finds a weapon linked to its page.
- An IGPA instance here will make Oni crash.
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 "WPge").
- Every WPge 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 "WPgew1_tap":
- #0 (WPge instance) links to #1 (IGPG instance)
- #1 (unknown placeholder, only presented in original files) (can be ignored)
- #2 (IGPG instance) links to #4 and #5 (IGSA instances)
- #3 (unknown placeholder, only presented in original files) (can be ignored)
- #4 (IGSA instance) links from #9 up to #14 (IGSt instances)
- #5 (IGSA instance) links from #6 up to #8 (IGSt instances)
XML tags and options
WPge instance tags
- <WeaponClass> (file name without prefix "ONWC" and suffix ".oni")
- <Page> (links 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)
- <Family>
- <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 #13))
- <Family>
example
<?xml version="1.0" encoding="utf-8"?> <Oni Version="0.9.34.0"> <Instance id="0" type="WPge"> <WeaponClass>ONWCw1_tap</WeaponClass> <Page>#2</Page> </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.
<Instance id="2" type="IGPG"> <Font> <Family></Family> <Style>Normal</Style> <Color>0 0 0 0</Color> <Size>0</Size> <Flags></Flags> </Font> <Image>TXMPtctf_autopistol</Image> <Text1>#4</Text1> <Text2>#5</Text2> </Instance>
Instance number 13 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="4" type="IGSA"> <Strings> <Link>#9</Link> <Link>#10</Link> <Link>#11</Link> <Link>#12</Link> <Link>#13</Link> <Link>#14</Link> </Strings> </Instance> <Instance id="5" type="IGSA"> <Strings> <Link>#6</Link> <Link>#7</Link> <Link>#8</Link> </Strings> </Instance> <Instance id="6" type="IGSt"> <Font> <Family></Family> <Style>Normal</Style> <Color>0 0 0 0</Color> <Size>0</Size> <Flags></Flags> </Font> <Text>Hint:</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>This weapon has high recoil.</Text> </Instance> <Instance id="8" type="IGSt"> <Font> <Family></Family> <Style>Normal</Style> <Color>0 0 0 0</Color> <Size>0</Size> <Flags></Flags> </Font> <Text>Compensate when firing on full auto.</Text> </Instance> <Instance id="9" type="IGSt"> <Font> <Family></Family> <Style>Normal</Style> <Color>0 0 0 0</Color> <Size>0</Size> <Flags></Flags> </Font> <Text>Name.....................Campbell Equalizer Mk4</Text> </Instance> <Instance id="10" type="IGSt"> <Font> <Family></Family> <Style>Normal</Style> <Color>0 0 0 0</Color> <Size>0</Size> <Flags></Flags> </Font> <Text>Ammunition Type.................Ballistic Ammo</Text> </Instance> <Instance id="11" type="IGSt"> <Font> <Family></Family> <Style>Normal</Style> <Color>0 0 0 0</Color> <Size>0</Size> <Flags></Flags> </Font> <Text>Magazine Capacity......................10 rounds</Text> </Instance> <Instance id="12" type="IGSt"> <Font> <Family></Family> <Style>Normal</Style> <Color>0 0 0 0</Color> <Size>0</Size> <Flags></Flags> </Font> <Text>Fire Rate.....................5 rounds per second</Text> </Instance> <Instance id="13" 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="14" type="IGSt"> <Font> <Family></Family> <Style>Normal</Style> <Color>0 0 0 0</Color> <Size>0</Size> <Flags></Flags> </Font> <Text>The Equalizer is the standard issue TCTF sidearm. It has undergone a number of refinements since the original model appeared during the World Coalition Government's rise to power.</Text> </Instance> </Oni>