Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |
00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 00011 00012 00013 00014 00015 00016 00017 00018 00019 00020 00021 00022 00023 00024 00025 00026 00027 00028 00029 00030 00031 00032 00033 00034 00035 00036 00037 00038 00039 00040 00041 00042 00043 00044 00045 00046 00047 00048 00049 00050 00051 00052 00053 00054 00055 00056 00057 00058 00059 00060 00061 00062 00063 00064 00065 00066 00067 00068 00069 00070 |
/** * Copyright 1998-2008 Epic Games, Inc. All Rights Reserved. */ /** spawns a projectile at a certain location that moves toward the given location with the given Instigator */ class UTSeqAct_SpawnProjectile extends SequenceAction; /** Class of projectile to spawn */ var() class<Projectile> ProjectileClass; event Activated() { local Controller InstigatorController; local Pawn InstigatorPawn; local vector SpawnLoc, TargetLoc; local Projectile Proj; if ( VariableLinks.length < 3 || VariableLinks[0].LinkedVariables.length == 0 || VariableLinks[1].LinkedVariables.length == 0 || VariableLinks[2].LinkedVariables.length == 0 ) { ScriptLog("ERROR: All variable links must be filled"); } else { // get the instigator if (VariableLinks[2].LinkedVariables.length > 0) { InstigatorController = Controller(SeqVar_Object(VariableLinks[2].LinkedVariables[0]).GetObjectValue()); if (InstigatorController != None) { InstigatorPawn = InstigatorController.Pawn; } else { InstigatorPawn = Pawn(SeqVar_Object(VariableLinks[2].LinkedVariables[0]).GetObjectValue()); if (InstigatorPawn != None) { InstigatorController = InstigatorPawn.Controller; } else if (SeqVar_Object(VariableLinks[2].LinkedVariables[0]).GetObjectValue() != None) { ScriptLog("ERROR: Instigator specified for" @ self @ "is not a Controller"); } } } // get the spawn location SpawnLoc = SeqVar_Vector(VariableLinks[0].LinkedVariables[0]).VectValue; TargetLoc = SeqVar_Vector(VariableLinks[1].LinkedVariables[0]).VectValue; // spawn a projectile at the requested location and point it at the requested target Proj = GetWorldInfo().Spawn(ProjectileClass,,, SpawnLoc); if (InstigatorController != None) { Proj.Instigator = InstigatorPawn; Proj.InstigatorController = InstigatorController; } Proj.Init(Normal(TargetLoc - SpawnLoc)); } } defaultproperties { bCallHandler=False VariableLinks(0)=(ExpectedType=Class'Engine.SeqVar_Vector',LinkDesc="Spawn Location",MaxVars=1) VariableLinks(1)=(ExpectedType=Class'Engine.SeqVar_Vector',LinkDesc="Target Location",MinVars=1,MaxVars=1) VariableLinks(2)=(ExpectedType=Class'Engine.SeqVar_Object',LinkDesc="Instigator",MaxVars=1) ObjName="Spawn Projectile" Name="Default__UTSeqAct_SpawnProjectile" ObjectArchetype=SequenceAction'Engine.Default__SequenceAction' } |
Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |