XML:WPge: Difference between revisions

From OniGalore
m (New page: ==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 ...)
 
m (wikilinked Data Comlink)
 
(12 intermediate revisions by 2 users not shown)
Line 1: Line 1:
==[[OBD:WPge|WPeg]]: weapon page==
{{XML_File_Header | prev=WMM | type=WPge | next=AISA | name=Weapon Page}}
* See [[XML basic tutorial|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_...)
==General information==
* A weapon page can be read for first time when player finds a weapon linked to its page.
* The XML on this page is compatible with OniSplit '''v0.9.61.0'''.
* WPges are global (level0_Final.dat).
* A weapon page becomes available to read under the [[Data Comlink]]'s Weapons tab when the player finds the weapon linked to that page.
* An IGPA instance here will make Oni crash.
* An IGPA instance here will make Oni crash.


 
==XML structure==
===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").
Think of "instances" (#N) as file sections, they go from 1 to N. 0 is the header (it defines the file type, here "WPge").


Line 17: Line 18:
: IGSt means a (text) string
: IGSt means a (text) string


 
Example from WPgew1_tap:
example on "WPgew1_tap":


: #0  (WPge instance) links to #1 (IGPG instance)
: #0  (WPge instance) links to #1 (IGPG instance)
: #1  (unknown placeholder, only presented in original files) (can be ignored)
: #1  (unknown placeholder, only present in original files) (can be ignored)
: #2  (IGPG instance) links to #4 and #5 (IGSA instances)
: #2  (IGPG instance) links to #4 and #5 (IGSA instances)
: #3  (unknown placeholder, only presented in original files) (can be ignored)
: #3  (unknown placeholder, only present in original files) (can be ignored)
: #4  (IGSA instance) links from #9 up to #14 (IGSt instances)
: #4  (IGSA instance) links from #9 up to #14 (IGSt instances)
: #5  (IGSA instance) links from #6 up to #8 (IGSt instances)
: #5  (IGSA instance) links from #6 up to #8 (IGSt instances)


 
==XML tags and options==
===XML tags and options===
'''WPge instance tags'''
'''WPge instance tags'''
: <WeaponClass> (file name without prefix "ONWC" and suffix ".oni")
: <WeaponClass> (file name without prefix "ONWC" and suffix ".oni")
Line 41: Line 40:
::: '''Bold'''
::: '''Bold'''
::: ''Italic''
::: ''Italic''
:: <Color> ([[wikipedia:RGB_color_model#The_24-bit_RGB_representation|RGB]] range, e.g. <Color>255 0 77</Color>)
:: <Color> ([[wikipedia:RGB_color_model#Numeric_representations|RGB]] range, e.g. <Color>255 0 77</Color>)
:: <Size> (10 and 12 are usually used)
:: <Size> (10 and 12 are usually used)
: <Image> (links to a TXMP or PSpc file)
: <Image> (links to a TXMP or PSpc file)
Line 61: Line 60:
:: <Color>
:: <Color>
:: <Size>
:: <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..)
:: <Flags> (Every IGSt can have its 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.)
::: <font style="color:#777">Family</font>
::: <font style="color:#777">Family</font>
::: Style
::: Style
Line 68: Line 67:
:: <Text> (contains the actual text but can also create a bare paragraph (see example at instance #13))
:: <Text> (contains the actual text but can also create a bare paragraph (see example at instance #13))


 
==Example==
===example===
[[Image:XML_WPge_w1_tap.jpg|thumb|200px]]
{| border=0 cellspacing=20 cellpadding=0 align=right
[[Image:XML_WPge_Silenced_Machine_Gun.jpg|thumb|200px]]
| [http://i305.photobucket.com/albums/nn207/unknownfuture/Oni_Galore_Images/XML_modding/WPge_tap.png http://i305.photobucket.com/albums/nn207/unknownfuture/Oni_Galore_Images/XML_modding/WPge_tap_preview.png]<br>
[http://i305.photobucket.com/albums/nn207/unknownfuture/Oni_Galore_Images/XML_modding/WPge.png http://i305.photobucket.com/albums/nn207/unknownfuture/Oni_Galore_Images/XML_modding/WPge_preview.png]
|}


  <?xml version="1.0" encoding="utf-8"?>
  <?xml version="1.0" encoding="utf-8"?>
  <Oni Version="0.9.34.0">
  <Oni>
     <Instance id="0" type="WPge">
     <WPge id="0">
         <WeaponClass>ONWCw1_tap</WeaponClass>
         <WeaponClass>ONWCw1_tap</WeaponClass>
         <Page>#2</Page>
         <Page>#2</Page>
     </Instance>
     </WPge>


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


<Text2> is used for the hint field -- see screenshot.
<Text2> is used for the hint field see examples at right.


     <Instance id="2" type="IGPG">
     <IGPG id="2">
         <nowiki><Font></nowiki>
         <nowiki><Font></nowiki>
             <Family></Family>
             <Family></Family>
Line 97: Line 93:
         <Text1>#4</Text1>
         <Text1>#4</Text1>
         <Text2>#5</Text2>
         <Text2>#5</Text2>
     </Instance>
     </IGPG>


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 #13 uses a space between the text tags (<Text> </Text>) to produce a new paragraph. OniSplit currently ignores that space, but you can fix it by writing "<Text xml:space="preserve"> </Text>".


     <Instance id="4" type="IGSA">
     <IGSA id="4">
         <Strings>
         <Strings>
             <Link>#9</Link>
             <Link>#9</Link>
Line 110: Line 106:
             <Link>#14</Link>
             <Link>#14</Link>
         </Strings>
         </Strings>
     </Instance>
     </IGSA>
     <Instance id="5" type="IGSA">
     <IGSA id="5">
         <Strings>
         <Strings>
             <Link>#6</Link>
             <Link>#6</Link>
Line 117: Line 113:
             <Link>#8</Link>
             <Link>#8</Link>
         </Strings>
         </Strings>
     </Instance>
     </IGSA>
     <Instance id="6" type="IGSt">
     <IGSt id="9">
         <nowiki><Font></nowiki>
         <nowiki><Font></nowiki>
             <Family></Family>
             <Family></Family>
Line 126: Line 122:
             <Flags></Flags>
             <Flags></Flags>
         <nowiki></Font></nowiki>
         <nowiki></Font></nowiki>
         <Text>Hint:</Text>
         <Text>Name.....................Campbell Equalizer Mk4</Text>
     </Instance>
     </IGSt>
     <Instance id="7" type="IGSt">
     <IGSt id="10">
         <nowiki><Font></nowiki>
         <nowiki><Font></nowiki>
             <Family></Family>
             <Family></Family>
Line 136: Line 132:
             <Flags></Flags>
             <Flags></Flags>
         <nowiki></Font></nowiki>
         <nowiki></Font></nowiki>
         <Text>This weapon has high recoil.</Text>
         <Text>Ammunition Type.................Ballistic Ammo</Text>
     </Instance>
     </IGSt>
     <Instance id="8" type="IGSt">
     <IGSt id="11">
         <nowiki><Font></nowiki>
         <nowiki><Font></nowiki>
             <Family></Family>
             <Family></Family>
Line 146: Line 142:
             <Flags></Flags>
             <Flags></Flags>
         <nowiki></Font></nowiki>
         <nowiki></Font></nowiki>
         <Text>Compensate when firing on full auto.</Text>
         <Text>Magazine Capacity......................10 rounds</Text>
     </Instance>
     </IGSt>
     <Instance id="9" type="IGSt">
     <IGSt id="12">
         <nowiki><Font></nowiki>
         <nowiki><Font></nowiki>
             <Family></Family>
             <Family></Family>
Line 156: Line 152:
             <Flags></Flags>
             <Flags></Flags>
         <nowiki></Font></nowiki>
         <nowiki></Font></nowiki>
         <Text>Name.....................Campbell Equalizer Mk4</Text>
         <Text>Fire Rate.....................5 rounds per second</Text>
     </Instance>
     </IGSt>
     <Instance id="10" type="IGSt">
     <IGSt id="13">
         <nowiki><Font></nowiki>
         <nowiki><Font></nowiki>
             <Family></Family>
             <Family></Family>
Line 166: Line 162:
             <Flags></Flags>
             <Flags></Flags>
         <nowiki></Font></nowiki>
         <nowiki></Font></nowiki>
         <Text>Ammunition Type.................Ballistic Ammo</Text>
         <Text> </Text>
     </Instance>
     </IGSt>
     <Instance id="11" type="IGSt">
     <IGSt id="14">
         <nowiki><Font></nowiki>
         <nowiki><Font></nowiki>
             <Family></Family>
             <Family></Family>
Line 176: Line 172:
             <Flags></Flags>
             <Flags></Flags>
         <nowiki></Font></nowiki>
         <nowiki></Font></nowiki>
         <Text>Magazine Capacity......................10 rounds</Text>
         <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>
     </IGSt>
     <Instance id="12" type="IGSt">
     <IGSt id="6">
         <nowiki><Font></nowiki>
         <nowiki><Font></nowiki>
             <Family></Family>
             <Family></Family>
Line 186: Line 182:
             <Flags></Flags>
             <Flags></Flags>
         <nowiki></Font></nowiki>
         <nowiki></Font></nowiki>
         <Text>Fire Rate.....................5 rounds per second</Text>
         <Text>Hint:</Text>
     </Instance>
     </IGSt>
     <Instance id="13" type="IGSt">
     <IGSt id="7">
         <nowiki><Font></nowiki>
         <nowiki><Font></nowiki>
             <Family></Family>
             <Family></Family>
Line 196: Line 192:
             <Flags></Flags>
             <Flags></Flags>
         <nowiki></Font></nowiki>
         <nowiki></Font></nowiki>
         <Text xml:space="preserve"> </Text>
         <Text>This weapon has high recoil.</Text>
     </Instance>
     </IGSt>
     <Instance id="14" type="IGSt">
     <IGSt id="8">
         <nowiki><Font></nowiki>
         <nowiki><Font></nowiki>
             <Family></Family>
             <Family></Family>
Line 206: Line 202:
             <Flags></Flags>
             <Flags></Flags>
         <nowiki></Font></nowiki>
         <nowiki></Font></nowiki>
         <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>
         <Text>Compensate when firing on full auto.</Text>
     </Instance>
     </IGSt>
  </Oni>
  </Oni>
{{XML}}

Latest revision as of 15:42, 6 December 2023

WPge : Weapon Page
XML modding tips
See HERE to start learning about XML modding.
See HERE if you are searching for information on how to handle object coordinates.
See HERE for some typical modding errors and their causes.
XML.png
XML

WMM << Other file types >> AISA

switch to OBD page

General information

  • The XML on this page is compatible with OniSplit v0.9.61.0.
  • WPges are global (level0_Final.dat).
  • A weapon page becomes available to read under the Data Comlink's Weapons tab when the player finds the weapon linked to that 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 from WPgew1_tap:

#0 (WPge instance) links to #1 (IGPG instance)
#1 (unknown placeholder, only present in original files) (can be ignored)
#2 (IGPG instance) links to #4 and #5 (IGSA instances)
#3 (unknown placeholder, only present 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)
<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 have its 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))

Example

XML WPge w1 tap.jpg
XML WPge Silenced Machine Gun.jpg
<?xml version="1.0" encoding="utf-8"?>
<Oni>
   <WPge id="0">
       <WeaponClass>ONWCw1_tap</WeaponClass>
       <Page>#2</Page>
   </WPge>

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

<Text2> is used for the hint field — see examples at right.

   <IGPG id="2">
       <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>
   </IGPG>

Instance #13 uses a space between the text tags (<Text> </Text>) to produce a new paragraph. OniSplit currently ignores that space, but you can fix it by writing "<Text xml:space="preserve"> </Text>".

   <IGSA id="4">
       <Strings>
           <Link>#9</Link>
           <Link>#10</Link>
           <Link>#11</Link>
           <Link>#12</Link>
           <Link>#13</Link>
           <Link>#14</Link>
       </Strings>
   </IGSA>
   <IGSA id="5">
       <Strings>
           <Link>#6</Link>
           <Link>#7</Link>
           <Link>#8</Link>
       </Strings>
   </IGSA>
   <IGSt id="9">
       <Font>
           <Family></Family>
           <Style>Normal</Style>
           <Color>0 0 0 0</Color>
           <Size>0</Size>
           <Flags></Flags>
       </Font>
       <Text>Name.....................Campbell Equalizer Mk4</Text>
   </IGSt>
   <IGSt id="10">
       <Font>
           <Family></Family>
           <Style>Normal</Style>
           <Color>0 0 0 0</Color>
           <Size>0</Size>
           <Flags></Flags>
       </Font>
       <Text>Ammunition Type.................Ballistic Ammo</Text>
   </IGSt>
   <IGSt id="11">
       <Font>
           <Family></Family>
           <Style>Normal</Style>
           <Color>0 0 0 0</Color>
           <Size>0</Size>
           <Flags></Flags>
       </Font>
       <Text>Magazine Capacity......................10 rounds</Text>
   </IGSt>
   <IGSt id="12">
       <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>
   </IGSt>
   <IGSt id="13">
       <Font>
           <Family></Family>
           <Style>Normal</Style>
           <Color>0 0 0 0</Color>
           <Size>0</Size>
           <Flags></Flags>
       </Font>
       <Text> </Text>
   </IGSt>
   <IGSt id="14">
       <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>
   </IGSt>
   <IGSt id="6">
       <Font>
           <Family></Family>
           <Style>Normal</Style>
           <Color>0 0 0 0</Color>
           <Size>0</Size>
           <Flags></Flags>
       </Font>
       <Text>Hint:</Text>
   </IGSt>
   <IGSt id="7">
       <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>
   </IGSt>
   <IGSt id="8">
       <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>
   </IGSt>
</Oni>