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 |
//============================================================================= // SmokeHose. //============================================================================= class SmokeHose extends Effects; // Shoots out a stream of RisingSpriteSmokePuffs. The smoke sprites are shot // in the direction of the SmokeHoseDest actor with the same Tag as this actors // Event. The speed, speedvariance, spawning delay and variance, size and // size variance, as well as the acceleration of the smoke puffs are adjustable. // The effect can be initially active all the time, or enabled when the player // is within a trigger's radius. var() bool bInitiallyActive; var() float SmokeSpeed; var() Vector SmokeAccel; var() float SmokeDelay; var() float SmokeDelayVariance; var() float SpeedVariance; var() float BasePuffSize; var() float SizeVariance; var() int TotalNumPuffs; var Actor SmokeDestObj; var int NumPuffsSpawned; function BeginPlay() { local SmokeHoseDest SDest; // Find the SmokeHoseDest object which has the same tag as // the event of this SmokeHose. foreach AllActors( class 'SmokeHoseDest', SDest, Event ) { SmokeDestObj = SDest; break; } if ( SmokeDestObj == None ) { Destroy(); return; } NumPuffsSpawned = 0; if( bInitiallyActive ) { Enable('Timer'); SetTimer( SmokeDelay+FRand()*SmokeDelayVariance, False ); } else Enable('Trigger'); } function Timer() { // Spawn another smoke puff sprite local RisingSpriteSmokePuff sp; sp = Spawn(class'RisingSpriteSmokePuff'); sp.DrawScale = BasePuffSize+FRand()*SizeVariance; sp.Velocity = (SmokeSpeed + FRand()*SpeedVariance) * Normal(SmokeDestObj.Location - Location); sp.Acceleration = SmokeAccel; NumPuffsSpawned++; if( NumPuffsSpawned>TotalNumPuffs ) Destroy(); SetTimer( SmokeDelay+FRand()*SmokeDelayVariance, False ); } function Trigger( actor Other, pawn EventInstigator ) { // Actor entered the triggers radius Enable('Timer'); SetTimer( SmokeDelay+FRand()*SmokeDelayVariance, False ); } function UnTrigger( actor Other, pawn EventInstigator ) { // Actor left the triggers radius Disable('Timer'); } defaultproperties { bInitiallyActive=True SmokeSpeed=100.000000 SmokeAccel=(Z=90.000000) SmokeDelay=0.100000 SmokeDelayVariance=0.150000 SpeedVariance=20.000000 BasePuffSize=1.000000 SizeVariance=0.200000 TotalNumPuffs=10000 bHidden=True bNetTemporary=False DrawType=DT_Sprite } |
Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |