Scripted.cpp
6108 palavras
25 páginas
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============////
// Purpose: Implementation of entities that cause NPCs to participate in
// scripted events. These entities find and temporarily possess NPCs
// within a given search radius.
//
// Multiple scripts with the same targetname will start frame-synchronized.
//
// Scripts will find available NPCs by name or class name and grab them
// to play the script. If the NPC is already playing a script, the
// new script may enqueue itself unless there is already a non critical
// script in the queue.
//
//=============================================================================//
#include "cbase.h"
#include "ai_schedule.h"
#include "ai_default.h"
#include "ai_motor.h"
#include "ai_hint.h"
#include "ai_networkmanager.h"
#include "ai_network.h"
#include "engine/IEngineSound.h"
#include "animation.h"
#include "scripted.h"
#include "entitylist.h"
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
ConVar ai_task_pre_script( "ai_task_pre_script", "0", FCVAR_NONE );
//
// targetname "me" - there can be more than one with the same name, and they act in concert
// target "the_entity_I_want_to_start_playing" or "class entity_classname" will pick the closest inactive scientist
// play "name_of_sequence"
// idle "name of idle sequence to play before starting"
// moveto - if set the NPC first moves to this nodes position
// range # - only search this far to find the target
// spawnflags - (stop if blocked, stop if player seen)
//
BEGIN_DATADESC( CAI_ScriptedSequence )
DEFINE_KEYFIELD( m_iszEntry, FIELD_STRING, "m_iszEntry" ), DEFINE_KEYFIELD( m_iszPreIdle, FIELD_STRING, "m_iszIdle" ), DEFINE_KEYFIELD( m_iszPlay, FIELD_STRING, "m_iszPlay" ), DEFINE_KEYFIELD( m_iszPostIdle, FIELD_STRING, "m_iszPostIdle" ), DEFINE_KEYFIELD( m_iszCustomMove, FIELD_STRING, "m_iszCustomMove" ),