I want to create an ability for a unit that has veterancy. When I click the button on the unit I need it to find a nearby Barracks, walk over to it and become hidden (as I'd prefer to not give the Barracks the functionality of having cargo). Once the unit is hidden that should queue off a training unit in the Barracks. If the training is canceled the hidden unit should be revealed again, otherwise, once the training is complete the hidden unit can be destroyed and the new unit should be the same level as the old one.
I'm not really sure if there are any abilities in the game that I should be using for guidance. I think I'm going to try to use the Set Unit Property trigger to try and transfer the experience from the original unit to the new one but I haven't figure out what the proper event should be yet.
This is how I'm thinking to start off this ability (but it seems very inefficient):
Ability - Effect-Instant -> Effect - Apply Behavior (a buff to mark that unit for a search by the barracks) -> Behavior - Buff -> Effect - Search Area (find nearest barracks) -> Effect - Issue Order (move to barracks) -> Effect - Apply Behavior (on the barracks) -> Behavior - Buff -> Effect - Search Area (periodically searching for the unit with the buff within a radius of 1) -> Effect - Modify Unit (hide unit) -> Effect - Set: Remove Behavior (the buff on the barracks) and Issue Order (train the new unit) -> somehow catch when the trained unit is complete to set off the event for the Set Unit Property trigger and destroy the old unit
and that's as far as I've gotten but I'm sure I'm doing it wrong.
I would go effect - instant -> search area (with a max count of 1) -> apply behavior (to target) -> buff (that is removed by validators when the unit is close and uses a periodic -> issue order (caster to source move ability) and an expire effect -> Set effect which in turn has an -> issue order (to start training the unit) and -> apply behavior (to caster)]) ->buff (uses the no draw flag and a load more to make uncommandable and untargetable, is validated that the target of first apply behaviour of ability has unit queued using a Unit Order Queue validator).
All effects from the first buff and the buff itself are validated for the unit being ordered to move to the barracks and not a target unit/point that is not the target of the first apply behavior of the ability (combine of a Location Type, a Unit Order Queue and Unit Type validator). This will allow the ability to be canceled before the unit reached the barracks.
Wasn't able to work on this yesterday but I spent several hours today on it (about to head to bed right now actually :P). I got the majority of what you wrote to work except for the validators (not including the first one). So when the ability is activated the search effect applies a buff on the barracks that tells the unit to move to it, when the unit reaches the barracks the buff gets removed, the barracks starts training and a new buff is applied to the original unit (the caster).
is validated that the target of first apply behaviour of ability has unit queued using a Unit Order Queue validator)
I messed around with both the Unit Order and Unit Order Queue validators and I partially got it to work. It seems to recognize that the appropriate unit is being trained in the barracks but even though I have the validator in the "Behavior: Validators (Remove) +" field it never seems to be considered false except when I Lift Off the barracks, only then does it finally remove the buff.
And then lastly, I read the Wiki page on the Location Type validator, but I'm still pretty confused as to how I'm supposed to set up the last three validators you had mentioned, but I didn't even get around to testing them though.
If I only had half of your experience with the editor I could be flying through this project :P Thanks for all the help Doc.
Set the Validator - Ability to your Train type ability, the Validator - Ability Command to the slot of your unit, the Validator - Unit - Effect set to the first Apply Behavior effect of your ability and the Validator - Unit - Value set to target.
With the second one set the Combine to AND logic , the Unit Order Queue is the Move ability from the caster ot the target, the Unit Type validator is set to the type of unit that the ability targets. The Location Point validator needs exta validators in the Validator - Point and Validator - Unit fields to specify the point or unit is the target unit of the ability. That way if the unit is ordered to any other unit or point other than the target ability the Combine validator returns false.
Rollback Post to RevisionRollBack
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
Set the Validator - Ability to your Train type ability, the Validator - Ability Command to the slot of your unit, the Validator - Unit - Effect set to the first Apply Behavior effect of your ability and the Validator - Unit - Value set to target.
Yeah, this is exactly what I did except for the Validator - Unit - Effect set to the first behavior, but I added that now and I get the same results. It doesn't validate as true with Unit Order Queue and with Unit Order it doesn't produce a false even when the unit is canceled in the barracks.
The Location Point validator needs exta validators in the Validator - Point and Validator - Unit fields to specify the point or unit is the target unit of the ability.
I put a Unit Type validator with a value of "Barracks" in the Validator - Unit field and left the Validator - Point field with (none) since the location is a unit, correct? And then I put the Unit Order Queue (with the Move ability, and Unit Value set to Caster and Target Value set to Target Unit) and the Location Point validators in the Combine (with Type set to AND).
Now you said to stick this into all the effects after and including the first buff that gets applied, but isn't it this first buff that tells the unit to start moving to the barracks, so if I put the validator on the Buff or the Issue Order (move) effect, they're not going to validate as true because they haven't happened yet? I could create a duplicate Buff though that wasn't validated and could have a duration of 0.01 seconds and switch its Final - Effect to apply the original buff. Again my idea of a solution feels so sloppy :P but I tested it and it does work.
True, only test I have performed used an ennumerate area validator that had that stuff. Only location point validator I used was to disable the one backup system.
Rollback Post to RevisionRollBack
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
So, but what about the Unit Order validator, any ideas how to make it produce a false when the training unit is canceled in the barracks to make the caster re-appear?
Well to use a tried and proven method. Use an Enumerate Area validator with a short range that checks for a single barracks via the Unit Type validator and that then checks if it is training the unit via a Unit Order Queue validator.
Here is the latest verion of my harvest simulation map (unfinished). This is as far as my testing went in that direction.
OK, so actually a Unit Compare Order Count validator worked properly to check if a specific unit was being trained in the barracks. *Sigh* this editor... hehe. I'm going to go ahead and call this one solved as you helped me with everything I initially posted. Thanks again DrSuperEvil.
And for anyone that's curious, I also allowed the first buff that this ability applies to receive up to 5 stacks. This fixed a problem I had with multiple units attempting to use this ability. So now every unit that reaches the barracks will remove one stack of this buff, each one triggering the Final Effect, allowing five units to be properly queued up to train in the barracks.
My next task is to try and match up the queued unit with its appropriate caster. This way when I cancel the third unit queued in the barracks, only the third caster to reach the barracks will be revealed, instead of having to remove all units from the queue to then simultaneously reveal all the casters.
I want to create an ability for a unit that has veterancy. When I click the button on the unit I need it to find a nearby Barracks, walk over to it and become hidden (as I'd prefer to not give the Barracks the functionality of having cargo). Once the unit is hidden that should queue off a training unit in the Barracks. If the training is canceled the hidden unit should be revealed again, otherwise, once the training is complete the hidden unit can be destroyed and the new unit should be the same level as the old one.
I'm not really sure if there are any abilities in the game that I should be using for guidance. I think I'm going to try to use the Set Unit Property trigger to try and transfer the experience from the original unit to the new one but I haven't figure out what the proper event should be yet.
This is how I'm thinking to start off this ability (but it seems very inefficient):
Ability - Effect-Instant -> Effect - Apply Behavior (a buff to mark that unit for a search by the barracks) -> Behavior - Buff -> Effect - Search Area (find nearest barracks) -> Effect - Issue Order (move to barracks) -> Effect - Apply Behavior (on the barracks) -> Behavior - Buff -> Effect - Search Area (periodically searching for the unit with the buff within a radius of 1) -> Effect - Modify Unit (hide unit) -> Effect - Set: Remove Behavior (the buff on the barracks) and Issue Order (train the new unit) -> somehow catch when the trained unit is complete to set off the event for the Set Unit Property trigger and destroy the old unit
and that's as far as I've gotten but I'm sure I'm doing it wrong.
I would go effect - instant -> search area (with a max count of 1) -> apply behavior (to target) -> buff (that is removed by validators when the unit is close and uses a periodic -> issue order (caster to source move ability) and an expire effect -> Set effect which in turn has an -> issue order (to start training the unit) and -> apply behavior (to caster)]) ->buff (uses the no draw flag and a load more to make uncommandable and untargetable, is validated that the target of first apply behaviour of ability has unit queued using a Unit Order Queue validator).
All effects from the first buff and the buff itself are validated for the unit being ordered to move to the barracks and not a target unit/point that is not the target of the first apply behavior of the ability (combine of a Location Type, a Unit Order Queue and Unit Type validator). This will allow the ability to be canceled before the unit reached the barracks.
to be continued.
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
Wasn't able to work on this yesterday but I spent several hours today on it (about to head to bed right now actually :P). I got the majority of what you wrote to work except for the validators (not including the first one). So when the ability is activated the search effect applies a buff on the barracks that tells the unit to move to it, when the unit reaches the barracks the buff gets removed, the barracks starts training and a new buff is applied to the original unit (the caster).
I don't know where the "no draw" or the "load more" flags are. Or are these effects that the buff should be initiating?
I messed around with both the Unit Order and Unit Order Queue validators and I partially got it to work. It seems to recognize that the appropriate unit is being trained in the barracks but even though I have the validator in the "Behavior: Validators (Remove) +" field it never seems to be considered false except when I Lift Off the barracks, only then does it finally remove the buff.
And then lastly, I read the Wiki page on the Location Type validator, but I'm still pretty confused as to how I'm supposed to set up the last three validators you had mentioned, but I didn't even get around to testing them though.
If I only had half of your experience with the editor I could be flying through this project :P Thanks for all the help Doc.
@LostMapmaker: Go
I said "a load more", in english that means several other.
http://www.sc2mapster.com/wiki/galaxy/data/behaviors/buff/
Set the Validator - Ability to your Train type ability, the Validator - Ability Command to the slot of your unit, the Validator - Unit - Effect set to the first Apply Behavior effect of your ability and the Validator - Unit - Value set to target.
With the second one set the Combine to AND logic , the Unit Order Queue is the Move ability from the caster ot the target, the Unit Type validator is set to the type of unit that the ability targets. The Location Point validator needs exta validators in the Validator - Point and Validator - Unit fields to specify the point or unit is the target unit of the ability. That way if the unit is ordered to any other unit or point other than the target ability the Combine validator returns false.
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
Yeah, this is exactly what I did except for the Validator - Unit - Effect set to the first behavior, but I added that now and I get the same results. It doesn't validate as true with Unit Order Queue and with Unit Order it doesn't produce a false even when the unit is canceled in the barracks.
I put a Unit Type validator with a value of "Barracks" in the Validator - Unit field and left the Validator - Point field with (none) since the location is a unit, correct? And then I put the Unit Order Queue (with the Move ability, and Unit Value set to Caster and Target Value set to Target Unit) and the Location Point validators in the Combine (with Type set to AND).
Now you said to stick this into all the effects after and including the first buff that gets applied, but isn't it this first buff that tells the unit to start moving to the barracks, so if I put the validator on the Buff or the Issue Order (move) effect, they're not going to validate as true because they haven't happened yet? I could create a duplicate Buff though that wasn't validated and could have a duration of 0.01 seconds and switch its Final - Effect to apply the original buff. Again my idea of a solution feels so sloppy :P but I tested it and it does work.
True, only test I have performed used an ennumerate area validator that had that stuff. Only location point validator I used was to disable the one backup system.
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
@DrSuperEvil: Go
So, but what about the Unit Order validator, any ideas how to make it produce a false when the training unit is canceled in the barracks to make the caster re-appear?
Well to use a tried and proven method. Use an Enumerate Area validator with a short range that checks for a single barracks via the Unit Type validator and that then checks if it is training the unit via a Unit Order Queue validator.
Here is the latest verion of my harvest simulation map (unfinished). This is as far as my testing went in that direction.
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
@DrSuperEvil: Go
OK, so actually a Unit Compare Order Count validator worked properly to check if a specific unit was being trained in the barracks. *Sigh* this editor... hehe. I'm going to go ahead and call this one solved as you helped me with everything I initially posted. Thanks again DrSuperEvil.
And for anyone that's curious, I also allowed the first buff that this ability applies to receive up to 5 stacks. This fixed a problem I had with multiple units attempting to use this ability. So now every unit that reaches the barracks will remove one stack of this buff, each one triggering the Final Effect, allowing five units to be properly queued up to train in the barracks.
My next task is to try and match up the queued unit with its appropriate caster. This way when I cancel the third unit queued in the barracks, only the third caster to reach the barracks will be revealed, instead of having to remove all units from the queue to then simultaneously reveal all the casters.
The problem with stacked buffs is that the first unit to apply the buff is known as the caster for all stacks.
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