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 00071 00072 00073 00074 00075 00076 00077 00078 00079 00080 00081 00082 00083 00084 00085 00086 00087 00088 00089 00090 00091 00092 00093 00094 00095 00096 00097 00098 00099 00100 00101 00102 00103 00104 00105 00106 00107 00108 00109 00110 00111 00112 00113 00114 00115 00116 00117 00118 00119 00120 00121 00122 00123 00124 00125 00126 00127 00128 00129 00130 00131 00132 00133 00134 |
/** * Copyright 1998-2008 Epic Games, Inc. All Rights Reserved. */ /** spawns a ghost to magically fire a weapon for cinematics * @note: no replication, expected to execute completely clientside */ class UTSeqAct_DummyWeaponFire extends SeqAct_Latent; /** dummy pawn used to fire the weapon */ var UTDummyPawn DummyPawn; /** number of shots to fire, <= 0 for shoot forever */ var() int ShotsToFire; /** class of weapon to fire */ var() class<UTWeapon> WeaponClass; /** which fire mode to use */ var() byte FireMode; /** actor where the weapon fire is coming from */ var() Actor Origin; /** target actor for the weapon fire */ var() Actor Target; /** how far off the target shots can be */ var() rotator MaxSpread; /** if set, weapon doesn't play any sounds */ var() bool bSuppressSounds; /** number of shots fired so far */ var int ShotsFired; event Activated() { local UTWeapon NewWeapon; if (InputLinks[0].bHasImpulse) { if (WeaponClass == None) { ScriptLog("Error: DummyWeaponFire with no WeaponClass"); } else if (Origin == None) { ScriptLog("Error: DummyWeaponFire with no Origin"); } else if (Target == None) { ScriptLog("Error: DummyWeaponFire with no Target"); } else { // start firing ShotsFired = 0; if (DummyPawn == None || DummyPawn.bDeleteMe) { // init the dummy pawn DummyPawn = Origin.Spawn(class'UTDummyPawn'); if (DummyPawn == None) { ScriptLog("Error: Failed to spawn dummy actor"); } else { DummyPawn.FireAction = self; // give it the weapon NewWeapon = DummyPawn.Spawn(WeaponClass, DummyPawn); NewWeapon.bAllowFiringWithoutController = true; NewWeapon.bSuppressSounds = bSuppressSounds; NewWeapon.GiveTo(DummyPawn); DummyPawn.InvManager.SetCurrentWeapon(NewWeapon); // make sure the weapon attachment is set up DummyPawn.WeaponAttachmentChanged(); // start it firing DummyPawn.StartFire(FireMode); } } else { // restart already existing pawn DummyPawn.StopWeaponFiring(); DummyPawn.StartFire(FireMode); DummyPawn.LifeSpan = 0.0; } } } else { if (DummyPawn != None) { DummyPawn.StopWeaponFiring(); DummyPawn.LifeSpan = 1.0; // so final muzzle flash has time to play OutputLinks[2].bHasImpulse = true; } } OutputLinks[0].bHasImpulse = true; } /** notification that the dummy pawn has fired a shot */ function NotifyDummyFire() { ShotsFired++; if (ShotsToFire > 0 && ShotsFired >= ShotsToFire) { // we're done DummyPawn.StopWeaponFiring(); DummyPawn.LifeSpan = 1.0; // so final muzzle flash has time to play OutputLinks[1].bHasImpulse = true; } } event bool Update(float DeltaTime) { // keep ticking as long as the dummy pawn is still going return (DummyPawn != None && DummyPawn.LifeSpan ~= 0.0); } defaultproperties { ShotsToFire=1 bCallHandler=False bAutoActivateOutputLinks=False InputLinks(0)=(LinkDesc="Start Firing") InputLinks(1)=(LinkDesc="Stop Firing") OutputLinks(0)=(LinkDesc="Out") OutputLinks(1)=(LinkDesc="Finished") OutputLinks(2)=(LinkDesc="Stopped") VariableLinks(0)=(LinkDesc="Origin",PropertyName="Origin",MaxVars=1) VariableLinks(1)=(ExpectedType=Class'Engine.SeqVar_Object',LinkDesc="Target",PropertyName="Target",MinVars=1,MaxVars=1) ObjName="Dummy Weapon Fire" ObjCategory="Cinematic" Name="Default__UTSeqAct_DummyWeaponFire" ObjectArchetype=SeqAct_Latent'Engine.Default__SeqAct_Latent' } |
Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |