XML:OFGA: Difference between revisions

From OniGalore
Jump to navigation Jump to search
m (+ cat)
m (link fix)
 
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{XML_File_Header | type=OFGA | prev=OBAN | next=ONCC | name=Object Furniture Geometry Array }}
{{XML_File_Header | prev=OBAN | type=OFGA | next=ONCC | name=Object Furniture Geometry Array}}


===general information===
==General information==
* The xml code on this page is compatible with onisplit '''v0.9.61.0''' and '''v0.9.68.0'''
* The XML on this page is compatible with OniSplit '''v0.9.61.0''' and '''v0.9.68.0'''.
* OFGA are level specific<!-- and maybe global? (not tested) -->.
* OFGA are level-specific (and maybe can be global too? Not tested).
* OFGA files were rarely used in game, only to get the bounding box of the geometry.
* OFGA files were rarely used in-game only to get the bounding box of the geometry.
* Nowadays they are used to import objects with no functions. (Doors, consoles, etc. becomes imported by their object collections. See [[XML:ONLV|ONLV]] for more information.)
* Nowadays they are used to import objects with no function. (Doors and consoles get imported through object collections. See [[XML:ONLV|ONLV]] for more information.)


==XML tags==
{| class="wikitable" width="100%"
!width=150px| XML tag
!width=120px| Content type
! Description
|-
| <OFGA id="...">
| integer
| Marks the beginning of the OFGA content.
|-
|valign=top| <EnvParticle>
|valign=top| "#" + integer
| ENVP instance number (#N)
|-
| <Elements>
| -
| You can put here practically any number of <OFGAElement> tags. The array is an int32.
|-
| <OFGAElement>
| -
|
|-
|valign="top"| <GunkFlags>
|valign="top"| flag
| Here are the common flags. For more theoretically-possible AGQG flags, see ''onisplit -help enums''.
: None
: NoCharacterCollision
: NoObjectCollision
: NoCollision
: NoOcclusion
: Invisible - used for collision boxes
: TwoSided
|-
| <Geometry>
| link
| M3GM''file_name''<font color="#777777">.oni</font> <font color="#777777">(don't use file suffix)</font>
|-
| <ENVP id="...">
| integer
| Instance number. Use the one from <EnvParticle>.
|-
| <Particles>
| -
| You can put here practically any number of <ENVPParticle> tags. The array is an int16.
|-
|valign="top"| <ENVPParticle>
|valign="top"| -
| ENVP is used to store particles attached to objects or furniture: locklights, lights, fire, smoke, steam, bolts of electricity, etc. Loose particles are normally added to the level's [[XML:BINA/OBJC/PART|particle collection]].
|-
| <Class>
| char[64]
| <font color="#777777">BINA3RAP</font>''file_name''<font color="#777777">.oni</font> <font color="#777777">(don't use file prefix/suffix)</font>
|-
|valign="top"| <Tag>
|valign="top"| char[48]
| Particle name for BSL commands. For some reason an underscore "_" will be added to the name. '''Examples:'''


===file structure===
: FURN <Particle>test</Particle> + OFGA <Tag>streetlight</Tag> = '''test_streetlight'''
There's space only for one particle but multiple OFGA elements.
: FURN <Particle></Particle> + OFGA <Tag>streetlight</Tag> = '''_streetlight'''
 
: FURN <Particle>test</Particle> + OFGA <Tag></Tag> = '''test_'''
{| border=0 cellspacing=20 cellpadding=0 style="float:right"
|-
|width=200px|
| <Transform>
[http://i305.photobucket.com/albums/nn207/unknownfuture/Oni_Galore_Images/XML_modding/OFGAV_tctf_cruiser.png http://i305.photobucket.com/albums/nn207/unknownfuture/Oni_Galore_Images/XML_modding/OFGAV_tctf_cruiser_tn.png]
| matrix
 
| Float 3*3 + float X Y Z position of the particle. Can be used to orient and stretch the particles (decals, locklights, etc.). (How? Expand on this.)
extracted OFGAV_tctf_cruiser.xml file led to the 8 M3GM instances
|-
| <DecalScale>
| integer, integer
| X Y
|-
|valign="top"| <Flags>
|valign="top"| flag
|  
:None
:NotInitiallyCreated
|}


the single parts were then imported into Mod Tool
===Example 1===
|}
[[Image:OFGA_extracted_M3GMs_of_V_tctf_cruiser.png|thumb|200px|right|Extracted "V_tctf_cruiser.oni" (OFGA) from shared folder (furniture), seen in Mod Tool, Wireframe mode.]]


  <?xml version="1.0" encoding="utf-8"?>
  <?xml version="1.0" encoding="utf-8"?>
Line 61: Line 127:
  </Oni>
  </Oni>


===Example 2===
[[Image:OFGA_streetlights_with_particle_ingame.png|thumb|200px|right|Streetlights are originally part of the level geometry. For import tests they have been transformed into a M3GM and OFGA file.]]


===tags===
<?xml version="1.0" encoding="utf-8"?>
{| class="wikitable" width="100%"
<Oni>
!width=150px| XML tag
    <OFGA id="0">
!width=120px| content type
        <EnvParticle>#1</EnvParticle>
! description
        <Elements>
|-
            <OFGAElement>
|valign=top| <EnvParticle>
                <GunkFlags>NoOcclusion</GunkFlags>
|valign=top| ?
                <Geometry>M3GMstreetlight_0</Geometry>
| if used, the name is equal to ONLV => ENVP => <Tag>...</Tag> ?
            </OFGAElement>
|-
        </Elements>
| <Elements>
    </OFGA>
| -
    <ENVP id="1">
| You can put here quite any number of <OFGAElement> tags. The array is an int32.
        <Particles>
|-
            <ENVPParticle>
| <OFGAElement>
                <Class>env_lensflare09</Class>
| -
                <Tag>streetlight</Tag>
|
                <Transform>1 -4.559326E-08 1.35404189E-05 -1.354042E-05 -2.03512554E-05 1 -4.53176945E-08 -1 -2.03512554E-05 1.3262 63.5907 10.4082</Transform>
|-
                <DecalScale>1 1</DecalScale>
|valign="top"| <GunkFlags>
                <Flags></Flags>
|valign="top"| flag
            </ENVPParticle>
|
            <ENVPParticle>
: NoCharacterCollision
                <Class>env_lensflare09</Class>
: NoOcclusion
                <Tag>streetlight</Tag>
: Invisible - used for collision boxes
                <Transform>1 -4.559326E-08 1.35404189E-05 -1.354042E-05 -2.03512554E-05 1 -4.53176945E-08 -1 -2.03512554E-05 1.3262 63.5907 -8.877</Transform>
: NoObjectCollision
                <DecalScale>1 1</DecalScale>
|-
                <Flags></Flags>
| <Geometry>
            </ENVPParticle>
| link
        </Particles>
| M3GM''file_name''<font color="#777777">.oni</font> (without file suffix .oni)
    </ENVP>
|}
  </Oni>
 
 
==export==
The direct export ignores geometry with the flag "Invisible".
onisplit -extract:obj out in/OFGA*.oni
 
 
You can also identify the single geometry parts by going through the xml file and then export the M3GM file of your interest.
onisplit -extract:xml out in/OFGA*.oni
  onisplit -extract:obj out in/M3GM*.oni


==Export==
To extract the OFGA file:
OniSplit -extract:xml out in/OFGA*.oni


==import==
To extract M3GM parts only:
OniSplit -extract:obj out in/OFGA*.oni


==Import==
Be sure your OBJ file contains triangulated meshes. Quads can give you visual glitches.


==error prevention==
OniSplit out_folder -create:m3gm [-tex:texture_name] input_folder/file.obj
: The "-tex" argument is optional but you should use it to prevent bugs.


After the creation of the TXMP, M3GM and OFGA, you can go on to the [[Creating a level#Furniture.xml|furniture file]].


{{XML}}
{{XML}}

Latest revision as of 01:19, 20 November 2023

OFGA : Object Furniture Geometry Array
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

OBAN << Other file types >> ONCC

switch to OBD page

General information

  • The XML on this page is compatible with OniSplit v0.9.61.0 and v0.9.68.0.
  • OFGA are level-specific (and maybe can be global too? Not tested).
  • OFGA files were rarely used in-game — only to get the bounding box of the geometry.
  • Nowadays they are used to import objects with no function. (Doors and consoles get imported through object collections. See ONLV for more information.)

XML tags

XML tag Content type Description
<OFGA id="..."> integer Marks the beginning of the OFGA content.
<EnvParticle> "#" + integer ENVP instance number (#N)
<Elements> - You can put here practically any number of <OFGAElement> tags. The array is an int32.
<OFGAElement> -
<GunkFlags> flag Here are the common flags. For more theoretically-possible AGQG flags, see onisplit -help enums.
None
NoCharacterCollision
NoObjectCollision
NoCollision
NoOcclusion
Invisible - used for collision boxes
TwoSided
<Geometry> link M3GMfile_name.oni (don't use file suffix)
<ENVP id="..."> integer Instance number. Use the one from <EnvParticle>.
<Particles> - You can put here practically any number of <ENVPParticle> tags. The array is an int16.
<ENVPParticle> - ENVP is used to store particles attached to objects or furniture: locklights, lights, fire, smoke, steam, bolts of electricity, etc. Loose particles are normally added to the level's particle collection.
<Class> char[64] BINA3RAPfile_name.oni (don't use file prefix/suffix)
<Tag> char[48] Particle name for BSL commands. For some reason an underscore "_" will be added to the name. Examples:
FURN <Particle>test</Particle> + OFGA <Tag>streetlight</Tag> = test_streetlight
FURN <Particle></Particle> + OFGA <Tag>streetlight</Tag> = _streetlight
FURN <Particle>test</Particle> + OFGA <Tag></Tag> = test_
<Transform> matrix Float 3*3 + float X Y Z position of the particle. Can be used to orient and stretch the particles (decals, locklights, etc.). (How? Expand on this.)
<DecalScale> integer, integer X Y
<Flags> flag
None
NotInitiallyCreated

Example 1

Extracted "V_tctf_cruiser.oni" (OFGA) from shared folder (furniture), seen in Mod Tool, Wireframe mode.
<?xml version="1.0" encoding="utf-8"?>
<Oni>
   <OFGA id="0">
       <EnvParticle></EnvParticle>
       <Elements>
           <OFGAElement>
               <GunkFlags>NoCharacterCollision NoOcclusion</GunkFlags>
               <Geometry>M3GMV_tctf_cruiser_0</Geometry>
           </OFGAElement>
           <OFGAElement>
               <GunkFlags>NoCharacterCollision NoOcclusion</GunkFlags>
               <Geometry>M3GMV_tctf_cruiser_1</Geometry>
           </OFGAElement>
           <OFGAElement>
               <GunkFlags>NoCharacterCollision NoOcclusion</GunkFlags>
               <Geometry>M3GMV_tctf_cruiser_2</Geometry>
           </OFGAElement>
           <OFGAElement>
               <GunkFlags>NoCharacterCollision NoOcclusion</GunkFlags>
               <Geometry>M3GMV_tctf_cruiser_3</Geometry>
           </OFGAElement>
           <OFGAElement>
               <GunkFlags>NoCharacterCollision NoOcclusion</GunkFlags>
               <Geometry>M3GMV_tctf_cruiser_4</Geometry>
           </OFGAElement>
           <OFGAElement>
               <GunkFlags>NoCharacterCollision NoOcclusion</GunkFlags>
               <Geometry>M3GMV_tctf_cruiser_5</Geometry>
           </OFGAElement>
           <OFGAElement>
               <GunkFlags>NoCharacterCollision NoOcclusion</GunkFlags>
               <Geometry>M3GMV_tctf_cruiser_6</Geometry>
           </OFGAElement>
           <OFGAElement>
               <GunkFlags>Invisible NoObjectCollision</GunkFlags>
               <Geometry>M3GMV_tctf_cruiser_7</Geometry>
           </OFGAElement>
       </Elements>
   </OFGA>
</Oni>

Example 2

Streetlights are originally part of the level geometry. For import tests they have been transformed into a M3GM and OFGA file.
<?xml version="1.0" encoding="utf-8"?>
<Oni>
   <OFGA id="0">
       <EnvParticle>#1</EnvParticle>
       <Elements>
           <OFGAElement>
               <GunkFlags>NoOcclusion</GunkFlags>
               <Geometry>M3GMstreetlight_0</Geometry>
           </OFGAElement>
       </Elements>
   </OFGA>
   <ENVP id="1">
       <Particles>
           <ENVPParticle>
               <Class>env_lensflare09</Class>
               <Tag>streetlight</Tag>
               <Transform>1 -4.559326E-08 1.35404189E-05 -1.354042E-05 -2.03512554E-05 1 -4.53176945E-08 -1 -2.03512554E-05 1.3262 63.5907 10.4082</Transform>
               <DecalScale>1 1</DecalScale>
               <Flags></Flags>
           </ENVPParticle>
           <ENVPParticle>
               <Class>env_lensflare09</Class>
               <Tag>streetlight</Tag>
               <Transform>1 -4.559326E-08 1.35404189E-05 -1.354042E-05 -2.03512554E-05 1 -4.53176945E-08 -1 -2.03512554E-05 1.3262 63.5907 -8.877</Transform>
               <DecalScale>1 1</DecalScale>
               <Flags></Flags>
           </ENVPParticle>
       </Particles>
   </ENVP>
</Oni>

Export

To extract the OFGA file:

OniSplit -extract:xml out in/OFGA*.oni

To extract M3GM parts only:

OniSplit -extract:obj out in/OFGA*.oni

Import

Be sure your OBJ file contains triangulated meshes. Quads can give you visual glitches.

OniSplit out_folder -create:m3gm [-tex:texture_name] input_folder/file.obj
The "-tex" argument is optional but you should use it to prevent bugs.

After the creation of the TXMP, M3GM and OFGA, you can go on to the furniture file.