Virtual pofs.tbl

From FreeSpace Wiki
Jump to: navigation, search
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
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
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
Particle effects(-part.tbm)** /particle/effects...
Post_processing.tbl /graphics/gropenglpostprocessing.cpp
Rank.tbl /stats/scoring.cpp
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, 22.4:

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

+Copy Turrets:

  • Optional: If set to true, all turret definitions will be copied over to the new POF. If false, only the models but not the functionality of the turrets will be copied. Default is false.
    • Syntax: boolean

+Copy Glowpoints:

  • Optional: If set to true, the glowpoints on the submodels to be added will be copied. Default is false.
    • 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

$Add Turret:

  • This operation adds a turret definition (but not model data!) to a submodel on the current POF

+POF to Add:

  • The filename of the POF which has the turret definition.
    • Syntax: string, filename

+Source Turret:

  • The name of the base subobject in the to-be-added POF that has the turret definition
    • Syntax: string

+Destination Turret:

  • The name of the base subobject in POF that should recieve the turret definition
    • Syntax: string

+Destination Barrel:

  • The name of the barrel subobject in POF that should recieve the turret definition. Must be specified if the source turret is a multipart. Can be omitted otherwise.
    • Syntax: string

$Add Engine:

  • This operation adds an engine definition to the current POF.

+POF to Add:

  • The filename of the POF which has the engine definition.
    • Syntax: string, filename

+Source Engine:

  • Specifies the number of the engine (1-index based) in the source POF. Either this or +Source Engine Subsystem must be specified.
    • Syntax: integer, engine number

+Source Engine:

  • Specifies the subsystem name of the engine in the source POF. Only valid if the source subsystem name is not ambiguous. Either this or +Source Engine must be specified.
    • Syntax: string, subsystem name

+Move Engine:

  • Optional: If set, will move the engine by the specified amount
    • Syntax: three floats, offset in x, y, z

+Destination Subsystem:

  • Optional: Specifies the subsystem name that the engine is attached to in the combined POF. If not set, the engine will be attached to a subsystem with the same name as in the source POF. Has no effect if the engine was not attached to any subsystem in the source.
    • Syntax: string, subsystem name

$Add Glowpoint:

  • This operation adds a glowpoint to the current POF.

+POF to Add:

  • The filename of the POF which has the glowpoint.
    • Syntax: string, filename

+Source Glowpoint:

  • Specifies the number of the glowpoint(1-index based) in the source POF.
    • Syntax: integer, glowpoint number

+Move Glowpoint:

  • Optional: If set, will move the glowpoint by the specified amount
    • Syntax: three floats, offset in x, y, z

+Destination Submodel:

  • Specifies the submodel name the glowpoint will be attached to
    • Syntax: string, submodel name

$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