XML:DOOR: Difference between revisions

From OniGalore
Jump to navigation Jump to search
mNo edit summary
m (oops)
 
(16 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 code===
===Sample XML===
'''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==
==door 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.]]
 
==door 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.


Such simple reference (relative path) is seen here in the [[#sample_code|sample code]]. So, it will be just the file name in <Geometry>.
==Exporting animation==
Normally it would be...


Of course TXMP(s) are required for the new 3D content.
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


==door animation export==
Then, in a 3D editor, group the geometries under the animated NULL object.
Basically it's:


onisplit -extract:dae output_path path_to/OBAN''file''.oni -geom:M3GM''file''.oni
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.


==door animation import==
==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.


==using a new door class==
'''Note: At the moment, OBAN import works only with cameras. '''
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/X.
==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.


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 (one for each embedded M3GM instance)
  * TXMP file(s) (only one for each embedded M3GM instance)
   
   
  '''in level 0 / level X*'''
  '''In level 0'''
  * DOOR file
  * DOOR file
  * OBAN 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 an animated door part. (Doors consist of an animated and a static part.)
; Open question
: 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)
: 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.


{{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.