I'm trying to find the most simple and least possibly-buggy solution that I could propose be used to patch the live game to make it such that SCVs that have been instructed to harvest from a Refinery do not count as Idle Workers.
Workers that are waiting their turn to mine at a mineral field don't count as Idle, so it's very strange that workers waiting for a refinery do.
I tried (and failed, probably due to my inexperience at the editor) to make SCVs channel an ability while waiting but this didn't work because the moment their current command is not a "harvest" command they cease mineral walking and this forces them apart from each other instead of staying stacked on the refinery
It may not be possible, but if it is I need to get my hands on a least impactful and bug-free solution because messing with workers in any future patch will be dangerous as hell
Explanation: Add a behaviour to workers that is disabled unless the worker is stationary, visible, trying to mine, and doesn't already have gas in its hands. This behaviour periodically checks if units that are touching the worker are valid to have a new ability cast on them (requires being a structure, owned by the player, that has gas, is still in progress of being built, and that the worker currently is trying to gather from). If valid, tell workers to add the new ability (validate they are not already using this new ability) to the front of their queue. This ability generates a channeled effect, and the channeling from this ability effect keeps the worker considered "non-idle". Use a periodic validator on this channeled effect to break out of the channel when the vespene structure is no longer considered in progress (completed or dead).
Behaviours
<!--Behaviour that periodically calls an Effect search-->
<CBehaviorBuffid="PeriodicRefineryCheck">
<InfoFlagsindex="Hidden"value="1"/>
<EditorCategoriesvalue="AbilityorEffectType:Units"/>
<DisableValidatorArrayvalue="WorkerIsHarvestingCombine"/>
<DisableValidatorArrayvalue="CasterIsStationary"/>
<DisableValidatorArrayvalue="CasterIsVisible"/>
<DisableValidatorArrayvalue="WorkerNotCarryingVespeneCombine"/>
<DisableValidatorArrayvalue="WorkerNoIdleChannelOrder"/>
<PeriodicEffectvalue="WorkerFindVespeneStructureStopIdle"/>
</CBehaviorBuff>
Effects
<!--Effects--><!--The Effect Search-->
<CEffectEnumAreaid="WorkerFindVespeneStructureStopIdle">
<EditorCategoriesvalue=""/>
<AreaArrayEffect="WorkerStartStopIdleAbility"/>
<SearchFlagsindex="ExtendByUnitRadius"value="1"/>
<SearchFlagsindex="SameCliff"value="1"/>
</CEffectEnumArea>
<!--Issue Order Effect that starts the Ability-->
<CEffectIssueOrderid="WorkerStartStopIdleAbility">
<EditorCategoriesvalue=""/>
<WhichUnitValue="Caster"/>
<Abilvalue="WorkerStopIdleAbilityVespene"/>
<CmdFlagsindex="Preempt"value="1"/>
<CmdFlagsindex="AutoQueued"value="1"/>
<TargetValue="TargetUnit"/>
</CEffectIssueOrder>
<!--The Effect (channeled) by the Ability-->
<CEffectCreatePersistentid="WorkerChannelStopIdle">
<ValidatorArrayvalue="HasVespene"/>
<ValidatorArrayvalue="WorkerNoIdleChannelOrder"/>
<ValidatorArrayvalue="WorkerCasterGatheringThisCombine"/>
<EditorCategoriesvalue=""/>
<WhichLocationValue="TargetUnit"/>
<Flagsindex="Channeled"value="1"/>
<Flagsindex="PersistUntilDestroyed"value="1"/>
<PeriodicValidatorvalue="IsUnderConstruction"/>
</CEffectCreatePersistent>
<!--Validators--><!--Validators confirming the target of the periodic search is the particular geyser the worker is going to mine from-->
<CValidatorUnitOrderQueueid="WorkerDroneGatheringThis">
<AbilLinkvalue="DroneHarvest"/>
<TargetValue="TargetUnit"/>
</CValidatorUnitOrderQueue>
<CValidatorUnitOrderQueueid="WorkerSCVGatheringThis">
<AbilLinkvalue="SCVHarvest"/>
<TargetValue="TargetUnit"/>
</CValidatorUnitOrderQueue>
<CValidatorUnitOrderQueueid="WorkerProbeGatheringThis">
<AbilLinkvalue="ProbeHarvest"/>
<TargetValue="TargetUnit"/>
</CValidatorUnitOrderQueue>
<CValidatorCombineid="WorkerCasterGatheringThisCombine">
<CombineArrayvalue="WorkerDroneGatheringThis"/>
<CombineArrayvalue="WorkerProbeGatheringThis"/>
<CombineArrayvalue="WorkerSCVGatheringThis"/>
</CValidatorCombine>
<!--Validator that makes sure the worker isn't already channeling before issuing a new channel order-->
<CValidatorUnitCompareOrderCountid="WorkerNoIdleChannelOrder">
<ResultNoUnitvalue="NotWhileOccupied"/>
<AbilLinkvalue="WorkerStopIdleAbilityVespene"/>
</CValidatorUnitCompareOrderCount>
<!--Validators that tell the Periodic Search Behaviour to disable itself unless the worker is mining. To be honest these could probably be cut out as it is my well-intentioned attempt to mitigate any performance impact by reducing the number of periodic searches... except doing multiple comparisons to enable/disable the ability may just have the same impact making it pointless -->
<CValidatorUnitCompareOrderCountid="WorkerIsDroneHarvesting">
<ResultFailedvalue="Error,Is Not Harvesting"/>
<AbilLinkvalue="DroneHarvest"/>
<Valuevalue="1"/>
</CValidatorUnitCompareOrderCount>
<CValidatorUnitCompareOrderCountid="WorkerIsProbeHarvesting">
<ResultFailedvalue="Error,Is Not Harvesting"/>
<AbilLinkvalue="ProbeHarvest"/>
<Valuevalue="1"/>
</CValidatorUnitCompareOrderCount>
<CValidatorUnitCompareOrderCountid="WorkerIsSCVHarvesting">
<ResultFailedvalue="Error,Is Not Harvesting"/>
<AbilLinkvalue="SCVHarvest"/>
<Valuevalue="1"/>
</CValidatorUnitCompareOrderCount>
<CValidatorCombineid="WorkerIsHarvestingCombine">
<CombineArrayvalue="WorkerIsDroneHarvesting"/>
<CombineArrayvalue="WorkerIsProbeHarvesting"/>
<CombineArrayvalue="WorkerIsSCVHarvesting"/>
</CValidatorCombine>
<!--Validators that prevent workers that already have gas from sitting uselessly waiting for a refinery to finish. To be honest these could probably be cut out as well. It's a nice little QoL that makes things feel polished to leave them in but it really is a lot of validators for pretty small impact so up to you-->
<CValidatorUnitCompareBehaviorCountid="WorkerNotCarryingRichVespeneProtoss">
<WhichUnitValue="Caster"/>
<Behaviorvalue="CarryHarvestableRichVespeneGeyserGasProtoss"/>
</CValidatorUnitCompareBehaviorCount>
<CValidatorUnitCompareBehaviorCountid="WorkerNotCarryingRichVespeneZerg">
<WhichUnitValue="Caster"/>
<Behaviorvalue="CarryHarvestableRichVespeneGeyserGasZerg"/>
</CValidatorUnitCompareBehaviorCount>
<CValidatorUnitCompareBehaviorCountid="WorkerNotCarryingRichVespeneTerran">
<WhichUnitValue="Caster"/>
<Behaviorvalue="CarryHarvestableVespeneGeyserGas"/>
</CValidatorUnitCompareBehaviorCount>
<CValidatorUnitCompareBehaviorCountid="WorkerNotCarryingVespeneProtoss">
<WhichUnitValue="Caster"/>
<Behaviorvalue="CarryHarvestableVespeneGeyserGasProtoss"/>
</CValidatorUnitCompareBehaviorCount>
<CValidatorUnitCompareBehaviorCountid="WorkerNotCarryingVespeneZerg">
<WhichUnitValue="Caster"/>
<Behaviorvalue="CarryHarvestableVespeneGeyserGasZerg"/>
</CValidatorUnitCompareBehaviorCount>
<CValidatorUnitCompareBehaviorCountid="WorkerNotCarryingVespeneTerran">
<WhichUnitValue="Caster"/>
<Behaviorvalue="CarryHarvestableVespeneGeyserGas"/>
</CValidatorUnitCompareBehaviorCount>
<CValidatorCombineid="WorkerNotCarryingVespeneCombine">
<Typevalue="And"/>
<CombineArrayvalue="WorkerNotCarryingRichVespeneProtoss"/>
<CombineArrayvalue="WorkerNotCarryingRichVespeneTerran"/>
<CombineArrayvalue="WorkerNotCarryingRichVespeneZerg"/>
<CombineArrayvalue="WorkerNotCarryingVespeneProtoss"/>
<CombineArrayvalue="WorkerNotCarryingVespeneTerran"/>
<CombineArrayvalue="WorkerNotCarryingVespeneZerg"/>
</CValidatorCombine>
Units
<!--Units (Workers need the ability and behaviour added)-->
<CUnitid="SCV">
<AbilArrayLink="WorkerStopIdleAbilityVespene"/>
<BehaviorArrayLink="PeriodicRefineryCheck"/>
</CUnit>
<CUnitid="Probe">
<AbilArrayLink="WorkerStopIdleAbilityVespene"/>
<BehaviorArrayLink="PeriodicRefineryCheck"/>
</CUnit>
<CUnitid="Drone">
<AbilArrayLink="WorkerStopIdleAbilityVespene"/>
<BehaviorArrayLink="PeriodicRefineryCheck"/>
</CUnit>
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I'm trying to find the most simple and least possibly-buggy solution that I could propose be used to patch the live game to make it such that SCVs that have been instructed to harvest from a Refinery do not count as Idle Workers.
Workers that are waiting their turn to mine at a mineral field don't count as Idle, so it's very strange that workers waiting for a refinery do.
I tried (and failed, probably due to my inexperience at the editor) to make SCVs channel an ability while waiting but this didn't work because the moment their current command is not a "harvest" command they cease mineral walking and this forces them apart from each other instead of staying stacked on the refinery
It may not be possible, but if it is I need to get my hands on a least impactful and bug-free solution because messing with workers in any future patch will be dangerous as hell
Tudo isto é de facto muito interessante. Obrigado ao autor do tópico.
I have made progress but I'm currently struggling to find how to validate an SCV's already-current order is aimed at a refinery rather than minerals.
Here is my solution:
Explanation: Add a behaviour to workers that is disabled unless the worker is stationary, visible, trying to mine, and doesn't already have gas in its hands. This behaviour periodically checks if units that are touching the worker are valid to have a new ability cast on them (requires being a structure, owned by the player, that has gas, is still in progress of being built, and that the worker currently is trying to gather from). If valid, tell workers to add the new ability (validate they are not already using this new ability) to the front of their queue. This ability generates a channeled effect, and the channeling from this ability effect keeps the worker considered "non-idle". Use a periodic validator on this channeled effect to break out of the channel when the vespene structure is no longer considered in progress (completed or dead).
Behaviours
Effects
Abilities
Validators
Units