Author Topic: hud_gauges.tbl - ship specific entries  (Read 2243 times)

0 Members and 1 Guest are viewing this topic.

hud_gauges.tbl - ship specific entries
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?

Code: [Select]
$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

 
Re: hud_gauges.tbl - ship specific entries
Anyone??

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: hud_gauges.tbl - ship specific entries
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.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline chief1983

  • Still lacks a custom title
  • Moderator
  • 212
  • ⬇️⬆️⬅️⬅️🅰➡️⬇️
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
Re: hud_gauges.tbl - ship specific entries
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.
Fate of the Galaxy - Now Hiring!  Apply within | Diaspora | SCP Home | Collada Importer for PCS2
Karajorma's 'How to report bugs' | Mantis
#freespace | #scp-swc | #diaspora | #SCP | #hard-light on EsperNet

"You may not sell or otherwise commercially exploit the source or things you created based on the source." -- Excerpt from FSO license, for reference

Nuclear1:  Jesus Christ zack you're a little too hamyurger for HLP right now...
iamzack:  i dont have hamynerge i just want ptatoc hips D:
redsniper:  Platonic hips?!
iamzack:  lays

 

Offline JGZinv

  • 211
  • The Last Dual! Guardian
    • The FringeSpace Conversion Mod
Re: hud_gauges.tbl - ship specific entries
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.
True power comes not from strength, but from the soul and imagination.
Max to PCS2 to FS2 SCP Guide
The FringeSpace Conversion Mod

 

Offline Wanderer

  • Wiki Warrior
  • 211
  • Mostly harmless
Re: hud_gauges.tbl - ship specific entries
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
Do not meddle in the affairs of coders for they are soggy and hard to light

 
Re: hud_gauges.tbl - ship specific entries
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.
STRONGTEA. Why can't the x86 be sane?

 
Re: hud_gauges.tbl - ship specific entries
$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.

 
Re: hud_gauges.tbl - ship specific entries
Code: [Select]
//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.
STRONGTEA. Why can't the x86 be sane?

 
Re: hud_gauges.tbl - ship specific entries
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():
Code: [Select]
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)

  

Offline chief1983

  • Still lacks a custom title
  • Moderator
  • 212
  • ⬇️⬆️⬅️⬅️🅰➡️⬇️
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
Re: hud_gauges.tbl - ship specific entries
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.
Fate of the Galaxy - Now Hiring!  Apply within | Diaspora | SCP Home | Collada Importer for PCS2
Karajorma's 'How to report bugs' | Mantis
#freespace | #scp-swc | #diaspora | #SCP | #hard-light on EsperNet

"You may not sell or otherwise commercially exploit the source or things you created based on the source." -- Excerpt from FSO license, for reference

Nuclear1:  Jesus Christ zack you're a little too hamyurger for HLP right now...
iamzack:  i dont have hamynerge i just want ptatoc hips D:
redsniper:  Platonic hips?!
iamzack:  lays