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 |
class TsActionFakeShoot extends MojoActions.TsAction; var() class<Weapon> WeaponClass "The reference class for the spawned projectile"; var() class<Emitter> WeaponFlareClass "The weapon flare emitter used"; var() int ShotgunAmount "If not 0, then multiple projectiles are created in a shotgun effect"; var() float ShotgunSpread "The amount of spread in the shotgun blast"; var() Name OriginBone "The bone at which the projectile starts. If none, it starts at the actor's position"; var() bool bHitWorld "Whether the projectile collides with the world"; var() bool bHitPlayers "Whether the projectile collides with characters"; var() bool bManualTargetPoint "Set this to true to specify the target point of the projectile"; var() MojoKeyframe TargetPoint "If bManualTargetPoint is true, the projectile will fly towards this location"; function bool OnStart() { local Rotator r; local Vector targetVec; local Projectile Projectile; local Vector origin; local Vector X,Y,Z; local float spread; local int i; local int num; if (OriginBone != '') { origin = Actor.GetBoneCoords(OriginBone).Origin; } else { origin = Actor.Location; } spread = shotgunSpread; num = shotgunAmount; if (num == 0) { num = 1; spread = 0; } for (i = 0; i < num; i++) { Projectile = new(Actor.Level) WeaponClass.default.projectileClass(Rook(Actor), '', origin); if (Projectile == None) { log("Couldn't construct projectile of type "$WeaponClass.default.projectileClass); return false; } // set projectile parameters Projectile.rookAttacker = Rook(Actor); Projectile.SetCollision(bHitPlayers, false, false); Projectile.bCollideWorld = bHitWorld; Projectile.makeHarmless(); // set orientation if (!bManualTargetPoint) { if (OriginBone != '') { r = Actor.GetBoneRotation(OriginBone); } else { r = Actor.Rotation; } } else { targetVec = (TargetPoint.position - Projectile.Location); targetVec /= VSize(targetVec); r = Rotator(targetVec); } // apply spread GetAxes(r, X, Y, Z); Projectile.SetRotation(Rotator(Vector(r) + (spread * (FRand() - 0.5)) * X + (spread * (FRand() - 0.5)) * Y + (spread * (FRand() - 0.5)) * Z)); Projectile.Velocity = Vector(Projectile.Rotation) * WeaponClass.default.projectileVelocity; } // spawn weapon flare if (WeaponFlareClass != None) Actor.AttachToBone(Actor.spawn(WeaponFlareClass), OriginBone); return true; } function bool OnTick(float delta) { return false; } function bool CanGenerateOutputKeys() { return false; } defaultproperties { DName ="Fake Weapon Shoot" Track ="Effects" Help ="Spawn a faked projectile from the given bone" FastForwardSkip = true WeaponClass =class'Spinfusor' OriginBone ="bip01 rhand" bHitWorld =true bHitPlayers =false shotgunSpread =0.4 } |
Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |