Jump to content

HUD Framework help


Halstrom

Recommended Posts

I have this script and it is failing to compile on this line, any ideas?

; HUDFramework
HUDFramework hud

Error message :smile:

Quote

Papyrus Compiler Version 2.8.0.4 for Fallout 4
Copyright (C) ZeniMax Media. All rights reserved.
Starting 1 compile threads for 1 files...
Compiling "SynthPlayer:Synth0HUD"...
C:\Users\Owner\AppData\Local\Temp\PapyrusTemp\SynthPlayer\Synth0HUD.psc(34,13): unknown type hudframework
C:\Users\Owner\AppData\Local\Temp\PapyrusTemp\SynthPlayer\Synth0HUD.psc(47,7): variable HUDFramework is undefined
C:\Users\Owner\AppData\Local\Temp\PapyrusTemp\SynthPlayer\Synth0HUD.psc(47,20): none is not a known user-defined script type
C:\Users\Owner\AppData\Local\Temp\PapyrusTemp\SynthPlayer\Synth0HUD.psc(47,1): type mismatch while assigning to a hudframework (cast missing or types unrelated)
C:\Users\Owner\AppData\Local\Temp\PapyrusTemp\SynthPlayer\Synth0HUD.psc(66,6): hudframework is not a known user-defined script type

 

Link to comment

Ok that worked sort of it compiles fine.

But I can set properties only once then after that the script refuses to open or set properties even after restarting CK. I have to remove it and delete pcs and pex completely, restart CK and create a new script done, this 12 times and its damn annoying.

 

This is the error CK gives me:

Quote
SCRIPTS:    Cannot open store for class "hudframework", missing file?
SCRIPTS:    Error: Unable to link type of variable "hud" on object "SynthPlayer:Synth0DisplayStats"
SCRIPTS:    Error: Unable to link types associated with function "OnInit" in state "" on object "SynthPlayer:Synth0DisplayStats".
 

 

 

Link to comment

That’s pretty common. Make sure HUDFramework.pex and HUDFrameworkNative.pex reside in your data\script folder. (i’m not sure if the latter is needed, but I tossed it in there none the less)

 

you’ll need to extract the PEX files from the BA2 for HUDFramework. 

Link to comment
38 minutes ago, Carreau said:

That’s pretty common. Make sure HUDFramework.pex and HUDFrameworkNative.pex reside in your data\script folder. (i’m not sure if the latter is needed, but I tossed it in there none the less)

 

you’ll need to extract the PEX files from the BA2 for HUDFramework. 

Oh wow , that fixed it, I been trying crazy stuff all day and had given up on having a HUD :smile:
And it works, sorta, positioning's a bit crazy but will work on that tomorrow .

Thank you so much!!!

Link to comment

Playing with the positioning is pretty easy. What I found annoying (and I’m certain I’m doing something wrong) was trying to reposition it during run time. Positions worked fine during on load, but the hud wouldn’t move to a new position when i was calling it by script. I wanted to give my users some flexibility, but I gave up after a while and decided my energy needed to be somewhere else. 

Link to comment
  • 4 weeks later...

Ok have it working, but getting some errors I have no idea how to fix been poking it in different ways to no luck.

Multiple errors are like this: 

Quote

[04/22/2018 - 09:07:20AM] error: Cannot call UnregisterWidget() on a None object, aborting function call
stack:
 [SynthPlayer (3B004C26)].SynthPlayer:Synth0DisplayStatus.OnUninstall() - "C:\Users\Owner\AppData\Local\Temp\PapyrusTemp\SynthPlayer\Synth0DisplayStatus.psc" Line 288
 [SynthPlayer (3B004C26)].SynthPlayer:Synth0DisplayStatus.OnInit() - "C:\Users\Owner\AppData\Local\Temp\PapyrusTemp\SynthPlayer\Synth0DisplayStatus.psc" Line 103

SynthPlayer (3B004C26)].SynthPlayer:Synth0DisplayStatus.OnUninstall() - "C:\Users\Owner\AppData\Local\Temp\PapyrusTemp\SynthPlayer\Synth0DisplayStatus.psc" Line 290
 [SynthPlayer (3B004C26)].SynthPlayer:Synth0DisplayStatus.OnInit() - "C:\Users\Owner\AppData\Local\Temp\PapyrusTemp\SynthPlayer\Synth0DisplayStatus.psc" Line 103
[04/22/2018 - 09:07:30AM] error: Cannot call UnregisterWidget() on a None object, aborting function call
stack:
 [SynthPlayer (3B004C26)].SynthPlayer:Synth0DisplayStatus.OnUninstall() - "C:\Users\Owner\AppData\Local\Temp\PapyrusTemp\SynthPlayer\Synth0DisplayStatus.psc" Line 288
 [SynthPlayer (3B004C26)].SynthPlayer:Synth0DisplayStatus.OnInit() - "C:\Users\Owner\AppData\Local\Temp\PapyrusTemp\SynthPlayer\Synth0DisplayStatus.psc" Line 103
[04/22/2018 - 09:07:30AM] error: Cannot call UnregisterWidget() on a None object, aborting function call
stack:
 [SynthPlayer (3B004C26)].SynthPlayer:Synth0DisplayStatus.OnUninstall() - "C:\Users\Owner\AppData\Local\Temp\PapyrusTemp\SynthPlayer\Synth0DisplayStatus.psc" Line 292
 [SynthPlayer (3B004C26)].SynthPlayer:Synth0DisplayStatus.OnInit() - "C:\Users\Owner\AppData\Local\Temp\PapyrusTemp\SynthPlayer\Synth0DisplayStatus.psc" Line 103
[04/22/2018 - 09:07:31AM] error: Cannot call UnregisterWidget() on a None object, aborting function call
stack:
 [SynthPlayer (3B004C26)].SynthPlayer:Synth0DisplayStatus.OnUninstall() - "C:\Users\Owner\AppData\Local\Temp\PapyrusTemp\SynthPlayer\Synth0DisplayStatus.psc" Line 290
 [SynthPlayer (3B004C26)].SynthPlayer:Synth0DisplayStatus.OnInit() - "C:\Users\Owner\AppData\Local\Temp\PapyrusTemp\SynthPlayer\Synth0DisplayStatus.psc" Line 103
[04/22/2018 - 09:07:31AM] error: Cannot call UnregisterWidget() on a None object, aborting function call
stack:
 [SynthPlayer (3B004C26)].SynthPlayer:Synth0DisplayStatus.OnUninstall() - "C:\Users\Owner\AppData\Local\Temp\PapyrusTemp\SynthPlayer\Synth0DisplayStatus.psc" Line 294
 [SynthPlayer (3B004C26)].SynthPlayer:Synth0DisplayStatus.OnInit() - "C:\Users\Owner\AppData\Local\Temp\PapyrusTemp\SynthPlayer\Synth0DisplayStatus.psc" Line 103
 

 

Script is:

Scriptname SynthPlayer:Synth0DisplayStatus extends Quest

Group Misc
	Quest Property qMQ101 Auto
	GlobalVariable Property gBootup Auto
	GlobalVariable Property gDebugSetting Auto
	GlobalVariable property gOverClock auto
	GlobalVariable property gPowerPerc auto
	GlobalVariable property gLubriCoolPerc auto
	GlobalVariable property gFirewallPerc auto
	GlobalVariable property gCoreTempPerc auto
	GlobalVariable property gUnitStatus auto
	GlobalVariable property gSexProcessorPerc auto
	GlobalVariable property gSexFertilePerc auto
	GlobalVariable property gSexPregPerc auto
	GlobalVariable property gUpperServosPerc auto
	GlobalVariable property gMobilityServosPerc auto
	GlobalVariable property gTorsoChassisPerc auto
	GlobalVariable property gCranialStatusPerc auto
	GlobalVariable property gVisualSensorsPerc auto
	GlobalVariable property gSynthPlayerHUD_Scale auto
	GlobalVariable property gSynthPlayerHUD_XPos auto
	GlobalVariable property gSynthPlayerHUD_YPos auto
	int Property Command_UpdateCount = 100 AutoReadOnly
	String Property CoreTempPerc_Widget = "SynthPlayer_CoreTempPerc.swf" AutoReadOnly
	String Property PowerPerc_Widget = "SynthPlayer_PowerPerc.swf" AutoReadOnly
	String Property LubriCoolPerc_Widget = "SynthPlayer_LubriCoolPerc.swf" AutoReadOnly
	String Property FirewallPerc_Widget = "SynthPlayer_FirewallPerc.swf" AutoReadOnly
	String Property UnitStatus_Widget = "SynthPlayer_UnitStatus.swf" AutoReadOnly
	String Property SexProcessorPerc_Widget = "SynthPlayer_SexProcessorPerc.swf" AutoReadOnly
	String Property TorsoChassisPerc_Widget = "SynthPlayer_TorsoChassisPerc.swf" AutoReadOnly
	String Property MobilityServosPerc_Widget = "SynthPlayer_MobilityServosPerc.swf" AutoReadOnly
	String Property UpperServosPerc_Widget = "SynthPlayer_UpperServosPerc.swf" AutoReadOnly
	String Property CranialStatusPerc_Widget = "SynthPlayer_CranialStatusPerc.swf" AutoReadOnly
	String Property VisualSensorsPerc_Widget = "SynthPlayer_VisualSensorsPerc.swf" AutoReadOnly
