Is there a way to create a validator that checks the behavior stacks of the creator of the unit?
The long story:
I'm using a Arm Magazine ability to spawn units with veterancy levels from a building with veterancy levels. I'm trying to get those levels to translate to the spawned units. Example: a level 2 gateway spawns level 2 zealots.
Currently, I have a set of effects that are applied to the spawned units, one for each level increase (basically +1 xp each). It obviously fires all the effects as the set when the unit is spawned and they all come out at max level regardless of the level of the structure. I wanted to create validators for each individual effect to check the level of the building spawning the units.
Unless by lvl you mean a seperate unit it is not so simple to do with data since the ammo units are known as their own casters. Only way I can think of is to link them using a forwards and reverse peristent effects (the reverse can then be validated for levels of the host unit and modify the levels of the ammo units using a modify unit effect).
Rollback Post to RevisionRollBack
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
Right now I limit the number of ammo units produced at one time with a requirement similar to the Carrier.
I'd like to increase that number depending on the level of the building, but can't copy the Carrier's upgrade since I'm wanting it per unit instead of the Catalog.
Then that can be done with a requirement just compare the number of ammo units completed at unit (like the carrier) compared to some function of the count behavior (your veterancy) completed at unit instead of a constant.
Using the Arm Interceptor requirement as a basis you could get this expression: CountUnit(Interceptor,QueuedOrBetterAtUnit) < {Carrier must have fewer than 8 Interceptors}(4 + ((2 + CountBehavior(CBehaviorVeterancy,CompleteOnlyAtUnit)) / 2)) which would give 5 interceptors at level 0 and +1 every two levels. In short 4 + [(2+level)/2].
What I tried for the levels is having a Validator for each level 1-5 that did CountBehavior(CBehaviorVeterancy,CompleteOnlyAtUnit) > X and had a Switch Effect with fall through that would each add a level to the spawned unit for every one that met each validator.
The problem is, the Caster target for the Launch effect on the Arm Magazine doesn't correspond with the unit that has the ability, so the validators in the Switch always fail.
With the launch effects the ammo units are known as the casters. The only way around this is to have a launch effect that does a Search Area effect (low radius) with a validator for Unit Type (for the host unit) that then applies a Create Persistent effect with the Persist Until Destroyed flag from the Caster to the target. This persistent effect then applies another Create Persistent effect from the source (the host unit) to the caster (the ammo unit) which can then be validated.
Rollback Post to RevisionRollBack
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
The short of it:
Is there a way to create a validator that checks the behavior stacks of the creator of the unit?
The long story:
I'm using a Arm Magazine ability to spawn units with veterancy levels from a building with veterancy levels. I'm trying to get those levels to translate to the spawned units. Example: a level 2 gateway spawns level 2 zealots.
Currently, I have a set of effects that are applied to the spawned units, one for each level increase (basically +1 xp each). It obviously fires all the effects as the set when the unit is spawned and they all come out at max level regardless of the level of the structure. I wanted to create validators for each individual effect to check the level of the building spawning the units.
Unless there is a better way to go about this?
Side note: it's extremely simple to set up through a trigger:
Event: - Any Unit creates a unit with ability SpawningBuilding (Magazine) or behavior No Game Link
Actions: - Unit - Set (Created Unit) Experience to (Real((Stack count of SpawningBuildingVeterancy on (Triggering Unit))))
However, I'd REALLY like to keep it in the data editor (and learn more about effects and validators)
Unless by lvl you mean a seperate unit it is not so simple to do with data since the ammo units are known as their own casters. Only way I can think of is to link them using a forwards and reverse peristent effects (the reverse can then be validated for levels of the host unit and modify the levels of the ammo units using a modify unit effect).
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg
Slightly different question:
Right now I limit the number of ammo units produced at one time with a requirement similar to the Carrier.
I'd like to increase that number depending on the level of the building, but can't copy the Carrier's upgrade since I'm wanting it per unit instead of the Catalog.
Is there an easy way to do this?
Then that can be done with a requirement just compare the number of ammo units completed at unit (like the carrier) compared to some function of the count behavior (your veterancy) completed at unit instead of a constant.
Using the Arm Interceptor requirement as a basis you could get this expression: CountUnit(Interceptor,QueuedOrBetterAtUnit) < {Carrier must have fewer than 8 Interceptors}(4 + ((2 + CountBehavior(CBehaviorVeterancy,CompleteOnlyAtUnit)) / 2)) which would give 5 interceptors at level 0 and +1 every two levels. In short 4 + [(2+level)/2].
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg
Got that working with ammo requirements.
What I tried for the levels is having a Validator for each level 1-5 that did CountBehavior(CBehaviorVeterancy,CompleteOnlyAtUnit) > X and had a Switch Effect with fall through that would each add a level to the spawned unit for every one that met each validator.
The problem is, the Caster target for the Launch effect on the Arm Magazine doesn't correspond with the unit that has the ability, so the validators in the Switch always fail.
With the launch effects the ammo units are known as the casters. The only way around this is to have a launch effect that does a Search Area effect (low radius) with a validator for Unit Type (for the host unit) that then applies a Create Persistent effect with the Persist Until Destroyed flag from the Caster to the target. This persistent effect then applies another Create Persistent effect from the source (the host unit) to the caster (the ammo unit) which can then be validated.
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg