Through looking at various threads, the best way to make a "taunt"-type ability would be to have a Create Persistent Effect or Behavior that rapidly issues an Attack Order on the caster unit with periods/duration set up for the desired amount of time. However, upon creating this effect (via Ability) with a Create Persistent, Behavior, or even just a raw Issue Order, the taunted target will not stop attacking the taunt's caster until one of the two is killed.
Ideally, I'd like to create an Ability that temporarily taunts a unit, so that after the duration is over, the taunted unit will simply go back to taunting whatever it was attacking before (especially if it has a higher target priority). Issue Order sounds like the best way to do this, although I'm also looking into possible ways to achieve the effect through attack priority (if it can be modified), and Behavior-driven Target Sorts (if those can be created).
It doesn't really look like anybody else has run into the same problem as I have, although that might be due to the fact that I am using all custom units, made from scratch - so there might be something missing that is usually built into the actual SC2 units. Any advice?
EDIT: I've been messing around with Generate/Suppress Threat, although it doesn't quite get the result I want, since it doesn't seem to be able to single out a single enemy (and instead just affects all enemies it gets into Acquire range for).
Oh, absolutely! I'm not too picky when it comes to getting things done, and I've been meaning to get a better grasp on all this crazy Triggers business anyway.
Well I was writing some kind of complicated system. But no I don't think you need a full aggro table system, so you can just create :
- a dummy ability named taunt (maybe which apply a dummy behavior to show that the unit is taunted)
- a trigger activated when this ability is used : in which you order the unit taunted to attack the taunter, you wait the duration you want for the taunt, then you order the unit taunted to stop
If several units can taunt the same target, you will have to check before to order to stop if the taunter is the actual taunter of the unit, as an other unit may have taunted above (and you would stop the second taunt which already stopped the first taunt), not sure how to verify that though, maybe the dummy behavior can be configured to overwrite a pre-existing same behavior and so you could check who put the behavior (I am not very used to data). Trigger way : before to order to attack, you can remove an existing dummy behavior, and you would have to activate the trigger before that the new behavior is put on the unit (I don't remember the parameter but something like ability initiated, before the ability is executed). So you could check before to order to stop who put the dummy behavior on the unit.
Or you can symply not allow to taunt an already taunted unit (maybe doable by data, I don't know how, but in the trigger you can add the condition that the taunted unit does not have the dummy behavior).
Tell me if it is not understandable, I begin to feel sleepy right now.
why dont u just make target ability with apply behavior effect, behavior gives target uncomandable flag and periodic issue order to attack caster every second while its on and clear orders when behavior is expired.
The good news is, both of these work to some extent! The taunted unit attacks the taunter, and when the taunt wears off, they go back to business as usual.
The only problem seems to be, that even though leash rules are maintained (if the taunted unit is brought outside of its leash radius, it will quickly return), if the taunted unit is not brought outside of its leash, the place it is standing when the taunt wears off becomes its new leash point.
This might be a different issue entirely, but is there any way to get the taunted unit to behave as though they have merely acquired the taunting unit? With AI units that just acquire things within their acquire range, they follow until they reach the limit of their leash and then return there (they also return if whatever they acquired is killed). Is there any way to achieve this with the Issue Order or the trigger?
I might also look into a way to force any given unit to return to their original point (wherever they were created, or where they were when the map initiated), although this sounds like something that would have to be done with triggers, so I'll start looking over in that subforum in the meantime.
If the unit of a player can be taunted, yes Uroboros is right.
Of course you can do it via triggers too, but it is always better to do it via datta.
Not sure to understand very well all what you need ItemsGuy. But you can save the point where the taunted unit is in a local variable initiated to the position of the taunted unit when the trigger is activated. Then when you order to stop, if the unit is alive you can instead order to move to this initial place. You can even save the angle of the unit the same way. And instead to wait, you can check the distance in a loop, and react if the distance is to big, as order to go back to the initial place.
Hmm, I guess a more straightforward way to ask would be, is there a way (through Triggers or Data) to make a character affected by a Behavior/Effect/etc. acquire the caster of that Behavior/Effect/etc.? The main difference I've found between having an (AI) unit attack somebody with an Issue Order: Attack and simply having them Acquire something due to Acquire Range/Target Sorts/etc., is that upon Acquiring something, the unit will always return to its original leash location, whereas the unit that was forced to attack through an Issue Order will change its leash location to the point where it was last ordered to attack.
I think I'll look into what you've suggested (as far as saving origin points in a local variable goes), if there are any tutorials for that in the Triggers forums, but I may also try to see if custom Target Sorts can be created to prioritize units with certain Behaviors, and if a unit's Target Sorts can be dynamically changed (most likely through Triggers).
EDIT: Another short-term solution I might look into in the meantime is simply having the units I'm working with be incapable of moving. The intention was to have them stationed at certain points that the player must fight their way through, and since the player is meant to come to them, giving them the ability to move around freely isn't necessary. Of course I'll look into the solution you've proposed as soon as I'm able to, though!
The good news is, both of these work to some extent! The taunted unit attacks the taunter, and when the taunt wears off, they go back to business as usual.
The only problem seems to be, that even though leash rules are maintained (if the taunted unit is brought outside of its leash radius, it will quickly return), if the taunted unit is not brought outside of its leash, the place it is standing when the taunt wears off becomes its new leash point.
This might be a different issue entirely, but is there any way to get the taunted unit to behave as though they have merely acquired the taunting unit? With AI units that just acquire things within their acquire range, they follow until they reach the limit of their leash and then return there (they also return if whatever they acquired is killed). Is there any way to achieve this with the Issue Order or the trigger?
I might also look into a way to force any given unit to return to their original point (wherever they were created, or where they were when the map initiated), although this sounds like something that would have to be done with triggers, so I'll start looking over in that subforum in the meantime.
Ah, I think I see what this is meant to do, but unfortunately, I'm having a bit of trouble figuring out how to do this in the Trigger Editor (for example, for the first Event, searching "Behavior" in the find bar doesn't bring up any prompt that matches what you have). I'm getting to this by creating a new Element and working from there, but I'm not sure if there are any other ways to create Triggers.
Unless that isn't a Trigger, of course, and just a Data section I'm not familiar with (it looks like the kind of language the Trigger editor uses, though) - if so, what Data tab do you open to access this?
Ah, I think I see what this is meant to do, but unfortunately, I'm having a bit of trouble figuring out how to do this in the Trigger Editor (for example, for the first Event, searching "Behavior" in the find bar doesn't bring up any prompt that matches what you have). I'm getting to this by creating a new Element and working from there, but I'm not sure if there are any other ways to create Triggers.
Unless that isn't a Trigger, of course, and just a Data section I'm not familiar with (it looks like the kind of language the Trigger editor uses, though) - if so, what Data tab do you open to access this?
Event is "Unit Behavior Changes"
U need to do something like this if u want to do it trigger way
Hmm, managed to figure most of it out! The Trigger is up and running, however I think the missing piece might be the "create persistent point at location" you mentioned a few posts ago. I'm guessing this point would be referenced in place of "No Point" for the Location variable, although, I'm not exactly sure how to create a "point" using a Create Persistent effect. Would this be done through the Target: Location field (maybe Target Point or something like that?), or maybe through a Periodic Offset of 0,0,0? I'm also guessing this is a persistent effect that is created at the location of the taunted unit upon applying the taunt, so it should be bundled up with the Apply Behavior effect itself via a Set, if I'm not mistaken.
I've never done anything like this with Triggers or Data, and nothing useful is showing up via forum search, so I'll just trial and error in the meantime. Seems like we're almost there, though!
Hmm, managed to figure most of it out! The Trigger is up and running, however I think the missing piece might be the "create persistent point at location" you mentioned a few posts ago. I'm guessing this point would be referenced in place of "No Point" for the Location variable, although, I'm not exactly sure how to create a "point" using a Create Persistent effect. Would this be done through the Target: Location field (maybe Target Point or something like that?), or maybe through a Periodic Offset of 0,0,0? I'm also guessing this is a persistent effect that is created at the location of the taunted unit upon applying the taunt, so it should be bundled up with the Apply Behavior effect itself via a Set, if I'm not mistaken.
I've never done anything like this with Triggers or Data, and nothing useful is showing up via forum search, so I'll just trial and error in the meantime. Seems like we're almost there, though!
Ah, I'm probably getting a little confused here! I remember you mentioned "First when u use taunt ability u apply behavior and also create persistent point at location : caster and when taunt buff expires do not clear orders but issue order to move to persistent point." but so far I've been using the Trigger solution you showed me. I'm just a bit stumped because although our Trigger Events look identical, the taunted unit ends up following the taunt caster forever. I guess I'll outline what I've done so it's a bit more clear!
I have an Ability that applies a Behavior, with a set duration and and an Issue Order (Attack, with the caster as the target) that is rapidly fired off as a Periodic Effect. This Behavior is also tied to the Trigger Event you showed me (Unit - Any Unit has Taunt change Any), although unlike when I had the Behavior's Final Effect as Cancel Order (Attack), the taunted unit will continue following the taunt caster forever, regardless of its Leash Radius.
I think I'll attach the map this is being applied to, since I might not be explaining everything well! I might also be mixing up your Data-related advice and your Trigger-related advice, so that may be messing things up. Thanks for the patience so far!
EDIT: Oh, the ability in question is being tested to the right of where the camera starts off when the map is opened, if that helps.
I was to tired yesterday evening.
I just took the time to do you an example.
So I have created in your map (I have put "Znimu -" as prefixe for all of that) :
- the taunt ability
- the effect of the taunt ability (it applies the behavior)
- the taunt behavior (applied to the taunted unit)
- the taunt button
I have given this taunt ability to the ultralisk that I have put to the right of the map, near the disciples.
I have done the trigger. I highly commented it, but you can ask if you don't understand something, or if you'd like to change something.
You should increase the move_distance_max variable : I put it to 5 to show you, but the cast range of the taunt beeing bigger, the unit backs if you taunt from far.
There is an issue : if you taunt a unit which is not at his initial place, then the taunted unit can only go back to the place where it was taunted, not to his initial place. To fix this, I think that you would have to register a point for every tauntable units as global variables. Depends on what you want, it would be tedious to create a point for every units. Not sure, maybe it is possible to get the position where the unit would go back becoming idle, I don't know that. If someone can confirm or not ?
Ah, just realized the problem I'd run into this and uroboros's Trigger suggestions is, like with having the Clear Order as the final effect of the taunt Behavior, the unit would only return to the point at which it was taunted, rather than to some predetermined point.
I've been messing around with Triggers for the past while, and I think that, instead of having the unit return to a point that is created when it is taunted, I could just have a "return to point when not in combat" Trigger that returns it to a set point when it hasn't dealt or received damage within a set window of time. Through Data, I could give a Behavior to the unit that is disabled via Validators; a Location variable could be set as soon as the unit acquires this Behavior (ie. as soon as it is created), and it could be ordered to return to that point whenever it is enabled.
Problem with this might be that it would set a new location as soon as it leaves combat and just stay there (rather than returning to the location where the dummy Behavior was initially applied), so it might be possible to instead have an initial dummy Behavior that is always on, which runs a periodic Effect (which is enabled/disabled by the Validator) that applies a separate, temporary Behavior. When the initial Behavior is applied, the Location variable is set, and whenever the temporary Behavior is applied, the unit returns to the set Location.
I'm going to mess around in the Trigger editor to see if I can figure out how to get this to work, and I'll update the OP with the solution if I do - however, if any of you guys get there before me or know that this won't work, please let me know!
Not sure because I feel tired right now, but I think you could add to what I did a new trigger which would be activated when a unit stop to be idle (i.e. when the unit aquire a target), and with the condition to execute to be a computer player or something. You register in it the point where is the unit. Then you wait for the unit to become idle, then you order to it to back to its initial place.
It would complete the trigger I did for the taunt, as it would order to back to the real initial position when the unit become idle, so after the end of the taunt trigger.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Through looking at various threads, the best way to make a "taunt"-type ability would be to have a Create Persistent Effect or Behavior that rapidly issues an Attack Order on the caster unit with periods/duration set up for the desired amount of time. However, upon creating this effect (via Ability) with a Create Persistent, Behavior, or even just a raw Issue Order, the taunted target will not stop attacking the taunt's caster until one of the two is killed.
Ideally, I'd like to create an Ability that temporarily taunts a unit, so that after the duration is over, the taunted unit will simply go back to taunting whatever it was attacking before (especially if it has a higher target priority). Issue Order sounds like the best way to do this, although I'm also looking into possible ways to achieve the effect through attack priority (if it can be modified), and Behavior-driven Target Sorts (if those can be created).
It doesn't really look like anybody else has run into the same problem as I have, although that might be due to the fact that I am using all custom units, made from scratch - so there might be something missing that is usually built into the actual SC2 units. Any advice?
EDIT: I've been messing around with Generate/Suppress Threat, although it doesn't quite get the result I want, since it doesn't seem to be able to single out a single enemy (and instead just affects all enemies it gets into Acquire range for).
No idea how to do this with data, I could explain to you how to do it with triggers and an aggro table if you are interested though.
@Kloupz: Go
Oh, absolutely! I'm not too picky when it comes to getting things done, and I've been meaning to get a better grasp on all this crazy Triggers business anyway.
Well I was writing some kind of complicated system. But no I don't think you need a full aggro table system, so you can just create :
- a dummy ability named taunt (maybe which apply a dummy behavior to show that the unit is taunted)
- a trigger activated when this ability is used : in which you order the unit taunted to attack the taunter, you wait the duration you want for the taunt, then you order the unit taunted to stop
If several units can taunt the same target, you will have to check before to order to stop if the taunter is the actual taunter of the unit, as an other unit may have taunted above (and you would stop the second taunt which already stopped the first taunt), not sure how to verify that though, maybe the dummy behavior can be configured to overwrite a pre-existing same behavior and so you could check who put the behavior (I am not very used to data). Trigger way : before to order to attack, you can remove an existing dummy behavior, and you would have to activate the trigger before that the new behavior is put on the unit (I don't remember the parameter but something like ability initiated, before the ability is executed). So you could check before to order to stop who put the dummy behavior on the unit.
Or you can symply not allow to taunt an already taunted unit (maybe doable by data, I don't know how, but in the trigger you can add the condition that the taunted unit does not have the dummy behavior).
Tell me if it is not understandable, I begin to feel sleepy right now.
why dont u just make target ability with apply behavior effect, behavior gives target uncomandable flag and periodic issue order to attack caster every second while its on and clear orders when behavior is expired.
sounds pretty easy.
The good news is, both of these work to some extent! The taunted unit attacks the taunter, and when the taunt wears off, they go back to business as usual.
The only problem seems to be, that even though leash rules are maintained (if the taunted unit is brought outside of its leash radius, it will quickly return), if the taunted unit is not brought outside of its leash, the place it is standing when the taunt wears off becomes its new leash point.
This might be a different issue entirely, but is there any way to get the taunted unit to behave as though they have merely acquired the taunting unit? With AI units that just acquire things within their acquire range, they follow until they reach the limit of their leash and then return there (they also return if whatever they acquired is killed). Is there any way to achieve this with the Issue Order or the trigger?
I might also look into a way to force any given unit to return to their original point (wherever they were created, or where they were when the map initiated), although this sounds like something that would have to be done with triggers, so I'll start looking over in that subforum in the meantime.
If the unit of a player can be taunted, yes Uroboros is right. Of course you can do it via triggers too, but it is always better to do it via datta.
Not sure to understand very well all what you need ItemsGuy. But you can save the point where the taunted unit is in a local variable initiated to the position of the taunted unit when the trigger is activated. Then when you order to stop, if the unit is alive you can instead order to move to this initial place. You can even save the angle of the unit the same way. And instead to wait, you can check the distance in a loop, and react if the distance is to big, as order to go back to the initial place.
@Kloupz: Go
Hmm, I guess a more straightforward way to ask would be, is there a way (through Triggers or Data) to make a character affected by a Behavior/Effect/etc. acquire the caster of that Behavior/Effect/etc.? The main difference I've found between having an (AI) unit attack somebody with an Issue Order: Attack and simply having them Acquire something due to Acquire Range/Target Sorts/etc., is that upon Acquiring something, the unit will always return to its original leash location, whereas the unit that was forced to attack through an Issue Order will change its leash location to the point where it was last ordered to attack.
I think I'll look into what you've suggested (as far as saving origin points in a local variable goes), if there are any tutorials for that in the Triggers forums, but I may also try to see if custom Target Sorts can be created to prioritize units with certain Behaviors, and if a unit's Target Sorts can be dynamically changed (most likely through Triggers).
EDIT: Another short-term solution I might look into in the meantime is simply having the units I'm working with be incapable of moving. The intention was to have them stationed at certain points that the player must fight their way through, and since the player is meant to come to them, giving them the ability to move around freely isn't necessary. Of course I'll look into the solution you've proposed as soon as I'm able to, though!
@uroboros1987: Go
Ah, I think I see what this is meant to do, but unfortunately, I'm having a bit of trouble figuring out how to do this in the Trigger Editor (for example, for the first Event, searching "Behavior" in the find bar doesn't bring up any prompt that matches what you have). I'm getting to this by creating a new Element and working from there, but I'm not sure if there are any other ways to create Triggers.
Unless that isn't a Trigger, of course, and just a Data section I'm not familiar with (it looks like the kind of language the Trigger editor uses, though) - if so, what Data tab do you open to access this?
Event is "Unit Behavior Changes"
U need to do something like this if u want to do it trigger way
Whoops, looks like i added 1 wrong condition at begining.
@uroboros1987: Go
Hmm, managed to figure most of it out! The Trigger is up and running, however I think the missing piece might be the "create persistent point at location" you mentioned a few posts ago. I'm guessing this point would be referenced in place of "No Point" for the Location variable, although, I'm not exactly sure how to create a "point" using a Create Persistent effect. Would this be done through the Target: Location field (maybe Target Point or something like that?), or maybe through a Periodic Offset of 0,0,0? I'm also guessing this is a persistent effect that is created at the location of the taunted unit upon applying the taunt, so it should be bundled up with the Apply Behavior effect itself via a Set, if I'm not mistaken.
I've never done anything like this with Triggers or Data, and nothing useful is showing up via forum search, so I'll just trial and error in the meantime. Seems like we're almost there, though!
so u want to do it Data way?
@uroboros1987: Go
Ah, I'm probably getting a little confused here! I remember you mentioned "First when u use taunt ability u apply behavior and also create persistent point at location : caster and when taunt buff expires do not clear orders but issue order to move to persistent point." but so far I've been using the Trigger solution you showed me. I'm just a bit stumped because although our Trigger Events look identical, the taunted unit ends up following the taunt caster forever. I guess I'll outline what I've done so it's a bit more clear!
I have an Ability that applies a Behavior, with a set duration and and an Issue Order (Attack, with the caster as the target) that is rapidly fired off as a Periodic Effect. This Behavior is also tied to the Trigger Event you showed me (Unit - Any Unit has Taunt change Any), although unlike when I had the Behavior's Final Effect as Cancel Order (Attack), the taunted unit will continue following the taunt caster forever, regardless of its Leash Radius.
I think I'll attach the map this is being applied to, since I might not be explaining everything well! I might also be mixing up your Data-related advice and your Trigger-related advice, so that may be messing things up. Thanks for the patience so far!
EDIT: Oh, the ability in question is being tested to the right of where the camera starts off when the map is opened, if that helps.
I was to tired yesterday evening. I just took the time to do you an example.
So I have created in your map (I have put "Znimu -" as prefixe for all of that) :
- the taunt ability
- the effect of the taunt ability (it applies the behavior)
- the taunt behavior (applied to the taunted unit)
- the taunt button
I have given this taunt ability to the ultralisk that I have put to the right of the map, near the disciples. I have done the trigger. I highly commented it, but you can ask if you don't understand something, or if you'd like to change something.
You should increase the move_distance_max variable : I put it to 5 to show you, but the cast range of the taunt beeing bigger, the unit backs if you taunt from far.
There is an issue : if you taunt a unit which is not at his initial place, then the taunted unit can only go back to the place where it was taunted, not to his initial place. To fix this, I think that you would have to register a point for every tauntable units as global variables. Depends on what you want, it would be tedious to create a point for every units. Not sure, maybe it is possible to get the position where the unit would go back becoming idle, I don't know that. If someone can confirm or not ?
@Kloupz: Go
Ah, just realized the problem I'd run into this and uroboros's Trigger suggestions is, like with having the Clear Order as the final effect of the taunt Behavior, the unit would only return to the point at which it was taunted, rather than to some predetermined point.
I've been messing around with Triggers for the past while, and I think that, instead of having the unit return to a point that is created when it is taunted, I could just have a "return to point when not in combat" Trigger that returns it to a set point when it hasn't dealt or received damage within a set window of time. Through Data, I could give a Behavior to the unit that is disabled via Validators; a Location variable could be set as soon as the unit acquires this Behavior (ie. as soon as it is created), and it could be ordered to return to that point whenever it is enabled.
Problem with this might be that it would set a new location as soon as it leaves combat and just stay there (rather than returning to the location where the dummy Behavior was initially applied), so it might be possible to instead have an initial dummy Behavior that is always on, which runs a periodic Effect (which is enabled/disabled by the Validator) that applies a separate, temporary Behavior. When the initial Behavior is applied, the Location variable is set, and whenever the temporary Behavior is applied, the unit returns to the set Location.
I'm going to mess around in the Trigger editor to see if I can figure out how to get this to work, and I'll update the OP with the solution if I do - however, if any of you guys get there before me or know that this won't work, please let me know!
Not sure because I feel tired right now, but I think you could add to what I did a new trigger which would be activated when a unit stop to be idle (i.e. when the unit aquire a target), and with the condition to execute to be a computer player or something. You register in it the point where is the unit. Then you wait for the unit to become idle, then you order to it to back to its initial place.
It would complete the trigger I did for the taunt, as it would order to back to the real initial position when the unit become idle, so after the end of the taunt trigger.