Difference between revisions of "Virtual pofs.tbl"

From FreeSpace Wiki
Jump to: navigation, search
(Add Virtual_pofs.tbl)
 
m (there's no need to repeat the title... right under the title)
Line 5: Line 5:
 
The new table format to specify virtual POF-models, created modularly from other POF files.
 
The new table format to specify virtual POF-models, created modularly from other POF files.
 
}}
 
}}
 
=#Virtual POFs=
 
  
 
The POFs defined here can be used from all other parts of the engine as if they were real, existing POF-files.
 
The POFs defined here can be used from all other parts of the engine as if they were real, existing POF-files.
Line 90: Line 88:
 
**Syntax: '''Vector''', three ''floats'', x, y, z respectively. All values must be larger than those specified in <tt>+Minimum:</tt>
 
**Syntax: '''Vector''', three ''floats'', x, y, z respectively. All values must be larger than those specified in <tt>+Minimum:</tt>
  
=Example=
+
==Example==
  
 
<pre>
 
<pre>

Revision as of 17:26, 3 September 2022

This feature requires FreeSpace Open
List of Tables and related code files
* Notes Modular Tables
** Notes tables which only use modular tables
Ai.tbl* /ai/aicode.cpp
Ai_profiles.tbl* /ai/ai_profiles.cpp
Animation.tbl** /model/modelanimation.cpp
Armor.tbl* /ship/ship.cpp
Asteroid.tbl* /asteroid/asteroid.cpp
Autopilot.tbl* /autopilot/autopilot.cpp
Cheats.tbl* /cheats_table/cheats_table.cpp
Colors.tbl* /globalincs/alphacolors.cpp
Curves.tbl* /math/curves.cpp
Controlconfigdefaults.tbl /controlconfig/controlsconfigcommon.cpp
Credits.tbl* /menuui/credits.cpp
Cutscenes.tbl* /cutscene/cutscenes.cpp
Decals.tbl** /decals/decals.cpp
Fireball.tbl* /fireball/fireballs.cpp
Fonts.tbl* /graphics/font.cpp
Game_settings.tbl* /mod_table/mod_table.cpp
Glowpoints.tbl* /model/modelread.cpp
Help.tbl* /gamehelp/contexthelp.cpp
Hud_gauges.tbl* /hud/hudparse.cpp
Icons.tbl* /mission/missionbriefcommon.cpp
Iff_defs.tbl* /iff_defs/iff_defs.cpp
Keywords.tbl* Not In Codebase
Lighting_Profiles.tbl* /lighting/lighting_profiles.cpp
Lightning.tbl* /nebula/neblightning.cpp
Mainhall.tbl* /menuui/mainhallmenu.cpp
Medals.tbl* /stats/medals.cpp
Messages.tbl* /mission/missionmessage.cpp
Mflash.tbl* /weapon/muzzleflash.cpp
Music.tbl* /gamesnd/eventmusic.cpp
Nebula.tbl* /nebula/neb.cpp
Objecttypes.tbl* /ship/ship.cpp
Options.tbl* Not In Codebase
Particle effects(-part.tbm)** /particle/effects...
Post_processing.tbl /graphics/gropenglpostprocessing.cpp
Rank.tbl* /stats/scoring.cpp
Scpui.tbl* Not In Codebase
Scripting.tbl* /parse/scripting.cpp
Ships.tbl* /ship/ship.cpp
Sexps.tbl** /parse/sexp/sexp_lookup.cpp
Sounds.tbl* /gamesnd/gamesnd.cpp
Species_defs.tbl* /species_defs/species_defs.cpp
Species.tbl* /menuui/techmenu.cpp
Ssm.tbl* /hud/hudartillery.cpp
Stars.tbl* /starfield/starfield.cpp
Strings.tbl* /localization/localize.cpp
Tips.tbl* /menuui/playermenu.cpp
Traitor.tbl* /stats/scoring.cpp
Tstrings.tbl* /localization/localize.cpp
Virtual_pofs.tbl* /model/modelreplace.cpp
Weapon_expl.tbl* /weapon/weapons.cpp
Weapons.tbl* /weapon/weapons.cpp


