HowTo:Edit HUDs

From VsWiki
Revision as of 23:07, 4 April 2005 by smbarbour (talk | contribs) (XML Schema)
Jump to: navigation, search
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. Where I have placed (?)'s, I am unsure if my information is correct.

<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.
  • Sprite definitions
    • Common parameters:
      • file="" - SPR file to use
      • xcent="#" ycent="#" - center along x or y at # (?)
      • width="#" height="#" - Set width and height
      • Gauges - GaugeRight, GaugeLeft, GaugeDown, GaugeUp(Default?) = "1" - Sets direction that gauges clear from
    • <code><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
    • <WarpEnergy ... /> - Warp capacitor level
    • <Lock ... /> - Someone has locked onto you
    • <MissileLock ... /> - Someone has gained a missile lock on you
    • <ECM ... /> - ECM activated (?)
    • <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
    • <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

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