XML:TxtC: Difference between revisions

From OniGalore
Jump to navigation Jump to search
(my "digest" notes from the old talk page)
m (oops)
 
(15 intermediate revisions by 2 users not shown)
Line 1: Line 1:
==Notes on tutorial(s) from Iritscen==
{{XML_File_Header | prev=TXMP | type=TxtC | next=WMCL | name=Text Console}}
Well, geyser and I decided to move the page here, as you can see. Having the tutorials out there as separate pages means individually linking to each one from the related OBD page as well as the (not-yet-created) overview page, whereas having it here makes it easy to say "All tutorials are on the talk pages for their related file types", plain and simple. Naming is also a no-brainer now :-).


Also, this might not be its permanent place, but for now it seems appropriate to put all tutorials into Talk pages like so. If they develop into broader articles than simply elaborating on the OBD file type as this article does, we might at least make those articles stand-alone. Anyway, thanks to paradox for all your work on this, especially this one, where the basic OBD page is sorely lacking any explanation of how the type actually works.
==General notes==
* The XML on this page is compatible with OniSplit '''v0.9.61.0'''.
* Console text pages don't need a console to display them; they can be called up at any time with the BSL command "text_console".
* TxtCs are normally level-specific (level''x''_Final), but could be made global (level0_Final).
* "TxtC" should really have been "CPge", for consistency with DPge, HPge, IPge, OPge and WPge, but hey, we didn't name it.


A couple things I wanted to preserve from the old Talk page that was attached to this article before the article itself became a Talk page:
==BSL support==
 
"If you develop on the structure of an instance in its OBD talk page, some of the "digest" [I think he means "summarized"] wisdom can be copied/moved to the OBD article" -- geyser
 
Also, I had said:
 
"have you considered writing the tutorials from a goal-oriented perspective" --Iritscen
 
And you replied:
 
"TRAM has a taste of it (with "adding impact flash", "adding colorful trails" and the hidden "adding motion blur" (mechanism seems buggy). I think this should be decided from case to case. ONCC, ONGS, ONIE and PART will need similar for sure but not TxtC, TRMA, and most of object collections (the goal there is obvious)." --Paradox-01
 
That is very true, and I clearly should have read your WIP page more closely. Thanks again for your hard work! --[[User:Iritscen|iritscen]] 20:57, 9 November 2008 (CET)
 
==[[TxtC]]: text console (page)==
===general notes===
* See [[XML basic tutorial|HERE]] if you don't know how to convert an oni file into XML and vice versa.
 
* Console text pages can be called via BSL command "text_console". In fact they don't need a console, you can call up a page in any function you like.
 
* TxtC's are normally level specific, but could be made global.
 
 
===BSL support===
: <font style="color:#777">console_activate ''console_id:int''
: <font style="color:#777">console_activate ''console_id:int''
: console_deactivate ''console_id:int''
: console_deactivate ''console_id:int''
Line 33: Line 13:
: text_console ''name:string''
: text_console ''name:string''


Two example functions:


two example functions
  ### Called up by a console
 
  ### called up by a console
  func void console_jump(string ai_name)
  func void console_jump(string ai_name)
  {
  {
Line 43: Line 22:
  }
  }
   
   
  ### called up by a random function, pops up when player performs Konoko's first punch
  ### Pops up onscreen when Konoko performs her first punch
  func just_show_me_a_page
  func just_show_me_a_page
  {
  {
Line 50: Line 29:
  }
  }


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


: Every TxtC contains one instance of type IGPA.
: Every TxtC contains one instance of type IGPA.
Line 65: Line 42:
: IGSt means a (text) string
: IGSt means a (text) string


:Take care of the structure and the cake is yours.
:Be mindful of the structure and it's a piece of cake.


