UnrealShare
Class SpawnPoint

source: e:\games\UnrealTournament\UnrealShare\Classes\Spawnpoint.uc
Core.Object
   |
   +--Engine.Actor
      |
      +--Engine.NavigationPoint
         |
         +--UnrealShare.SpawnPoint
Direct Known Subclasses:None

class SpawnPoint
extends Engine.NavigationPoint

//============================================================================= // Spawnpoint. //Used by Creature Factories for spawning monsters //=============================================================================
Variables
 ThingFactory factory


Function Summary
 bool Create()



Source Code


00001	//=============================================================================
00002	// Spawnpoint.
00003	//Used by Creature Factories for spawning monsters
00004	//=============================================================================
00005	class SpawnPoint extends NavigationPoint;
00006	
00007	#exec Texture Import File=Textures\SpwnAI.pcx Name=S_SpawnP Mips=Off Flags=2
00008	
00009	var ThingFactory factory;
00010	
00011	function bool Create()
00012	{
00013		local pawn newcreature;
00014		local CreatureFactory pawnFactory;
00015		local pawn creature;
00016		local actor temp, A;
00017		local rotator newRot;
00018	
00019		if ( factory.bCovert && PlayerCanSeeMe() ) //make sure no player can see this
00020			return false;
00021		
00022		temp = Spawn(factory.prototype);
00023		if (temp == None)
00024			return false;
00025		newRot = rot(0,0,0);
00026		newRot.yaw = rotation.yaw;
00027		temp.SetRotation(newRot);
00028		temp.event = factory.tag;
00029		temp.tag = factory.itemtag;
00030		newcreature = pawn(temp);
00031		
00032		if( Event != '' )
00033			foreach AllActors( class 'Actor', A, Event )
00034				A.Trigger( Self, Instigator );
00035		if ( factory.bFalling )
00036			temp.SetPhysics(PHYS_Falling);
00037		if (newcreature == None)
00038			return true;
00039	
00040		pawnFactory = CreatureFactory(factory);
00041		if (pawnFactory == None)
00042		{
00043			log("Error - use creature factory to spawn pawns");
00044			return true;
00045		}
00046		if (ScriptedPawn(newcreature) != None)
00047		{
00048			ScriptedPawn(newcreature).Orders = pawnFactory.Orders;
00049			ScriptedPawn(newcreature).OrderTag = pawnFactory.OrderTag;
00050			ScriptedPawn(newcreature).SetEnemy(pawnFactory.enemy);
00051			ScriptedPawn(newcreature).Alarmtag = pawnFactory.AlarmTag;
00052		}
00053		else 
00054			newcreature.enemy = pawnFactory.enemy;
00055		if (newcreature.enemy != None)
00056			newcreature.lastseenpos = newcreature.enemy.location;
00057		newcreature.SetMovementPhysics();
00058		if ( newcreature.Physics == PHYS_Walking)
00059			newcreature.SetPhysics(PHYS_Falling);
00060		return true;
00061	}
00062	
00063	defaultproperties
00064	{
00065	     bDirectional=True
00066	     Texture=Texture'UnrealShare.S_SpawnP'
00067	     SoundVolume=128
00068	}

End Source Code