EndGroup

;-----------------------------------------------------------------------------------------------------------------------------

Actor rActor
Int iBootup
Int iDebugSetting
int iCurrPowerPerc
int iPrevPowerPerc
int iCurrLubriCoolPerc
int iPrevLubriCoolPerc
int iCurrCoreTempPerc
int iPrevCoreTempPerc
int iCurrFirewallPerc
int iPrevFirewallPerc
int iCurrUnitStatus
int iPrevUnitStatus
int iCurrSexProcessorPerc
int iPrevSexProcessorPerc
int iCurrTorsoChassisPerc
int iPrevTorsoChassisPerc
int iCurrMobilityServosPerc
int iPrevMobilityServosPerc
int iCurrUpperServosPerc
int iPrevUpperServosPerc
int iCurrCranialStatusPerc
int iPrevCranialStatusPerc
int iCurrVisualSensorsPerc
int iPrevVisualSensorsPerc

Float fHUD_XPosBootup = 550.0
Float fHUD_YPosBootup = 180.0
Float fHUD_ScaleBootup = 1.8
Float fHUD_XPos = 0.0
Float fHUD_YPos = 400.0
Float fHUD_Scale = 1.4
Float fHUD_Y_PowerPerc
Float fHUD_Y_LubriCoolPerc
Float fHUD_Y_CoreTempPerc
Float fHUD_Y_FirewallPerc
Float fHUD_Y_UnitStatus
Float fHUD_Y_SexProcessorPerc
Float fHUD_Y_TorsoChassisPerc
Float fHUD_Y_MobilityServosPerc
Float fHUD_Y_UpperServosPerc
Float fHUD_Y_CranialStatusPerc
Float fHUD_Y_VisualSensorsPerc

Float fFrequencyTimer = 1.0
Int iTimerID = 32

; HUDFramework
HUDFramework hud

;-----------------------------------------------------------------------------------------------------------------------------

Event OnInit()
	Utility.wait(2.0)
	rActor = Game.GetPlayer()
	RegisterForRemoteEvent(rActor, "OnDeath")
	gSynthPlayerHUD_XPos.SetValue(fHUD_XPos)
	gSynthPlayerHUD_YPos.SetValue(fHUD_YPos)
	gSynthPlayerHUD_Scale.SetValue(fHUD_Scale)
