XML:DOOR: Difference between revisions

From OniGalore
Jump to navigation Jump to search
mNo edit summary
m (link fix)
 
(18 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{XML_File_Header | type=DOOR | prev=CRSA | next=DPge | name=Door }}
{{XML_File_Header | prev=CONS | type=DOOR | next=DPge | name=Door}}


__TOC__
__TOC__


'''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 (in edition/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 named in the <Class> tag of [[XML:BINA/OBJC/DOOR|BINACJBODOOR]] files
 
 
 
'''file structure'''


==File structure==
  DOOR
  DOOR
   |
   |
Line 24: Line 21:
               +-- IDXA <TriangleStrips>
               +-- IDXA <TriangleStrips>
               +-- IDXA <FaceNormalIndices>
               +-- IDXA <FaceNormalIndices>
       


==XML tags==
==XML tags==
===DOOR===
===DOOR===
{|class="wikitable" width="100%"
{|class="wikitable" width="100%"
!width=200px| tag
!width=200px| tag
Line 38: Line 31:
| width=200px| <Geometries>
| width=200px| <Geometries>
| width=40px| -
| width=40px| -
| contains 2 <Link> tags but only one is used (is this correct for all DOOR files?)
| contains 2 <Link> tags but only one is used (is this true for all DOOR files?)
|-
|-
|valign=top |<Link>
|valign=top |<Link>
Line 50: Line 43:
| <AISoundAttenuation>
| <AISoundAttenuation>
| float
| float
| passed sound "attenuation", exact formula unknown
| passable sound "attenuation", exact formula unknown
|-
|-
|valign=top| <AISoundAllow>
|valign=top| <AISoundAllow>
Line 72: Line 65:
| <AISoundDistance>
| <AISoundDistance>
| float
| float
| AI sound volume ?
| AI sound volume?
|-
|-
| <OpenSound>
| <OpenSound>
Line 83: Line 76:
|}
|}


===OFGA===
Read about these '''[[XML:OFGA|HERE]]'''.
===Sample XML===
'''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>


===OFGA===
==Exporting geometry==
Read on '''[[XML:OFGA|HERE]]'''.
onisplit -extract:xml output_path path_to/DOOR*.oni
 
This will extract some metadata in an XML file alongside the 3D content stored in a DAE file.
 
