Garry's Mod Wiki

Revision Difference

ENTITY:TranslateActivity#563515

<function name="TranslateActivity" parent="ENTITY" type="hook"> <added>2023.11.16</added> <description> Called by the engine to alter NPC activities, if desired by the NPC. <note>This hook only exists for `ai` type SENTs.</note> </description> <realm>Server</realm> <args> <arg name="act" type="number">The activity to translate. See <page>Enums/ACT</page>.</arg> </args> <rets> <ret name="" type="number">The activity that should override the incoming activity. See <page>Enums/ACT</page>. ⤶ Do not return anything to not override.</ret> ⤶ Not returning anything, or returning a non value will perform the [default action](https://github.com/ValveSoftware/source-sdk-2013/blob/master/sp/src/game/server/ai_basenpc.cpp#L5976).</ret> </rets> </function>