;	fHUD_XPos = fHUD_XPosBootup
;	fHUD_YPos = fHUD_YPosBootup
;	fHUD_Scale = fHUD_ScaleBootup
;	fnDebug("Init2 HUD Values X/Y/Scale: " + fHUD_XPos + "/" + fHUD_YPos + "/" + fHUD_Scale)
	OnUninstall("Unregister")
	hud = HUDFramework.GetInstance()
	If (hud)
		fnCalcPos()
		hud.RegisterWidget(Self, CoreTempPerc_Widget, fHUD_XPos, fHUD_Y_CoreTempPerc, abLoadNow = True, abAutoLoad = True)
		hud.RegisterWidget(Self, PowerPerc_Widget, fHUD_XPos, fHUD_Y_PowerPerc, abLoadNow = True, abAutoLoad = True)
		hud.RegisterWidget(Self, LubriCoolPerc_Widget, fHUD_XPos, fHUD_Y_LubriCoolPerc, abLoadNow = True, abAutoLoad = True)
		hud.RegisterWidget(Self, FirewallPerc_Widget, fHUD_XPos, fHUD_Y_FirewallPerc, abLoadNow = True, abAutoLoad = True)
		hud.RegisterWidget(Self, UnitStatus_Widget, fHUD_XPos, fHUD_Y_UnitStatus, abLoadNow = True, abAutoLoad = True)
		hud.RegisterWidget(Self, SexProcessorPerc_Widget, fHUD_XPos, fHUD_Y_SexProcessorPerc, abLoadNow = True, abAutoLoad = True)
		hud.RegisterWidget(Self, TorsoChassisPerc_Widget, fHUD_XPos, fHUD_Y_TorsoChassisPerc, abLoadNow = True, abAutoLoad = True)
		hud.RegisterWidget(Self, MobilityServosPerc_Widget, fHUD_XPos, fHUD_Y_MobilityServosPerc, abLoadNow = True, abAutoLoad = True)
		hud.RegisterWidget(Self, UpperServosPerc_Widget, fHUD_XPos, fHUD_Y_UpperServosPerc, abLoadNow = True, abAutoLoad = True)
		hud.RegisterWidget(Self, CranialStatusPerc_Widget, fHUD_XPos, fHUD_Y_CranialStatusPerc, abLoadNow = True, abAutoLoad = True)
		hud.RegisterWidget(Self, VisualSensorsPerc_Widget, fHUD_XPos, fHUD_Y_VisualSensorsPerc, abLoadNow = True, abAutoLoad = True)
		OnApply("")
		hud.SendMessage(CoreTempPerc_Widget, Command_UpdateCount, iCurrCoreTempPerc)
		hud.SendMessage(PowerPerc_Widget, Command_UpdateCount, iCurrPowerPerc)
		hud.SendMessage(LubriCoolPerc_Widget, Command_UpdateCount, iCurrLubriCoolPerc)
		hud.SendMessage(FirewallPerc_Widget, Command_UpdateCount, iCurrFirewallPerc)
		hud.SendMessage(UnitStatus_Widget, Command_UpdateCount, iCurrUnitStatus)
		hud.SendMessage(SexProcessorPerc_Widget, Command_UpdateCount, iCurrSexProcessorPerc)
		hud.SendMessage(TorsoChassisPerc_Widget, Command_UpdateCount, iCurrTorsoChassisPerc)
		hud.SendMessage(MobilityServosPerc_Widget, Command_UpdateCount, iCurrMobilityServosPerc)
		hud.SendMessage(UpperServosPerc_Widget, Command_UpdateCount, iCurrUpperServosPerc)
		hud.SendMessage(CranialStatusPerc_Widget, Command_UpdateCount, iCurrCranialStatusPerc)
		hud.SendMessage(VisualSensorsPerc_Widget, Command_UpdateCount, iCurrVisualSensorsPerc)
		Utility.wait(0.2)
		OnApply("")
		StartTimer(fFrequencyTimer, iTimerID)
	EndIf
EndEvent

;-----------------------------------------------------------------------------------------------------------------------------

Event OnTimer(int aiTimerID)
	iDebugSetting = (gDebugSetting.GetValue()) as Int
	iBootup = gBootup.GetValueInt()
	If (aiTimerID >= iTimerID) && (iBootup > 1) && (qMQ101.IsCompleted() == True)
		iCurrPowerPerc = (gPowerPerc.GetValue()) as Int
		iCurrLubriCoolPerc = (gLubriCoolPerc.GetValue()) as Int
		iCurrCoreTempPerc = (gCoreTempPerc.GetValue()) as Int
		iCurrFirewallPerc = (gFirewallPerc.GetValue()) as Int
		iCurrUnitStatus = (gUnitStatus.GetValue()) as Int
		iCurrSexProcessorPerc = (gSexProcessorPerc.GetValue()) as Int
		iCurrTorsoChassisPerc = (gTorsoChassisPerc.GetValue()) as Int
		iCurrMobilityServosPerc = (gMobilityServosPerc.GetValue()) as Int
		iCurrUpperServosPerc = (gUpperServosPerc.GetValue()) as Int
		iCurrCranialStatusPerc = (gCranialStatusPerc.GetValue()) as Int
		iCurrVisualSensorsPerc = (gVisualSensorsPerc.GetValue()) as Int

		fHUD_XPos = gSynthPlayerHUD_XPos.GetValue()
		fHUD_YPos = gSynthPlayerHUD_YPos.GetValue()
		fHUD_Scale = gSynthPlayerHUD_Scale.GetValue()