==Importing geometry==
[[Image:Quadrangulated_vs_triangulated_M3GM.jpg|thumb|200px|right|Use triangulated meshes to avoid holes in M3GM instances.]]
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 file should be in the same folder. Sample references (as relative paths) can be seen in the [[#Sample_XML|Sample XML]] section under the <Geometry> tags. Of course TXMPs are required as part of the new 3D content.
 
==Exporting animation==
Normally it would be...
 
onisplit -extract:dae output_path path_to/OBAN''file''.oni -geom:M3GM''file''.oni
 
...but since we don't use standalone M3GMs for doors anymore, use this instead:
onisplit -create output_path path_to/DOOR*.xml
onisplit -extract:dae output_path path_to/OBAN*.oni
 
Then, in a 3D editor, group the geometries under the animated NULL object.
 
Next, you might want to do the following:
* Set the geometries' local rotation to X = 0
* Translate the geometries' center to their lowest point
* Translate the geometries in object mode onto the NULL


; Question: Does OniSplit respect ZAxisUp while converting OBAN*.oni to *.dae?
; Answer: No. The output values are the same no matter if ZAxisUp is present or not.


==M3GM export/import==
==Importing animation==
'''export'''
Note: ZAxisUp must be set in the OBAN.


You would need to cut the DOOR instance so that only the M3GM and its connected instances remain and convert it to oni.
; Question: Do InitialTransform and BaseTransform affect the door?
:   onisplit -extract:xml output_folder input_folder\DOORfile.oni
; Answer: Yes. To keep the animation unchanged, use these:
:    onisplit -create output_folder input_folder\cutfile.xml
        <InitialTransform>1 0 0 0 0 -1 0 1 0 0 0 0</InitialTransform>
        <BaseTransform>1 0 0 0 1 0 0 0 1 0 0 0</BaseTransform>


Convert the M3GMfile.oni to obj:
; Question: How is ZAxisUp handled best in a 3D editor when OniSplit doesn't respect its value?
:   onisplit -extract:obj output_folder input_folder\M3GMfile.oni
; Answer: For now, keep NULL's global X rotation to -90.


'''Note: At the moment, OBAN import works only with cameras. '''


'''import'''
==Making a new door class==
Before importing doors via the "[[Creating a level#The master XML file|master file]]", you must place the door class and its TXMP(s) inside the "shared" 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.
After level creation, the new door class and its animation must be placed in level 0.


You can create M3GM meshes from obj files.
'''In shared folder'''
: onisplit -create:m3gm output_folder -tex:weapon_tex input_folder/weapon.obj
* DOOR file
:: -tex is optional
* TXMP file(s) (only one for each embedded M3GM instance)
:: The TXMP file must created separately (if needed).
'''In level 0'''
* DOOR file
* OBAN file


Then you can convert the file to xml and replace the TRIG's old M3GM xml code.
; Open question
: Does re-converting an original DOOR change it in any way so that e.g. its OBAN is also required in the shared folder?


Remember to change the links (#N) and instance IDs of the new data.
; Notes about original doors
-->
: In the original game levels, there are files such as "M3GMdoor_1_0.oni". That's an animated door part. (Doors consist of an animated and a static part.) But OniSplit will store animated door parts inside ONLV, so we don't need separate M3GMs.


{{XML}}
{{XML}}

Latest revision as of 01:18, 20 November 2023

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

CONS << 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 named in the <Class> tag of BINACJBODOOR files

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 true for all DOOR files?)
<Link> link OFGA instance number (#N)
<Animation> link OBANfile.oni (file suffix not used)
<AISoundAttenuation> float passable 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 about these HERE.

Sample XML

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>

Exporting geometry

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

This will extract some metadata in an XML file alongside the 3D content stored in a DAE file.

Importing geometry

Use triangulated meshes to avoid holes in M3GM instances.
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 file should be in the same folder. Sample references (as relative paths) can be seen in the Sample XML section under the <Geometry> tags. Of course TXMPs are required as part of the new 3D content.

Exporting animation

Normally it would be...

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

...but since we don't use standalone M3GMs for doors anymore, use this instead:

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

Then, in a 3D editor, group the geometries under the animated NULL object.

Next, you might want to do the following:

  • Set the geometries' local rotation to X = 0
  • Translate the geometries' center to their lowest point
  • Translate the geometries in object mode onto the NULL
Question
Does OniSplit respect ZAxisUp while converting OBAN*.oni to *.dae?
Answer
No. The output values are the same no matter if ZAxisUp is present or not.

Importing animation

Note: ZAxisUp must be set in the OBAN.

Question
Do InitialTransform and BaseTransform affect the door?
Answer
Yes. To keep the animation unchanged, use these:
       <InitialTransform>1 0 0 0 0 -1 0 1 0 0 0 0</InitialTransform>
       <BaseTransform>1 0 0 0 1 0 0 0 1 0 0 0</BaseTransform>
Question
How is ZAxisUp handled best in a 3D editor when OniSplit doesn't respect its value?
Answer
For now, keep NULL's global X rotation to -90.

Note: At the moment, OBAN import works only with cameras.

Making a new door class

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

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

In shared folder
* DOOR file
* TXMP file(s) (only one for each embedded M3GM instance)

In level 0
* DOOR file
* OBAN file
Open question
Does re-converting an original DOOR change it in any way so that e.g. its OBAN is also required in the shared folder?
Notes about original doors
In the original game levels, there are files such as "M3GMdoor_1_0.oni". That's an animated door part. (Doors consist of an animated and a static part.) But OniSplit will store animated door parts inside ONLV, so we don't need separate M3GMs.