XML:DOOR: Difference between revisions

From OniGalore
Jump to navigation Jump to search
mNo edit summary
(updating page based on onisplit 0.9.96.0; "door animation import" section is going to be filled later)
Line 4: Line 4:


'''general information'''
'''general information'''
* The xml code on this page was extracted with onisplit '''v0.9.68.0'''
* The xml code on this page was extracted with onisplit '''v0.9.96.0'''
* DOOR files are stored globally (AE/GameDataFolder/level0_Final)
* DOOR files are stored globally (AE/GameDataFolder/level0_Final)
* DOOR files are used by [[XML:BINA/OBJC/DOOR|BINACJBODOOR]] <Class>
* DOOR files are used by [[XML:BINA/OBJC/DOOR|BINACJBODOOR]] <Class>
Line 88: Line 88:




==M3GM export/import==
===sample code===
'''export'''
'''DOORAIRglass01.xml'''
<?xml version="1.0" encoding="utf-8"?>
<Oni>
    <DOOR id="0">
        <Geometries>
            <Link>#1</Link>
            <Link></Link>
        </Geometries>
        <Animation>OBANAIRglass01_anim</Animation>
        <AISoundAttenuation>0.5</AISoundAttenuation>
        <AISoundAllow>Gunfire</AISoundAllow>
        <AISoundType>None</AISoundType>
        <AISoundDistance>100</AISoundDistance>
        <OpenSound>door2_shrt</OpenSound>
        <CloseSound>door2_shrt</CloseSound>
    </DOOR>
    <OFGA id="1">
        <EnvParticle></EnvParticle>
        <Elements>
            <OFGAElement>
                <GunkFlags></GunkFlags>
                <Geometry>AIRglass01_3.dae</Geometry>
            </OFGAElement>
            <OFGAElement>
                <GunkFlags></GunkFlags>
                <Geometry>AIRglass01_4.dae</Geometry>
            </OFGAElement>
            <OFGAElement>
                <GunkFlags></GunkFlags>
                <Geometry>AIRglass01_5.dae</Geometry>
            </OFGAElement>
        </Elements>
    </OFGA>
</Oni>


You would need to cut the DOOR instance so that only the M3GM and its connected instances remain and convert it to oni.
:    onisplit -extract:xml output_folder input_folder\DOORfile.oni
:    onisplit -create output_folder input_folder\cutfile.xml


Convert the M3GMfile.oni to obj:
==door geometry export==
:    onisplit -extract:obj output_folder input_folder\M3GMfile.oni
onisplit -extract:xml output_path path_to/DOOR*.oni


This will extract some meta data in an xml file and the 3D content is stored in dae file(s).


'''import'''
DOOR and TXMP files must be in the same folder.


[...]<!--There are some tags which make together the mesh but you basically need to know that you can replace that content with data from another M3GM.


You can create M3GM meshes from obj files.
==door geometry import==
: onisplit -create:m3gm output_folder -tex:weapon_tex input_folder/weapon.obj
onisplit -create output_path path_to/DOOR*.xml
:: -tex is optional
:: The TXMP file must created separately (if needed).  


Then you can convert the file to xml and replace the TRIG's old M3GM xml code.
The 3D content can probably also be referenced with absolute file paths but to keep things simple the dae files should be in the same folder.
 