FS2 Open, 23.0:

The new table format to specify virtual POF-models, created modularly from other POF files.

The POFs defined here can be used from all other parts of the engine as if they were real, existing POF-files. It can / will be able to be used for a variety of different purposes:

  • Variety without copying models, by having one base model POF with the variations defined as virtual POFs
  • Better dependency on other assets, by being able to modify existing models of depending mods instead of needing a full modified copy of the model.
  • To modify models in a mod without having to redefine the ship classes
  • To semi-dynamically generate certain types of models, like ships with modular hardpoints for certain turrets or other parts, or large structures like asteroid fields.

$POF:

  • The virtual filename of this POF.
    • If a POF of this filename already exists, this virtual POF will replace it. Virtual POFs can replace other virtual POFs as well, including those that already replace other POFs themselves.
    • Accessing a POF with the same name from this definition will use the POF to-be-replaced.
    • (Example: Virtual POF A overwrites the real A.pof. Accessing A.pof within the definition of the virtual POF A will yield the original A.pof. Accessing A.pof from the engine will yield virtual POF A)

+Base POF:

  • The filename of the base POF to be modified.

Operations

  • Here, the actual modification operations are specified. The operations that are defined here, need to be a list with elements made out of the following:

$Add Subobject:

  • This operation adds a subobject from a different POF to the current POF to be modified.

+POF to Add:

  • The filename of the POF from which the new subobject is to be copied.
    • Syntax: string, filename

+Source Subobject:

  • The name of the subobject in the to-be-added POF that should be copied
    • Syntax: string

+Copy Children:

  • Optional: If set to true, the subobject and all of its children will be copied. If false, only the single subobject is copied. Default is true.
    • Syntax: boolean

$Rename Subobjects:

  • Optional: Can be used to rename the copied subobjects. This is optional, except if the resulting model would have two subobjects of the same name. This is not allowed, a model must always have unique submodel names.

+Destination Subobject:

  • The name of the subobject in the to-be-modified POF that will be the parent of the to-be-copied submodel
    • Syntax: string

$Rename Subobjects:

  • This operation renames subobjects. The following two entries can be repeated as often as needed

+Replace:

  • The name of the subobject to be renamed
    • Syntax: string

+With:

  • The new name of the subobject
    • Syntax: string

$Set Subobject Data:

  • This operation can be used to modify a specific subobject.

+Subobject:

  • The name of the subobject to be modified
    • Syntax: string

+Set Offset:

  • Optional: If set, modifies the offset of the subobject, relative to the center of its parent
    • Syntax: Vector, three floats, x, y, z respectively

$Set Header Data:

  • This operation can be used to modify the header data of a model

+Set Radius:

  • Optional: If set, modifies the radius of the model. The model can only collide with parts that lie within this radius, measured from the model center
    • Syntax: float

$Set Bounding Box:

  • Optional: If set, modifies the bounding box of the model. The model can only collide with parts that lie within this bounding box
+Minimum:
  • The corner of the bounding box with lower coordinates
    • Syntax: Vector, three floats, x, y, z respectively
+Maximum:
  • The corner of the bounding box with higher coordinates
    • Syntax: Vector, three floats, x, y, z respectively. All values must be larger than those specified in +Minimum:

Example

#Virtual POFs

$POF: Fighter01.pof
	+Base POF: Fighter01.pof
	$Add Subobject:
		+POF to Add: Fenris_FS2.pof
		+Source Subobject: detailbox_engines
		+Destination Subobject: detail0
	$Add Subobject:
		+POF to Add: Fenris_FS2.pof
		+Source Subobject: radar01a-dish
		$Rename Subobjects:
			+Replace: radar01a-dish
			+With: radar
		+Destination Subobject: detail0
	$Set Subobject Data:
		+Submodel: detailbox_engines
		+Set Offset: 0, 0, -15
	$Set Subobject Data:
		+Submodel: radar
		+Set Offset: 0, 10, 0
		
#End