I already have a solution in place, but it's messy. I'd like to be able to dynamically change the research/train speed of a unique unit of a single unit type without changing it for the whole type.
My current solution is to have an ability that applies a buff behavior. The buff behavior increases the max energy (which starts at 0, and i don't need energy for anything else on the map) of the training unit (i.e. barracks) to the desired "training time", lets say 100. There is a validator that removes the behavior when the energy fills up and runs the final effect (i.e. creating a marine). Using energy I can give the barracks a stackable +1 to energy regen buff to modify how fast training occurs at that barracks.
Problem: in a perfect world I could just use either time scale or rate multiplier to use the queue for research and training and have the default progress bar function nicely, but the rate multiplier, as its name suggests, is multiplicative, and therefore, exponential when stacked. (i.e. when i want the unit to train 2 times as fast i can, but when i want it to train 3 times as fast, it goes 4 times as fast. when i want 5 times as fast it goes 16 times as fast.)
Is there an efficient way to do this without creating several different abilities/buffs/effects/upgrades to represent each level of speed i want?
[EDIT]
I may have found a working solution. I will implement it for now and see if it causes problems for my other map aspects. I created a veterancy that takes 1 xp per level and sets the queueable rate multiplier to the level. with this i can easily apply permanent and temporary multipliers as well as flat changes to the speed. I'll post back on my results.
@Photoloss: Go
I was real excited about that at first, and that's why I mentioned upgrades, the only problem is I also need to be able to remove the boost. It will change several times throughout a game, both up and down. Also, even though the number of unique units per type per player shouldn't be too large, it would still be rather messy to use upgrades. I'm stumped on finding a better way.
What's the context of this unit and what determines the training time? If it's a rare occurrence (town hall upgrade, tier/race changes in Footmen etc) you can probably get away with triggers to remove the upgrades. If it's meant to update constantly (+5% per hero level, -1% for every Pylon you build...) you should stick with the energy bar solution until you find a hardcoded rate adjustment method or make unique buffs for all cases.
I already have a solution in place, but it's messy. I'd like to be able to dynamically change the research/train speed of a unique unit of a single unit type without changing it for the whole type.
My current solution is to have an ability that applies a buff behavior. The buff behavior increases the max energy (which starts at 0, and i don't need energy for anything else on the map) of the training unit (i.e. barracks) to the desired "training time", lets say 100. There is a validator that removes the behavior when the energy fills up and runs the final effect (i.e. creating a marine). Using energy I can give the barracks a stackable +1 to energy regen buff to modify how fast training occurs at that barracks.
Problem: in a perfect world I could just use either time scale or rate multiplier to use the queue for research and training and have the default progress bar function nicely, but the rate multiplier, as its name suggests, is multiplicative, and therefore, exponential when stacked. (i.e. when i want the unit to train 2 times as fast i can, but when i want it to train 3 times as fast, it goes 4 times as fast. when i want 5 times as fast it goes 16 times as fast.)
Is there an efficient way to do this without creating several different abilities/buffs/effects/upgrades to represent each level of speed i want?
[EDIT]
I may have found a working solution. I will implement it for now and see if it causes problems for my other map aspects. I created a veterancy that takes 1 xp per level and sets the queueable rate multiplier to the level. with this i can easily apply permanent and temporary multipliers as well as flat changes to the speed. I'll post back on my results.
Since you mention Upgrades those can apply additive effects, the problem is you can't remove them without triggers.
@Photoloss: Go I was real excited about that at first, and that's why I mentioned upgrades, the only problem is I also need to be able to remove the boost. It will change several times throughout a game, both up and down. Also, even though the number of unique units per type per player shouldn't be too large, it would still be rather messy to use upgrades. I'm stumped on finding a better way.
What's the context of this unit and what determines the training time? If it's a rare occurrence (town hall upgrade, tier/race changes in Footmen etc) you can probably get away with triggers to remove the upgrades. If it's meant to update constantly (+5% per hero level, -1% for every Pylon you build...) you should stick with the energy bar solution until you find a hardcoded rate adjustment method or make unique buffs for all cases.
Catalog triggers are your best bet then.
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