Difference between revisions of "HowTo:Edit HUDs"

From VsWiki
Jump to: navigation, search
m (XML Schema: gauges mark)
m (XML Schema - replaced ? with {{fixme}})
Line 69: Line 69:
  
 
=== XML Schema ===
 
=== XML Schema ===
''This is the information I have gathered from looking at the files.  Where I have placed (?)'s, I am unsure if my information is correct.''
+
''This is the information I have gathered from looking at the files.''
  
 
<code><Cockpit ...> </Cockpit></code> Marks the beginning and end of the cockpit definition
 
<code><Cockpit ...> </Cockpit></code> Marks the beginning and end of the cockpit definition
Line 78: Line 78:
 
* <code>right=""</code> - Sprite file to use for right-facing view of 2D cockpits
 
* <code>right=""</code> - Sprite file to use for right-facing view of 2D cockpits
 
* <code>back=""</code> - Sprite file to use for rear-facing view of 2D cockpits
 
* <code>back=""</code> - Sprite file to use for rear-facing view of 2D cockpits
* <code>ViewOffset="#"</code> - (?) Horizontal offset within cockpit
+
* <code>ViewOffset="#"</code> - {{fixme}} Horizontal offset within cockpit
* <code>CockpitOffset="#"</code> - (?) Not certain of the purpose of this option
+
* <code>CockpitOffset="#"</code> - {{fixme}} Not certain of the purpose of this option
 
* The following options are supported in cockpit_xml.cpp (In CVS as of 5/18/2005) and may or may not be functional in the game.
 
* The following options are supported in cockpit_xml.cpp (In CVS as of 5/18/2005) and may or may not be functional in the game.
 
** <code>font=""</code> - Specify the font file to be used
 
** <code>font=""</code> - Specify the font file to be used
** <code>file=""</code> - (?) Unknown
+
** <code>file=""</code> - {{fixme}} Unknown
** <code>soundfile=""</code> - (?) Unknown
+
** <code>soundfile=""</code> - {{fixme}} Unknown
  
 
* Sprite definitions
 
* Sprite definitions
Line 90: Line 90:
 
*** <code>xcent="#" ycent="#"</code> - center along x or y at # (range is -1 to 1)
 
*** <code>xcent="#" ycent="#"</code> - center along x or y at # (range is -1 to 1)
 
*** <code>width="#" height="#"</code> - Set width and height
 
*** <code>width="#" height="#"</code> - Set width and height
*** For gauges: <code>GaugeRight, GaugeLeft, GaugeDown, GaugeUp(Default?) = "1"</code> - Sets direction that gauges clear from.
+
*** For gauges: <code>GaugeRight, GaugeLeft, GaugeDown, GaugeUp(Default) = "1"</code> - Sets direction that gauges clear from.
 
** <code><Crosshairs ... /></code> - Crosshairs sprite
 
** <code><Crosshairs ... /></code> - Crosshairs sprite
 
** <code><Radar ... /></code> - Forward radar
 
** <code><Radar ... /></code> - Forward radar
Line 132: Line 132:
 
** <code><ArmorR ... /></code> - Right Armor Gauge
 
** <code><ArmorR ... /></code> - Right Armor Gauge
 
** Additional elements found in cockpit_xml.cpp that may or may not be implemented
 
** Additional elements found in cockpit_xml.cpp that may or may not be implemented
*** <code><LeftVDU ... /></code> - (?) Left VDU
+
*** <code><LeftVDU ... /></code> - {{fixme}} Left VDU
*** <code><RightVDU ... /></code> - (?) Right VDU
+
*** <code><RightVDU ... /></code> - {{fixme}} Right VDU
*** <code><Panel ... /></code> - (?) Unknown (Appears to be related to Crosshairs)
+
*** <code><Panel ... /></code> - {{fixme}} Unknown (Appears to be related to Crosshairs)
*** <code><Collision ... /></code> - (?) Sprite indicating a collision has occurred.
+
*** <code><Collision ... /></code> - {{fixme}} Sprite indicating a collision has occurred.
 
{{fixme}} CORRECTIONS AND ADDITIONAL INFORMATION REQUESTED
 
{{fixme}} CORRECTIONS AND ADDITIONAL INFORMATION REQUESTED
  

Revision as of 19:41, 25 May 2005

arrow_left.png Edit Mesh Files arrow_up.png HowTo Create a Cockpit in Wings3d arrow_right.png

Editing or Creating a HUD

Image files

  • To display your own graphic files in the HUD you can use every image format that is supported by vegastrike (png/jpg/bmp/...).
  • The sides of the images must have a size that is a power of 2.

