Do you know how to achieve this effect? I would like my unit to fire missile at its target, and then reaquire next, random target in range. Cant find the way :/
edit:
I think i could achieve similiar effect with 2-3 weapons firing at different targets. But how to do that?
edit2:
Another option would be to make the projectile not accurate and land with some random offset from the target.
edit:
Im not that advanced in editor to know each of its aspects. I havent done anythng with validators yet, so if you would be so kind and explain me how do i try what you suggested, i would be thankfull.
edit2:
Another option would be to make the projectile not accurate and land with some random offset from the target.
I can help you with that. I asked around for random offsets before and made a small example map for personal use.
It uses a couple of effects:
Machine Gun Attack: An actor which creates attack sounds and the beam effect.
Machine Gun Damage: Deals the actual damage (in a small AoE)
Machine Gun Damage Dummy: Only used to create the beam effect. Somehow it doesn't wanna go well with the real damage effect.
Machine Gun Persistent: This one specifies the random offsets and casts the Set effect on that location.
Machine Guns Set: This one casts the damage and damage dummy effect.
The map's name is the same as Prozaic's example map for beams (because that's where I built it on). Just ignore everything which doesn't have the words "Machine Gun" in it's name :P
(The Banshee and Machine Gunner use this weapon.)
@Azzaaer: Go
(in reference to picking new targets each time it fires)
Here's what you essentially need: A fake/dummy behavior and a validator checking for its presence on targets.
The behavior just has to have some small timer on it (the time before you'd like the weapon to potentially aim at them again) and then a validator needs to be created that's looking for its presence, I can't remember any off hand but I know there are examples of validators that do this among the existing that you can copy and modify for this purpose. The third step is within the weapon's effect you just need this validator included in its list and this will stop the weapon from picking that target until the behavior's timer expires. Oh right and somewhere within that weapon's effects it needs to apply that dummy behavior to the target using an add behavior effect.
This is hackish though and I'm sure there's a cleaner way to do this with target sorting instead but frankly I haven't delved too much into that.
ED: On second thought, this method would suck the moment you introduce more then one such weapon onto a side in a fire fight since they'd run out of targets rather quickly since they'd both share the same filter on availables...bleh.
I will try to clone what s3rius posted, to do such thing from the scratch. Never done it yet. So far i only edited and swapped stuff. Slowly, very slowly figuring out how these are connected with each other. After braketroughs in my learning it all seems to damn simple from the moment i know how it works. But for now... making what you did is still black magic. :) Im going to study it's arcane knowledge now cause the effects are bloody worth it. :)
p.s.
love the idea of this heavy machine gunner :D I hope i will be able to show off with the unit im trying to create atm. Such custom units that looks and works cool are so damn nice difference to all these "balanced", boring sc2 multiplayer units.
How to i add this new "create persistent" effect to my unit? Where to link it with the unit/actor?
I know that there are effects, and actors, but i have no idea where they are linked with units... How do i add an actor or effect to unit? I can only add effects and actors that are not linked with anything.
Ok so i have made screenshot and highlighted what connections i see and understund in your machine gunner unit:
These 2 effects have visible connection with unit's attack actor. How about the rest?
edit:
ahh... they are connected with the weapon... What i dont understund: why attack effects are connected some with actor and some with weapon?
edit2:
Oh at last i was able to make this random offset for my long range artillery unit with persistant attack effect. It shoudlnt be hard now to figure out how to make more units like that :) THanks again for help.
Ok it all works nicely. But 1 of these new custom units with this kind of effects is acting wierd here for me... It throws molotovs at enemies, but the wierd thing in it all is that it first plays the explosion effect and then throws the bottle... Cant find the reason. Could you advise where to look? Most wierd is that i have similiar unit there also with molotov and it plays the effects n correct way...
edit:
Ok found the problem. While i was duplicating this unit, it's actor changed it's art section called "missile" to: CivilianAttack2Missile, and i had to remove this "2" manually. Now it works as it should :)
heh. I'm bumping this because I found a very simple way and I figured some people might want to know. You do not need a validator of any kind or a fake/dummy behavior.
I just experimented and made my weapon work. It shoots 5 different targets, but previously would only target those same 5 targets until 1 or all died. Now, my weapon randomly targets 5 units after each attack. And will continue to do so until everything dies.
In my case, here's what's going on. My weapon's Effect is linked to Search Effect.
Effect - Beam (Search)
Search - Areas+:
Arc: 360
Effect: Beam (Damage)
Max Count: 5
Radius: 7
Search - Max Count: -1
Search - Minimum Count: 1
Target - Target Sorts+:
Request Count: 5
Request Percentage: 1
Sorts - Value: TSRandom
Set this up similarly if you want your weapon to randomize it's targets. Areas+ -> Max Count of 5 along with Target Sorts+ ->Request Count 5 is what makes it randomize 5 targets. If you have Max Count of 5 with Req Count of 3, I believe 2 targets would remain the same and it would randomize 3 other targets. Might be useful if you want your main target to always be hit, and 4 others randomized every shot. I haven't tested out the Request Count in any other capacity other than making it identical to my Areas+ Max Count #.
Request Percentage -> 1 basically means this will Target Sort 100% of the time, based on your value. 0 is 0%, and 0.5 is 50%.
Sorts - Value: TSRandom controls your request count. If you had TSShields, I believe your weapon would favor targets that had shields. Especially useful if you give a unit a weapon that does extra damage VS shields.
You will also notice that Damage Effects have a Target - Targets Sorts+ field. Placing the TargetSort value in Damage effects could be useful in other ways. Think of a rocket or grenade that on impact, deals 50 damage to target and splits into 2 which hit 2 other targets for 40. With some clever use of TS / Validators, you could turn these 2 "shrapnel" into heatseeking mini missiles.
Have fun! Oh ya, here's a video of 'The Shadow' shooting 5 beams at 5 random targets after every shot.
thank you very much!! finally someone that EXPLAINED a target sort! This should be very useful for my map. But now i have an additional issue...
I am trying to make my enemy creeps acquire the hero that is shooting them. This allows the team to "dance" a large threat enemy so that he chases the one shooting him and then that hero stops attacking while other heros attack so that the enemy will effectively play monkey in the middle. Nearly every enemy unit is melee with range = 1 and all player heroes are ranged with about 14 range. Since my enemies are melee with range 1 how do I implement this search area to choose a target but without the damage effect becoming ranged?
Hmm, not exactly sure. Have you tried using TSPriority? It might not work since the unit has a Combat - Attack Target Priority field which does just that. Although, maybe using TSPriority will prioritize the attacking unit?
If you know any code or function, possibly take a look at AI - AI Override Target Priority, AI - Tactical AI Channel, AI - Tactical AI Function, AI - Tactical AI Range fields for units. I've got no more ideas for now.
ok i seem to have found a solution to this for melee attacks. The key components are a dmg response behavior and a behavior that periodically issues an attack order.
I have attached a test map that implements it. Any customized things in the map are with editor prefix "TEST" so u can find all of them quickly.
In the test map you have groups of marines surrounding abberrations and brutalisks. Try dancing the aberrations and it will work. Now try dancing the brutalisks (they dont have the following behaviors) and they will not dance. Once they acquire an attack target they stick with that target until it dies or they exhaust their chase range on their weapon.
The following items must be created in the data editor:
(1) Target Sort
(1) Validator
(3) effects (1 issue order, 1 search area, 1 apply behavior)
(3) behaviors (all 3 buffs)
In my example I use an aberration as the boss that will "dance" or always prioritize attacking someone that is attacking him.
First make a BEHAVIOR - "Attacking Aberration" that has short duration. I used 1.0 second.
Next make an apply behavior EFFECT - "Attacking Aberration (APPLY)" with behavior field set to "attacking aberration".
Next make another BEHAVIOR - "Mark Attackers" with combat dmg response chance = 1 and handled effect = "Attacking Aberration (APPLY)" and make sure the dmg response location is set to "defender".
Next make a unit compare behavior count type VALIDATOR - "Target is attacking aberration" and set the behavior to "Attacking Aberration" and the value to 1.
Next make a compare behavior type TARGET SORT - "Attacking Aberration". Set the behavior to "attacking aberration" and the value to 1.
Next make an issue order type EFFECT - "Attack the Attacker". Set the ability to attack. set the target+ to target unit and the unit+ to source unit. Also set the effect validator to the one you just created.
Next make a search area EFFECT - "Find Attackers". Set the Search Area+ fields to your desired radius and the effect to "Attack the Attacker" and the max count to 1. Now set the Target Sorts field to "Attacking Aberration" and TSDistance (or w/e additional sorts you desire). With request count and percentage set to 1.
Next make a buff BEHAVIOR - "Acquire Attacker". Set the periodic effect to your search area effect you just made. Set the period to w/e you desire, I used 0.5 secs.
Finally go to whatever units you want to have this "dancing" type AI and give them 2 behaviors: "Mark Attackers" and "Acquire Attacker".
Additional Notes: You can give the "Acquire Attacker" behavior to any enemy units you want and they will dance as well if there is one of the boss units with "mark attackers" behavior in the fight. This is highly useful for using a large hp boss to make all the creeps on screen play monkey in the middle or hot potato if you so desire.
Do you know how to achieve this effect? I would like my unit to fire missile at its target, and then reaquire next, random target in range. Cant find the way :/
edit:
I think i could achieve similiar effect with 2-3 weapons firing at different targets. But how to do that?
edit2:
Another option would be to make the projectile not accurate and land with some random offset from the target.
Mb, using Validators should to the trick.
Don't know anything more :D
@o3210: Go
Mb?
edit:
Im not that advanced in editor to know each of its aspects. I havent done anythng with validators yet, so if you would be so kind and explain me how do i try what you suggested, i would be thankfull.
I can help you with that. I asked around for random offsets before and made a small example map for personal use.
It uses a couple of effects:
The map's name is the same as Prozaic's example map for beams (because that's where I built it on). Just ignore everything which doesn't have the words "Machine Gun" in it's name :P
(The Banshee and Machine Gunner use this weapon.)
@Azzaaer: Go (in reference to picking new targets each time it fires)
Here's what you essentially need: A fake/dummy behavior and a validator checking for its presence on targets.
The behavior just has to have some small timer on it (the time before you'd like the weapon to potentially aim at them again) and then a validator needs to be created that's looking for its presence, I can't remember any off hand but I know there are examples of validators that do this among the existing that you can copy and modify for this purpose. The third step is within the weapon's effect you just need this validator included in its list and this will stop the weapon from picking that target until the behavior's timer expires. Oh right and somewhere within that weapon's effects it needs to apply that dummy behavior to the target using an add behavior effect.
This is hackish though and I'm sure there's a cleaner way to do this with target sorting instead but frankly I haven't delved too much into that.
ED: On second thought, this method would suck the moment you introduce more then one such weapon onto a side in a fire fight since they'd run out of targets rather quickly since they'd both share the same filter on availables...bleh.
Thanks.
I will try to clone what s3rius posted, to do such thing from the scratch. Never done it yet. So far i only edited and swapped stuff. Slowly, very slowly figuring out how these are connected with each other. After braketroughs in my learning it all seems to damn simple from the moment i know how it works. But for now... making what you did is still black magic. :) Im going to study it's arcane knowledge now cause the effects are bloody worth it. :)
p.s.
love the idea of this heavy machine gunner :D I hope i will be able to show off with the unit im trying to create atm. Such custom units that looks and works cool are so damn nice difference to all these "balanced", boring sc2 multiplayer units.
@Azzaaer: Go
How to i add this new "create persistent" effect to my unit? Where to link it with the unit/actor?
I know that there are effects, and actors, but i have no idea where they are linked with units... How do i add an actor or effect to unit? I can only add effects and actors that are not linked with anything.
@Azzaaer: Go
Ok so i have made screenshot and highlighted what connections i see and understund in your machine gunner unit:
These 2 effects have visible connection with unit's attack actor. How about the rest?
edit:
ahh... they are connected with the weapon... What i dont understund: why attack effects are connected some with actor and some with weapon?
edit2:
Oh at last i was able to make this random offset for my long range artillery unit with persistant attack effect. It shoudlnt be hard now to figure out how to make more units like that :) THanks again for help.
edit3:
I did it xD I did it! :D
@Azzaaer: Go
Ok it all works nicely. But 1 of these new custom units with this kind of effects is acting wierd here for me... It throws molotovs at enemies, but the wierd thing in it all is that it first plays the explosion effect and then throws the bottle... Cant find the reason. Could you advise where to look? Most wierd is that i have similiar unit there also with molotov and it plays the effects n correct way...
edit:
Ok found the problem. While i was duplicating this unit, it's actor changed it's art section called "missile" to: CivilianAttack2Missile, and i had to remove this "2" manually. Now it works as it should :)
@Azzaaer: Go
heh. I'm bumping this because I found a very simple way and I figured some people might want to know. You do not need a validator of any kind or a fake/dummy behavior.
I just experimented and made my weapon work. It shoots 5 different targets, but previously would only target those same 5 targets until 1 or all died. Now, my weapon randomly targets 5 units after each attack. And will continue to do so until everything dies.
In my case, here's what's going on. My weapon's Effect is linked to Search Effect.
Set this up similarly if you want your weapon to randomize it's targets. Areas+ -> Max Count of 5 along with Target Sorts+ ->Request Count 5 is what makes it randomize 5 targets. If you have Max Count of 5 with Req Count of 3, I believe 2 targets would remain the same and it would randomize 3 other targets. Might be useful if you want your main target to always be hit, and 4 others randomized every shot. I haven't tested out the Request Count in any other capacity other than making it identical to my Areas+ Max Count #.
Request Percentage -> 1 basically means this will Target Sort 100% of the time, based on your value. 0 is 0%, and 0.5 is 50%.
Sorts - Value: TSRandom controls your request count. If you had TSShields, I believe your weapon would favor targets that had shields. Especially useful if you give a unit a weapon that does extra damage VS shields.
You will also notice that Damage Effects have a Target - Targets Sorts+ field. Placing the TargetSort value in Damage effects could be useful in other ways. Think of a rocket or grenade that on impact, deals 50 damage to target and splits into 2 which hit 2 other targets for 40. With some clever use of TS / Validators, you could turn these 2 "shrapnel" into heatseeking mini missiles.
Have fun! Oh ya, here's a video of 'The Shadow' shooting 5 beams at 5 random targets after every shot.
@BorgDragon: Go
thank you very much!! finally someone that EXPLAINED a target sort! This should be very useful for my map. But now i have an additional issue...
I am trying to make my enemy creeps acquire the hero that is shooting them. This allows the team to "dance" a large threat enemy so that he chases the one shooting him and then that hero stops attacking while other heros attack so that the enemy will effectively play monkey in the middle. Nearly every enemy unit is melee with range = 1 and all player heroes are ranged with about 14 range. Since my enemies are melee with range 1 how do I implement this search area to choose a target but without the damage effect becoming ranged?
@FahqueL: Go
Hmm, not exactly sure. Have you tried using TSPriority? It might not work since the unit has a Combat - Attack Target Priority field which does just that. Although, maybe using TSPriority will prioritize the attacking unit?
If you know any code or function, possibly take a look at AI - AI Override Target Priority, AI - Tactical AI Channel, AI - Tactical AI Function, AI - Tactical AI Range fields for units. I've got no more ideas for now.
@BorgDragon: Go
ok i seem to have found a solution to this for melee attacks. The key components are a dmg response behavior and a behavior that periodically issues an attack order.
I have attached a test map that implements it. Any customized things in the map are with editor prefix "TEST" so u can find all of them quickly. In the test map you have groups of marines surrounding abberrations and brutalisks. Try dancing the aberrations and it will work. Now try dancing the brutalisks (they dont have the following behaviors) and they will not dance. Once they acquire an attack target they stick with that target until it dies or they exhaust their chase range on their weapon.
The following items must be created in the data editor: (1) Target Sort (1) Validator (3) effects (1 issue order, 1 search area, 1 apply behavior) (3) behaviors (all 3 buffs)
In my example I use an aberration as the boss that will "dance" or always prioritize attacking someone that is attacking him.
Additional Notes: You can give the "Acquire Attacker" behavior to any enemy units you want and they will dance as well if there is one of the boss units with "mark attackers" behavior in the fight. This is highly useful for using a large hp boss to make all the creeps on screen play monkey in the middle or hot potato if you so desire.