Back again, and with another question this time. I'll start by telling you what I'm trying to accomplish. I'm making a Weapon with 4 Beams that each deliver their own damage, and try to spread that damage over as many Units as possible (4 Units in area? - fire one at each / just one? fire all on that one), preferably with a slight delay between the shots (but not absolutely necessary).
Now, with a Create Persistent Effect I can easily create 4 Damage Effects with a slight delay between them - but they all seem to fire at the same unit. I've tried to do it with markers a bit, but they don't seem to help much, and they're pretty tough to understand.
With a Set Effect I can make them all fire simultaneously by just implementing the same Damage Effect four times, but I'm again at a loss as to how to get them to spread.
And lastly, with a Search Area Effect, I can make them fire simultaneously, and distribute them properly - but the Search Area is in a Splash Damage area - it has to find one unit first, and then, according to the radius acquires the targets.
Would it be possible to combine the Search Area's target acquisition with the Create Persistent Effect somehow?
I would go for a persistent effect, which uses a search effect 4 times. Enable the id markers for the persistent effect. Create a new Target Sort, which compares marker counts (we need basically TSMarker reversed; you can copy that and reverse the order) Use the new target sort and TSDistanceToTarget for your search effect in this order. Set the number of targets to 1.
This should place a marker on each target, which was already hit. The search effects will prefer units, which were hit by less beams (aka have a lower marker count) and if equal, target the unit closest to the target (so they are guaranteed to hit the main target at least once).
Nice, yeah, makes sense, seems like a clean solution. Did all that, but where do the TS go in this case, the Search Area Effect? Doesn't seem to be working there. If it does, should the Request Count be other than 0? Tried both, don't seem to work. The beams go to friendly units too, and they still pick just one target :/
edit: Gimme a min, I'll post some screenshots
edit2: Here
Weapon link oversight
Ah, forgot the details of the TS - most important since I don't really understand those
I took the marker and just enabled descending, that correct?
edit: Sorry for all the pictures, they dont seem to be scalin :/
Hm yes, it works alright indeed. That was pretty much the same way I ended up on (after lots of struggling :P), well, yours is worked out better of course. But it still has the same problem - it searches in the area of the first acquired unit. So if both the enemy units are in the area of the firing unit, but on opposite sides of it, it will only shoot one.
Furthermore, you have to disable ally and self firing - otherwise it will start shooting them as well. Even if it hasn't acquired them as a target - the search function will include them. But when you turn that off (exclude Allies, Player and Neutral), you suddenly can't fire at Player, Neutral or Allied units anymore, even if you attack-select them.
I think I'm starting to see why this might not work though, the target acquiring doesn't work like that it seems? Isn't it possible to reset the center of the Search Area back to the Casting Unit, then use the same radius as the Weapon has and find the targets like that?
Or perhaps it's possible to create multiple weapons and have them acquire targets independently? But they'd probably end up on the same target anyways, since their position is the same, right?
edit: Thanks for helping btw!
edit2: It's also possible to attack select at your own unit, then place it on the edge of the Target Radius, and then you'll have added range to the weapon.
Hm yes, it works alright indeed. That was pretty much the same way I ended up on (after lots of struggling :P), well, yours is worked out better of course. But it still has the same problem - it searches in the area of the first acquired unit. So if both the enemy units are in the area of the firing unit, but on opposite sides of it, it will only shoot one.
I did it that way, because it seemed logical to me.
Quote:
Furthermore, you have to disable ally and self firing - otherwise it will start shooting them as well. Even if it hasn't acquired them as a target - the search function will include them. But when you turn that off (exclude Allies, Player and Neutral), you suddenly can't fire at Player, Neutral or Allied units anymore, even if you attack-select them.
For the testmap I uploaded, there shouldn't be any friendly fire.
Quote:
I think I'm starting to see why this might not work though, the target acquiring doesn't work like that it seems? Isn't it possible to reset the center of the Search Area back to the Casting Unit, then use the same radius as the Weapon has and find the targets like that?
Just set the impact location of the search to source point instead of target point and set the radius to the weapon range (or slightly higher).
In this case, I would recommend executing the first damage on the target directly, and execute 3 searches afterwards, because otherwise you won't have a guaranteed hit on your attack target.
Quote:
Or perhaps it's possible to create multiple weapons and have them acquire targets independently? But they'd probably end up on the same target anyways, since their position is the same, right?
Multiple weapons can acquire different targets, if you use different rules of acquiring (distance or angle for example); however if you initiate an attack, they will always fire at this attack target; so multiple weapons without special handling only fire on different targets, if none of the weapons can initiate an attack, making you unable to specify a target for the attack.
I did it that way, because it seemed logical to me.
That's true, but when you turn friendly fire on, the targets acquired by the Search Area Effect will disregard the allegiance of the first acquisition. Is it possible to set the allegiance of Search Area to the same as the first acquired target/auto-acquired/attack-selected?
Quote:
Just set the impact location of the search to source point instead of target point and set the radius to the weapon range (or slightly higher).
In this case, I would recommend executing the first damage on the target directly, and execute 3 searches afterwards, because otherwise you won't have a guaranteed hit on your attack target.
Oh hell! That worked perfectly. Now it's not searching in the area of the target anymore! I tried this as well before, but I guess I did something wrong, it even made SC2 crash every time I tested the map. I think I did it on the wrong effect, or something like that. Works well now though.
That's true, but when you turn friendly fire on, the targets acquired by the Search Area Effect will disregard the allegiance of the first acquisition. Is it possible to set the allegiance of Search Area to the same as the first acquired target/auto-acquired/attack-selected?
If this is mandatory, you can use a Switch effect and a Validator in combination with another search effect. Basically, you want to check the alliance status to the target player (there should be a validator for this - I think you can check a target filter similar to the search filters of the search effects).
If it is an enemy, execute the usual search.
If it is an ally, execute another search, which searches allies instead.
@snekkel: GoIf this is mandatory, you can use a Switch effect and a Validator in combination with another search effect. Basically, you want to check the alliance status to the target player (there should be a validator for this - I think you can check a target filter similar to the search filters of the search effects).
If it is an enemy, execute the usual search.
If it is an ally, execute another search, which searches allies instead.
Excellent! Now I'm on track to get it solved :) Working with Switch - Validator for Enemy, executes the normal Set (which calls the Persistent and then Search Area and so forth) and the Default effect set to aim at one single target (since you can be sure that the target is selected if it's not an enemy.
When the Switch goes to the Default effect it doesn't do any damage though. Is it because I'm using the Default effect; should I just use another Effect - Case for it?
edit: Belay that - changing the value of Target - Location + from Target Point to Target Unit worked!
Allright, got it working up to my satisfaction. With trial and error though, I still don't completely understand the markers, they work in mysterious ways...
So what I ended up with is 6 Effects in total. Overview: Switch > ( [ Create Persistent > Damage ] OR [ Set > ( [ Damage ] AND [ Create Persistent > Search Area > Damage ] ) )**
In detail: Weapon directs to a Switch Effect containing
Effect - Default
[-]Default - Persistent Single
Effect - Cases +
[-]Effect - Enemy Set Effect (Set)
[-]Validator - Target is Enemy (Fall Through - Disabled)
The Target is Enemy validator excludes Player, Ally and Neutral, so it will use this effect only when aiming at an enemy. Default effect Persistent Single, which is used when aiming at yourself (player), Neutral or Ally merely consists of a persistent effect with 4 periods that directly uses the Laser Damage Effect
Enemy Set Effect contains
Effect - Effects
[-]Effects - Laser Damage(to make sure the first shot is fired properly)
[-]Effects - Persistent Enemy (type: Create Persistent)
Target - Marker +
[-]Match Flags - Id - Enabled
Persistent Enemy contains
Effect - Flags
[-]Flags - Channeled
Effect - Period Count
[-]Period Count - 3 (now you're firing the rest of the shots, after the first, in my case 3 to make it 4 in total)
Search - Areas +
[-]Arc - 360
[-]Effect - Laser Damage
[-]Maximum Count - -1
[-]Radius - 8 (Set this to your weapon's range + 1, to get the same range)
[-]Radius Bonus - 0
Search - Maximum Count
[-]Maximum Count - 1
Search - Search Filters
[-]Exclude - Player, Ally, Neutral (this is to stop it from including allied units, since Search Area effects basically reset all of this)
Target - Impact Location
[-]Value - Source Unit (setting this to the source unit will make it start the search from the middle of the unit, instead of the middle of the unit that's being targeted)
Target - Target Sorts
[-]Sorts - (TSMarker) (still not sure on how markers work, but this seems to make it try to lock on to as many targets as possible that have markers. Setting the markers in the Set Effect makes sure that it includes a marker for the first unit that isn't included in the Persistent Effect. If you would set the markers in the Persistent Effect it would hit the first found target twice, and then divide over the rest)
Laser Damage contains the usual for any Damage Effect, just specify the damage and such here.
My apologies if this isn't clear enough, never really made much of an explanation/tutorial before, but thought it might be helpful to some. Much much credit to Kueken531, second time you've helped me, it's very much appreciated!
Back again, and with another question this time. I'll start by telling you what I'm trying to accomplish. I'm making a Weapon with 4 Beams that each deliver their own damage, and try to spread that damage over as many Units as possible (4 Units in area? - fire one at each / just one? fire all on that one), preferably with a slight delay between the shots (but not absolutely necessary).
Now, with a Create Persistent Effect I can easily create 4 Damage Effects with a slight delay between them - but they all seem to fire at the same unit. I've tried to do it with markers a bit, but they don't seem to help much, and they're pretty tough to understand.
With a Set Effect I can make them all fire simultaneously by just implementing the same Damage Effect four times, but I'm again at a loss as to how to get them to spread.
And lastly, with a Search Area Effect, I can make them fire simultaneously, and distribute them properly - but the Search Area is in a Splash Damage area - it has to find one unit first, and then, according to the radius acquires the targets.
Would it be possible to combine the Search Area's target acquisition with the Create Persistent Effect somehow?
I would go for a persistent effect, which uses a search effect 4 times. Enable the id markers for the persistent effect. Create a new Target Sort, which compares marker counts (we need basically TSMarker reversed; you can copy that and reverse the order) Use the new target sort and TSDistanceToTarget for your search effect in this order. Set the number of targets to 1.
This should place a marker on each target, which was already hit. The search effects will prefer units, which were hit by less beams (aka have a lower marker count) and if equal, target the unit closest to the target (so they are guaranteed to hit the main target at least once).
Does this make sense to you?
Nice, yeah, makes sense, seems like a clean solution. Did all that, but where do the TS go in this case, the Search Area Effect? Doesn't seem to be working there. If it does, should the Request Count be other than 0? Tried both, don't seem to work. The beams go to friendly units too, and they still pick just one target :/
edit: Gimme a min, I'll post some screenshots
edit2: Here
Weapon link oversight
Weapon details
Damage details
Search details
Persistent details
It should be.
All the screenshots are not really that helpful, though, could you attach the map?
€ ah, my bad. We will not need a custom target sort, TSMarker uses the correct order already :)
Just tried it, seems to work just fine.
If in doubt add a turret and do like the goliath weapon upgrades.
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
I did it that way, because it seemed logical to me.
For the testmap I uploaded, there shouldn't be any friendly fire.
Just set the impact location of the search to source point instead of target point and set the radius to the weapon range (or slightly higher).
In this case, I would recommend executing the first damage on the target directly, and execute 3 searches afterwards, because otherwise you won't have a guaranteed hit on your attack target.
Multiple weapons can acquire different targets, if you use different rules of acquiring (distance or angle for example); however if you initiate an attack, they will always fire at this attack target; so multiple weapons without special handling only fire on different targets, if none of the weapons can initiate an attack, making you unable to specify a target for the attack.
That's true, but when you turn friendly fire on, the targets acquired by the Search Area Effect will disregard the allegiance of the first acquisition. Is it possible to set the allegiance of Search Area to the same as the first acquired target/auto-acquired/attack-selected?
Oh hell! That worked perfectly. Now it's not searching in the area of the target anymore! I tried this as well before, but I guess I did something wrong, it even made SC2 crash every time I tested the map. I think I did it on the wrong effect, or something like that. Works well now though.
If this is mandatory, you can use a Switch effect and a Validator in combination with another search effect. Basically, you want to check the alliance status to the target player (there should be a validator for this - I think you can check a target filter similar to the search filters of the search effects).
If it is an enemy, execute the usual search.
If it is an ally, execute another search, which searches allies instead.
Excellent! Now I'm on track to get it solved :) Working with Switch - Validator for Enemy, executes the normal Set (which calls the Persistent and then Search Area and so forth) and the Default effect set to aim at one single target (since you can be sure that the target is selected if it's not an enemy.
When the Switch goes to the Default effect it doesn't do any damage though. Is it because I'm using the Default effect; should I just use another Effect - Case for it?
edit: Belay that - changing the value of Target - Location + from Target Point to Target Unit worked!
Allright, got it working up to my satisfaction. With trial and error though, I still don't completely understand the markers, they work in mysterious ways...
So what I ended up with is 6 Effects in total. Overview:
Switch > ( [ Create Persistent > Damage ] OR [ Set > ( [ Damage ] AND [ Create Persistent > Search Area > Damage ] ) )**
In detail:
Weapon directs to a Switch Effect containing
[-]Default - Persistent Single
[-]Effect - Enemy Set Effect (Set)
[-]Validator - Target is Enemy (Fall Through - Disabled)
The Target is Enemy validator excludes Player, Ally and Neutral, so it will use this effect only when aiming at an enemy. Default effect Persistent Single, which is used when aiming at yourself (player), Neutral or Ally merely consists of a persistent effect with 4 periods that directly uses the Laser Damage Effect
Enemy Set Effect contains
[-]Effects - Laser Damage (to make sure the first shot is fired properly)
[-]Effects - Persistent Enemy (type: Create Persistent)
[-]Match Flags - Id - Enabled
Persistent Enemy contains
[-]Flags - Channeled
[-]Period Count - 3 (now you're firing the rest of the shots, after the first, in my case 3 to make it 4 in total)
[-]Period Effects - Search Enemy (type: Search Area)
Search Enemy contains
[-]Arc - 360
[-]Effect - Laser Damage
[-]Maximum Count - -1
[-]Radius - 8 (Set this to your weapon's range + 1, to get the same range)
[-]Radius Bonus - 0
[-]Maximum Count - 1
[-]Exclude - Player, Ally, Neutral (this is to stop it from including allied units, since Search Area effects basically reset all of this)
[-]Value - Source Unit (setting this to the source unit will make it start the search from the middle of the unit, instead of the middle of the unit that's being targeted)
[-]Sorts - (TSMarker) (still not sure on how markers work, but this seems to make it try to lock on to as many targets as possible that have markers. Setting the markers in the Set Effect makes sure that it includes a marker for the first unit that isn't included in the Persistent Effect. If you would set the markers in the Persistent Effect it would hit the first found target twice, and then divide over the rest)
Laser Damage contains the usual for any Damage Effect, just specify the damage and such here.
My apologies if this isn't clear enough, never really made much of an explanation/tutorial before, but thought it might be helpful to some. Much much credit to Kueken531, second time you've helped me, it's very much appreciated!
Pictures of it in action.
Firing at enemy (auto, or select-attack)
Firing at own unit, no overlap to neutral or enemy units
Thanks again!