Looking to have a structure that will consume one type of unit one at a time to train a new one (worker becomes warrior in this case)
I created a structure with an ability that autocasts to train a new unit, gave it a cargo space of 1 and created a trigger that kills the cargo unit when it starts training a new unit.
Problem is Im a noob with requirements and that my requirement/behavior/validator will not disable the ability when there are no units inside the cargo.
The train ability has a requirement HasCargoWarrior Use -> Behavior allowed "HasCargoTrainWarrior"
The behavior has a validator HasCargo
HasCargo Validator says : Compare: Equal To / Result-Failure: No Cargo to Unload / Validator Type: Load
I'm not sure how it can work if you have it on autocast. But when a unit is loaded you can issue an order to the structure to kill the unit and also train a new unit (Ability: Load Cargo Effect). That way a new unit will train for every unit loaded and there is no need for any confusing requirements. You also won't need any triggers. If you use one trigger you might as well all of them.
Thanks for the help, took a few attempts but validators were the way to go. Just using an effect means it won't train a unit when there is existing cargo, only upon the unit being loaded.
I created a behavior that disables the ability, validated by checking for no cargo
Also changed the trigger to kill the cargo unit upon completion of the unit being trained
So now it will train a single unit, but only while it has cargo.
Minor problem still; since I am not killing the unit right away, the player has +1 supply. I want to make it so that either the unit in the cargo space of the building is worth 0 supply, or that the new unit being trained does not take up supply until it has completed. Not sure how to do this.
Thanks again! Made a behavior that supresses food used when the building is loaded with cargo.
One final problem though, in this map I have two structures that are autocasting a train unit ability. One is the warrior hut from the above and the other is the worker hut. The worker hut is always autocasting, so the only thing that stops it is a supply cap.
Problem is that when the player is supply capped and sends a worker into the warrior hut to become a warrior, a new worker will be trained from a worker hut because the supply has dropped down for a brief moment. I want the Warrior hut's train ability to always be prioritized. I thought of a requirement that says warrior training must be queued, but that will disable it at all times and I want the player to be able to train both when supply is available. Best Unit flag does nothing... Maybe create a trigger that disabled the train worker while supply capped and adds a slight delay to re-enabling it? there has to be a more elegant way.
That's a bit of a catch-22, if the worker supply is only suppressed when the warrior is being trained, then the warrior training will never start because the player will remain supply capped. unless I am misunderstanding and I should make it so that the train ability suppresses the supply, and not the load ability? Although I think that would fall into the same problem.
Looking to have a structure that will consume one type of unit one at a time to train a new one (worker becomes warrior in this case)
I created a structure with an ability that autocasts to train a new unit, gave it a cargo space of 1 and created a trigger that kills the cargo unit when it starts training a new unit.
Problem is Im a noob with requirements and that my requirement/behavior/validator will not disable the ability when there are no units inside the cargo.
The train ability has a requirement HasCargoWarrior Use -> Behavior allowed "HasCargoTrainWarrior" The behavior has a validator HasCargo HasCargo Validator says : Compare: Equal To / Result-Failure: No Cargo to Unload / Validator Type: Load
Thanks in advance for any help!
@TheFish7: Go
I'm not sure how it can work if you have it on autocast. But when a unit is loaded you can issue an order to the structure to kill the unit and also train a new unit (Ability: Load Cargo Effect). That way a new unit will train for every unit loaded and there is no need for any confusing requirements. You also won't need any triggers. If you use one trigger you might as well all of them.
There are validators that allow you to look at the cargo of transports directly.
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
Thanks for the help, took a few attempts but validators were the way to go. Just using an effect means it won't train a unit when there is existing cargo, only upon the unit being loaded.
I created a behavior that disables the ability, validated by checking for no cargo Also changed the trigger to kill the cargo unit upon completion of the unit being trained
So now it will train a single unit, but only while it has cargo.
Minor problem still; since I am not killing the unit right away, the player has +1 supply. I want to make it so that either the unit in the cargo space of the building is worth 0 supply, or that the new unit being trained does not take up supply until it has completed. Not sure how to do this.
There is a Supress Food Used flag that buffs can apply
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
Thanks again! Made a behavior that supresses food used when the building is loaded with cargo.
One final problem though, in this map I have two structures that are autocasting a train unit ability. One is the warrior hut from the above and the other is the worker hut. The worker hut is always autocasting, so the only thing that stops it is a supply cap.
Problem is that when the player is supply capped and sends a worker into the warrior hut to become a warrior, a new worker will be trained from a worker hut because the supply has dropped down for a brief moment. I want the Warrior hut's train ability to always be prioritized. I thought of a requirement that says warrior training must be queued, but that will disable it at all times and I want the player to be able to train both when supply is available. Best Unit flag does nothing... Maybe create a trigger that disabled the train worker while supply capped and adds a slight delay to re-enabling it? there has to be a more elegant way.
Try only supressing the worker supply when the warrior is actually being trained?
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
That's a bit of a catch-22, if the worker supply is only suppressed when the warrior is being trained, then the warrior training will never start because the player will remain supply capped. unless I am misunderstanding and I should make it so that the train ability suppresses the supply, and not the load ability? Although I think that would fall into the same problem.
Then you will need some global search to cancel a few random trainings.
Else add an intermediate dummy that compared supply adds the hide supply buff and then orders the train.
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