XML:DOOR: Difference between revisions

From OniGalore
Jump to navigation Jump to search
m (script update/bugfix: triangulates objects, txmps are now also created on the desktop)
m (marking dead link)
Line 219: Line 219:


For now you can grab this [[Mod_Tool#Scripting|script]].
For now you can grab this [[Mod_Tool#Scripting|script]].
: [https://dl.dropboxusercontent.com/u/139715/temp/DoorClassMaker_wip.txt DoorClassMaker_wip.txt] Not tested with "large" textures (512 pixel in hight/width).
: DoorClassMaker_wip.txt (<nowiki>https://dl.dropboxusercontent.com/u/139715/temp/DoorClassMaker_wip.txt</nowiki>, dead link) Not tested with "large" textures (512 pixel in hight/width).


The script will process a self-made null object which has door geometries as children.
The script will process a self-made null object which has door geometries as children.

Revision as of 14:27, 20 August 2020

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>


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.


geometry import

use triangulated meshes to avoid holes in M3GMs instances/files
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.

A simple reference (relative path) can be seen in the sample code at <Geometry>.

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


animation export

Actually it would be ...

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

... but since we don't use standalone M3GM 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 compensate 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

ZAxisUp must be set in OBAN.

[...]


Question
Do InitialTransform and BaseTransform effect 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>
Questions
How is ZAxisUp handled best in a 3D editor when Onisplit doesn't compensate its effect?
Answer
For now, keep NULL's global X rotation to -90.


At the moment OBAN import works only with cameras.


using a new door class

Before importing doors via "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) (max. one for each embedded M3GM instance)

in level 0
* DOOR file
* OBAN file

[...]

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
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.)
But onisplit will store animated door parts inside ONLV so we don't need extra M3GMs. --paradox-01 (talk) 18:41, 15 February 2014 (CET)


Mod Tool addon

Mod Tool addon "Oni Tools" will support combined creation of DOOR, TXMPs and OBAN someday.

For now you can grab this script.

DoorClassMaker_wip.txt (https://dl.dropboxusercontent.com/u/139715/temp/DoorClassMaker_wip.txt, dead link) Not tested with "large" textures (512 pixel in hight/width).

The script will process a self-made null object which has door geometries as children.

In the simplest case you have only one door object. But just in case, multiple objects are supported.
null (animated for OBAN, but X rotation must be always -90°)
 |
 +-- door_geometry_1
 +-- door_geometry_N

Select the null object and run the script. The oni files will appear on your desktop.