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 00191 00192 00193 00194 00195 00196 00197 00198 00199 00200 00201 00202 00203 00204 00205 00206 00207 00208 00209 00210 00211 00212 00213 00214 00215 00216 00217 00218 00219 00220 00221 00222 00223 00224 00225 00226 00227 00228 00229 00230 00231 00232 00233 00234 |
//============================================================================= // Emitter actor class. // Copyright 1998-2008 Epic Games, Inc. All Rights Reserved. //============================================================================= class Emitter extends Actor native(Particle) placeable; var() editconst const ParticleSystemComponent ParticleSystemComponent; var bool bDestroyOnSystemFinish; /** used to update status of toggleable level placed emitters on clients */ var repnotify bool bCurrentlyActive; replication { if (bNoDelete) bCurrentlyActive; } // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) native noexport event SetTemplate(ParticleSystem NewTemplate, optional bool bDestroyOnFinish); simulated event PostBeginPlay() { Super.PostBeginPlay(); // Let them die quickly on a dedicated server if (WorldInfo.NetMode == NM_DedicatedServer) { LifeSpan = 0.2; } // Set Notification Delegate if (ParticleSystemComponent != None) { ParticleSystemComponent.OnSystemFinished = OnParticleSystemFinished; bCurrentlyActive = ParticleSystemComponent.bAutoActivate; } } simulated event ReplicatedEvent(name VarName) { if (VarName == 'bCurrentlyActive') { if (bCurrentlyActive) { ParticleSystemComponent.ActivateSystem(); } else { ParticleSystemComponent.DeactivateSystem(); } } else { Super.ReplicatedEvent(VarName); } } function OnParticleSystemFinished(ParticleSystemComponent FinishedComponent) { if (bDestroyOnSystemFinish) { Lifespan = 0.0001f; } bCurrentlyActive = false; } /** * Handling Toggle event from Kismet. */ simulated function OnToggle(SeqAct_Toggle action) { // Turn ON if (action.InputLinks[0].bHasImpulse) { ParticleSystemComponent.ActivateSystem(); bCurrentlyActive = TRUE; } // Turn OFF else if (action.InputLinks[1].bHasImpulse) { ParticleSystemComponent.DeactivateSystem(); bCurrentlyActive = FALSE; } // Toggle else if (action.InputLinks[2].bHasImpulse) { // If spawning is suppressed or we aren't turned on at all, activate. if ((ParticleSystemComponent.bSuppressSpawning == TRUE) || (bCurrentlyActive == FALSE)) { ParticleSystemComponent.ActivateSystem(); bCurrentlyActive = TRUE; } else { ParticleSystemComponent.DeactivateSystem(); bCurrentlyActive = FALSE; } } ParticleSystemComponent.LastRenderTime = WorldInfo.TimeSeconds; ForceNetRelevant(); } simulated function SetFloatParameter(name ParameterName, float Param) { if (ParticleSystemComponent != none) ParticleSystemComponent.SetFloatParameter(ParameterName, Param); else LogInternal("Warning: Attempting to set a parameter on "$self$" when the PSC does not exist"); } simulated function SetVectorParameter(name ParameterName, vector Param) { if (ParticleSystemComponent != none) ParticleSystemComponent.SetVectorParameter(ParameterName, Param); else LogInternal("Warning: Attempting to set a parameter on "$self$" when the PSC does not exist"); } simulated function SetColorParameter(name ParameterName, color Param) { if (ParticleSystemComponent != none) ParticleSystemComponent.SetColorParameter(ParameterName, Param); else LogInternal("Warning: Attempting to set a parameter on "$self$" when the PSC does not exist"); } simulated function SetExtColorParameter(name ParameterName, byte Red, byte Green, byte Blue, byte Alpha) { local color c; if (ParticleSystemComponent != none) { c.r = Red; c.g = Green; c.b = Blue; c.a = Alpha; ParticleSystemComponent.SetColorParameter(ParameterName, C); } else LogInternal("Warning: Attempting to set a parameter on "$self$" when the PSC does not exist"); } simulated function SetActorParameter(name ParameterName, actor Param) { if (ParticleSystemComponent != none) ParticleSystemComponent.SetActorParameter(ParameterName, Param); else LogInternal("Warning: Attempting to set a parameter on "$self$" when the PSC does not exist"); } /** * Kismet handler for setting particle instance parameters. */ simulated function OnSetParticleSysParam(SeqAct_SetParticleSysParam Action) { local int Idx, ParamIdx; if (ParticleSystemComponent != None && Action.InstanceParameters.Length > 0) { for (Idx = 0; Idx < Action.InstanceParameters.Length; Idx++) { if (Action.InstanceParameters[Idx].ParamType != PSPT_None) { // look for an existing entry ParamIdx = ParticleSystemComponent.InstanceParameters.Find('Name',Action.InstanceParameters[Idx].Name); // create one if necessary if (ParamIdx == -1) { ParamIdx = ParticleSystemComponent.InstanceParameters.Length; ParticleSystemComponent.InstanceParameters.Length = ParamIdx + 1; } // update the instance parm ParticleSystemComponent.InstanceParameters[ParamIdx] = Action.InstanceParameters[Idx]; if (Action.bOverrideScalar) { ParticleSystemComponent.InstanceParameters[ParamIdx].Scalar = Action.ScalarValue; } } } } } defaultproperties { Begin Object Class=ParticleSystemComponent Name=ParticleSystemComponent0 ObjName=ParticleSystemComponent0 Archetype=ParticleSystemComponent'Engine.Default__ParticleSystemComponent' SecondsBeforeInactive=1.000000 Name="ParticleSystemComponent0" ObjectArchetype=ParticleSystemComponent'Engine.Default__ParticleSystemComponent' End Object ParticleSystemComponent=ParticleSystemComponent0 Begin Object Class=SpriteComponent Name=Sprite ObjName=Sprite Archetype=SpriteComponent'Engine.Default__SpriteComponent' Sprite=Texture2D'EngineResources.S_Emitter' bIsScreenSizeScaled=True ScreenSize=0.002500 HiddenGame=True AlwaysLoadOnClient=False AlwaysLoadOnServer=False Name="Sprite" ObjectArchetype=SpriteComponent'Engine.Default__SpriteComponent' End Object Components(0)=Sprite Components(1)=ParticleSystemComponent0 Begin Object Class=ArrowComponent Name=ArrowComponent0 ObjName=ArrowComponent0 Archetype=ArrowComponent'Engine.Default__ArrowComponent' ArrowColor=(B=128,G=255,R=0,A=255) ArrowSize=1.500000 Name="ArrowComponent0" ObjectArchetype=ArrowComponent'Engine.Default__ArrowComponent' End Object Components(2)=ArrowComponent0 TickGroup=TG_DuringAsyncWork bNoDelete=True bHardAttach=True bGameRelevant=True bEdShouldSnap=True Name="Default__Emitter" ObjectArchetype=Actor'Engine.Default__Actor' } |
Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |