Revision Difference
ENTITY:TranslateActivity#563563
<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>
<arg name="oldAct" type="number{ACT}">The activity to translate. </arg>
</args>
<rets>
<ret name="" type="number">The activity that should override the incoming activity. See <page>Enums/ACT</page>.
<ret name="newAct" type="number{ACT}">The activity that should override the incoming activity.
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>