1[
ComponentEditorProps(
category:
"GameScripted/Editor/EffectsModule", description:
"Holds and executes various effects such as artillery and smoke the editor can place")]
12 [
Attribute(
"1",
desc:
"If true will execute as soon as it is placed. If false will only execute manually")]
15 [
Attribute(
desc:
"Holds the effect module config with all the required variables and logic to execute")]
85 child.OnTransformReset();
93 Math3D.MatrixIdentity3(transform);
107 trace.Exclude =
child;
108 trace.TargetLayers = EPhysicsLayerDefs.FireGeometry;
113 if (normal !=
vector.Zero)
114 Math3D.MatrixFromUpVec(normal, transform);
118 Math3D.MatrixInvMultiply3(ownerTransform, transform, transform);
120 transform[3] = snapPosition;
121 child.SetTransform(transform);
152 effectModuleChildren.Clear();
160 if (effectModuleChild)
161 effectModuleChildren.Insert(effectModuleChild);
166 return effectModuleChildren.Count();
183 Print(
"SCR_EffectsModuleComponent.SpawnEffectEntity: Failed to create spawn params. Entity defined in Effect Config will not be spawned.",
LogLevel.WARNING);
191 Print(
"'SCR_EffectsModuleComponent' failed to spawn entity",
LogLevel.ERROR);
199 if (spawnedRplComp && parentRplComp)
201 RplNode spawnedNode = spawnedRplComp.GetNode();
202 RplNode parentNode = parentRplComp.GetNode();
203 if (spawnedNode && parentNode && spawnedNode.GetParent() != parentNode)
204 spawnedNode.SetParent(parentNode);
209 if (!effectModuleChild)
211 Debug.Error2(
"SCR_EffectsModuleComponent",
"Spawned effect module entity does not have 'SCR_EffectsModuleChildComponent'!");
212 delete spawnedEntity;
224 RplComponent rplComp = RplComponent.Cast(spawnedEntity.GetOwner().FindComponent(RplComponent));
227 Print(
"'SCR_EffectsModuleComponent' spawned entity has no 'RplComponent'!",
LogLevel.ERROR);
228 delete spawnedEntity.GetOwner();
246 RplComponent rplComp = RplComponent.Cast(
Replication.FindItem(
id));
250 IEntity spawnedEntity = rplComp.GetEntity();
255 if (!effectModuleChild)
259 m_EffectConfig.OnEntitySpawnedBroadcast(effectModuleChild, targetPosition);
277 CancelModuleServer();
283 if(editableEffectsModule != null)
285 editableEffectsModule.
Delete();
330 if (!CanPause() ||
IsPaused() == paused)
383 if (!gameMode || !gameMode.
IsMaster())
397 Print(
"'SCR_EffectsModuleComponent' has no effect config assigned!",
LogLevel.ERROR);
402 Print(
"'SCR_EffectsModuleComponent' effect config is invalid as no prefab assigned!",
LogLevel.ERROR);
407 Print(
"'SCR_EffectsModuleComponent' effect config is invalid as type is NONE!",
LogLevel.ERROR);
412 Print(
"'SCR_EffectsModuleComponent' effect config has no Zone Data assigned!",
LogLevel.ERROR);
449 if (gameMode && gameMode.
IsMaster())
450 CancelModuleServer();
474 bool isPaused, isLooping;
476 reader.ReadBool(isPaused);
477 reader.ReadBool(isLooping);
ArmaReforgerScripted GetGame()
enum EAIGroupCombatMode ComponentEditorProps(category:"GameScripted/AI", description:"Component for utility AI system for groups")
SCR_BaseGameMode GetGameMode()
@ MODULE_ENTITY
Entities that are placed such as Mines.
@ PROJECTILE
Projectiles that fly in such as Mortars.
@ PARTICLE
Particles that are directly spawned.
func EffectsModuleOnChangedMethod
ScriptInvokerBase< EffectsModuleOnChangedMethod > EffectsModuleOnChanged
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
void GetChildren(out array< SCR_ScenarioFrameworkLayerBase > children)
proto external int SetEventMask(notnull IEntity owner, int mask)
proto external Managed FindComponent(typename typeName)
proto external BaseWorld GetWorld()
proto external void GetTransform(out vector mat[])
proto external bool IsDeleted()
Object holding reference to resource. In destructor release the resource.
Replication item identifier.
override bool Delete(bool changedByUser=false, bool updateNavmesh=true)
void InitChild(notnull SCR_EffectsModuleComponent effectModule, notnull SCR_EffectsModule effectConfig)
override void EOnInit(IEntity owner)
ref EffectsModuleOnChanged m_OnEditorOnRemovedFromParent
void CancelModuleBroadcast()
ref SCR_EffectsModule m_EffectConfig
void EditorOnRemovedFromParent()
OnEffectsModuleChildDeleted()
Rpc(CancelModuleBroadcast)
EffectsModuleOnChanged GetOnEditorOnRemovedFromParent()
bool EditorInstantDelete()
void PostEntitySpawned(notnull SCR_EffectsModuleChildComponent spawnedEntity, vector targetPosition)
void SetLoopingServer(bool loop)
int GetEffectsModuleChildren(notnull out array< SCR_EffectsModuleChildComponent > effectModuleChildren)
SCR_EffectsModule GetEffectsModuleConfig()
void OnEntitySpawnedBroadcast(RplId id, vector targetPosition)
EffectsModuleOnChanged GetOnTransformChanged()
override void OnPostInit(IEntity owner)
override bool RplLoad(ScriptBitReader reader)
ref EffectsModuleOnChanged m_OnDeleted
void SetLoopingBroadcast(bool loop)
SCR_EffectsModuleChildComponent childComponent
ref EffectsModuleOnChanged m_OnTransformChanged
void SetPausedBroadcast(bool paused)
m_EffectConfig CancelModuleBroadcast()
override void OnDelete(IEntity owner)
void SetPausedServer(bool paused)
EffectsModuleOnChanged GetOnDelete()
void OnEffectsModuleChildDeleted()
static RplComponent GetEntityRplComponent(notnull IEntity entity)
static bool IsEmptyOrWhiteSpace(string input)
static float GetTerrainY(vector pos, BaseWorld world=null, bool noUnderwater=false, TraceParam trace=null)
static void SnapToGeometry(out vector newPosition, vector currentPosition, array< IEntity > excludedEntities, BaseWorld world=null, TraceParam traceParam=null, out vector surfaceNormal=vector.Zero)
proto external GenericEntity GetOwner()
Get owner entity.
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
LogLevel
Enum with severity of the logging message.
@ NONE
When Shape is created and not initialized yet.
SCR_FieldOfViewSettings Attribute
EntityEvent
Various entity events.
void RplRpc(RplChannel channel, RplRcver rcver, RplCondition condition=RplCondition.None, string customConditionName="")
RplChannel
Communication channel. Reliable is guaranteed to be delivered. Unreliable not.