Such simple reference (relative path) is seen here in the [[#sample_code|sample code]]. So, it will be just the file name in <Geometry>.
 
Of course TXMP are required for the new new 3D content.
 
 
==door animation export==
Basically it's:
 
onisplit -extract:dae output_path path_to/OBAN''file''.oni -geom:M3GM''file''.oni
 
 
==door animation import==
[...]
 
 
 
==using a new door class==
Before importing doors via the "[[XML:ONLV#The_master_xml_file|master file]]" you must place the door class file and its TXMP(s) inside the "shared" folder.
 
After level creation, the new door class its animation must be placed in level 0/X.
 
 
'''in shared folder'''
* DOOR file
* TXMP file (one for each embedded M3GM instance)
'''in level 0 / level X*'''
* DOOR file
* OBAN file
 
<nowiki>*</nowiki> As long as these two files are in the same folder it doesn't matter if they are stored 'globally' or 'locally' stored. Not tested on Mac.
 
 
;Notes about original doors:
 
: In original game levels there are files like this "M3GMdoor_1_0.oni". That's the animated door part.
: But onisplit will store the animated door part inside ONLV so we don't need extra M3GMs. --[[User:Paradox-01|paradox-01]] ([[User talk:Paradox-01|talk]]) 18:41, 15 February 2014 (CET)


Remember to change the links (#N) and instance IDs of the new data.
-->


{{XML}}
{{XML}}

Revision as of 17:41, 15 February 2014

DOOR : Door
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

CRSA << Other file types >> DPge

switch to OBD page

general information

  • The xml code on this page was extracted with onisplit v0.9.96.0
  • DOOR files are stored globally (AE/GameDataFolder/level0_Final)
  • DOOR files are used by BINACJBODOOR <Class>


file structure

DOOR
  |
  +-- OFGA
        |
        +-- M3GM (holds <Texture> TXMP link to external file)
              |
              +-- PNTA <Points>
              +-- VCRA <VertexNormals>
              +-- VCRA <FaceNormals>
              +-- TXCA <TextureCoordinates>
              +-- IDXA <TriangleStrips>
              +-- IDXA <FaceNormalIndices>
       


XML tags

DOOR

tag type description
<Geometries> - contains 2 <Link> tags but only one is used (is this correct for all DOOR files?)
<Link> link OFGA instance number (#N)
<Animation> link OBANfile.oni (file suffix not used)
<AISoundAttenuation> float passed sound "attenuation", exact formula unknown
<AISoundAllow> flag AI sound types which are allowed to pass:
All
Combat
Gunfire
None
<AISoundType> flag AI sound types:
Unimportant
Interesting
Danger
Melee
Gunfire
None
<AISoundDistance> float AI sound volume ?
<OpenSound> char[32] OSBDfile.imp.oni (file prefix and suffix not used), 32 letters allowed
<CloseSound> char[32] OSBDfile.imp.oni (file prefix and suffix not used), 32 letters allowed


OFGA

Read on HERE.


sample code

DOORAIRglass01.xml

<?xml version="1.0" encoding="utf-8"?>
<Oni>
   <DOOR id="0">
       <Geometries>
           <Link>#1</Link>
           <Link></Link>
       </Geometries>
       <Animation>OBANAIRglass01_anim</Animation>
       <AISoundAttenuation>0.5</AISoundAttenuation>
       <AISoundAllow>Gunfire</AISoundAllow>
       <AISoundType>None</AISoundType>
       <AISoundDistance>100</AISoundDistance>
       <OpenSound>door2_shrt</OpenSound>
       <CloseSound>door2_shrt</CloseSound>
   </DOOR>
   <OFGA id="1">
       <EnvParticle></EnvParticle>
       <Elements>
           <OFGAElement>
               <GunkFlags></GunkFlags>
               <Geometry>AIRglass01_3.dae</Geometry>
           </OFGAElement>
           <OFGAElement>
               <GunkFlags></GunkFlags>
               <Geometry>AIRglass01_4.dae</Geometry>
           </OFGAElement>
           <OFGAElement>
               <GunkFlags></GunkFlags>
               <Geometry>AIRglass01_5.dae</Geometry>
           </OFGAElement>
       </Elements>
   </OFGA>
</Oni>


door geometry export

onisplit -extract:xml output_path path_to/DOOR*.oni

This will extract some meta data in an xml file and the 3D content is stored in dae file(s).

DOOR and TXMP files must be in the same folder.


door geometry import

onisplit -create output_path path_to/DOOR*.xml

The 3D content can probably also be referenced with absolute file paths but to keep things simple the dae files should be in the same folder.

Such simple reference (relative path) is seen here in the sample code. So, it will be just the file name in <Geometry>.

Of course TXMP are required for the new new 3D content.


door animation export

Basically it's:

onisplit -extract:dae output_path path_to/OBANfile.oni -geom:M3GMfile.oni


door animation import

[...]


using a new door class

Before importing doors via the "master file" you must place the door class file and its TXMP(s) inside the "shared" folder.

After level creation, the new door class its animation must be placed in level 0/X.


in shared folder
* DOOR file
* TXMP file (one for each embedded M3GM instance)

in level 0 / level X*
* DOOR file
* OBAN file 

* As long as these two files are in the same folder it doesn't matter if they are stored 'globally' or 'locally' stored. Not tested on Mac.


Notes about original doors
In original game levels there are files like this "M3GMdoor_1_0.oni". That's the animated door part.
But onisplit will store the animated door part inside ONLV so we don't need extra M3GMs. --paradox-01 (talk) 18:41, 15 February 2014 (CET)