;		if (iBootup == 10)
;			OnApply("")
;			fnDebug("Timer HUD ValuesBefore X/Y/Scale: " + fHUD_XPos + "/" + fHUD_YPos + "/" + fHUD_Scale)
;			gBootup.SetValue(11)
;		endif

		if (iCurrPowerPerc != iPrevPowerPerc)
			hud.SendMessage(PowerPerc_Widget, Command_UpdateCount, iCurrPowerPerc)
		endif
		if (iCurrLubriCoolPerc != iPrevLubriCoolPerc)
			hud.SendMessage(LubriCoolPerc_Widget, Command_UpdateCount, iCurrLubriCoolPerc)
		endif
		if (iCurrCoreTempPerc != iPrevCoreTempPerc)
			hud.SendMessage(CoreTempPerc_Widget, Command_UpdateCount, iCurrCoreTempPerc)
		endif
		if (iCurrFirewallPerc != iPrevFirewallPerc)
			hud.SendMessage(FirewallPerc_Widget, Command_UpdateCount, iCurrFirewallPerc)
		endif
		if (iCurrUnitStatus != iPrevUnitStatus)
			hud.SendMessage(UnitStatus_Widget, Command_UpdateCount, iCurrUnitStatus)
		endif
		if (iCurrSexProcessorPerc != iPrevSexProcessorPerc)
			hud.SendMessage(SexProcessorPerc_Widget, Command_UpdateCount, iCurrSexProcessorPerc)
		endif
		if (iCurrTorsoChassisPerc != iPrevTorsoChassisPerc)
			hud.SendMessage(TorsoChassisPerc_Widget, Command_UpdateCount, iCurrTorsoChassisPerc)
		endif
		if (iCurrMobilityServosPerc != iPrevMobilityServosPerc)
			hud.SendMessage(MobilityServosPerc_Widget, Command_UpdateCount, iCurrMobilityServosPerc)
		endif
		if (iCurrUpperServosPerc != iPrevUpperServosPerc)
			hud.SendMessage(UpperServosPerc_Widget, Command_UpdateCount, iCurrUpperServosPerc)
		endif
		if (iCurrCranialStatusPerc != iPrevCranialStatusPerc)
			hud.SendMessage(CranialStatusPerc_Widget, Command_UpdateCount, iCurrCranialStatusPerc)
		endif
		if (iCurrVisualSensorsPerc != iPrevVisualSensorsPerc)
			hud.SendMessage(VisualSensorsPerc_Widget, Command_UpdateCount, iCurrVisualSensorsPerc)
		endif

		iPrevPowerPerc = iCurrPowerPerc
		iPrevLubriCoolPerc = iCurrLubriCoolPerc
		iPrevCoreTempPerc = iCurrCoreTempPerc
		iPrevFirewallPerc = iCurrFirewallPerc
		iPrevUnitStatus = iCurrUnitStatus
		iPrevSexProcessorPerc = iCurrSexProcessorPerc
		iPrevTorsoChassisPerc = iCurrTorsoChassisPerc
		iPrevMobilityServosPerc = iCurrMobilityServosPerc
		iPrevUpperServosPerc = iCurrUpperServosPerc
		iPrevCranialStatusPerc = iCurrCranialStatusPerc
		iPrevVisualSensorsPerc = iCurrVisualSensorsPerc
	Endif ; (aiTimerID >= iTimerID)
	StartTimer(fFrequencyTimer, iTimerID)
EndEvent

;-----------------------------------------------------------------------------------------------------------------------------

Function OverClock(String sString)
	gOverClock.SetValue(iCurrUnitStatus)
	fnMessage("OverClock Activated: " + iCurrUnitStatus + " Sec")
EndFunction

Function fnCalcPos()
	fHUD_Y_UnitStatus = (fHUD_YPos + (1 * fHUD_Scale))
	fHUD_Y_PowerPerc = (fHUD_YPos + (13 * fHUD_Scale))
	fHUD_Y_CoreTempPerc = (fHUD_YPos + (26 * fHUD_Scale))
	fHUD_Y_LubriCoolPerc = (fHUD_YPos + (39 * fHUD_Scale))
	fHUD_Y_FirewallPerc = (fHUD_YPos + (52 * fHUD_Scale))
	fHUD_Y_SexProcessorPerc = (fHUD_YPos + (65 * fHUD_Scale))
	fHUD_Y_TorsoChassisPerc = (fHUD_YPos + (78 * fHUD_Scale))
	fHUD_Y_MobilityServosPerc = (fHUD_YPos + (91 * fHUD_Scale))
	fHUD_Y_UpperServosPerc = (fHUD_YPos + (104 * fHUD_Scale))
	fHUD_Y_CranialStatusPerc = (fHUD_YPos + (117 * fHUD_Scale))
	fHUD_Y_VisualSensorsPerc = (fHUD_YPos + (130 * fHUD_Scale))