The cockpit directory

The cockpit directory contains all the relevant files that consist of the HUD and cockpit. These files are:

  • .cpt file - FIXME PROVIDE EXPLANATION OF PURPOSE OF FILE
  • .bfxm file - FIXME PROVIDE EXPLANATION OF PURPOSE OF FILE
  • .xmesh file - FIXME PROVIDE EXPLANATION OF PURPOSE OF FILE
  • .spr files - FIXME PROVIDE EXPLANATION OF PURPOSE OF FILE

Example

../cockpits/disabled-cockpit.cpt

Structure

disable-cockpit.cpt is the name of the subdirectory.

Description

All cockpit/HUD information is held under a single directory located as a subdirectory of the cockpits directory.

The ".cpt" file format

FIXME COMPLETE MISSING INFORMATION

Example

disabled-cockpit.cpt

 <Cockpit r="0" g=".75" b="1">
    <Crosshairs file="crosshairs.spr" xcent="0" ycent="0" /> 
    <Radar file="radar.spr" /> 
    <RearRadar file="radarr.spr" /> 
    <Speed file="radar.spr" xcent="-.23" ycent="-.52" width=".018" height=".036" /> 
    <SetSpeed file="radar.spr" xcent=".23" ycent="-.52" width=".018" height=".036" /> 
    <WARPFIELDSTRENGTH file="radar.spr" xcent="-.23" ycent="-.58" width=".018" height=".036" /> 
    <Fuel file="fuelstat.spr" GaugeRight="1" xcent="0" ycent="-.6" /> 
    <Energy file="blasterpower.spr" GaugeRight="1" /> 
    <WarpEnergy file="jumppower.spr" GaugeRight="1" xcent="0" ycent="-.55" /> 
    <Lock file="locklight.spr" xcent="0" ycent="-.7" /> 
    <MissileLock file="locklight.spr" xcent=".04" ycent="-.7" /> 
    <ECM file="locklight.spr" xcent="-.04" ycent="-.7" /> 
    <Auto file="auto.spr" /> 
    <Jump file="canjump.spr" /> 
    <Eject file="eject.spr" /> 
    <VDU TextRows="30" TextCols="25" type="Weapon Manifest Damage" file="wvdu.spr" xcent="-.8" ycent=".2" /> 
    <VDU TextRows="15" TextCols="25" type="Target Comm View TargetManifest Nav" file="rvdu.spr" xcent=".775" ycent="-.75" /> 
    <VDU TextRows="15" TextCols="25" type="Shield Manifest" file="lvdu.spr" xcent="-.775" ycent="-.75" /> 
    <VDU TextRows="14" TextCols="100" type="Message" file="mvdu.spr" /> 
    <VDU TextRows="30" TextCols="30" type="Objectives" file="objvdu.spr" /> 
    <FPS file="radar.spr" xcent=".9" ycent=".8" width=".018" height=".036" /> 
 </Cockpit>

XML Schema

This is the information I have gathered from looking at the files.

