Hard Light Productions Forums
Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: KeldorKatarn on June 02, 2009, 12:20:38 pm
-
The wiki isn't very enlightening when it comes to this and I can't get this to work.
I defined a custom gauge and would like to set its looks specifically for one ship with a default for any other ship.
This does however not work. The ship specific entry is totally ignored and if I remove the non-specific entry no custom gauge is drawn at all.
What am I doing wrong?
$Max Escort Ships: 10
$Length Unit Multiplier: 6.33333
$Wireframe Targetbox: 1 ; 0 = standard, 1 = wireframe, 2 = textured wireframe
$Lock Wireframe Mode: YES
#Custom Gauges
$Name: Central
#End
#Main Gauges
$Default: (1024 768)
$Player Shield: (694 670) ;(634 670)
$Target Shield: (232 670) ;(292 670)
$Afterburner Energy: (344 643) ;(274 424)
$Weapons Energy: (596 643) ;(666 424)
$Weapons Energy Text: (650 745)
$Central: (347 219)
+Image: central
+Color: 175 230 175
#End
#Ship Main Gauges
$Ship: F-27B Arrow
$Default: (1024 768)
$Central: (347 219)
+Image: central_arrow
+Color: 175 230 175
#End
-
Anyone??
-
WMCoolmon was the guy who coded hud_gauges and he isn't around at the moment. I don't know if anyone has used the feature much cause I do remember hearing him complain about it.
-
The wiki entry is a bit confusing, and it seems almost impossible to get it to throw errors with a lot of bad data. The game will just ignore many lines it doesn't recognize, even a bunch of gibberish at the bottom of the file. Also, several of those misc values are only in trunk right now, and not the 3.6.10 RCs, so if you're using those it just silently stops parsing the file once it finds an unrecognized one. Try renaming hud_gauges.tbl to something like custom-hdg.tbm, and enable +parse in the debug_filter. Then look for custom-hdg in the debug log and see how far it got before moving to the next file. I'm betting something in there is just causing it to stop.
-
Backslash would be the other person to talk to, since we've been trying for ship specific
HUDs, or at minimum it's planned to be done.
Bax is fighting off a major pc virus though, so seeing him online is spotty.
-
Wiki entry is bad cause i had no idea how it was supposed to work when i was writing it. Reading the same thing from the didn't help much either
-
I've added what's going on (and why we're seeing CTD) to Mantis 1936. I have no idea how to solve it properly though.
$Central and the flags below it don't appear to be supported by the code in the table Keldor added to the mantis issue.
-
$Central is the name of the gauge as defined further up. That is supported, I've taken a glimpse at the code myself.
The necessary lines are all there. Either they're in the wrong order (then it would be nice to find out which is the right one) or the game parses them incorrectly.
It works fine for custom gauges that are defined for all ships, but it doesn't work for per-ship gauges.
-
//Parse main ship gauges
if(optional_string("#Ship Main Gauges"))
{
while (required_string_either("#End","$Ship:"))
{
if(dest_hud = parse_ship_start(), dest_hud)
{
while(rval = required_string_3("#End", "$Default:", "$Resolution:"), rval)
{
if(parse_resolution_start(dest_hud, rval))
{
parse_resolution(dest_hud);
}
else
{
skip_to_start_of_string_either("$Resolution:", "$Default:", "$Ship:");
}
}
}
}
required_string("#End");
}
I can't find a reference to $Central anywhere in there, or the functions it calls.
Can you give me any pointers?
EDIT: Just did a search for '$Central' on the entire codebase, and couldn't find it.
-
You missunderstood this. you cannot search for the literal "Central". Central is a name that you define within the table:
#Custom Gauges
$Name: Central
#End
The code looks for it here in parse_custom_gauge():
required_string("$Name:");
//Gotta make this a token
cg->fieldname[0] = '$';
stuff_string(cg->fieldname + 1, F_NAME, sizeof(cg->fieldname) - 1);
strcat(cg->fieldname, ":");
As you can see it looks for "$Name", then specifies the string after that as the gauge name, in this case "Central", and adds a $ in the beginning, making it
$Central. That way it specifies a new gauge name, that it can look for later on when parsing its specifics in
parse_resolution(dest_hud)
and
stuff_coords(dest_hud, cg)
-
Makes some sense now, hadn't taken a close enough look at that portion of the wiki entry. I got fed up with it when I realized how few parse errors it would actually tell you about.