Highlight Effect Handler
Jump to navigation
Jump to search
The Highlight Effect Handler briefly sweeps a glow across eligible nearby objects. It scans active physics bodies, checks selected script classes and calls each entity’s _Global_CanBeHighlighted function. The response must supply a Boolean result and the entity ID in global argument 0. On-screen visibility and a minimum light level are also checked.
The stock tool script reads the HighlightActive instance variable. Its _Global_CanBeHighlighted returns that flag and supplies mBaseObj.GetID(); disabling that flag prevents this tool from being accepted by the handler.
Trace a tool’s highlight setting
- Find
HighlightActiveineditor/userclasses/EntityClasses.def. The tool instance variable is a Boolean with a declared default of true; its description says it controls the highlight effect when the tool is looked at. - Open
script/props/Prop_Tool.hps. The tool reads that instance variable intombHighlightActiveand returns it through the callback below. - Follow
UpdateAddObjectsinscript/modules/HighlightEffectHandler.hps. It filters for selected stock script classes, requires a mesh and an on-screen entity, and skips entities whose measured light level is below0.1. A true tool flag therefore supplies eligibility; the handler still applies those additional checks.
Stock tool eligibility callback
void _Global_CanBeHighlighted()
{
cScript_SetGlobalReturnBool(mbHighlightActive);
cScript_SetGlobalArgID(0,mBaseObj.GetID());
}