XML:DOOR: Difference between revisions

From OniGalore
Jump to navigation Jump to search
m (ZAxisUp is ignored during file conversion)
m (oops)
 
(12 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.96.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 named in the <Class> tag of [[XML:BINA/OBJC/DOOR|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>
       


==File structure==
{{Tree list}}
*DOOR
**OFGA
***M3GM (holds <Texture> TXMP link to external file)
****PNTA <Points>
****VCRA <VertexNormals>
****VCRA <FaceNormals>
****TXCA <TextureCoordinates>
****IDXA <TriangleStrips>
****IDXA <FaceNormalIndices>
{{Tree list/end}}


==XML tags==
==XML tags==
===DOOR===
===DOOR===
{|class="wikitable" width="100%"
{|class="wikitable" width="100%"
!width=200px| tag
!width=200px| tag
Line 38: Line 30:
| 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 42:
| <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 64:
| <AISoundDistance>
| <AISoundDistance>
| float
| float
| AI sound volume ?
| AI sound volume?
|-
|-
| <OpenSound>
| <OpenSound>
Line 82: Line 74:
| <font color="#777777">OSBD</font>file<font color="#777777">.imp.oni (file prefix and suffix not used)</font>, 32 letters allowed
| <font color="#777777">OSBD</font>file<font color="#777777">.imp.oni (file prefix and suffix not used)</font>, 32 letters allowed
|}
|}


===OFGA===
===OFGA===
Read on '''[[XML:OFGA|HERE]]'''.
Read about these '''[[XML:OFGA|HERE]]'''.


 
===Sample XML===
===sample code===
'''DOORAIRglass01.xml'''
'''DOORAIRglass01.xml'''
  <?xml version="1.0" encoding="utf-8"?>
  <?xml version="1.0" encoding="utf-8"?>
Line 124: Line 114:
  </Oni>
  </Oni>


 
==Exporting geometry==
==geometry export==
  onisplit -extract:xml output_path path_to/DOOR*.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).
This will extract some metadata in an XML file alongside the 3D content stored in a DAE file.


DOOR and TXMP files must be in the same folder.
==Importing geometry==
 
[[Image:Quadrangulated_vs_triangulated_M3GM.jpg|thumb|200px|right|Use triangulated meshes to avoid holes in M3GM instances.]]
 
==geometry import==
  onisplit -create output_path path_to/DOOR*.xml
  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.
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.


A simple reference (relative path) can be seen in the [[#sample_code|sample code]] at <Geometry>.
==Exporting animation==
 
Normally it would be...
Of course TXMP(s) are required for the new 3D content.
 
 
==animation export==
Actually it would be ...


  onisplit -extract:dae output_path path_to/OBAN''file''.oni -geom:M3GM''file''.oni
  onisplit -extract:dae output_path path_to/OBAN''file''.oni -geom:M3GM''file''.oni


... but since we don't use standalone M3GM for doors anymore, use this instead:
...but since we don't use standalone M3GMs for doors anymore, use this instead:
  onisplit -create output_path path_to/DOOR*.xml
  onisplit -create output_path path_to/DOOR*.xml
  onisplit -extract:dae output_path path_to/OBAN*.oni
  onisplit -extract:dae output_path path_to/OBAN*.oni


Then in a 3D editor, put the geometries under the animated NULL object.
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
Next, you might want to do the following:
: Does Onisplit compensate ZAxisUp while converting OBAN*.oni to *.dae?
* Set the geometries' local rotation to X = 0
; Answer
* Translate the geometries' center to their lowest point
: No. The output values are the same no matter if ZAxisUp is present or not.
* 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.


==animation import==
==Importing animation==
ZAxisUp must be set in OBAN.
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.


; Remaining questions
'''Note: At the moment, OBAN import works only with cameras. '''
: How is ZAxisUp handled best in a 3D editor assuming Onisplit will compensate its effect?
: Does InitialTransform have any effect on the door?


 
==Making a new door class==
==using 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.
Before importing doors via "[[XML:ONLV#The_master_xml_file|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.
After level creation, the new door class and its animation must be placed in level 0.


  '''in shared folder'''
  '''In shared folder'''
  * DOOR file
  * DOOR file
  * TXMP file(s) (max. one for each embedded M3GM instance)
  * TXMP file(s) (only one for each embedded M3GM instance)
   
   
  '''in level 0'''
  '''In level 0'''
  * DOOR file
  * DOOR file
  * OBAN 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?
; Remaining question
: Does reconverting 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
; Notes about original doors
: In original game levels there are files like this "M3GMdoor_1_0.oni". That's an animated door part. (Doors consist of an animated and a static part.)
: 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.
: But onisplit will store animated door parts 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)
 


{{XML}}
{{XML}}

Latest revision as of 15:41, 13 May 2024

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.