Hard Light Productions Forums

Modding, Mission Design, and Coding => The Scripting Workshop => Topic started by: Scooby_Doo on May 10, 2013, 01:27:53 am

Title: Scripting HUDs
Post by: Scooby_Doo on May 10, 2013, 01:27:53 am
Does anyone know how to hid/show standard hud elements?  I see there's a sexp for custom gauges, but that doesn't seem to work for standard ones.  And theres some lua entries, I can get some info from them, but it seems to be read only.
Title: Re: Scripting HUDs
Post by: mjn.mixael on May 10, 2013, 06:55:38 am
I'm pretty sure there's a separate SEXP that can do the standard elements.
Title: Re: Scripting HUDs
Post by: Admiral MS on May 10, 2013, 07:44:28 am
Use the hud-activate-gauge-type SEXP with the name of the standard element (like "Target monitor" or "Auto target") and true/false for activation/deactivation. Scripting can't really do a lot of HUD modification besides drawing things.
Title: Re: Scripting HUDs
Post by: General Battuta on May 10, 2013, 09:59:55 am
Here's a SEXP from BP that switches off a lot of the HUD

Code: [Select]
( when-argument
      ( every-of
         "Damage"
         "Wingman status"
         "Countermeasures"
         "Directives"
         "Weapons"
         "Comm menu"
         "Player shield"
         "Target shield"
         "Kills"
         "Weapon energy"
         "Offscreen indicator"
         "Center reticle"
         "Lead indicator"
         "Threat indicator"
         "Target direction"
         "Orientation"
         "Afterburner energy"
         "Throttle"
      )
      ( true )
      ( hud-activate-gauge-type
         "<argument>"
         ( false )
      )
   )

Note that the SEXP you want to use here is hud-activate-gauge-type as Admiral MS said.
Title: Re: Scripting HUDs
Post by: Scooby_Doo on May 10, 2013, 02:43:07 pm
Ahh that works, I tried that earlier but it appears Radar isn't one of the gauges that can be hidden.  :blah:
Also before I get too far, you can run sexp's via scripting? Think I saw it done somewheres.
Title: Re: Scripting HUDs
Post by: m!m on May 10, 2013, 03:05:46 pm
You can use the runESXP and evealuateSEXP functions to do that. You just have to use '!' instead of '"' for strings.
Title: Re: Scripting HUDs
Post by: Scooby_Doo on May 11, 2013, 02:25:11 am
Well that was easy, but is radar missing or does it go by another name?
Title: Re: Scripting HUDs
Post by: m!m on May 11, 2013, 03:13:43 am
I checked the code and there are three radar related entries: Radar, Radar orb and Radar BSG. You should be on the safe site when you just deactivate all those types which also covers the case that the user has 3D radar enabled.