EndFunction

Function OnApply(string s)
	fnCalcPos()
	fnMessage("OnApply HUD Scale and Positioning X/Y/Scale: " + fHUD_XPos + "/" + fHUD_YPos + "/" + fHUD_Scale)
;	hud.SetWidgetPosition(CoreTempPerc_Widget, fHUD_XPos, fHUD_Y_CoreTempPerc, false)
;	Utility.wait(0.1)
	hud.SetWidgetPosition(CoreTempPerc_Widget, fHUD_XPos, fHUD_Y_CoreTempPerc, false)
	Utility.wait(0.1)
	hud.SetWidgetScale(CoreTempPerc_Widget, fHUD_Scale, fHUD_Scale, false)
	Utility.wait(0.1)
	hud.SetWidgetPosition(PowerPerc_Widget, fHUD_XPos, fHUD_Y_PowerPerc, false)
	Utility.wait(0.1)
	hud.SetWidgetScale(PowerPerc_Widget, fHUD_Scale, fHUD_Scale, false)
	Utility.wait(0.1)
	hud.SetWidgetPosition(LubriCoolPerc_Widget, fHUD_XPos, fHUD_Y_LubriCoolPerc, false)
	Utility.wait(0.1)
	hud.SetWidgetScale(LubriCoolPerc_Widget, fHUD_Scale, fHUD_Scale, false)
	Utility.wait(0.1)
	hud.SetWidgetPosition(FirewallPerc_Widget, fHUD_XPos, fHUD_Y_FirewallPerc, false)
	Utility.wait(0.1)
	hud.SetWidgetScale(FirewallPerc_Widget, fHUD_Scale, fHUD_Scale, false)
	Utility.wait(0.1)
	hud.SetWidgetPosition(UnitStatus_Widget, fHUD_XPos, fHUD_Y_UnitStatus, false)
	Utility.wait(0.1)
	hud.SetWidgetScale(UnitStatus_Widget, fHUD_Scale, fHUD_Scale, false)
	Utility.wait(0.1)
	hud.SetWidgetPosition(SexProcessorPerc_Widget, fHUD_XPos, fHUD_Y_SexProcessorPerc, false)
	Utility.wait(0.1)
	hud.SetWidgetScale(SexProcessorPerc_Widget, fHUD_Scale, fHUD_Scale, false)
	Utility.wait(0.1)
	hud.SetWidgetPosition(TorsoChassisPerc_Widget, fHUD_XPos, fHUD_Y_TorsoChassisPerc, false)
	Utility.wait(0.1)
	hud.SetWidgetScale(TorsoChassisPerc_Widget, fHUD_Scale, fHUD_Scale, false)
	Utility.wait(0.1)
	hud.SetWidgetPosition(MobilityServosPerc_Widget, fHUD_XPos, fHUD_Y_MobilityServosPerc, false)
	Utility.wait(0.1)
	hud.SetWidgetScale(MobilityServosPerc_Widget, fHUD_Scale, fHUD_Scale, false)
	Utility.wait(0.1)
	hud.SetWidgetPosition(UpperServosPerc_Widget, fHUD_XPos, fHUD_Y_UpperServosPerc, false)
	Utility.wait(0.1)
	hud.SetWidgetScale(UpperServosPerc_Widget, fHUD_Scale, fHUD_Scale, false)
	Utility.wait(0.1)
	hud.SetWidgetPosition(CranialStatusPerc_Widget, fHUD_XPos, fHUD_Y_CranialStatusPerc, false)
	Utility.wait(0.1)
	hud.SetWidgetScale(CranialStatusPerc_Widget, fHUD_Scale, fHUD_Scale, false)
	Utility.wait(0.1)
	hud.SetWidgetPosition(VisualSensorsPerc_Widget, fHUD_XPos, fHUD_Y_VisualSensorsPerc, false)
	Utility.wait(0.1)
	hud.SetWidgetScale(VisualSensorsPerc_Widget, fHUD_Scale, fHUD_Scale, false)
	Utility.wait(0.1)
	fnMessage("OnApply HUD Scale and Positioning complete")
EndFunction

Function OnUninstall(string sString)
	fnMessage("Uninstalling SynthPlayer HUD. Please wait...")
	hud.UnregisterWidget(PowerPerc_Widget)
	Utility.wait(1)
	hud.UnregisterWidget(LubriCoolPerc_Widget)
	Utility.wait(1)
	hud.UnregisterWidget(CoreTempPerc_Widget)
	Utility.wait(1)
	hud.UnregisterWidget(FirewallPerc_Widget)
	Utility.wait(1)
	hud.UnregisterWidget(UnitStatus_Widget)
	Utility.wait(1)
	hud.UnregisterWidget(SexProcessorPerc_Widget)
	Utility.wait(1)
	hud.UnregisterWidget(TorsoChassisPerc_Widget)
	Utility.wait(1)
	hud.UnregisterWidget(MobilityServosPerc_Widget)
	Utility.wait(1)
	hud.UnregisterWidget(UpperServosPerc_Widget)
	Utility.wait(1)
	hud.UnregisterWidget(CranialStatusPerc_Widget)
	Utility.wait(1)
	hud.UnregisterWidget(VisualSensorsPerc_Widget)
	Utility.wait(1)
	fnMessage("Uninstallation complete")
EndFunction

; This function is called by HUDFramework when the widget is loaded.
Function HUD_WidgetLoaded(string asWidget)
	If (asWidget == PowerPerc_Widget)
		hud.SendMessage(PowerPerc_Widget, Command_UpdateCount, iCurrPowerPerc)
	ElseIf (asWidget == LubriCoolPerc_Widget)
		hud.SendMessage(LubriCoolPerc_Widget, Command_UpdateCount, iCurrLubriCoolPerc)
	ElseIf (asWidget == CoreTempPerc_Widget)
		hud.SendMessage(CoreTempPerc_Widget, Command_UpdateCount, iCurrCoreTempPerc)
	ElseIf (asWidget == FirewallPerc_Widget)
		hud.SendMessage(FirewallPerc_Widget, Command_UpdateCount, iCurrFirewallPerc)
	ElseIf (asWidget == UnitStatus_Widget)
		hud.SendMessage(UnitStatus_Widget, Command_UpdateCount, iCurrUnitStatus)
	ElseIf (asWidget == SexProcessorPerc_Widget)
		hud.SendMessage(SexProcessorPerc_Widget, Command_UpdateCount, iCurrSexProcessorPerc)
	ElseIf (asWidget == TorsoChassisPerc_Widget)
		hud.SendMessage(TorsoChassisPerc_Widget, Command_UpdateCount, iCurrTorsoChassisPerc)
	ElseIf (asWidget == MobilityServosPerc_Widget)
		hud.SendMessage(MobilityServosPerc_Widget, Command_UpdateCount, iCurrMobilityServosPerc)
	ElseIf (asWidget == UpperServosPerc_Widget)
		hud.SendMessage(UpperServosPerc_Widget, Command_UpdateCount, iCurrUpperServosPerc)
	ElseIf (asWidget == CranialStatusPerc_Widget)
		hud.SendMessage(CranialStatusPerc_Widget, Command_UpdateCount, iCurrCranialStatusPerc)
	ElseIf (asWidget == VisualSensorsPerc_Widget)
		hud.SendMessage(VisualSensorsPerc_Widget, Command_UpdateCount, iCurrVisualSensorsPerc)
    EndIf
EndFunction

;-----------------------------------------------------------------------------------------------------------------------------

Function fnDebug(String sDebug)
	if (iDebugSetting > 0)
		Debug.Trace(sDebug)
	endif
	if (iDebugSetting > 1)
		Debug.Notification(sDebug)
	endif
EndFunction

Function fnMessage(String sMessage)
	Debug.Notification(sMessage)
	if (iDebugSetting > 0)
		Debug.Trace(sMessage)
	endif
EndFunction

Event Actor.OnDeath(Actor akSender, Actor akKiller)
	CancelTimer(iTimerID)
	UnregisterForAllEvents()
EndEvent

 

Link to comment

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use