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 00135 00136 00137 00138 00139 00140 00141 00142 00143 00144 00145 00146 00147 00148 00149 00150 00151 00152 00153 00154 00155 00156 00157 00158 00159 00160 00161 00162 00163 00164 00165 00166 00167 00168 00169 00170 00171 00172 00173 00174 00175 00176 00177 00178 00179 00180 00181 00182 00183 00184 00185 00186 00187 00188 00189 00190 |
//================================================================ // class: Force // file: Force.uc // author: Raven // www: http://turniej.unreal.pl/rp // description: // adds force to particles //================================================================ /* usage: if bOn is true this actor will change velocity of all particles that will touch it. Force has 4 states: * TriggerToggle - toggle when triggered. * TriggerTurnsOff - tunrs off when triggered. * TriggerTurnsOn - turns on when triggered. * TriggerControl - turns on when triggered, tunrs off when get untriggered. And 4 variables: * ParticleSpeed (float) - new particle speed * ParticleSpeedVariance (float) - new particle speed variance * bOn (bool) - is active or not * ForceType (enum) - how change particle velocity - FORCE_Addictive - new force will be add to particle velocity - FORCE_Multiply - new force will multiply particle velocity - FORCE_Replace - new force will replace particle velocity */ class UIForce extends UIParticleSystem; var() float ParticleSpeed; //new particle speed var() float ParticleSpeedVariance; //new particle speed variance var() bool bOn; //is active or not var() enum EForceType { FORCE_Addictive, //new force will be add to particle velocity FORCE_Multiply, //new force will multiply particle velocity FORCE_Replace //new force will replace particle velocity } ForceType; //how change particle velocity var() float SprayFactor; //spray var() float SprayFactorVariance; //spray vairance var() bool bRandomizeRotation; //uses random spawn rotation var() bool bRandPitch; //random pitch var() bool bRandYaw; //random yaw var() bool bRandRoll; //randomed roll var() rotator MinRotation; //min rotation var() rotator MaxRotation; //max rotation var() bool bForceRndRot; //forces RotRand() function var vector NewLocal; var rotator RndRot,RndRot2; replication { // Variables the server should send to the client. unreliable if ( Role==ROLE_Authority ) bOn,NewLocal,RndRot,RndRot2; unreliable if ( Role==ROLE_Authority ) AddForce; } simulated function AddForce(UIBasicParticle BasicParticle) { if (BasicParticle == none) return; if (bRandomizeRotation) { RndRot=Rotation; if (!bForceRndRot) { if (bRandPitch) RndRot.Pitch=RandRange(MinRotation.Pitch, MaxRotation.Pitch); if (bRandYaw) RndRot.Yaw=RandRange(MinRotation.Yaw, MaxRotation.Yaw); if (bRandRoll) RndRot.Roll=RandRange(MinRotation.Roll, MaxRotation.Roll); } else { RndRot2=RotRand(); if (bRandPitch) RndRot.Pitch=RndRot2.Pitch; if (bRandYaw) RndRot.Yaw=RndRot2.Yaw; if (bRandRoll) RndRot.Roll=RndRot2.Roll; } NewLocal=(ParticleSpeed + Jiiter(ParticleSpeedVariance))*vector(RndRot); } else { NewLocal=(ParticleSpeed + Jiiter(ParticleSpeedVariance))*vector(Rotation); } if (SprayFactor > 0.0) { NewLocal.x=NewLocal.x*(SprayFactor + Jiiter(SprayFactorVariance)); NewLocal.y=NewLocal.y*(SprayFactor + Jiiter(SprayFactorVariance)); NewLocal.z=NewLocal.z*(SprayFactor + Jiiter(SprayFactorVariance)); } if (Forcetype == FORCE_Addictive) { BasicParticle.Velocity+=NewLocal; } else if (Forcetype == FORCE_Multiply) { BasicParticle.Velocity*=NewLocal; } else if (Forcetype == FORCE_Replace) { BasicParticle.Velocity=NewLocal; } // log("BasicParticle touched, "$BasicParticle$".Velocity="$BasicParticle.Velocity,'FORCE'); } simulated function Touch(Actor Other) { // log("Touched Other"$Other,'FORCE'); if (UIBasicParticle(Other) != none && bOn) AddForce(UIBasicParticle(Other)); } //============================================================================= // Toggle when triggered. //============================================================================= simulated state() TriggerToggle { simulated function Trigger( actor Other, pawn EventInstigator ) { if (bOn) { bOn=false; } else { bOn=true; } } } //============================================================================= // tunrs off when triggered. //============================================================================= simulated state() TriggerTurnsOff { simulated function Trigger( actor Other, pawn EventInstigator ) { bOn=false; Destroy(); } Bagin: bOn=true; } //============================================================================= // turns on when triggered. //============================================================================= simulated state() TriggerTurnsOn { simulated function Trigger( actor Other, pawn EventInstigator ) { bOn=true; } Bagin: bOn=false; } //============================================================================= // Start when triggered, Stop when get untriggered. //============================================================================= simulated state() TriggerControl { simulated function Trigger( actor Other, pawn EventInstigator ) { bOn=true; } simulated function UnTrigger( actor Other, pawn EventInstigator ) { bOn=false; } Bagin: bOn=false; } defaultproperties { bRandPitch=True bRandYaw=True bRandRoll=True MaxRotation=(Pitch=65536,Yaw=65536,Roll=65536) bHidden=True bNoDelete=True bStasis=True RemoteRole=ROLE_SimulatedProxy bDirectional=True Texture=Texture'UnrealShare.Icons.ParticleForce' DrawScale=0.500000 bCollideActors=True } |
Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |