Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/components/UnitAI.js
Show First 20 Lines • Show All 2,713 Lines • ▼ Show 20 Lines | "REPAIR": { | ||||
this.StopMoving(); | this.StopMoving(); | ||||
let cmpBuilderList = QueryBuilderListInterface(this.repairTarget); | let cmpBuilderList = QueryBuilderListInterface(this.repairTarget); | ||||
if (cmpBuilderList) | if (cmpBuilderList) | ||||
cmpBuilderList.AddBuilder(this.entity); | cmpBuilderList.AddBuilder(this.entity); | ||||
this.FaceTowardsTarget(this.order.data.target); | this.FaceTowardsTarget(this.order.data.target); | ||||
this.SelectAnimation("build"); | let cmpIdentity = Engine.QueryInterface(this.order.data.target, IID_Identity); | ||||
this.SelectAnimation(cmpIdentity && cmpIdentity.HasClass("Field") ? "build_farm" : "build"); | |||||
elexis: that requires all building units to have build_farm animation? (fallback to default)
building… | |||||
StanUnsubmitted Not Done Inline ActionsYes it does, else it would default to idle, which is not ideal. Stan: Yes it does, else it would default to idle, which is not ideal. | |||||
ImarokAuthorUnsubmitted Done Inline Actionsyes, which will be the case after this revision. Imarok: yes, which will be the case after this revision.
But let's don't overcomplicate it. | |||||
elexisUnsubmitted Not Done Inline ActionsComplicating what exactly? The feature design or the code? Also Hardcoding template classes and template names is against the purpose of having template values in template files, not in the code. If the feature you want is having a specific build animation for a specific building chosen by the game designer, then implementing it only for the Field = build_farm pair is undercomplicating it. Just moving these two constants to template_unit.xml (or template_structure_resource_field.xml) should be achievable? elexis: Complicating what exactly? The feature design or the code? Also
there is a difference between… | |||||
this.StartTimer(1000, 1000); | this.StartTimer(1000, 1000); | ||||
return false; | return false; | ||||
}, | }, | ||||
"leave": function() { | "leave": function() { | ||||
let cmpBuilderList = QueryBuilderListInterface(this.repairTarget); | let cmpBuilderList = QueryBuilderListInterface(this.repairTarget); | ||||
if (cmpBuilderList) | if (cmpBuilderList) | ||||
cmpBuilderList.RemoveBuilder(this.entity); | cmpBuilderList.RemoveBuilder(this.entity); | ||||
▲ Show 20 Lines • Show All 3,354 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
that requires all building units to have build_farm animation? (fallback to default)
building-specific build animations sound like a feature that could be implemented in the templates for arbitrary classes.
Perhaps the Repairable template could store the actor animation to be chosen? Sounds weird, and it also wouldnt allow chosing a different animation per unit.
Otherwise the Builder template might store a pairs of classes and animations to remove the hardcoding.