Jump to content

HUDFramework -- curious code that looks like a mistake. Help me understand.


Recommended Posts

Since the author of the framework seemingly isn't active anymore, perhaps someone in this forum can help me make sense of this.

In order to instantiate the framework and run it, the first think one must do is retrieve an instance of the HUDFramework script as instructed here:
On the Papyrus end, to load a HUD widget, you need to:
1. Get a reference to HUDFramework by calling HUDFramework hud = HUDFramework.GetInstance(). If HUDFramework is not installed, this returns None.
Makes sense. However the function in said script does not make sense to my eyes:
HUDFramework Function GetInstance() global
Debug.MessageBox("Warning: HUDFramework implementation not present. You may have compiled HUDFramework.psc without an implementation.")
return None
EndFunction
This can only ever return None, no? What is this wizardry and what am I missing?

Link to page/article
https://www.nexusmods.com/fallout4/articles/371
Link to comment
Share on other sites

Never mind, the reason is it's merely a signature-psc while the actual pex in the BS2 contains the working code. Recompiling will make the function throw a noticeable error instead. Pretty clever.

 

;**************************************************************************************************
;**** Note: This file contains method signatures only and must not be compiled. ******
;**** Take care to ensure that it is not inadvertently distributed with your mod's scripts. ******
;**************************************************************************************************
Link to comment
Share on other sites

  • Recently Browsing   0 members

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