Interfaces Overview
< HPL3 | SOMA | Scripting(Redirected from HPL3/Interfaces Overview)
Jump to navigation
Jump to search
Script interfaces connect SOMA’s AngelScript classes to engine objects and callbacks. Start with a stock terminal to see how a base class differs from a callback interface.
Trace the terminal script
- Open
script/props/Prop_Terminal.hps. Its declaration is:
class cScrPropTerminal : iScrProp, iScrProp_Interface
- Follow
iScrProptoscript/interfaces/Prop_Interface.hps. It stores a nativecLuxProphandle inmBaseObj.SetupBaseInterfaceassigns it andGetBase()returns it. - Return to the terminal’s
SetupAfterLoad. It reads resource variables and callsmBaseObj.CreateAndSetupGuito set up the terminal GUI. This is an example of using the engine object exposed by the base.
The terminal also implements iScrProp_Interface. Its script defines callbacks such as SetupAfterLoad, OnInteract and GetInteractIconId; these are separate from the base’s handle-access functions.
Find the matching base
The area, agent, critter, player, effect and user-module interface files use the same handle-wrapper pattern for their corresponding native object types. Use the base belonging to the script you are studying; the prop wrapper holds a cLuxProp, while the module wrapper holds a cLuxUserModule.