<Cockpit ...> </Cockpit> Marks the beginning and end of the cockpit definition

  • r="#" g="#" b="#" Specifies percentages of color used for generated elements (text and radar). Numbers between 0 and 1. Example is for cyan.
  • mesh="" - Mesh file to use for 3D cockpits
  • front="" - Sprite file to use for forward-facing view of 2D cockpits
  • left="" - Sprite file to use for left-facing view of 2D cockpits
  • right="" - Sprite file to use for right-facing view of 2D cockpits
  • back="" - Sprite file to use for rear-facing view of 2D cockpits
  • ViewOffset="#" - FIXME Horizontal offset within cockpit
  • CockpitOffset="#" - FIXME Not certain of the purpose of this option
  • The following options are supported in cockpit_xml.cpp (In CVS as of 5/18/2005) and may or may not be functional in the game.
    • font="" - Specify the font file to be used
    • file="" - FIXME Unknown
    • soundfile="" - FIXME Unknown
  • Sprite definitions
    • Common parameters:
      • file="" - SPR file to use
      • xcent="#" ycent="#" - center along x or y at # (range is -1 to 1)
      • width="#" height="#" - Set width and height
      • For gauges: GaugeRight, GaugeLeft, GaugeDown, GaugeUp(Default) = "1" - Sets direction that gauges clear from.
    • <Crosshairs ... /> - Crosshairs sprite
    • <Radar ... /> - Forward radar
    • <RearRadar ... /> - Rear radar
    • <Speed ... /> - Current speed
    • <SetSpeed ... /> - Set speed
    • <WARPFIELDSTRENGTH ... /> - Current SPEC multiplier.
    • <Fuel ... /> - Fuel (Gauge)
    • <Energy ... /> - Main (reactor) capacitor level. (Gauge)
    • <WarpEnergy ... /> - Warp capacitor level. (Gauge)
    • <Lock ... /> - Someone has locked onto you.
    • <MissileLock ... /> - Someone has gained a missile lock on you
    • <ECM ... /> - ECM activated (Is this when your ECM stops a missile or when an enemy stops your missile?)
    • <Auto ... /> - Timeless Autopilot or SPEC mode indicator
    • <Jump ... /> - Jump point in range indicator
    • <Eject ... /> - Critical failure indicator
    • <VDU ... /> - Video Display Unit (multiple entries allowed)
      • Additional parameters:
        • TextRows = "#" - Number of rows displayed (Note: If sprite is not large enough, the maximum number of rows possible is displayed)
        • TextCols = "#" - Number of characters across displayed
        • Type = "" - VDU types to display separated by spaces
          • Weapon - Displays active guns and missiles
          • Manifest - Displays the content of your cargo hold
          • Damage - Displays the status of your ship and it's systems
          • Target - Displays your target's shields, hull and distance from your ship
          • Comm - Displays your communications options
          • View - Displays a camera view of your target
          • TargetManifest - Displays your target's cargo
          • Nav - Another camera view
          • Shield - Your shield status
          • Message - Incoming and outgoing message display
          • Objectives - Mission objectives
    • <FPS ... /> - Simulated Frames per Second
    • <ShieldF ... /> - Front Shield Gauge
    • <ShieldB ... /> - Rear Shield Gauge
    • <ShieldL ... /> - Left Shield Gauge
    • <ShieldR ... /> - Right Shield Gauge
    • <ArmorF ... /> - Front Armor Gauge
    • <ArmorB ... /> - Rear Armor Gauge
    • <ArmorL ... /> - Left Armor Gauge
    • <ArmorR ... /> - Right Armor Gauge
    • Additional elements found in cockpit_xml.cpp that may or may not be implemented
      • <LeftVDU ... /> - FIXME Left VDU
      • <RightVDU ... /> - FIXME Right VDU
      • <Panel ... /> - FIXME Unknown (Appears to be related to Crosshairs)
      • <Collision ... /> - FIXME Sprite indicating a collision has occurred.

FIXME CORRECTIONS AND ADDITIONAL INFORMATION REQUESTED

Description

This is the .cpt file, using the same name as per the directory name. FIXME INFORMATION ON STRUCTURE REQUIRED

The ".spr" file format

FIXME REDEFINE INTO EASY TO FOLLOW INSTRUCTIONS

Example

./cockpits/disabled-cockpit.cpt/blasterpower.spr

cockpit/blasterpower.png cockpit/blasterpower.png
.25 .09
0 -.5

Structure

imagename alphaname
scaleX scaleY
positionX positionY

Description

  • imagename - path to the image to be used (e.g cockpit/blasterpower.png ... this will search in ../textures/cockpit/ for the file blasterpower.png)
  • alphaname - This is the alpha map for the image. It must either be a greyscale .bmp, or a .png (where the png's alpha map is used), even if you are using the alpha-map from the first png, it must also be listed here as the source of the alphamap!
  • scaleX - Scales the image on the X-Axis (1 = Fullsize, 0.5 = Halfsize, 2 = Doublesize etc)
  • scaleY - Scales the image on the Y-Axis (see scaleX)
  • positionX - Start drawing the image on a relative position specified by positionX
  • positionY - Start drawing the image on a relative position specified by positionY

The last four options require some explanation on how Vega Strike 4.01 draws its sprites. First of all, you have to know that the resolution of the image is absolutely irrelevant, as Vega Strike works with relative coordinates and scaling, with (0,0) being the center of the screen. Imageine a picture of exactly one red pixel (1x1) in size, with scaleX=scaleY=1 ,positionX=positionY=0. The result is a red square, whose center is on the center of the screen. It fills the left, the right, the upper and the lower half of the screen. scaleX=scaleY=2 would make it exactly fullscreen. The same applies to positionX and positionY. PositonY=-1 whould start drawing it on the lower half from the center of the screen, whereas PositionY=2 whould completely draw it offscreen.

One note regarding negative values in scaleX and scaleY : Vega Strike flips the sprite on that axis, but in the case of gauges like Blasterpower will also start decreasing it flipped (not from the right, but from the left).


arrow_left.png Edit Mesh Files arrow_up.png HowTo Create a Cockpit in Wings3d arrow_right.png