8 name:
"Scenario Framework 1.0.0 -> 1.1.0 Update - phase 1",
11 wbModules: {
"WorldEditor" },
12 awesomeFontCode: 0x0031,
13 description:
"This plugin updates Scenario Framework Slots from the old (1.0.0) to the new (1.1.0+) standard")]
14class SCR_ScenarioFrameworkConversionPlugin_Phase1 : WorkbenchPlugin
16 static const string GENERIC_CLASSNAME =
"GenericEntity";
19 static const string SLOT_WAYPOINT_PREFAB =
"{EBD91177954E8236}Prefabs/ScenarioFramework/Components/SlotWaypoint.et";
20 static const string SLOT_WAYPOINT_COMPONENT_CLASSNAME =
"SCR_ScenarioFrameworkSlotWaypoint";
21 protected static const string LAYER_PREFAB =
"{5F9FFF4BF027B3A3}Prefabs/ScenarioFramework/Components/Layer.et";
22 protected static const string CYCLE_WAYPOINT_CLASSNAME =
"SCR_ScenarioFrameworkWaypointCycle";
25 protected static const string BASE_SLOT_CLASSNAME =
"SCR_ScenarioFrameworkSlotBase";
26 protected static const string SLOT_PREFAB =
"{AA01691FDC4E9167}Prefabs/ScenarioFramework/Components/Slot.et";
27 protected static const string BASE_SLOT_FIELD =
"m_sObjectToSpawn";
30 protected static const string SLOT_AI_PREFAB =
"{8D43830F02C3F114}Prefabs/ScenarioFramework/Components/SlotAI.et";
31 protected static const string SLOT_KILL_PREFAB =
"{C70DC6CBD1AAEC9A}Prefabs/ScenarioFramework/Components/SlotKill.et";
32 protected static const string SLOT_DEFEND_PREFAB =
"{E123BAC59A9B3D5F}Prefabs/ScenarioFramework/Components/SlotDefend.et";
33 protected static const ref array<string> BASE_SLOTWP_CLASSNAMES = {
34 "SCR_ScenarioFrameworkSlotAI",
35 "SCR_ScenarioFrameworkSlotKill",
36 "SCR_ScenarioFrameworkSlotDefend",
38 protected static const string BASE_SLOTWP_FIELD_FROM =
"m_aWaypointGroupNames";
39 protected static const string BASE_SLOTWP_FIELD_TO =
"m_WaypointSet";
40 static const string WAYPOINT_COMPONENT_FIELD =
"m_Waypoint";
41 protected static const string WAYPOINT_CLASSNAME =
"SCR_ScenarioFrameworkWaypointSet";
42 protected static const string CYCLE_SUFFIX =
"_Cycle";
44 protected static const ref array<ref SCR_ScenarioFrameworkConversionPlugin_Rune> CONVERSION_TABLE = {};
49 WorldEditorAPI worldEditorAPI = SCR_WorldEditorToolHelper.GetWorldEditorAPI();
53 bool manageEditAction = SCR_WorldEditorToolHelper.BeginEntityAction();
56 Debug.BeginTimeMeasure();
57 array<IEntitySource> allEntitySources = GetEntitySources();
58 Debug.EndTimeMeasure(
"Entities obtention (" + allEntitySources.Count() +
" found)");
60 Debug.BeginTimeMeasure();
61 CreateCycleWaypoints(allEntitySources);
62 Debug.EndTimeMeasure(
"Cycle waypoints conversion");
64 Debug.BeginTimeMeasure();
65 Convert(allEntitySources);
66 Debug.EndTimeMeasure(
"" + allEntitySources.Count() +
" entities conversion");
68 SCR_WorldEditorToolHelper.EndEntityAction(manageEditAction);
74 protected array<IEntitySource> GetEntitySources()
77 array<IEntitySource> result = {};
78 WorldEditorAPI worldEditorAPI = SCR_WorldEditorToolHelper.GetWorldEditorAPI();
79 for (
int i, count = worldEditorAPI.GetEditorEntityCount(); i < count; i++)
81 entitySource = worldEditorAPI.GetEditorEntity(i);
85 if (!entitySource.GetAncestor())
88 if (entitySource.GetClassName() != GENERIC_CLASSNAME)
91 result.Insert(entitySource);
100 protected void CreateCycleWaypoints(notnull array<IEntitySource> allEntitySources)
103 array<ref SCR_WaypointSet> cycleWaypointSets = {};
105 GetLayersAndWaypointSets(allEntitySources, namedLayers, cycleWaypointSets);
107 if (namedLayers.IsEmpty())
110 array<ref ContainerIdPathEntry> waypointPath = {
new ContainerIdPathEntry(SLOT_WAYPOINT_COMPONENT_CLASSNAME) };
111 array<ref ContainerIdPathEntry> randomOrderBoolPath = {
120 WorldEditorAPI worldEditorAPI = SCR_WorldEditorToolHelper.GetWorldEditorAPI();
121 bool manageEditAction = SCR_WorldEditorToolHelper.BeginEntityAction();
123 foreach (SCR_WaypointSet cycleWaypointSet : cycleWaypointSets)
125 namedLayer = namedLayers.Get(cycleWaypointSet.m_sName);
128 Print(
"Cycle waypoint set is targeting an unknown layer " + cycleWaypointSet.m_sName,
LogLevel.WARNING);
132 string cycleWaypointEntityName = cycleWaypointSet.m_sName + CYCLE_SUFFIX;
133 entitySource = worldEditorAPI.FindEntityByName(cycleWaypointEntityName);
136 Print(
"Cycle waypoint already exists - " + cycleWaypointEntityName,
LogLevel.WARNING);
140 entitySource = worldEditorAPI.CreateEntity(SLOT_WAYPOINT_PREFAB, cycleWaypointEntityName, namedLayer.GetLayerID(), namedLayer,
vector.Zero,
vector.Zero);
143 Print(
"Failed to create cycle waypoint - " + cycleWaypointEntityName,
LogLevel.WARNING);
147 if (!worldEditorAPI.FindEntityByName(cycleWaypointEntityName))
149 if (!worldEditorAPI.RenameEntity(entitySource, cycleWaypointEntityName) || !worldEditorAPI.FindEntityByName(cycleWaypointEntityName))
151 Print(
"Could not name cycle waypoint entity properly - " + cycleWaypointEntityName,
LogLevel.WARNING);
152 worldEditorAPI.DeleteEntity(entitySource);
158 for (
int i, count = entitySource.GetComponentCount(); i < count; i++)
160 componentSource = entitySource.GetComponent(i);
161 if (!componentSource)
164 if (componentSource.GetClassName() != SLOT_WAYPOINT_COMPONENT_CLASSNAME)
169 if (!worldEditorAPI.CreateObjectVariableMember(entitySource, waypointPath, WAYPOINT_COMPONENT_FIELD, CYCLE_WAYPOINT_CLASSNAME))
171 Print(
"Cannot create component's waypoint - " + cycleWaypointEntityName,
LogLevel.WARNING);
175 if (!worldEditorAPI.SetVariableValue(entitySource, randomOrderBoolPath,
"m_bUseRandomOrder",
"1"))
177 Print(
"Cannot set component waypoint's UseRandomOrder value - " + cycleWaypointEntityName,
LogLevel.WARNING);
187 Print(
"Waypoint could not be set in SlotWaypoint - " + cycleWaypointEntityName,
LogLevel.WARNING);
188 worldEditorAPI.DeleteEntity(entitySource);
192 SCR_WorldEditorToolHelper.EndEntityAction(manageEditAction);
199 protected void GetLayersAndWaypointSets(notnull array<IEntitySource> allEntitySources, out notnull
map<string, IEntitySource> namedLayers, out notnull array<ref SCR_WaypointSet> cycleWaypointSets)
202 cycleWaypointSets.Clear();
204 SCR_WaypointSet waypointSet;
211 bool found, randomOrder, cycle;
214 ancestor = entitySource.GetAncestor();
217 name = entitySource.GetName();
219 namedLayers.Insert(name, entitySource);
227 for (
int i, count = entitySource.GetComponentCount(); i < count; i++)
231 componentSource = entitySource.GetComponent(i);
232 if (!componentSource)
235 name = componentSource.GetClassName();
236 if (!BASE_SLOTWP_CLASSNAMES.Contains(name))
239 waypointGroupNames = componentSource.GetObjectArray(
"m_aWaypointGroupNames");
240 if (!waypointGroupNames)
243 for (
int j, countJ = waypointGroupNames.Count(); j < countJ; j++)
245 waypointGroupName = waypointGroupNames.Get(j);
246 if (!waypointGroupName)
249 if (!waypointGroupName.Get(
"m_bCycleWaypoints", cycle)
251 || !waypointGroupName.Get(
"m_sName", name)
252 || !waypointGroupName.Get(
"m_bUseRandomOrder", randomOrder))
255 waypointSet =
new SCR_WaypointSet();
256 waypointSet.m_sName = name;
257 waypointSet.m_bCycleWaypoints = cycle;
258 waypointSet.m_bUseRandomOrder = randomOrder;
260 cycleWaypointSets.Insert(waypointSet);
273 protected void Convert(notnull array<IEntitySource> allEntitySources)
275 bool manageEditAction = SCR_WorldEditorToolHelper.BeginEntityAction();
276 WorldEditorAPI worldEditorAPI = SCR_WorldEditorToolHelper.GetWorldEditorAPI();
282 entity = worldEditorAPI.SourceToEntity(entitySource);
286 ancestor = entitySource.GetAncestor();
289 TryConvertSlot(entitySource);
296 TryAndConvertSlotWaypointGroups(entitySource);
300 SCR_WorldEditorToolHelper.EndEntityAction(manageEditAction);
305 protected void TryConvertSlot(notnull
IEntitySource entitySource)
311 for (
int i, count = entitySource.GetComponentCount(); i < count; i++)
313 componentSource = entitySource.GetComponent(i);
314 if (!componentSource)
317 if (componentSource.GetClassName() != BASE_SLOT_CLASSNAME)
320 if (!componentSource.Get(BASE_SLOT_FIELD, spawnedResourceName))
322 Print(
"Cannot obtain " + BASE_SLOT_FIELD +
" value",
LogLevel.WARNING);
326 if (spawnedResourceName.IsEmpty())
330 if (!resource.IsValid())
332 Print(
"Invalid resource " + spawnedResourceName,
LogLevel.WARNING);
336 resourceBaseContainer = resource.GetResource().ToBaseContainer();
337 if (!resourceBaseContainer)
339 Print(
"No base container for " + spawnedResourceName,
LogLevel.WARNING);
344 foreach (SCR_ScenarioFrameworkConversionPlugin_Rune rune : CONVERSION_TABLE)
348 if (ConvertSlotTo(entitySource, componentSource, rune))
350 Print(
"Successfully temp converted " + rune.m_sOldWaypointPrefab +
" to " + rune.m_sNewSlotPrefab,
LogLevel.NORMAL);
355 Print(
"Failed to convert " + rune.m_sOldWaypointPrefab +
" to " + rune.m_sNewSlotPrefab,
LogLevel.WARNING);
363 Print(
"Be sure to save, load the world and run the plugin's part two",
LogLevel.WARNING);
372 protected bool ConvertSlotTo(notnull
IEntitySource entitySource, notnull
IEntitySource componentSource, notnull SCR_ScenarioFrameworkConversionPlugin_Rune rune)
374 array<IEntityComponentSource> oldComponentSources = {};
375 for (
int i = entitySource.GetComponentCount() - 1; i >= 0; --i)
377 oldComponentSources.Insert(entitySource.GetComponent(i));
380 entitySource.SetAncestor(rune.m_sNewSlotPrefab);
381 if (entitySource.GetAncestor().GetResourceName() != rune.m_sNewSlotPrefab)
383 Print(
"Cannot change entitySource ancestor",
LogLevel.ERROR);
387 WorldEditorAPI worldEditorAPI = SCR_WorldEditorToolHelper.GetWorldEditorAPI();
388 string componentType = rune.m_ComponentType.ToString();
390 if (!newComponentSource)
392 Print(
"New component " + rune.m_ComponentType +
" was not found in the new ancestor",
LogLevel.ERROR);
396 if (!
SCR_EntitySourceHelper.CopyDataFromOldToNewComponent(entitySource, componentSource, entitySource, newComponentSource))
398 Print(
"Old data cannot be ported over to new component",
LogLevel.ERROR);
399 if (!worldEditorAPI.DeleteComponent(entitySource, newComponentSource))
400 Print(
"And the new component cannot be deleted - do it manually",
LogLevel.ERROR);
405 int newComponentId = -1;
406 for (
int i = entitySource.GetComponentCount() - 1; i >= 0; --i)
408 if (newComponentSource == entitySource.GetComponent(i))
415 if (newComponentId == -1)
417 Print(
"Cannot find the new component's id for path",
LogLevel.ERROR);
421 if (!worldEditorAPI.ClearVariableValue(entitySource, { new ContainerIdPathEntry(componentType, newComponentId) }, BASE_SLOT_FIELD))
423 Print(
"Cannot clear field, do it manually - " + BASE_SLOT_FIELD,
LogLevel.WARNING);
427 BaseContainer baseContainer = newComponentSource.GetObject(WAYPOINT_COMPONENT_FIELD);
435 string waypointClassname = ((
typename)rune.m_WaypointClassType).
ToString();
436 if (!worldEditorAPI.CreateObjectVariableMember(entitySource,
path, WAYPOINT_COMPONENT_FIELD, waypointClassname))
439 if (!worldEditorAPI.DeleteComponent(entitySource, newComponentSource))
440 Print(
"And the new component cannot be deleted - do it manually",
LogLevel.ERROR);
452 worldEditorAPI.DeleteComponent(entitySource, oldComponentSource);
461 protected void TryAndConvertSlotWaypointGroups(notnull
IEntitySource entitySource)
465 array<ref SCR_WaypointSet> waypointGroupNameSets;
468 WorldEditorAPI worldEditorAPI = SCR_WorldEditorToolHelper.GetWorldEditorAPI();
469 for (
int i, count = entitySource.GetComponentCount(); i < count; i++)
471 componentSource = entitySource.GetComponent(i);
472 if (!componentSource)
475 classname = componentSource.GetClassName();
476 if (!BASE_SLOTWP_CLASSNAMES.Contains(classname))
479 if (!componentSource.Get(BASE_SLOTWP_FIELD_FROM, waypointGroupNameSets))
482 if (!waypointGroupNameSets)
485 if (!componentSource.Get(BASE_SLOTWP_FIELD_TO, existingWaypointSet))
488 if (existingWaypointSet)
493 if (!worldEditorAPI.CreateObjectVariableMember(entitySource,
path, BASE_SLOTWP_FIELD_TO, WAYPOINT_CLASSNAME))
495 Print(
"Cannot create " + WAYPOINT_CLASSNAME +
" - " + entitySource.GetName(),
LogLevel.ERROR);
501 array<string> waypointNames = {};
502 foreach (
int j, SCR_WaypointSet waypointSet : waypointGroupNameSets)
504 if (waypointSet.m_sName)
506 if (waypointSet.m_bCycleWaypoints)
507 waypointNames.Insert(waypointSet.m_sName + CYCLE_SUFFIX);
509 waypointNames.Insert(waypointSet.m_sName);
513 if (!worldEditorAPI.SetVariableValue(entitySource,
path,
"m_aLayerName",
SCR_StringHelper.
Join(
",", waypointNames)))
515 Print(
"Cannot set waypoint name array values - " + entitySource.GetName(),
LogLevel.ERROR);
519 if (!worldEditorAPI.ClearVariableValue(entitySource, { new ContainerIdPathEntry(
"components", i) }, BASE_SLOTWP_FIELD_FROM))
520 componentSource.ClearVariable(BASE_SLOTWP_FIELD_FROM);
522 if (componentSource.Get(BASE_SLOTWP_FIELD_FROM, waypointGroupNameSets) && (!waypointGroupNameSets || !waypointGroupNameSets.IsEmpty()))
524 Print(
"Cannot clear previous waypoint set; do it manually - " + entitySource.GetName(),
LogLevel.WARNING);
534 protected void SCR_ScenarioFrameworkConversionPlugin_Phase1()
536 if (!CONVERSION_TABLE.IsEmpty())
539 array<ref SCR_ScenarioFrameworkConversionPlugin_Rune> runes = {
540 new SCR_ScenarioFrameworkConversionPlugin_Rune(
541 "{1B0E3436C30FA211}Prefabs/AI/Waypoints/AIWaypoint_Attack.et",
542 "{EBD91177954E8236}Prefabs/ScenarioFramework/Components/SlotWaypoint.et",
545 new SCR_ScenarioFrameworkConversionPlugin_Rune(
546 "{EAAE93F98ED5D218}Prefabs/AI/Waypoints/AIWaypoint_CaptureRelay.et",
547 "{EBD91177954E8236}Prefabs/ScenarioFramework/Components/SlotWaypoint.et",
550 new SCR_ScenarioFrameworkConversionPlugin_Rune(
551 "{93291E72AC23930F}Prefabs/AI/Waypoints/AIWaypoint_Defend.et",
552 "{EBD91177954E8236}Prefabs/ScenarioFramework/Components/SlotWaypoint.et",
555 new SCR_ScenarioFrameworkConversionPlugin_Rune(
556 "{2A81753527971941}Prefabs/AI/Waypoints/AIWaypoint_Defend_CP.et",
557 "{EBD91177954E8236}Prefabs/ScenarioFramework/Components/SlotWaypoint.et",
560 new SCR_ScenarioFrameworkConversionPlugin_Rune(
561 "{AAE8882E0DE0761A}Prefabs/AI/Waypoints/AIWaypoint_Defend_Hierarchy.et",
562 "{EBD91177954E8236}Prefabs/ScenarioFramework/Components/SlotWaypoint.et",
565 new SCR_ScenarioFrameworkConversionPlugin_Rune(
566 "{FAD1D789EE291964}Prefabs/AI/Waypoints/AIWaypoint_Defend_Large.et",
567 "{EBD91177954E8236}Prefabs/ScenarioFramework/Components/SlotWaypoint.et",
570 new SCR_ScenarioFrameworkConversionPlugin_Rune(
571 "{A33AF7FC5004F294}Prefabs/AI/Waypoints/AIWaypoint_Defend_Large_CO.et",
572 "{EBD91177954E8236}Prefabs/ScenarioFramework/Components/SlotWaypoint.et",
575 new SCR_ScenarioFrameworkConversionPlugin_Rune(
576 "{A0509D3C4DD4475E}Prefabs/AI/Waypoints/AIWaypoint_Follow.et",
577 "{EBD91177954E8236}Prefabs/ScenarioFramework/Components/SlotWaypoint.et",
580 new SCR_ScenarioFrameworkConversionPlugin_Rune(
581 "{06E1B6EBD480C6E0}Prefabs/AI/Waypoints/AIWaypoint_ForcedMove.et",
582 "{EBD91177954E8236}Prefabs/ScenarioFramework/Components/SlotWaypoint.et",
585 new SCR_ScenarioFrameworkConversionPlugin_Rune(
586 "{712F4795CF8B91C7}Prefabs/AI/Waypoints/AIWaypoint_GetIn.et",
587 "{EBD91177954E8236}Prefabs/ScenarioFramework/Components/SlotWaypoint.et",
590 new SCR_ScenarioFrameworkConversionPlugin_Rune(
591 "{B049D4C74FBC0C4D}Prefabs/AI/Waypoints/AIWaypoint_GetInNearest.et",
592 "{EBD91177954E8236}Prefabs/ScenarioFramework/Components/SlotWaypoint.et",
595 new SCR_ScenarioFrameworkConversionPlugin_Rune(
596 "{C40316EE26846CAB}Prefabs/AI/Waypoints/AIWaypoint_GetOut.et",
597 "{EBD91177954E8236}Prefabs/ScenarioFramework/Components/SlotWaypoint.et",
600 new SCR_ScenarioFrameworkConversionPlugin_Rune(
601 "{36ED7C150D5BB654}Prefabs/AI/Waypoints/AIWaypoint_Heal.et",
602 "{EBD91177954E8236}Prefabs/ScenarioFramework/Components/SlotWaypoint.et",
605 new SCR_ScenarioFrameworkConversionPlugin_Rune(
606 "{4ECD14650D82F5CA}Prefabs/AI/Waypoints/AIWaypoint_Loiter_CO.et",
607 "{EBD91177954E8236}Prefabs/ScenarioFramework/Components/SlotWaypoint.et",
610 new SCR_ScenarioFrameworkConversionPlugin_Rune(
611 "{750A8D1695BD6998}Prefabs/AI/Waypoints/AIWaypoint_Move.et",
612 "{EBD91177954E8236}Prefabs/ScenarioFramework/Components/SlotWaypoint.et",
615 new SCR_ScenarioFrameworkConversionPlugin_Rune(
616 "{97FB527ECC7CA49E}Prefabs/AI/Waypoints/AIWaypoint_ObservationPost.et",
617 "{EBD91177954E8236}Prefabs/ScenarioFramework/Components/SlotWaypoint.et",
620 new SCR_ScenarioFrameworkConversionPlugin_Rune(
621 "{1966BC58CE769D69}Prefabs/AI/Waypoints/AIWaypoint_OpenGate.et",
622 "{EBD91177954E8236}Prefabs/ScenarioFramework/Components/SlotWaypoint.et",
625 new SCR_ScenarioFrameworkConversionPlugin_Rune(
626 "{22A875E30470BD4F}Prefabs/AI/Waypoints/AIWaypoint_Patrol.et",
627 "{EBD91177954E8236}Prefabs/ScenarioFramework/Components/SlotWaypoint.et",
630 new SCR_ScenarioFrameworkConversionPlugin_Rune(
631 "{FBA8DC8FDA0E770D}Prefabs/AI/Waypoints/AIWaypoint_Patrol_Hierarchy.et",
632 "{EBD91177954E8236}Prefabs/ScenarioFramework/Components/SlotWaypoint.et",
635 new SCR_ScenarioFrameworkConversionPlugin_Rune(
636 "{A88F0B6CF25BD1DE}Prefabs/AI/Waypoints/AIWaypoint_Scout.et",
637 "{EBD91177954E8236}Prefabs/ScenarioFramework/Components/SlotWaypoint.et",
640 new SCR_ScenarioFrameworkConversionPlugin_Rune(
641 "{B3E7B8DC2BAB8ACC}Prefabs/AI/Waypoints/AIWaypoint_SearchAndDestroy.et",
642 "{EBD91177954E8236}Prefabs/ScenarioFramework/Components/SlotWaypoint.et",
645 new SCR_ScenarioFrameworkConversionPlugin_Rune(
646 "{04A06A6742FB0AF8}Prefabs/AI/Waypoints/AIWaypoint_UserAction.et",
647 "{EBD91177954E8236}Prefabs/ScenarioFramework/Components/SlotWaypoint.et",
650 new SCR_ScenarioFrameworkConversionPlugin_Rune(
651 "{531EC45063C1F57B}Prefabs/AI/Waypoints/AIWaypoint_Wait.et",
652 "{EBD91177954E8236}Prefabs/ScenarioFramework/Components/SlotWaypoint.et",
657 SCR_ArrayHelperRefT<SCR_ScenarioFrameworkConversionPlugin_Rune>.CopyReferencesFromTo(runes, CONVERSION_TABLE);
667 name:
"Scenario Framework 1.0.0 -> 1.1.0 Update - phase 2",
670 wbModules: {
"WorldEditor" },
671 awesomeFontCode: 0x0032,
672 description:
"This plugin updates Scenario Framework Slots from the old (1.0.0) to the new (1.1.0+) standard")]
673class SCR_ScenarioFrameworkConversionPlugin_Phase2 : WorkbenchPlugin
676 protected override void Run()
678 GetAllSlotWaypointWithTwoSlotWaypointComponentsAndRemoveUnsetOne();
683 protected void GetAllSlotWaypointWithTwoSlotWaypointComponentsAndRemoveUnsetOne()
685 WorldEditorAPI worldEditorAPI = SCR_WorldEditorToolHelper.GetWorldEditorAPI();
689 bool manageEditAction = SCR_WorldEditorToolHelper.BeginEntityAction();
694 array<IEntityComponentSource> sameComponents = {};
695 Debug.BeginTimeMeasure();
696 for (
int i, count = worldEditorAPI.GetEditorEntityCount(); i < count; i++)
698 entitySource = worldEditorAPI.GetEditorEntity(i);
702 ancestor = entitySource.GetAncestor();
706 if (entitySource.GetClassName() != SCR_ScenarioFrameworkConversionPlugin_Phase1.GENERIC_CLASSNAME)
709 if (!
SCR_BaseContainerTools.IsKindOf(ancestor, SCR_ScenarioFrameworkConversionPlugin_Phase1.SLOT_WAYPOINT_PREFAB))
713 sameComponents.Clear();
714 for (
int j, countJ = entitySource.GetComponentCount() - 1; j < countJ; j++)
716 componentSource = entitySource.GetComponent(j);
717 if (!componentSource)
720 if (componentSource.GetClassName() == SCR_ScenarioFrameworkConversionPlugin_Phase1.SLOT_WAYPOINT_COMPONENT_CLASSNAME)
723 sameComponents.Insert(componentSource);
731 componentSource = sameComponents[0];
733 if (componentSource.IsVariableSetDirectly(SCR_ScenarioFrameworkConversionPlugin_Phase1.WAYPOINT_COMPONENT_FIELD))
735 SCR_EntitySourceHelper.CopyDataFromOldToNewComponent(entitySource, componentSource, entitySource, componentSource2);
736 worldEditorAPI.DeleteComponent(entitySource, componentSource);
740 SCR_EntitySourceHelper.CopyDataFromOldToNewComponent(entitySource, componentSource2, entitySource, componentSource);
741 worldEditorAPI.DeleteComponent(entitySource, componentSource2);
746 Debug.EndTimeMeasure(
"Moving data from temp component to Prefab's component");
747 SCR_WorldEditorToolHelper.EndEntityAction(manageEditAction);
752class SCR_ScenarioFrameworkConversionPlugin_Rune
754 ResourceName m_sOldWaypointPrefab;
755 ResourceName m_sNewSlotPrefab;
756 typename m_ComponentType;
757 typename m_WaypointClassType;
766 void SCR_ScenarioFrameworkConversionPlugin_Rune(
767 ResourceName oldWaypointPrefab,
768 ResourceName newSlotPrefab,
769 typename componentType,
770 typename waypointClassType)
772 m_sOldWaypointPrefab = oldWaypointPrefab;
773 m_sNewSlotPrefab = newSlotPrefab;
774 m_ComponentType = componentType;
775 m_WaypointClassType = waypointClassType;
void ContainerIdPathEntry(string propertyName, int index=-1)
void SCR_ScenarioFrameworkSlotWaypoint(IEntityComponentSource src, IEntity ent, IEntity parent)
Object holding reference to resource. In destructor release the resource.
static string Join(string separator, notnull array< string > pieces, bool joinEmptyEntries=true)
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
LogLevel
Enum with severity of the logging message.
proto external string ToString()
Plain C++ pointer, no weak pointers, no memory management.