## Engine
Class AIScript

source: C:\XIII\Engine\Classes\AIScript.uc

    Core.Object
       |
       +--Engine.Actor
          |
          +--Engine.Keypoint
             |
             +--Engine.AIScript

Direct Known Subclasses:None

class AIScript
extends Engine.Keypoint

    //=============================================================================
    // AIScript - used by Level Designers to specify special AI scripts for pawns
    // placed in a level, and to change which type of AI controller to use for a pawn.
    // AIScripts can be shared by one or many pawns.
    // Game specific subclasses of AIScript will have editable properties defining game specific behavior and AI
    // This is a built-in Unreal class and it shouldn't be modified.
    //=============================================================================

Variables
`class` | `ControllerClass`
`AIScript` | `NextScript` Tag of next ScriptedSequence
`name` | `NextScriptTag` Tag of next ScriptedSequence
`float` | `SkillModifier` skill modifier (same scale as game difficulty)

Function Summary
`void` | `SpawnControllerFor(Pawn P)`
    /* SpawnController()
    Spawn and initialize an AI Controller (called by a non-player controlled Pawn at level startup)
    */

Source Code

    00001	//=============================================================================
    00002	// AIScript - used by Level Designers to specify special AI scripts for pawns
    00003	// placed in a level, and to change which type of AI controller to use for a pawn.
    00004	// AIScripts can be shared by one or many pawns.
    00005	// Game specific subclasses of AIScript will have editable properties defining game specific behavior and AI
    00006	// This is a built-in Unreal class and it shouldn't be modified.
    00007	//=============================================================================
    00008	class AIScript extends Keypoint
    00009		native
    00010		placeable;
    00011
    00012	var() class<AIController> ControllerClass;
    00013	var()	float	SkillModifier;		// skill modifier (same scale as game difficulty)
    00014	var() name NextScriptTag;	// Tag of next ScriptedSequence
    00015	var AIScript NextScript;
    00016
    00017
    00018	/* SpawnController()
    00019	Spawn and initialize an AI Controller (called by a non-player controlled Pawn at level startup)
    00020	*/
    00021	function SpawnControllerFor(Pawn P)
    00022	{
    00023		local AIController C;
    00024
    00025		if ( ControllerClass == None )
    00026		{
    00027			if ( P.ControllerClass == None )
    00028				return;
    00029			C = Spawn(P.ControllerClass);
    00030		}
    00031		else
    00032			C = Spawn(ControllerClass);
    00033		C.MyScript = self;
    00034		C.Skill += SkillModifier;
    00035		C.Possess(P);
    00036	}
    00037
    00038	defaultproperties
    00039	{
    00040	}

End Source Code