Tried searching and couldn't find anything helpful or any tutorial on the matter.
I am trying to create a wide-scale ammo system.
How I want it to work is for units to attack like regular, but to have a limited number of shots. Like how the harvesting system, when the run out of ammo I want them to move to the nearest building capable of restoring ammo (or in my example, capable of accepting resources) and then return to what they were fighting (if possible) just like workers go back to harvesting.
Thats the difficult part.
Using charges, I've been able to make it so that marines have a limited amount of ammo. When they run out, they stop attacking. I have no idea where to start in making them automatically get more ammo in the way described, though.
Another issue I have is I want it to display how much ammo (charges) they have left.
Any ideas? Is this even feasible using the data editor? (Or data-trigger hybrid - ammo system in data, automatic reloading with triggers)
I would just use buff stacks and a switch effect on the weapon. Last target has a marker buff. Ammo building uses a Battery ability. When ammo stacks depleted weapon uses global search that uses issue order to nearest battery which then fills up ammo stacks. When stacks are full the marker buff on the target activates to issue order the unit back.
Number of ammo rounds could be shown using actors.
Rollback Post to RevisionRollBack
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
@DrSuperEvil: Go
Thanks for your (as usual) great advice. It always leaves me feeling more stupid then before, but at least with some place to look. You provide the lock but not the key, so to speak. (Not that I have a problem with this - explaining the whole process might be tedious, and its good to let one learn for ones self rather then do everything for them)
Just to make sure I understand this correctly:
I have a Switch Effect that is used as the effect for the weapon, rather then the usual Weapon Effect.
The Default effect for this switch effect is the units normal weapon effect.
Under Cases I add a case with the effect being a Global Search Area (That will order the unit to the nearest building with the Battery ability) and a validator that checks if I am out of Ammo buff stacks?
The structure for recharging will have a Battery ability, which adds stacks of the Ammo buff (I just need a regular Apply Behavior for this?) until he has reached a maximum number of stacks.
Using Target marker buffs (?) to order the unit back to what he was originally fighting?
Do I have the general correct idea? Or am I completely off?
I tried making it using this general method, but ran into some roadblocks. Not sure if I'm doing it correctly at all.
For one thing, I'm not sure I'm using the switch effect correctly with the weapon. Secondly, I'm not sure how to set up the ammo buff at all - how to make it start with a certain number of stacks (ammo) and how to deplete one every time you attack. (Perhaps thats related to my miss-use of the switch effect?)
Anyway, I'll go back to trying to figure it out. Just checking if I am on the right track. Any help appreciated!
With switch effects you need to contrary validators. in the Effect - Cases - Validator field. Weapon uses a switch that is validated by Unit Compare Behaviour Count validators with it having greater than 0 stacks of the ammo buff causing it to use the attack Set effect while having equals to 0 stacks uses the global search that uses Issue Order to move to the battery ability containing unit. The attack set uses an Apply Behavior to apply a buff to the target unit which is disabled as long as the unit does not have max ammo and uses a periodic set to issue order the caster to attack it (source) and removes the buff, a Remove Behavior effect that removes 1 stack of the ammo buff on attack and then your Damage effect.
Yeah just use an Apply Behavior effect on the Battery ability validated that the unit does not have max stack amount (to reduce lag since battery uses an effect about 1.4x per second). For starting stack amounts you need to use another buff with a very low duration that as an initial effect uses an Apply Behavior effect to apply the right number.
Rollback Post to RevisionRollBack
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
I now start with a proper amount of stacks, and after attacking the right amount of times the stack wears off.
This is about the extent of my success: I've gotten him to move to a building, but I can't get the validator for whether it has the battery ability set up correctly.
And when it moves, it moves ON to the unit, not as if it is targeting the unit - ie, it does not trigger the battery ability. (Manually targeting it causes the battery to work fine)
I also don't know how to make it target the closet unit - in fact, it seems to target the furthest away by default.
I am also not sure how to get it to send him back - not sure what you meant by using marker effects to do this.
Then I just need to start working on getting an actor to display the ammo count on top of the weapon. >_<
Argh. Sorry for being such a noob - I tried for some time to figure out what I am doing wrong for some time, but with no success.
Here is the map if it helps you pinpoint what I'm doing wrong.
Sorry, not tried using issue orders to activate a battery before, maybe you need a behaviour on the battery that orders it to use the battery ability on a 0 ammo unit at very low range. How searches target units is down to Target Sorts, these can do alot but use TSDistance for your needs.
In short when weapon fires it applies a buff to the target, this buff acts as a marker that sends the attacking unit back to it when it has max ammo stacks.
With the actor use a Text type actor for each instance.
Now for the map, nice use of the Unit Ability validator, first time I have seen someone use it. All looks ok except the lack of the application of the return when full buff to the target under the AmmoAttackSet effect. Set the max count of your global search to 1.
Rollback Post to RevisionRollBack
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
Sorry, not tried using issue orders to activate a battery before, maybe you need a behaviour on the battery that orders it to use the battery ability on a 0 ammo unit at very low range.
Well, I thought the issue order command was simply treating its target as a point instead of a unit, and if you knew how to change it that would be fixed. If this isn't possible (or you think thats not the issue) I can attempt to figure out how to make a behavior do that.
Quote:
How searches target units is down to Target Sorts, these can do alot but use TSDistance for your needs.
Hm. I actually tried that, because from looking at some other things that seemed like it would work. I am confused why I thought it didn't work the first time, but when I tried it this time it works for sure. So turns out, I had this one figured out and I just made a dumb mistake.
Quote:
In short when weapon fires it applies a buff to the target, this buff acts as a marker that sends the attacking unit back to it when it has max ammo stacks.. . .all looks ok except the lack of the application of the return when full buff to the target under the AmmoAttackSet effect.
Hmm, so I need to create a new, separate buff that is applied to the target in the Attack Set that issues the attacking unit to return to attacking it? Is this buff applied every attack?
I sorta get the idea in theory, but I have no clue how to set the buff up to do that.. Not sure how to detect when the unit has refilled on ammo as a result of running out, how to detect when it is full of ammo again, and then have it issue attacker to target itself - all using a buff.
Quote:
Now for the map, nice use of the Unit Ability validator, first time I have seen someone use it.
Err.. as I mentioned in my other post my Unit Ability Validator, as nice as it is, is not working - my unit goes to any type of building, irregardless if it has the ability or not. I'm at a complete loss as to why - I've experimented with its settings quite a lot trying to get it to work.
I'm real bad at actors, so I'm not going to try and tackle that one until I get the rest of the spell working, but the part that I imagined would be difficult about it is that I wanted it to appear above the "Kills" count on the unit, not just floating text above the units head. Whether your suggested method would do that or not, I don't know - but I'm pretty sure it'll be a bit difficult for me to do, so I'll solve my current issues first.
As usual, thanks for taking the time to answer every question and stick with me despite being slow to understand the ways of the editor.
With the return to target buff just have it disabled and use the ffect periodically using a validator that checks if the caster has the buffs and then issue orders the caster to the source.
Maybe use a Unit Type validator then or specify a specific battery ability.
You either need a leaderboard (triggers) or to modify the UI interface (read aiur chef method tutorial).
A;so looking at your effect tree the validator is in the wrong spot. It needs to be on the effect after the search and not the search iteself.
I fixed my issue with using the battery by changing the command from Move to the Battery ability and switching the target\caster - in other words, it orders the ammo cache to target the marine, thus causing the marine to come back and refuel correctly.
I fixed the validator - all I had to do is move it to the correct position, as you said.
I made it so that a Return Buff is added to the target when the unit runs out of ammo (in a set along with the global search to order them to get ammo) and it correctly orders the unit to return. However, there is one problem: The unit continues being ordered to attack, even if you tell it not to - is there any way to cause the behavior to be removed or turned off after it orders the unit to attack once?
Also, do you think it will lag the game if too many units are being rapidly checked with the periodic checker?
I wish I hadn't thought of this just now, but using this method the unit will not go back to attacking if the target unit dies - is there any way to make the unit attack move to the position that the unit he was attacking used to be? Or would I be better off trying to trigger it if I want that. ._.
Then all I have to do is find *some* way of displaying the ammo count, which will be a pain... Modifying the UI interface using the Auir Chef method seems like the smartest way, but I have no experience with that.
Edit: Took the easy way out with displaying ammo count - just made an attribute that does nothing and had the ammo buff stack add one of it - and viola, ammo count. Works for me.
Get the behaviour to use a set effect that does what you want and then removes itself via a Remove Behavior effect.
I tried that, but it didn't work - the unit wouldn't return any more. My theory is that it removed the marker buff BEFORE the unit was ordered to return. Anyway, if I am going to use a Create Persistent instead, how would I have that destroy itself?
Quote:
What periodic checker?
Err, the Marker Buff (or in this case, the create persistent) that constantly checks if the unit has full ammo again so it can order it to return? I hope I didn't misunderstand you and make it in a completely different way then you intended.
I'm guessing it wont be an issue, though.
Quote:
You could insert a Create Persistent effect created at the point of the unit on death that does the same function.
I've decided just to use the Create Persistent effect from the start. (I think it will work better overall)
Ok, so heres what I currently have: The effect set for when you run out of ammo on the switcher has two effects - the global search to find the battery unit, and the Create Persistent effect instead of the Add Marker Buff effect.
The Create Persistent effect has a maximum number of periods (for the time being) with a period duration of 0.5 (thats what the marker buff was) and a period effect that issues the casting unit to return to the persistent if it has refilled on ammo.
But it doesn't work. Any idea what I did wrong? How should the targets be set up?
Here is the map once more, if you need to look at it in order to see how I muddled things up this time.
As always, grateful you haven't given up on me as a hopeless case,
The buff on the target is disabled via validators so no need for periodic checking (less lag). It only creates the persistent on unit death as a backup system.
There is a Destroy Persistent effect which could help you. Try the persist until destroyed flag insead of high count numbers.
Need to do some testing. Ok your persistent is being created at the caster point when it ran out of ammo, this what you want? You are also ordering the unit to attack itself. The effect on your battery ability has no validator so it might be the ability overriding the issue order? Seems the issue order would not accept a source point as a target and the persistent needed to target a unit.
Here is a crude fix but it makes it go to point of last target.
.It only creates the persistent on unit death as a backup system.
Ah - I decided to use a Persistent from the start because if the target unit has moved away while the unit was attacking, in its current form the unit would chase it's target down and attack it anyway, even though the player wouldn't actually know where the unit to since it moved out of vision. I take it you don't recommend this because unlike the other way, it could cause lag?
Quote:
There is a Destroy Persistent effect which could help you. Try the persist until destroyed flag instead of high count numbers.
OK, thanks. Problem is, the persistent isn't removed until the attacking unit returns to the spot he should be at - I want it to be removed just after the unit is issued the order. Why? Because a player might decided he *doesn't* want the unit to return, and manually order the unit to stop. How it currently works he wont be able to do that, because the persistent will keep re-commanding the unit to the spot. Any idea why its currently working as such?
Edit: Me = stupid again - the persistent isn't ever being removed, just after attacking they have less then full ammo and it has a validator that only tells them to return when they get full ammo. That means I just failed to set up the remove persistent correctly. Still not sure what I'm doing wrong, though.
Quote:
You are also ordering the unit to attack itself.
Lol, I'm an idiot. Got it working now, thanks. Some of the other things might have been off because I was trying random things to get it to work, but I think this was my main problem.
Depends on how often your periodic fires and how many units will be using it at once. You could use a Unit Filter validator that requires the target to be visible.
You need to give your returnammoset Set the validator your issue order has else the persistent is destroying itself on the first use.
By the way nice use of attributes to get around showing the ammo count, had forgotten about that.
Alright, sorry, got it working now. Tried looking it up but Destroy Persistent isn't very widely used\documented from the looks of it.
Now it works about 50% of the time, maybe less - it will send the units back and destroy the persistent some times, but the rest of the time the persistent is destroyed too soon and the unit is never sent back. I did give the returnammoset Set the validator my issue order has.
I confused by its intermittency - it seems to happen more often
My advise if to use the high templar persistent effect or the banshee cluster bomb search as a test since it has an easy to spot visual. Only potential fix i can think of is to add a persistent effect as a delay (like colossus damage has) to delay between the effect happening and the destruction of the persistent.
Rollback Post to RevisionRollBack
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
Delay didn't fix it (though I was wondering how you'd add delay, so its good to know)
I was considering try and make it destroy itself via a validator rather then via Destroy Persistent by having a marker buff on the target unit so that the persistent destroys itself when the unit gets the marker buff that says the unit has been issued back.. Never got it to work, though.
Tried searching and couldn't find anything helpful or any tutorial on the matter.
I am trying to create a wide-scale ammo system.
How I want it to work is for units to attack like regular, but to have a limited number of shots. Like how the harvesting system, when the run out of ammo I want them to move to the nearest building capable of restoring ammo (or in my example, capable of accepting resources) and then return to what they were fighting (if possible) just like workers go back to harvesting.
Thats the difficult part.
Using charges, I've been able to make it so that marines have a limited amount of ammo. When they run out, they stop attacking. I have no idea where to start in making them automatically get more ammo in the way described, though.
Another issue I have is I want it to display how much ammo (charges) they have left.
Any ideas? Is this even feasible using the data editor? (Or data-trigger hybrid - ammo system in data, automatic reloading with triggers)
I would just use buff stacks and a switch effect on the weapon. Last target has a marker buff. Ammo building uses a Battery ability. When ammo stacks depleted weapon uses global search that uses issue order to nearest battery which then fills up ammo stacks. When stacks are full the marker buff on the target activates to issue order the unit back.
Number of ammo rounds could be shown using actors.
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg
@DrSuperEvil: Go Thanks for your (as usual) great advice. It always leaves me feeling more stupid then before, but at least with some place to look. You provide the lock but not the key, so to speak. (Not that I have a problem with this - explaining the whole process might be tedious, and its good to let one learn for ones self rather then do everything for them)
Just to make sure I understand this correctly:
I have a Switch Effect that is used as the effect for the weapon, rather then the usual Weapon Effect.
The Default effect for this switch effect is the units normal weapon effect.
Under Cases I add a case with the effect being a Global Search Area (That will order the unit to the nearest building with the Battery ability) and a validator that checks if I am out of Ammo buff stacks?
The structure for recharging will have a Battery ability, which adds stacks of the Ammo buff (I just need a regular Apply Behavior for this?) until he has reached a maximum number of stacks.
Using Target marker buffs (?) to order the unit back to what he was originally fighting?
Do I have the general correct idea? Or am I completely off?
I tried making it using this general method, but ran into some roadblocks. Not sure if I'm doing it correctly at all.
For one thing, I'm not sure I'm using the switch effect correctly with the weapon. Secondly, I'm not sure how to set up the ammo buff at all - how to make it start with a certain number of stacks (ammo) and how to deplete one every time you attack. (Perhaps thats related to my miss-use of the switch effect?)
Anyway, I'll go back to trying to figure it out. Just checking if I am on the right track. Any help appreciated!
Thanks,
TheSkunk
With switch effects you need to contrary validators. in the Effect - Cases - Validator field. Weapon uses a switch that is validated by Unit Compare Behaviour Count validators with it having greater than 0 stacks of the ammo buff causing it to use the attack Set effect while having equals to 0 stacks uses the global search that uses Issue Order to move to the battery ability containing unit. The attack set uses an Apply Behavior to apply a buff to the target unit which is disabled as long as the unit does not have max ammo and uses a periodic set to issue order the caster to attack it (source) and removes the buff, a Remove Behavior effect that removes 1 stack of the ammo buff on attack and then your Damage effect.
Yeah just use an Apply Behavior effect on the Battery ability validated that the unit does not have max stack amount (to reduce lag since battery uses an effect about 1.4x per second). For starting stack amounts you need to use another buff with a very low duration that as an initial effect uses an Apply Behavior effect to apply the right number.
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
Thanks! I am getting oh-so-closer.
I now start with a proper amount of stacks, and after attacking the right amount of times the stack wears off.
This is about the extent of my success: I've gotten him to move to a building, but I can't get the validator for whether it has the battery ability set up correctly.
And when it moves, it moves ON to the unit, not as if it is targeting the unit - ie, it does not trigger the battery ability. (Manually targeting it causes the battery to work fine)
I also don't know how to make it target the closet unit - in fact, it seems to target the furthest away by default.
I am also not sure how to get it to send him back - not sure what you meant by using marker effects to do this.
Then I just need to start working on getting an actor to display the ammo count on top of the weapon. >_<
Argh. Sorry for being such a noob - I tried for some time to figure out what I am doing wrong for some time, but with no success.
Here is the map if it helps you pinpoint what I'm doing wrong.
Thanks again for your help, though.
Sorry, not tried using issue orders to activate a battery before, maybe you need a behaviour on the battery that orders it to use the battery ability on a 0 ammo unit at very low range. How searches target units is down to Target Sorts, these can do alot but use TSDistance for your needs.
In short when weapon fires it applies a buff to the target, this buff acts as a marker that sends the attacking unit back to it when it has max ammo stacks.
With the actor use a Text type actor for each instance.
Now for the map, nice use of the Unit Ability validator, first time I have seen someone use it. All looks ok except the lack of the application of the return when full buff to the target under the AmmoAttackSet effect. Set the max count of your global search to 1.
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
Well, I thought the issue order command was simply treating its target as a point instead of a unit, and if you knew how to change it that would be fixed. If this isn't possible (or you think thats not the issue) I can attempt to figure out how to make a behavior do that.
Hm. I actually tried that, because from looking at some other things that seemed like it would work. I am confused why I thought it didn't work the first time, but when I tried it this time it works for sure. So turns out, I had this one figured out and I just made a dumb mistake.
Hmm, so I need to create a new, separate buff that is applied to the target in the Attack Set that issues the attacking unit to return to attacking it? Is this buff applied every attack?
I sorta get the idea in theory, but I have no clue how to set the buff up to do that.. Not sure how to detect when the unit has refilled on ammo as a result of running out, how to detect when it is full of ammo again, and then have it issue attacker to target itself - all using a buff.
Err.. as I mentioned in my other post my Unit Ability Validator, as nice as it is, is not working - my unit goes to any type of building, irregardless if it has the ability or not. I'm at a complete loss as to why - I've experimented with its settings quite a lot trying to get it to work.
I'm real bad at actors, so I'm not going to try and tackle that one until I get the rest of the spell working, but the part that I imagined would be difficult about it is that I wanted it to appear above the "Kills" count on the unit, not just floating text above the units head. Whether your suggested method would do that or not, I don't know - but I'm pretty sure it'll be a bit difficult for me to do, so I'll solve my current issues first.
As usual, thanks for taking the time to answer every question and stick with me despite being slow to understand the ways of the editor.
With the return to target buff just have it disabled and use the ffect periodically using a validator that checks if the caster has the buffs and then issue orders the caster to the source.
Maybe use a Unit Type validator then or specify a specific battery ability.
You either need a leaderboard (triggers) or to modify the UI interface (read aiur chef method tutorial).
A;so looking at your effect tree the validator is in the wrong spot. It needs to be on the effect after the search and not the search iteself.
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 fixed my issue with using the battery by changing the command from Move to the Battery ability and switching the target\caster - in other words, it orders the ammo cache to target the marine, thus causing the marine to come back and refuel correctly.
I fixed the validator - all I had to do is move it to the correct position, as you said.
I made it so that a Return Buff is added to the target when the unit runs out of ammo (in a set along with the global search to order them to get ammo) and it correctly orders the unit to return. However, there is one problem: The unit continues being ordered to attack, even if you tell it not to - is there any way to cause the behavior to be removed or turned off after it orders the unit to attack once?
Also, do you think it will lag the game if too many units are being rapidly checked with the periodic checker?
I wish I hadn't thought of this just now, but using this method the unit will not go back to attacking if the target unit dies - is there any way to make the unit attack move to the position that the unit he was attacking used to be? Or would I be better off trying to trigger it if I want that. ._.
Then all I have to do is find *some* way of displaying the ammo count, which will be a pain... Modifying the UI interface using the Auir Chef method seems like the smartest way, but I have no experience with that.
Get the behaviour to use a set effect that does what you want and then removes itself via a Remove Behavior effect.
What periodic checker?
You could insert a Create Persistent effect created at the point of the unit on death that does the same function.
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
Edit: Took the easy way out with displaying ammo count - just made an attribute that does nothing and had the ammo buff stack add one of it - and viola, ammo count. Works for me.
I tried that, but it didn't work - the unit wouldn't return any more. My theory is that it removed the marker buff BEFORE the unit was ordered to return. Anyway, if I am going to use a Create Persistent instead, how would I have that destroy itself?
Err, the Marker Buff (or in this case, the create persistent) that constantly checks if the unit has full ammo again so it can order it to return? I hope I didn't misunderstand you and make it in a completely different way then you intended.
I'm guessing it wont be an issue, though.
I've decided just to use the Create Persistent effect from the start. (I think it will work better overall)
Ok, so heres what I currently have: The effect set for when you run out of ammo on the switcher has two effects - the global search to find the battery unit, and the Create Persistent effect instead of the Add Marker Buff effect.
The Create Persistent effect has a maximum number of periods (for the time being) with a period duration of 0.5 (thats what the marker buff was) and a period effect that issues the casting unit to return to the persistent if it has refilled on ammo.
But it doesn't work. Any idea what I did wrong? How should the targets be set up?
Here is the map once more, if you need to look at it in order to see how I muddled things up this time.
As always, grateful you haven't given up on me as a hopeless case,
- TheSkunk
The buff on the target is disabled via validators so no need for periodic checking (less lag). It only creates the persistent on unit death as a backup system.
There is a Destroy Persistent effect which could help you. Try the persist until destroyed flag insead of high count numbers.
Need to do some testing. Ok your persistent is being created at the caster point when it ran out of ammo, this what you want? You are also ordering the unit to attack itself. The effect on your battery ability has no validator so it might be the ability overriding the issue order? Seems the issue order would not accept a source point as a target and the persistent needed to target a unit.
Here is a crude fix but it makes it go to point of last target.
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
Ah - I decided to use a Persistent from the start because if the target unit has moved away while the unit was attacking, in its current form the unit would chase it's target down and attack it anyway, even though the player wouldn't actually know where the unit to since it moved out of vision. I take it you don't recommend this because unlike the other way, it could cause lag?
OK, thanks. Problem is, the persistent isn't removed until the attacking unit returns to the spot he should be at - I want it to be removed just after the unit is issued the order. Why? Because a player might decided he *doesn't* want the unit to return, and manually order the unit to stop. How it currently works he wont be able to do that, because the persistent will keep re-commanding the unit to the spot. Any idea why its currently working as such?
Edit: Me = stupid again - the persistent isn't ever being removed, just after attacking they have less then full ammo and it has a validator that only tells them to return when they get full ammo. That means I just failed to set up the remove persistent correctly. Still not sure what I'm doing wrong, though.
Lol, I'm an idiot. Got it working now, thanks. Some of the other things might have been off because I was trying random things to get it to work, but I think this was my main problem.
Depends on how often your periodic fires and how many units will be using it at once. You could use a Unit Filter validator that requires the target to be visible.
You need to give your returnammoset Set the validator your issue order has else the persistent is destroying itself on the first use.
By the way nice use of attributes to get around showing the ammo count, had forgotten about that.
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
Clearly I'm just setting up the Destroy Persistent effect wrong, because no matter what I do it doesn't destroy the persistent.
I tried it using 134 marines at once and it still seemed ok.. so I'm probably not going to worry about lag too much for the time being
Of course, maybe my computer is just badass, I dunno.
Set the target of it to caster and the count to 1. If in doubt look how nova does it with her one ability.
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
Alright, sorry, got it working now. Tried looking it up but Destroy Persistent isn't very widely used\documented from the looks of it.
Now it works about 50% of the time, maybe less - it will send the units back and destroy the persistent some times, but the rest of the time the persistent is destroyed too soon and the unit is never sent back. I did give the returnammoset Set the validator my issue order has.
I confused by its intermittency - it seems to happen more often
My advise if to use the high templar persistent effect or the banshee cluster bomb search as a test since it has an easy to spot visual. Only potential fix i can think of is to add a persistent effect as a delay (like colossus damage has) to delay between the effect happening and the destruction of the persistent.
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
Delay didn't fix it (though I was wondering how you'd add delay, so its good to know)
I was considering try and make it destroy itself via a validator rather then via Destroy Persistent by having a marker buff on the target unit so that the persistent destroys itself when the unit gets the marker buff that says the unit has been issued back.. Never got it to work, though.
Is your destroy persistent lower in the list than your other effects in the set?
Problem with that solution is if the target unit dies the buff is known as removed.
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