Hard Light Productions Forums
Modding, Mission Design, and Coding => The Modding Workshop => Topic started by: Black Wolf on January 22, 2011, 09:02:41 am
-
OK, this table is really ****tng me off. I had it working in the older, much, much simpler style, but since the rebuild of it, I can't make heads or tails of the entire system. The wiki page has a whole lot of data, but is minimally useful, since a lot of stuff is just not defined (What do the gauge types do? Which ones do we use for custom gauges? What is fonts.tbl?). This is made worse by the fact that this table refuses to output errors, and just causes silent hanging (the log usefully says "WARNING: "Invalid gauge found in hud_gauges.tbl" at hudparse.cpp:917"). I'm sure it's great for moving existing gauges around, as evidenced by the bevy of HUD layouts lately, but for brand new stuff it's really tough going.
What I need, and what the wiki article needs, is a working table file for a from-scratch custom gauge so that I and other people can start from something we know works. The page also needs a coder to fix some of the missing bits, but for now an example would be of the greatest use. I know I've seen custom gauges in Inferno and Wings, and I'm hoping that they aren't just in the older system the way mine was until today. If it helps, all I want is to be able to do this (http://www.hard-light.net/wiki/images/FrontlinesSS002.jpg) - see the little temperature gauge off to the right there? I just need something that can display a number provided by sexps.
So, has anyone managed to do this yet?
-
We're using quite a few custom gauges in BP.
+Custom:
Position: (1261, 250)
Name: BPTaccom
Text: TacNet Uplink
X Offset: 3
Y Offset: 2
Gauge Type: WINGMEN_STATUS
Slew: NO
Active by default: NO
Filename: directives1
+Custom:
Position: (1261, 262)
Name: BPTaccomA
Text: System in client mode
X Offset: 5
Gauge Type: WINGMEN_STATUS
Slew: NO
Active by default: NO
Filename: directives2
+Custom:
Position: (1261, 271)
Name: BPTaccomB
Text: No valid uplink targets
X Offset: 5
Gauge Type: WINGMEN_STATUS
Slew: NO
Active by default: NO
Filename: directives2
+Custom:
Position: (1261, 280)
Name: BPTaccomC
Text:
X Offset: 5
Gauge Type: WINGMEN_STATUS
Slew: NO
Active by default: NO
Filename: directives2
+Custom:
Position: (1261, 289)
Name: BPTaccomD
Text:
Gauge Type: WINGMEN_STATUS
Slew: NO
Active by default: NO
Filename: directives3
The important bits to remember are:
-Custom Gauges need to be defined for every resolution separately. The bits quoted above are from the standard 1440x900 layout we're using as a base.
-The "Name" field defines the name you need to use as an argument for the hud-set-* sexps.
-Text can be left empty
-"Gauge Type": This is a bit complicated. Every hud gauge needs to have a gauge type. Which one you choose is pretty much up to you; the important part is that you can deactivate/activate all gauges using the "activate-gauge-type" sexp.
-"Slew": If set to yes, the gauge will react to ship movements.
-"Active by default:" If set to No, the hud-gauge-set-active sexp needs to be used in order to display the gauge.
Now, for your specific temperature gauge, the tbl entry would look like this:
+Custom:
Position: (x, y)
Name: Temperature
Text: Bla
X Offset: 5
Y Offset: 3
Gauge Type: RADAR
Slew: NO
Active by default: NO
Filename: objective1
Where (x, y) needs to replaced with valid coordinates. In-game, you can use hud-set-message to display a variable value.
-
OK, that's helped, as did the original post which I just re-found (I can't believe I said it seemed intuitive :p).
Anyway, I think the key error, and the number 1 thing I need to change ASAP on the wiki is the lack of information about "$End Gauges" being a neccesary part of the whole process. I'm going to look into this tonight.
-
I'll be working on this tonight too. Perhaps we can compare notes if we get stuck.