Thanks for the reply anyways. But yeah, I know I could do it with a global variable, but that would be really sketchy with multiple units being trained by various players on the map. So instead I was trying to grab the "triggering unit" reference from two separate events, and I assume that would have to mean from two separate triggers.
It would be nice to figure out how to link two triggers together in this way, but I did manage to pull off what I wanted by applying a behavior to the newly created unit that searches for a hidden unit and targets it with a dummy ability. This way the two units are linked and I have a trigger go off when that ability is used and I transfer the experience there. It doesn't work well when there are multiple units being trained at one barracks, as it may grab the wrong hidden unit. So I'm trying to figure out a work around for that too now.
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.
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?
So I have an ability that causes the casting unit to walk to a barracks, become hidden and cause the barracks to start training a unit. Both the casting unit and the new unit being trained inside the barracks have Veterancy. What I need is for the newly trained unit to match the amount of experience the casting unit has.
Essentially all I need is to figure out how to reference the completed unit at the end of my ability's effect chain within the trigger, to give it the experience, just not sure how.
My best guess right now would be to create two triggers, one that goes off when "any unit uses myAbility at generic3 - execute stage (ignore shared abilities)", storing how much experience the triggering unit has in a local variable, and then the action would be to wait for a second trigger to go off which would occur when "any unit training progress is completed". Then back in the original trigger, this would be where I would set triggering progress unit *of Trigger 2* experience to my local variable.
But I don't know if this double trigger thing is even possible, or hopefully there's a more efficient way of doing what I need.
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.
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.
The thing is my abilities sometimes learn it around 2,3,6,9 which i wanted to be like 1,3,5,7
And it sounds to me you don't want the player to be able to learn rank 1 at any other level besides level 1? Because in WC3 you could learn rank 1 at any level, rank 2 at any level above level 3, etc., meaning you can learn a rank 1 ability at level 2. But if this is not what you want then you need to make sure that the "Level1" behavior is removed from the unit as soon it gains the "Level2" behavior.
Anyways, if that doesn't work, I don't know. Best of luck to you.
From my understanding (which isn't much) is that that function is intended to count a behavior obviously, so the piece of code I have quoted from you is going to essentially turn into an integer, but you don't have any operators (+, /, <, ==) next to it, so that part is written incorrectly. I also see you have written there "Level1" as your behavior, do you have a separate behavior for every level? If that's the case then you'd have to write > 0 following every CountBehavior() function you have. At that point it would probably work, or you may need to add an extra set of parenthesis around each set of functions combined by your && operators.
However, the editor already has a Veterancy behavior which is a whole leveling up system you can add to your units, instead of creating your own behaviors. If you were to use the Veterancy behavior your code could instead look something like this:
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.
Issue Order effect, wow how did I miss that :D That solved it, and in such a better fashion than having to put a switch effect into every weapon that I wanted to be able to utilize this buff. And in case anyone wants to know, the only other tweak I had to make was to add a validator to the Issue Order "Attack" effect, that validated that the Source unit was attacking, otherwise the buff would attempt to perpetually override any other command given to the unit.
I tried using a trigger to "Make (Damaging unit) face (Position of (Triggering unit)) over 0.1 seconds, and loop that every .05 seconds for about 17 iterations which would approximately be the cooldown period for the marine's attack, and I tried fiddling with these numbers but the whole thing still looks very clunky and this trigger also interferes with giving the units a new command.
I've seen the AI in the campaign switch to my low health units before, so I know the functionality is in here somewhere, just don't know why everything has to be so impossible to find :\ Thanks in advance for any help/suggestions!
Ah, thank you Ahli. I wasn't sure how to properly work with the Signal events but since I wanted it this change to occur when the marine got to level 3 I used the BehaviorLevel event and it worked out perfectly! I'm still obviously new to the editor, I should've thought of swapping the actor or just a plain 'ol morph. Thank you again!
I've managed to uncover the combat shield on a single marine when it reaches level 3 of the built-in veterancy behavior through a trigger. What I'd like to do now is compliment this by also changing the triggering unit's wireframe and group icon to the appropriate image (Assets\Textures\wireframe-terran-marine-shield.dds).
After hours of searching, the best answer I found on the web was from a forum post by blizzard (http://us.battle.net/sc2/en/forum/topic/2674992430) stating, "You can dynamically change the Actor's wireframe using upgrades or the Catalog Field Value Set trigger. We'll look into reusing the Upgrade UI for this trigger, which will allow you to easily see which fields can be changed."
Which only leaves me with another set of problems: 1) I am pretty certain that upgrades will affect all marines and I don't know if Catalog Field Value Set will work any differently, and more importantly, 2) I can't figure out how to even use the Catalog Field Value Set function.
So if anyone can help me solve this problem by whatever method, I would be greatly appreciative!
0
@Yaksmanofage: Go
Thanks for the reply anyways. But yeah, I know I could do it with a global variable, but that would be really sketchy with multiple units being trained by various players on the map. So instead I was trying to grab the "triggering unit" reference from two separate events, and I assume that would have to mean from two separate triggers.
It would be nice to figure out how to link two triggers together in this way, but I did manage to pull off what I wanted by applying a behavior to the newly created unit that searches for a hidden unit and targets it with a dummy ability. This way the two units are linked and I have a trigger go off when that ability is used and I transfer the experience there. It doesn't work well when there are multiple units being trained at one barracks, as it may grab the wrong hidden unit. So I'm trying to figure out a work around for that too now.
0
@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.
0
@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?
0
So I have an ability that causes the casting unit to walk to a barracks, become hidden and cause the barracks to start training a unit. Both the casting unit and the new unit being trained inside the barracks have Veterancy. What I need is for the newly trained unit to match the amount of experience the casting unit has.
Essentially all I need is to figure out how to reference the completed unit at the end of my ability's effect chain within the trigger, to give it the experience, just not sure how.
My best guess right now would be to create two triggers, one that goes off when "any unit uses myAbility at generic3 - execute stage (ignore shared abilities)", storing how much experience the triggering unit has in a local variable, and then the action would be to wait for a second trigger to go off which would occur when "any unit training progress is completed". Then back in the original trigger, this would be where I would set triggering progress unit *of Trigger 2* experience to my local variable.
But I don't know if this double trigger thing is even possible, or hopefully there's a more efficient way of doing what I need.
0
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.
0
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.
0
@TeamWinning: Go
Did you try adding the parentheses, and you still might need the operator for the CountBehavior() function? Try making it look like this:
( (CountAbil(Bolt,CompleteOnlyAtUnit)[TechTreeCheat] < 1 && CountBehavior(Level1,CompleteOnlyAtUnit)[TechTreeCheat]) > 0) || ( (CountAbil(Bolt,CompleteOnlyAtUnit)[TechTreeCheat] < 2 && CountBehavior(Level3,CompleteOnlyAtUnit)[TechTreeCheat]) > 0 ) || ( (CountAbil(Bolt,CompleteOnlyAtUnit)[TechTreeCheat] < 3 && CountBehavior(Level5,CompleteOnlyAtUnit)[TechTreeCheat]) > 0 ) || ( (CountAbil(Bolt,CompleteOnlyAtUnit)[TechTreeCheat] < 4 && CountBehavior(Level7,CompleteOnlyAtUnit)[TechTreeCheat]) > 0 )
And it sounds to me you don't want the player to be able to learn rank 1 at any other level besides level 1? Because in WC3 you could learn rank 1 at any level, rank 2 at any level above level 3, etc., meaning you can learn a rank 1 ability at level 2. But if this is not what you want then you need to make sure that the "Level1" behavior is removed from the unit as soon it gains the "Level2" behavior.
Anyways, if that doesn't work, I don't know. Best of luck to you.
0
From my understanding (which isn't much) is that that function is intended to count a behavior obviously, so the piece of code I have quoted from you is going to essentially turn into an integer, but you don't have any operators (+, /, <, ==) next to it, so that part is written incorrectly. I also see you have written there "Level1" as your behavior, do you have a separate behavior for every level? If that's the case then you'd have to write > 0 following every CountBehavior() function you have. At that point it would probably work, or you may need to add an extra set of parenthesis around each set of functions combined by your && operators.
However, the editor already has a Veterancy behavior which is a whole leveling up system you can add to your units, instead of creating your own behaviors. If you were to use the Veterancy behavior your code could instead look something like this:
CountBehavior(MyVeterancyLevels.CompeteOnlyAtUnit)[TechTreeCheat] >= (CountAbil(Bolt.CompeteOnlyAtUnit)[TechTreeCheat] + CountAbil(Bolt.CompeteOnlyAtUnit))[TechTreeCheat]
And that would be all you would need, no matter how many levels your units were to gain.
0
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.
0
Issue Order effect, wow how did I miss that :D That solved it, and in such a better fashion than having to put a switch effect into every weapon that I wanted to be able to utilize this buff. And in case anyone wants to know, the only other tweak I had to make was to add a validator to the Issue Order "Attack" effect, that validated that the Source unit was attacking, otherwise the buff would attempt to perpetually override any other command given to the unit.
Thank you so much DrSuperEvil!
0
I'm trying to set up a simple buff that forces affected units to attack the lowest health enemy unit that's in range. I saw two old threads on here (http://www.sc2mapster.com/forums/development/data/13501-unit-reaquiring-random-target-after-each-shot/#p11 and http://www.sc2mapster.com/forums/development/data/16588-weapons-target-sort-field/) that were related to my issue and I've got it all to work, however, even though the damage effect is being appropriately applied to the correct target it seems the weapon's "acquire" functionality is still based on distance and thus the unit ends up facing the wrong direction.
I tried using a trigger to "Make (Damaging unit) face (Position of (Triggering unit)) over 0.1 seconds, and loop that every .05 seconds for about 17 iterations which would approximately be the cooldown period for the marine's attack, and I tried fiddling with these numbers but the whole thing still looks very clunky and this trigger also interferes with giving the units a new command.
I've seen the AI in the campaign switch to my low health units before, so I know the functionality is in here somewhere, just don't know why everything has to be so impossible to find :\ Thanks in advance for any help/suggestions!
0
@Ahli634: Go
Ah, thank you Ahli. I wasn't sure how to properly work with the Signal events but since I wanted it this change to occur when the marine got to level 3 I used the BehaviorLevel event and it worked out perfectly! I'm still obviously new to the editor, I should've thought of swapping the actor or just a plain 'ol morph. Thank you again!
0
I've managed to uncover the combat shield on a single marine when it reaches level 3 of the built-in veterancy behavior through a trigger. What I'd like to do now is compliment this by also changing the triggering unit's wireframe and group icon to the appropriate image (Assets\Textures\wireframe-terran-marine-shield.dds).
After hours of searching, the best answer I found on the web was from a forum post by blizzard (http://us.battle.net/sc2/en/forum/topic/2674992430) stating, "You can dynamically change the Actor's wireframe using upgrades or the Catalog Field Value Set trigger. We'll look into reusing the Upgrade UI for this trigger, which will allow you to easily see which fields can be changed."
Which only leaves me with another set of problems: 1) I am pretty certain that upgrades will affect all marines and I don't know if Catalog Field Value Set will work any differently, and more importantly, 2) I can't figure out how to even use the Catalog Field Value Set function.
So if anyone can help me solve this problem by whatever method, I would be greatly appreciative!