Bench
Module: bench.lua
Overview
The Bench module is a thin action-dispatch script for a bench prop. The two Query* functions are called by the engine to ask βwhat named action should this input map to?β and return an action-name string; the three action functions (SuperUse, Use, MakeUpright) are the hooks the engine then calls β all three are empty stubs here, so the actual behaviour is engine-side (or intentionally a no-op).
Inheritance
- Inherits from:
none β base/utility module - Imports:
none
Instance pattern
This is a stateless manager/utility module with no per-instance tables or fields.
Functions
QueryRepair(intVal)
Engine dispatcher: returns the name of the repair action to run. Returns the string "MakeUpright" when intVal == 1, otherwise "" (no action). The returned name is the function the engine will call.
QueryActiveUse(intVal)
Engine dispatcher: returns the name of the βactive useβ action. Returns "SuperUse" when intVal == 1, otherwise "". Again the return value is a function name, not the behaviour itself.
SuperUse(floatval, aiguid)
Placeholder function for handling the βSuperUseβ action. Currently does nothing.
Use(aiguid, floatval)
Placeholder function for handling general use actions. Currently does nothing.
MakeUpright(objectguid, aiguid)
Placeholder function for making an object upright. Currently does nothing.
Events
This module does not listen to or fire any engine events.
Notes for modders
- The
Query*β action-name β action-function indirection is the reusable lever here: change whatQueryRepair/QueryActiveUsereturn (or theintValthey gate on) to remap which action fires, and fill in the matchingSuperUse/Use/MakeUprightbody to give it behaviour. The names returned by theQuery*functions must match the action functions the engine then calls. - All three action functions are currently empty β this bench prop does nothing scripted out of the box, so there is no existing behaviour to preserve if you override them.