This should help with simplifying the (un)placeable filtering again.
This is part of a slightly alternate proposal to D878 (though still with the same underlying logic).
Differential D933
Move formations/ templates to special/formations/. • leper on Sep 29 2017, 5:31 AM. Authored by
Details
This should help with simplifying the (un)placeable filtering again. This is part of a slightly alternate proposal to D878 (though still with the same underlying logic). Test if it works, as in test all things where formations are used and try if it still works.
Diff Detail
Event TimelineComment Actions Build is green Updating workspaces... Updating bundled third-party dependencies... FCollada/FCollada.cpp FCollada/FColladaPlugin.cpp FCollada/FCDocument/FCDAnimated.cpp FCollada/FCDocument/FCDAnimationChannel.cpp FCollada/FCDocument/FCDAnimationClip.cpp FCollada/FCDocument/FCDAnimationClipTools.cpp FCollada/FCDocument/FCDAnimation.cpp FCollada/FCDocument/FCDAnimationCurve.cpp FCollada/FCDocument/FCDAnimationCurveTools.cpp FCollada/FCDocument/FCDAnimationKey.cpp FCollada/FCDocument/FCDAnimationMultiCurve.cpp FCollada/FCDocument/FCDAsset.cpp FCollada/FCDocument/FCDCamera.cpp FCollada/FCDocument/FCDController.cpp FCollada/FCDocument/FCDControllerInstance.cpp FCollada/FCDocument/FCDControllerTools.cpp FCollada/FCDocument/FCDEffectCode.cpp FCollada/FCDocument/FCDEffect.cpp FCollada/FCDocument/FCDEffectParameter.cpp FCollada/FCDocument/FCDEffectParameterFactory.cpp FCollada/FCDocument/FCDEffectParameterSampler.cpp FCollada/FCDocument/FCDEffectParameterSurface.cpp FCollada/FCDocument/FCDEffectPass.cpp FCollada/FCDocument/FCDEffectPassShader.cpp FCollada/FCDocument/FCDEffectPassState.cpp FCollada/FCDocument/FCDEffectProfile.cpp FCollada/FCDocument/FCDEffectProfileFX.cpp FCollada/FCDocument/FCDEffectStandard.cpp FCollada/FCDocument/FCDEffectTechnique.cpp FCollada/FCDocument/FCDEffectTools.cpp FCollada/FCDocument/FCDEmitter.cpp FCollada/FCDocument/FCDEmitterInstance.cpp FCollada/FCDocument/FCDEmitterObject.cpp FCollada/FCDocument/FCDEmitterParticle.cpp FCollada/FCDocument/FCDEntity.cpp FCollada/FCDocument/FCDEntityInstance.cpp FCollada/FCDocument/FCDEntityReference.cpp FCollada/FCDocument/FCDExternalReferenceManager.cpp FCollada/FCDocument/FCDExtra.cpp FCollada/FCDocument/FCDForceDeflector.cpp FCollada/FCDocument/FCDForceDrag.cpp FCollada/FCDocument/FCDForceField.cpp FCollada/FCDocument/FCDForceGravity.cpp FCollada/FCDocument/FCDForcePBomb.cpp FCollada/FCDocument/FCDForceWind.cpp FCollada/FCDocument/FCDGeometry.cpp FCollada/FCDocument/FCDGeometryInstance.cpp FCollada/FCDocument/FCDGeometryMesh.cpp FCollada/FCDocument/FCDGeometryNURBSSurface.cpp FCollada/FCDocument/FCDGeometryPolygons.cpp FCollada/FCDocument/FCDGeometryPolygonsInput.cpp FCollada/FCDocument/FCDGeometryPolygonsTools.cpp FCollada/FCDocument/FCDGeometrySource.cpp FCollada/FCDocument/FCDGeometrySpline.cpp FCollada/FCDocument/FCDImage.cpp FCollada/FCDocument/FCDLibrary.cpp FCollada/FCDocument/FCDLight.cpp FCollada/FCDocument/FCDLightTools.cpp FCollada/FCDocument/FCDMaterial.cpp FCollada/FCDocument/FCDMaterialInstance.cpp FCollada/FCDocument/FCDMorphController.cpp FCollada/FCDocument/FCDObject.cpp FCollada/FCDocument/FCDObjectWithId.cpp FCollada/FCDocument/FCDocument.cpp FCollada/FCDocument/FCDocumentTools.cpp FCollada/FCDocument/FCDParameterAnimatable.cpp FCollada/FCDocument/FCDParticleModifier.cpp FCollada/FCDocument/FCDPhysicsAnalyticalGeometry.cpp FCollada/FCDocument/FCDPhysicsForceFieldInstance.cpp FCollada/FCDocument/FCDPhysicsMaterial.cpp FCollada/FCDocument/FCDPhysicsModel.cpp FCollada/FCDocument/FCDPhysicsModelInstance.cpp FCollada/FCDocument/FCDPhysicsRigidBody.cpp FCollada/FCDocument/FCDPhysicsRigidBodyInstance.cpp FCollada/FCDocument/FCDPhysicsRigidBodyParameters.cpp FCollada/FCDocument/FCDPhysicsRigidConstraint.cpp FCollada/FCDocument/FCDPhysicsRigidConstraintInstance.cpp FCollada/FCDocument/FCDPhysicsScene.cpp FCollada/FCDocument/FCDPhysicsShape.cpp FCollada/FCDocument/FCDPlaceHolder.cpp FCollada/FCDocument/FCDSceneNode.cpp FCollada/FCDocument/FCDSceneNodeIterator.cpp FCollada/FCDocument/FCDSceneNodeTools.cpp FCollada/FCDocument/FCDSkinController.cpp FCollada/FCDocument/FCDTargetedEntity.cpp FCollada/FCDocument/FCDTexture.cpp FCollada/FCDocument/FCDTransform.cpp FCollada/FCDocument/FCDVersion.cpp FCollada/FMath/FMAllocator.cpp FCollada/FMath/FMAngleAxis.cpp FCollada/FMath/FMColor.cpp FCollada/FMath/FMInterpolation.cpp FCollada/FMath/FMLookAt.cpp FCollada/FMath/FMMatrix33.cpp FCollada/FMath/FMMatrix44.cpp FCollada/FMath/FMQuaternion.cpp FCollada/FMath/FMRandom.cpp FCollada/FMath/FMSkew.cpp FCollada/FMath/FMVector3.cpp FCollada/FMath/FMVolume.cpp FCollada/FUtils/FUAssert.cp http://jenkins-master:8080/job/phabricator/2076/ for more details. Comment Actions Executing section Default... Executing section Source... Executing section JS... | | [NORMAL] ESLintBear (no-else-return): | | Unnecessary 'else' after 'return'. |----| | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 43| 43| return 1; | 44| 44| }, | 45| 45| EnableActiveQuery: function(id) { }, | 46| |- ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; }, | | 46|+ ResetActiveQuery: function(id) { if (mode == 0) return []; return [enemy]; }, | 47| 47| DisableActiveQuery: function(id) { }, | 48| 48| GetEntityFlagMask: function(identifier) { }, | 49| 49| }); binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 46| » » ResetActiveQuery:·function(id)·{·if·(mode·==·0)·return·[];·else·return·[enemy];·}, | | [NORMAL] JSHintBear: | | Use '===' to compare with '0'. binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 160| » if·(mode·==·0) | | [NORMAL] JSHintBear: | | Use '===' to compare with '0'. binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 229| » » » GetTurretParent:·function()·{·return·INVALID_ENTITY;·}, | | [NORMAL] JSHintBear: | | Don't make functions within a loop. binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 230| » » » GetPosition:·function()·{·return·new·Vector3D();·}, | | [NORMAL] JSHintBear: | | Don't make functions within a loop. binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 231| » » » GetPosition2D:·function()·{·return·new·Vector2D();·}, | | [NORMAL] JSHintBear: | | Don't make functions within a loop. binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 306| » for·(var·ent·of·unitAIs) | | [NORMAL] JSHintBear: | | 'ent' is already defined. binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 309| » for·(var·ent·of·unitAIs) | | [NORMAL] JSHintBear: | | 'ent' is already defined. binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 301| » » TS_ASSERT_EQUALS(unitAI.fsmStateName,·"INDIVIDUAL.COMBAT.ATTACKING"); | | [NORMAL] JSHintBear: | | 'unitAI' used out of scope. binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 310| » » TS_ASSERT_EQUALS(unitAI.fsmStateName,·"INDIVIDUAL.COMBAT.ATTACKING"); | | [NORMAL] JSHintBear: | | 'unitAI' used out of scope. binaries/data/mods/public/maps/random/danubius_triggers.js | 239| » if·(remainder·!=·0) | | [NORMAL] JSHintBear: | | Use '!==' to compare with '0'. binaries/data/mods/public/maps/random/danubius_triggers.js | 456| » if·(remainder·!=·0) | | [NORMAL] JSHintBear: | | Use '!==' to compare with '0'. binaries/data/mods/public/maps/random/danubius_triggers.js | 646| » » let·siegeEngines·=·attackers.filter(ent·=>·Engine.QueryInterface(ent,·IID_Identity).HasClass("Siege")); | | [NORMAL] JSHintBear: | | Don't make functions within a loop. binaries/data/mods/public/maps/random/danubius_triggers.js | 647| » » let·others·=·attackers.filter(ent·=>·siegeEngines.indexOf(ent)·==·-1); | | [NORMAL] JSHintBear: | | Don't make functions within a loop. binaries/data/mods/public/maps/random/danubius_triggers.js | 669| » if·(data.from·!=·0) | | [NORMAL] JSHintBear: | | Use '!==' to compare with '0'. binaries/data/mods/public/simulation/helpers/Commands.js | 901| » var·ids·=·[·id·for·(id·in·members)·]; | | [MAJOR] ESLintBear: | | Parsing error: Unexpected token for binaries/data/mods/public/simulation/helpers/Commands.js | 62| var·g_Commands·=·{ | | [NORMAL] JSHintBear: | | 'g_Commands' was used before it was defined. binaries/data/mods/public/simulation/helpers/Commands.js | 184| » » let·allowCapture·=·cmd.allowCapture·||·cmd.allowCapture·==·null; | | [NORMAL] JSHintBear: | | Use '===' to compare with 'null'. binaries/data/mods/public/simulation/helpers/Commands.js | 514| » » if·(notUngarrisoned·!=·0) | | [NORMAL] JSHintBear: | | Use '!==' to compare with '0'. binaries/data/mods/public/simulation/helpers/Commands.js | 528| » » » » ····&&·player·!=·+cmd.owner) | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/helpers/Commands.js | 716| » » » » var·cmpGUIInterface·=·Engine.QueryInterface(SYSTEM_ENTITY,·IID_GuiInterface); | | [NORMAL] JSHintBear: | | 'cmpGUIInterface' is already defined. binaries/data/mods/public/simulation/helpers/Commands.js | 901| » var·ids·=·[·id·for·(id·in·members)·]; | | [NORMAL] JSHintBear: | | 'array comprehension' is only available in Mozilla JavaScript extensions (use moz option). binaries/data/mods/public/simulation/helpers/Commands.js | 901| » var·ids·=·[·id·for·(id·in·members)·]; | | [NORMAL] JSHintBear: | | Expected 'for' and instead saw 'id'. binaries/data/mods/public/simulation/helpers/Commands.js | 951| » » for·(var·i·=·0;·i·<·length;·++i) | | [NORMAL] JSHintBear: | | 'i' is already defined. binaries/data/mods/public/simulation/helpers/Commands.js | 964| » » var·count·=·0; | | [NORMAL] JSHintBear: | | 'count' is already defined. binaries/data/mods/public/simulation/helpers/Commands.js |1111| » » var·cmpGuiInterface·=·Engine.QueryInterface(SYSTEM_ENTITY,·IID_GuiInterface); | | [NORMAL] JSHintBear: | | 'cmpGuiInterface' is already defined. binaries/data/mods/public/simulation/helpers/Commands.js |1275| » » » if·(!(i·==·0·&&·piece.template·==·cmd.wallSet.templates.tower·&&·!cmd.startSnappedEntity)) | | [NORMAL] JSHintBear: | | Use '===' to compare with '0'. binaries/data/mods/public/simulation/helpers/Commands.js |1363| » » var·piece·=·pieces[j]; | | [NORMAL] JSHintBear: | | 'piece' is already defined. binaries/data/mods/public/simulation/helpers/Commands.js |1392| » » » » if·(lastTowerControlGroup·!=·null·&&·lastTowerControlGroup·!=·INVALID_ENTITY) | | [NORMAL] JSHintBear: | | Use '!==' to compare with 'null'. binaries/data/mods/public/simulation/helpers/Commands.js |1447| » » var·cmpUnitAI·=·Engine.QueryInterface(ent,·IID_UnitAI); | | [NORMAL] JSHintBear: | | 'cmpUnitAI' is already defined. binaries/data/mods/public/simulation/helpers/Commands.js |1470| » if·(formedEnts.length·==·0) | | [NORMAL] JSHintBear: | | Use '===' to compare with '0'. binaries/data/mods/public/simulation/helpers/Commands.js |1487| » » » &&·cmpFormation.GetMemberCount()·==·formation.entities.length) | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/helpers/Commands.js |1502| » » for·(var·fid·in·formation.members) | | [NORMAL] JSHintBear: | | 'fid' is already defined. binaries/data/mods/public/simulation/helpers/Commands.js |1504| » » » var·cmpFormation·=·Engine.QueryInterface(+fid,·IID_Formation); | | [NORMAL] JSHintBear: | | 'cmpFormation' is already defined. binaries/data/mods/public/simulation/helpers/Commands.js |1521| » » » » » var·cmpUnitAI·=·Engine.QueryInterface(ent,·IID_UnitAI); | | [NORMAL] JSHintBear: | | 'cmpUnitAI' is already defined. binaries/data/mods/public/simulation/helpers/Commands.js |1544| » » » var·cmpFormation·=·Engine.QueryInterface(formationEnt,·IID_Formation); | | [NORMAL] JSHintBear: | | 'cmpFormation' is already defined. | | [NORMAL] ESLintBear (no-else-return): | | Unnecessary 'else' after 'return'. |----| | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js | 911| 911| this.FinishOrder(); | 912| 912| return; | 913| 913| } | 914| |- else | 915| |- { | | 914|+ | 916| 915| // Out of range; move there in formation | 917| 916| if (this.MoveToGarrisonRange(msg.data.target)) | 918| 917| { | 919| 918| this.SetNextState("GARRISON.APPROACHING"); | 920| 919| return; | 921| 920| } | 922| |- } | | 921|+ | 923| 922| } | 924| 923| | 925| 924| this.SetNextState("GARRISON.GARRISONING"); | | [NORMAL] ESLintBear (no-unneeded-ternary): | | Unnecessary use of boolean literals in conditional expression. |----| | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js |1958|1958| // TODO: we should probably only bother syncing projectile attacks, not melee |1959|1959| |1960|1960| // If using a non-default prepare time, re-sync the animation when the timer runs. |1961| |- this.resyncAnimation = (prepare != this.attackTimers.prepare) ? true : false; | |1961|+ this.resyncAnimation = (prepare != this.attackTimers.prepare); |1962|1962| |1963|1963| this.FaceTowardsTarget(this.order.data.target); |1964|1964| | | [NORMAL] ESLintBear (no-else-return): | | Unnecessary 'else' after 'return'. |----| | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js |2184|2184| this.PerformGather(nearby, false, false); |2185|2185| return true; |2186|2186| } |2187| |- else |2188| |- { | |2187|+ |2189|2188| // It's probably better in this case, to avoid units getting stuck around a dropsite |2190|2189| // in a "Target is far away, full, nearby are no good resources, return to dropsite" loop |2191|2190| // to order it to GatherNear the resource position. |2206|2205| return true; |2207|2206| } |2208|2207| } |2209| |- } | |2208|+ |2210|2209| return true; |2211|2210| } |2212|2211| return false; | | [NORMAL] ESLintBear (no-else-return): | | Unnecessary 'else' after 'return'. |----| | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js |2196|2196| this.GatherNearPosition(pos.x, pos.z, oldType, oldTemplate); |2197|2197| return true; |2198|2198| } |2199| |- else |2200| |- { | |2199|+ |2201|2200| // we're kind of stuck here. Return resource. |2202|2201| var nearby = this.FindNearestDropsite(oldType.generic); |2203|2202| if (nearby) |2205|2204| this.PushOrderFront("ReturnResource", { "target": nearby, "force": false }); |2206|2205| return true; |2207|2206| } |2208| |- } | |2207|+ |2209|2208| } |2210|2209| return true; |2211|2210| } | | [NORMAL] ESLintBear (no-unneeded-ternary): | | Unnecessary use of boolean literals in conditional expression. |----| | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js |2580|2580| this.StartTimer(prepare, this.healTimers.repeat); |2581|2581| |2582|2582| // If using a non-default prepare time, re-sync the animation when the timer runs. |2583| |- this.resyncAnimation = (prepare != this.healTimers.prepare) ? true : false; | |2583|+ this.resyncAnimation = (prepare != this.healTimers.prepare); |2584|2584| |2585|2585| this.FaceTowardsTarget(this.order.data.target); |2586|2586| }, | | [NORMAL] ESLintBear (no-unneeded-ternary): | | Unnecessary use of boolean literals in conditional expression. |----| | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js |3396|3396| |3397|3397| UnitAI.prototype.IsAnimal = function() |3398|3398| { |3399| |- return (this.template.NaturalBehaviour ? true : false); | |3399|+ return (!!this.template.NaturalBehaviour); |3400|3400| }; |3401|3401| |3402|3402| UnitAI.prototype.IsDangerousAnimal = function() | | [NORMAL] ESLintBear (no-else-return): | | Unnecessary 'else' after 'return'. |----| | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js |3715|3715| // Otherwise we've successfully processed a new order |3716|3716| return true; |3717|3717| } |3718| |- else |3719| |- { | |3718|+ |3720|3719| this.SetNextState("IDLE"); |3721|3720| |3722|3721| Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() }); |3737|3736| } |3738|3737| |3739|3738| return false; |3740| |- } | |3739|+ |3741|3740| }; |3742|3741| |3743|3742| /** | | [NORMAL] ESLintBear (no-multi-spaces): | | Multiple spaces found before 'Engine'. |----| | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js |4772|4772| // If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker |4773|4773| if (this.isGuardOf) |4774|4774| { |4775| |- var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI); | |4775|+ var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI); |4776|4776| var cmpAttack = Engine.QueryInterface(target, IID_Attack); |4777|4777| if (cmpUnitAI && cmpAttack && |4778|4778| cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type))) | | [NORMAL] ESLintBear (no-multi-spaces): | | Multiple spaces found before 'Engine'. |----| | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js |4819|4819| // If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker |4820|4820| if (this.isGuardOf) |4821|4821| { |4822| |- var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI); | |4822|+ var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI); |4823|4823| var cmpAttack = Engine.QueryInterface(target, IID_Attack); |4824|4824| if (cmpUnitAI && cmpAttack && |4825|4825| cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type))) | | [NORMAL] ESLintBear (no-else-return): | | Unnecessary 'else' after 'return'. |----| | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js |4993|4993| { |4994|4994| if (this.isGuardOf == target && this.order && this.order.type == "Guard") |4995|4995| return; |4996| |- else |4997| |- this.RemoveGuard(); | |4996|+ this.RemoveGuard(); |4998|4997| } |4999|4998| |5000|4999| this.AddOrder("Guard http://jenkins-master:8080/job/phabricator_lint/552/ for more details. Comment Actions
Comment Actions Sounds good. If we add a subdirectory to special/, having one for the player templates sounds appropriate too. Besides the danubius part, the patch doesn't look like it breaks mods, as every template access has a full path. Still some maintenance if they want to keep up. Perhaps someone should adopt DE before it completely falls apart. Comment Actions
We can do that afterwards, if someone wants to, might be nice to do that at a similar point in time as the gaia player addition (though can probably be done independently.
Well if some mod adds custom formations, or modifies the files that will break. Part of why I started updating that Changelog sometime ago to get to the point where we could outline modding related changes.
Feel free to help that one specific mod, I'll fix the others (or at least the subset of those I have access to. |