ENTITY:SelectSchedule
ENTITY:SelectSchedule()
Description
Set the schedule we should be playing right now. Allows the NPC to start either a Lua schedule or an engine schedule. Despite sharing the same name as CAI_BaseNPC::SelectSchedule()
, this isn't hooked to that function; this is called by Lua's ENTITY:RunAI, doesn't return an engine function, returning an engine function doesn't help and doesn't make the NPC start an engine schedule. To alter initial engine schedule, it is recommended to use ENTITY:TranslateSchedule.
This is a helper function only available if your SENT is based on
base_ai
Example
Creates a new schedule and assigns it to a scripted NPC.
Output: The scripted NPC will run around when spawned.