Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Black Wolf on June 07, 2006, 05:35:36 am

Title: Lua and the HUD
Post by: Black Wolf on June 07, 2006, 05:35:36 am
Is it possible to use lua scripting to add new guages to the HUD without having to recreate the HUD entirely in lua?

I don't know if it's my crappy scripting or the way lua works, but attempting to add a single guage earlier resulted in a completely blank hud and no new guage... so I'm assuming I screwed the guage up, but I'm, also wondering if, by implementing any file called hud.lua, it completely overrides FS basic hud or not?
Title: Re: Lua and the HUD
Post by: Wanderer on June 07, 2006, 08:06:49 am
Yes it is possible to create new gauges without overriding old ones. Just dont use the +override option
Title: Re: Lua and the HUD
Post by: WMCoolmon on June 07, 2006, 09:50:55 pm
Lua should be completely defined by scripting.tbl. That is, if you add a file called hud.lua as your only change, it shouldn't do anything. In order to make it work properly, you should have to use the scripting hook like so:
Code: [Select]
#Global Hooks
$HUD: [[hud.lua]]
#End

As long as +Override: isn't specified or is false, the retail HUD should still appear. Note that if you're just going to have Override by false all the time, you might as well not specify it. It's faster that way.
Title: Re: Lua and the HUD
Post by: WMCoolmon on June 08, 2006, 04:08:07 am
Just added event/directive support to lua. Now you can change a directive or keypress text to something else, mid-mission. :D