XML:DOOR
DOOR : Door | ||
---|---|---|
XML
CONS << Other file types >> DPge |
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:
|
<AISoundType> | flag | AI sound types:
|
<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
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.