{| border=0 cellspacing=20 cellpadding=0 align=right
[[Image:XML_TxtC.jpg|thumb|300px]]
| [http://i305.photobucket.com/albums/nn207/unknownfuture/Oni_Galore_Images/XML_modding/TxtC.png http://i305.photobucket.com/albums/nn207/unknownfuture/Oni_Galore_Images/XML_modding/TxtC_TN.png]
|}


example on "TxtClevel_1f.xml":
'''The following IDs are taken from "TxtClevel_1f.xml" as an example:'''


: #0 (TxtC instance) links to #1 (IGPA instance)
: #0 (TxtC instance) links to #1 (IGPA instance)
: #1 (IGPA instance) links from #2 up to #4 (IGPG instances, here we have 3 pages as you see)
: #1 (IGPA instance) links from #2 up to #4 (IGPG instances, in this case 3 pages)
: #2 (IGPG instance) links to #32 (IGSA instances)
: #2 (IGPG instance) links to #32 (IGSA instances)
: #3 (IGPG instance) links to #20 (IGSA instances)
: #3 (IGPG instance) links to #20 (IGSA instances)
: #4 (IGPG instance) links to #6 (IGSA instances)
: #4 (IGPG instance) links to #6 (IGSA instances)
: #5 corresponds to the TSFFTahoma placeholder
: #5 corresponds to the TSFFTahoma placeholder
: #6 (IGSA instance) links from #7 up to #19 (IGSt Instances)
: #6 (IGSA instance) links from #7 up to #19 (IGSt instances)
: #20 (IGSA instance) links from #21 up to #31 (IGSt Instances)
: #20 (IGSA instance) links from #21 up to #31 (IGSt instances)
: #32 (IGSA instance) links from #33 up to #43 (IGSt Instances)
: #32 (IGSA instance) links from #33 up to #43 (IGSt instances)


If you modify or create a new file, you can use #5 for anything you like because OniSplit re-indexes the instances when packing. The TSFFTahoma placeholder doesn't need to be present in your file.


===XML tags and options===
==XML tags and options==
'''TxtC instance tags'''
'''TxtC instance tags'''
: <Pages> (defines the number of pages)
: <Pages> (link to IGPA instance)


'''IGPA instance tags'''
'''IGPA instance tags'''
: <Pages>
: <Pages> (every link represents a page)
:: <Link> (links to an IGPG instance)
:: <Link> (links to an IGPG instance)


Line 100: Line 76:
::: '''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 120: Line 96:
:: <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 lets 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
::: Color
::: Color
::: Size
::: Size
:: <Text> (contains the actual text but can also create a bare paragraph (see example at instance #46))
:: <Text> (Contains the actual text but can also create a bare paragraph (see example at instance #46). You can use <code>&amp;gt;</code> to produce <code>&gt;</code> and <code>&amp;lt;</code> to produce <code>&lt;</code>.)


 
==Example==
===example===
[[Image:XML_TxtC_modders.jpg|thumb|200px]]
In this example you can see a modified header, a link to instance number 5 was added (OniSplit reindexes it when repacking, so there is no conflict with the original instance #5, the TSFFTahoma placeholder).
 
{| border=0 cellspacing=20 cellpadding=0 align=right
| [http://i305.photobucket.com/albums/nn207/unknownfuture/Oni_Galore_Images/XML_modding/modders.png http://i305.photobucket.com/albums/nn207/unknownfuture/Oni_Galore_Images/XML_modding/modders_preview.png]
|}


  <?xml version="1.0" encoding="utf-8"?>
  <?xml version="1.0" encoding="utf-8"?>
  <Oni Version="0.9.28.0">
  <Oni>
     <Instance id="0" type="TxtC" name="level_31b">
     <TxtC id="0">
         <Pages>#1</Pages>
         <Pages>#1</Pages>
     </Instance>
     </TxtC>
     <Instance id="1" type="IGPA">
     <IGPA id="1">
         <Pages>
         <Pages>
             <Link>#2</Link>
             <Link>#2</Link>
            <Link>#3</Link>
            <Link>#4</Link>
            <Link>'''#5'''</Link>
         </Pages>
         </Pages>
     </Instance>
     </IGPA>


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> cannot be used for TxtC because there isn't a note/hint field.
<Text2> cannot be used for TxtC because there isn't a note/hint field.


     <Instance '''id="5"''' type="IGPG">
     <IGPG id='''"2"'''>
         <nowiki><Font></nowiki>
         <nowiki><Font></nowiki>
             <Family>TSFFTahoma</Family>
             <Family>TSFFTahoma</Family>
Line 161: Line 129:
             <Flags>Family Style Color Size</Flags>
             <Flags>Family Style Color Size</Flags>
         <nowiki></Font></nowiki>
         <nowiki></Font></nowiki>
         '''<Image>'''TXMPlevel31_modders</Image>
         <Image>TXMPlevel31_modders</Image>
         <Text1>'''#44'''</Text1>
         <Text1>'''#3'''</Text1>
         <Text2></Text2>
         <Text2></Text2>
     </Instance>
     </IGPG>


Instance number 46 has a space between the text tags (<Text> </Text>) to produce a new paragraph. The import doesn't care about that in onisplit v0.9.28 but you can fix that by writing "<Text xml:space="preserve"> </Text>".
Instance number 5 has a space between the text tags (<Text> </Text>) to produce a new paragraph. The space won't be preserved unless you add a special attribute to the text tag: "<Text xml:space="preserve"> </Text>".


     <Instance '''id="44"''' type="IGSA">
     <IGSA id='''"3"'''>
         <Strings>
         <Strings>
             <Link>'''#45'''</Link>
             <Link>'''#4'''</Link>
             <Link>'''#46'''</Link>
             <Link>'''#5'''</Link>
             <Link>'''#47'''</Link>
             <Link>'''#6'''</Link>
         </Strings>
         </Strings>
     </Instance>
     </IGSA>
     <Instance '''id="45"''' type="IGSt">
     <IGSt id='''"4"'''>
         <nowiki><Font></nowiki>
         <nowiki><Font></nowiki>
             <Family></Family>
             <Family></Family>
Line 183: Line 151:
             <Flags>Style Color Size</Flags>
             <Flags>Style Color Size</Flags>
         <nowiki></Font></nowiki>
         <nowiki></Font></nowiki>
         <Text>That's a blue caption.</Text>
         <Text>Here's a blue caption.</Text>
     </Instance>
     </IGSt>
     <Instance '''id="46"''' type="IGSt">
     <IGSt id='''"5"'''>
         <nowiki><Font></nowiki>
         <nowiki><Font></nowiki>
             <Family></Family>
             <Family></Family>
Line 194: Line 162:
         <nowiki></Font></nowiki>
         <nowiki></Font></nowiki>
         <Text xml:space="preserve"> </Text>
         <Text xml:space="preserve"> </Text>
     </Instance>
     </IGSt>
     <Instance '''id="47"''' type="IGSt">
     <IGSt id='''"6"'''>
         <nowiki><Font></nowiki>
         <nowiki><Font></nowiki>
             <Family></Family>
             <Family></Family>
Line 203: Line 171:
             <Flags>Color Size</Flags>
             <Flags>Color Size</Flags>
         <nowiki></Font></nowiki>
         <nowiki></Font></nowiki>
         <Text>And that's a white, smaller text.</Text>
         <Text>And this is white, smaller text.</Text>
     </Instance>
     </IGSt>
</Oni>


[[Category:Tutorials]]
{{XML}}

Latest revision as of 23:54, 31 March 2021

TxtC : Text Console
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

TXMP << Other file types >> WMCL

switch to OBD page

General notes

  • The XML on this page is compatible with OniSplit v0.9.61.0.
  • Console text pages don't need a console to display them; they can be called up at any time with the BSL command "text_console".
  • TxtCs are normally level-specific (levelx_Final), but could be made global (level0_Final).
  • "TxtC" should really have been "CPge", for consistency with DPge, HPge, IPge, OPge and WPge, but hey, we didn't name it.

BSL support

console_activate console_id:int
console_deactivate console_id:int
console_reset console_id:int (resets a console to initial state)
text_console name:string

Two example functions:

### Called up by a console
func void console_jump(string ai_name)
{
	text_console level_1g
	console_reset 18
}

### Pops up onscreen when Konoko performs her first punch
func just_show_me_a_page
{
	chr_wait_animation 0 KONCOMcomb_p
	text_console level_1f
}

XML structure

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

Every TxtC 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
Be mindful of the structure and it's a piece of cake.
XML TxtC.jpg

The following IDs are taken from "TxtClevel_1f.xml" as an example:

#0 (TxtC instance) links to #1 (IGPA instance)
#1 (IGPA instance) links from #2 up to #4 (IGPG instances, in this case 3 pages)
#2 (IGPG instance) links to #32 (IGSA instances)
#3 (IGPG instance) links to #20 (IGSA instances)
#4 (IGPG instance) links to #6 (IGSA instances)
#5 corresponds to the TSFFTahoma placeholder
#6 (IGSA instance) links from #7 up to #19 (IGSt instances)
#20 (IGSA instance) links from #21 up to #31 (IGSt instances)
#32 (IGSA instance) links from #33 up to #43 (IGSt instances)

If you modify or create a new file, you can use #5 for anything you like because OniSplit re-indexes the instances when packing. The TSFFTahoma placeholder doesn't need to be present in your file.

XML tags and options

TxtC instance tags

<Pages> (link to IGPA instance)

IGPA instance tags

<Pages> (every link represents a page)
<Link> (links to an IGPG instance)

IGPG instance tags

<Font> (defines the font in case it isn't defined in the IGSt instance)
<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> (not used by TxtC)

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 lets 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 #46). You can use &gt; to produce > and &lt; to produce <.)

Example

XML TxtC modders.jpg
<?xml version="1.0" encoding="utf-8"?>
<Oni>
   <TxtC id="0">
       <Pages>#1</Pages>
   </TxtC>
   <IGPA id="1">
       <Pages>
           <Link>#2</Link>
       </Pages>
   </IGPA>

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> cannot be used for TxtC because there isn't a note/hint field.

   <IGPG id="2">
       <Font>
           <Family>TSFFTahoma</Family>
           <Style>Bold</Style>
           <Color>116 208 255</Color>
           <Size>10</Size>
           <Flags>Family Style Color Size</Flags>
       </Font>
       <Image>TXMPlevel31_modders</Image>
       <Text1>#3</Text1>
       <Text2></Text2>
   </IGPG>

Instance number 5 has a space between the text tags (<Text> </Text>) to produce a new paragraph. The space won't be preserved unless you add a special attribute to the text tag: "<Text xml:space="preserve"> </Text>".

   <IGSA id="3">
       <Strings>
           <Link>#4</Link>
           <Link>#5</Link>
           <Link>#6</Link>
       </Strings>
   </IGSA>
   <IGSt id="4">
       <Font>
           <Family></Family>
           <Style>Bold</Style>
           <Color>116 208 255</Color>
           <Size>12</Size>
           <Flags>Style Color Size</Flags>
       </Font>
       <Text>Here's a blue caption.</Text>
   </IGSt>
   <IGSt id="5">
       <Font>
           <Family></Family>
           <Style>Normal</Style>
           <Color>0 0 0 0</Color>
           <Size>0</Size>
           <Flags></Flags>
       </Font>
       <Text xml:space="preserve"> </Text>
   </IGSt>
   <IGSt id="6">
       <Font>
           <Family></Family>
           <Style>Normal</Style>
           <Color>150 150 150</Color>
           <Size>8</Size>
           <Flags>Color Size</Flags>
       </Font>
       <Text>And this is white, smaller text.</Text>
   </IGSt>
</Oni>