I have made an ability which gives a building a buff. The buff makes the building able to produce 2 units at the same time. (Like a temporary reactor)
As soon as the buff expires, 1 of the 2 units that are being produced is canceled.
For example:
I cast the spell on my barrack. It gets a buff that enables it to produce 2 units at the same time. I start produce 2 marines. After 10 seconds, when the buff expires, one of the marines cancels and I get the resources back.
Is there anyway to make the buff expire as soon as it has produced 2 units, no matther how long it takes to complete the units?
**
I have uploaded a test version of the map. I have created the ability described below in the thread. For some reason the stuff won´t work. Anyone wanna have a look and tell me what I am doing wrong?
You tried disabling the buff and seeing how that affects production?
How do you mean?
Once the buff is applied to a building I want it to last until the produced units are finsihed, no matther how long time it takes. But this might be hard as hell to get to work.. : /
I just don´t want the buff to expire after X seconds, cause that cancels units that are not finished within time. :(
You would need a second buff that removes it but I cannot think of a clean way of doing that in that the Unit Order validator would stay enabled because once the once unit finishes training it would re-enable with the next. Still worth a try incase it momentarily flashes off but would need a 0.016 periodic to detect.
Rollback Post to RevisionRollBack
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
I don't really have the time currently to check this out for you, but basically, the first behavior lasts 10.5 seconds, upon which time you MUST max out the building queue. Tot test this, make barracks have a queue count and queue size 1, and the buff could have queue count and queue size 1(allowing 2 units to be built simultaneously - I just gave the example of 2 max queue for simplicity's sake)
At 10 seconds, the second buff is added just before the first buff expires, allowing continued double queue. The validator on the second buff checks to ensure that the queue ability is maxed(at 2) and if not, removes the behavior instantly.
Does that make a bit of sense?? I hope so. Should be at least a look in the right direction(hopefully)
I´ve built the buffs and effects you describe. When I apply the buff to a building the production stops. Totally. 2 units starts to be produced as intended, but the timer freezes.
Any suggestions what might be wrong? :s
Edit: Ah I found out! The time scala field had been reduzed to 0.01. T_T
You would need a second buff that removes it but I cannot think of a clean way of doing that in that the Unit Order validator would stay enabled because once the once unit finishes training it would re-enable with the next. Still worth a try incase it momentarily flashes off but would need a 0.016 periodic to detect.
But if the queue size is limited to only 2 slots?
In this case the buff will end as soon as it can´t "detect" anything more in the queue. There will always be a gap between a unit finishes and a player who clicks to start the next unit.
Your create persistent has Target+ set to Target Point. It needs to be Target Unit - but would likely not work since the Building/Source is casting it, and Target Unit usually means OTHER unit, would have to be Caster Unit or Source Unit, etc.
I don't know why you use a Create Persistent... you could LITERALLY just use an Apply Behavior effect as your Periodic Effect to cast the buff on itself.
Anyways, I did some playing around and I got it working. I realized that Unit Compare Order Count validating a Queue ability is just incorrect(Since the Queue ability is never actually given an order unless it's to Cancel the queue). What I did was instead, Unit Compare Order Count the Barracks - Train ability to 'Equal' '2'.
But this makes this so much more of a hassle, since you would have to have multiple validators to compare the Order Count of each building's Train ability. Not to mention, you would have to work something out for buildings with a normal Queue (5) ability, adding Queue Count 1 and Queue Size 1 on the behavior, requiring the Unit Compare Order Count on the train ability(ies) set to Equal 6 or something (Or just Queue Count 1, Queue Size 0, requiring Equal 5)
Attached my map for your viewing. You can also stagger your marines starting the first right away and waiting like 7 seconds. The buff will continue until the first marine is trained, and then your secondary queue continues on without a hitch.
Also changed the Duration of the first buff to 10.0625 (minor tweak that didn't need to be added)
EDIT: Hmm, I wonder... can you add a NEGATIVE to the Queue Size (-3) and Queue Count 1, making a temporary, only 2 queued units total, but build simultaneously.... something to think about.
EDIT 2: Yes, you can add negative and it works until the first buff expires, then the Validator checking for Queue = 2 returns false for some reason, when it shouldn't...
EDIT 3: No luck with the negatives. If you have 2 negatives, it will temporarily cancel out your Double Production and not get rid of the buff. Making Buff 1 = -3 Size and Count +1, Buff 2 =0 Size and Count 1, added a Buff 3 = Size-3 and Count 0(Buff 2 and 3 need to coexist, but needed a way to space out the -3 size from happening twice). I timed it perfectly so that when Buff 1 expires naturally, Buff 3 applies, but there's always a tiny miniscule time difference and you get a cancellation, and then the validator bugs out.
EDIT 4: LOL.. stupid edits. Ok. Instead of using a Periodic Count on Buff 2, attempting to match the expiration of the first buff to apply buff 3, I did Buff 1 Expire Effect = Apply Buff 3, and it worked! No cancellation! However.... The validator doesn't work in this case and Buff 2 and 3 remain active forever. Will continue working on this...
EDIT 5: HA! Got it working perfectly!!! Apparently I changed the 'Equal To' in the validator to 'Less Than Or Equal To', so when I noticed that I changed it back. Presto chango, Perfecto!
Also attaching the second map... I just realized I have no clue why I did the second part... I mean... didn't the first work? Gah! Ideas distract me.
Oh right! Idea/Map #2 seems like your best bet. All you need now is the validator(each near identical, one for each Train ability) combined into a Combine Validator(Set to OR). This makes it easy to count 2 units being produced at once. What if a player doesn't have the resources to queue up 5 or 6 units, but really needs 2 units(which he has the resources for) to be trained simultaneously.
Since I want the ability to work on Barrack, Factory, Starport and Command center, I created more validators.
I create new validators that look exactly like the one you have, but I change the ability link to Starport - Train and Factory - Train. I add them all in one combined validator. I add the combined validator to queue buff #2.
The ability only still works in the barrack, not in the starport. If I train two marines, everything works! But if I train 2 units in the starport, only 1 keeps producing after 10 seconds. : /
I upload my changes in your test map here. (In this test map there are only 2 validators, one for barrack and one for starport.)
--------------------------------
If it work together with your buff, I will use Queue slots 2 on all buildings as standard. In this way, players can either FIRST click to queue 2 units then drop the buff. OR they can drop the buff and then queue 2 units that starts being produced at once. If so, no more or less queue slots will be needed.
Also, it seems like the buffs don´t work if two units of different kinds are produced. If I start a marine & a marauder, the marauder gets canceled after 10 seconds. The utopia would be that the buff lasts until the second unit is completed, no matther what unit it is or what the first unit is. If this is possible. But you have helped me so much already, so if you don´t have time for it I will just take it for what it is. Right now this is more then I could imagine!
Example just to clearify: Queue size is always 2. I click on Dropship + Battlecruiser in the starport. The dropship starts to be produced as normal. I cast the buff on the starport. The battlecruiser starts aswell. No more units can be queued because of the queue size of 2.
Since the dropship finishes first, 1 queue slot is now free in the starport. I click to train 1 more dropship. Normally, that unit would just queue because the BC is already in production. But since the buff is still active (battlecruiser is still being built) the second dropships starts being produced immediately.
Finally the battlecruiser finishes. The buff expires and the production slots is reduced to 1 normal again. Which means that only the dropship that is under production can be produced. One other unit can be queued. When I cast the buff again, the cycle continues. If this made sense ^^
Took a quick look, and what you wrote pointed me in the right direction.
The field 'Ability Command Index' on the Unit Compare Order Count validator specifically refers to a certain unit from that ability.
For Barracks, 0 = Marine, 1 = Reaper, 2 = Ghost, etc.
Leaving that field at 0 allows 2 marines to be trained at once, but no other combination is possible like 2 marauders or 1marine&1marauder.
Changing it to 1 allows 2 reapers.
Here are the Command Index for each train ability and which number references which unit. I got these from going to the train ability and double clicking the field Info +, and looking in there. Train 01 = Command Index 0. Train 02 = Command Index 1.
What you will basically need is...
Validators such as follows.
Double Marine: Command Index 0, Equal To, 2.
Single Marine: Command Index 0, Equal To, 1.
A Single and a Double validator for each unit type.
Many AND combine validators, like...
Single Marine AND Single Marauder, Single Marine AND Single Reaper, all put together into one massive OR Combine Validator along with the Double Marine, etc. And that's alot of validators for just the barracks.
I believe there is a limit or 32 possible max in the Combines + field. So you also basically need your ability to instead "Apply Queue 1", have it apply a Set Effect, one for Apply Queue Barracks(with filters allowing it only to be placed on Barracks), Apply Queue Factory, Apply Queue Starport. Or better yet, you leave the ability as is, you just change the Periodic Effect from Buff#1 to a Set Effect, applying a different buff for each building(again, filters).
I hope that is clear enough?
EDIT: Oh yea, I do not think it is possible to specify Queue Count Slot #2 being still in progress. I think the best we can get is a temporary Double Queue Count until 1 unit finishes and then the buff is removed.
It works perfect! The buildings I will use this buff on don´t have so many units to train in them. So making validators for them will be easy. I don´t think I will need to make more then perhaps 12-16 validators. And that is easy to make!
There is one small problem left, of an other kind...
Since there are 3 buffs being applied to the building, I can´t get the actor to work properly. I use the Calldown Supply - animation and model for this ability. When buff 1 is applied to a building, the calldown supply model lands on the roof. I made it last until buff 2 & 3 expires.
The problem is if I apply the buff on a building and then I don´t train anything.. If I dont train any units, buff 2 & 3 will not be applied, hence the model of buff 1 will not be removed.. It will stick forever on the building: /
Is there anyway to make the model expire "by itself" if it is not used?
Is there anyway to make the calldown supply - model vanish in a more good looking way, like a small smoke cloud appears or something? Right now, the model just disappears as the buff expires. It is just a minor problem, but it looks a bit weird.
(I upload a test map where I have experimented with the actors and some experiments with the validators and training from multiple buildings. It looks a bit sloppy, but this is not my major map. I´ve got the validators and training different units to work properly in my main map. The problem here is the actors )
So you are going with Configuration #2?
For the actor for your visual buff, do the following Actor Events+
Try adding these next few to your Actor Events+ of the buff model. I'm not even gonna look at the map, this should be straight forward enough.
Behavior.Queue1.On
StatusSet QTime 1
Behavior.Queue2.On
StatusSet QTime 0
Behavior.Queue1.Off
IsStatus QTime 1
Destroy
Since Queue2 is applied just before Queue 1 expires, if Queue2 is applied, it sets the status to 0. If status remains 1, it destroys the visual buff.
However... if the buff Queue2 is applied and instantly removed, does it count? Well, If that doesn't work, you would need to throw in a timer to check the status increment slightly later.
It works perfect! I added the events to the actor of the ability. I have events that create the model once buff 1 is on. When buff 2 or 3 is off, they destroy the actor. Your events make them destroy the actor when buff 1 expires due to it times out. (If it was never used.)
how come this won´t work if I use queue count 5? (The ordinary queue number of buildings)
I try to remove the negative value the buff gives to the queue size.
I queue up 5 units, applys the buff to the building and 2 units starts to train. But the buff never ends, all 5 units will be trained.
Is there any way to make the buff still work with queue count 5, but expire after it has trained 2 units and not all 5?
Note: The ability works fine for me, so nothing is broken! I just wonder if it would be possible to apply the buff to the ordinary queue system of 5, without reducing the queue slots. I´ve played around with it, but I can´t get it to work with queue 5. If it can´t be done, that is not a big deal.
Could always use the Ability - Info - Effect field to apply counter buff stacks when the last queue boosting buff is active. When there are two counters it removes the queue enhancing buff which in turn removes the counters.
Rollback Post to RevisionRollBack
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
I have made an ability which gives a building a buff. The buff makes the building able to produce 2 units at the same time. (Like a temporary reactor)
As soon as the buff expires, 1 of the 2 units that are being produced is canceled.
For example: I cast the spell on my barrack. It gets a buff that enables it to produce 2 units at the same time. I start produce 2 marines. After 10 seconds, when the buff expires, one of the marines cancels and I get the resources back.
Is there anyway to make the buff expire as soon as it has produced 2 units, no matther how long it takes to complete the units?
**
I have uploaded a test version of the map. I have created the ability described below in the thread. For some reason the stuff won´t work. Anyone wanna have a look and tell me what I am doing wrong?
You tried disabling the buff and seeing how that affects production?
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
How do you mean?
Once the buff is applied to a building I want it to last until the produced units are finsihed, no matther how long time it takes. But this might be hard as hell to get to work.. : /
I just don´t want the buff to expire after X seconds, cause that cancels units that are not finished within time. :(
Is it possible to make some kind of validator check to see if unit number 2 is porduced? As soon as the second unit finishes, the buff expires.
You would need a second buff that removes it but I cannot think of a clean way of doing that in that the Unit Order validator would stay enabled because once the once unit finishes training it would re-enable with the next. Still worth a try incase it momentarily flashes off but would need a 0.016 periodic to detect.
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 don't really have the time currently to check this out for you, but basically, the first behavior lasts 10.5 seconds, upon which time you MUST max out the building queue. Tot test this, make barracks have a queue count and queue size 1, and the buff could have queue count and queue size 1(allowing 2 units to be built simultaneously - I just gave the example of 2 max queue for simplicity's sake)
At 10 seconds, the second buff is added just before the first buff expires, allowing continued double queue. The validator on the second buff checks to ensure that the queue ability is maxed(at 2) and if not, removes the behavior instantly.
Does that make a bit of sense?? I hope so. Should be at least a look in the right direction(hopefully)
Thank you for your great reply, BorgDragon.
I´ve built the buffs and effects you describe. When I apply the buff to a building the production stops. Totally. 2 units starts to be produced as intended, but the timer freezes.
Any suggestions what might be wrong? :s
Edit: Ah I found out! The time scala field had been reduzed to 0.01. T_T
But if the queue size is limited to only 2 slots?
In this case the buff will end as soon as it can´t "detect" anything more in the queue. There will always be a gap between a unit finishes and a player who clicks to start the next unit.
Thoughts about this?
For some reason, buff #2 is not added to the building. I´ve followed your instructions but the building don´t get the second buff.
Any clues?
I upload a test version of the map here, where I have tried to create the ability. Anyone wanna have a look and tell me what I am doing wrong?
I have added a periodic effect now with a 0.016 seconds delay. Still it does not work.
Your create persistent has Target+ set to Target Point. It needs to be Target Unit - but would likely not work since the Building/Source is casting it, and Target Unit usually means OTHER unit, would have to be Caster Unit or Source Unit, etc.
I don't know why you use a Create Persistent... you could LITERALLY just use an Apply Behavior effect as your Periodic Effect to cast the buff on itself.
Anyways, I did some playing around and I got it working. I realized that Unit Compare Order Count validating a Queue ability is just incorrect(Since the Queue ability is never actually given an order unless it's to Cancel the queue). What I did was instead, Unit Compare Order Count the Barracks - Train ability to 'Equal' '2'.
But this makes this so much more of a hassle, since you would have to have multiple validators to compare the Order Count of each building's Train ability. Not to mention, you would have to work something out for buildings with a normal Queue (5) ability, adding Queue Count 1 and Queue Size 1 on the behavior, requiring the Unit Compare Order Count on the train ability(ies) set to Equal 6 or something (Or just Queue Count 1, Queue Size 0, requiring Equal 5)
Attached my map for your viewing. You can also stagger your marines starting the first right away and waiting like 7 seconds. The buff will continue until the first marine is trained, and then your secondary queue continues on without a hitch.
Also changed the Duration of the first buff to 10.0625 (minor tweak that didn't need to be added)
EDIT: Hmm, I wonder... can you add a NEGATIVE to the Queue Size (-3) and Queue Count 1, making a temporary, only 2 queued units total, but build simultaneously.... something to think about.
EDIT 2: Yes, you can add negative and it works until the first buff expires, then the Validator checking for Queue = 2 returns false for some reason, when it shouldn't...
EDIT 3: No luck with the negatives. If you have 2 negatives, it will temporarily cancel out your Double Production and not get rid of the buff. Making Buff 1 = -3 Size and Count +1, Buff 2 =0 Size and Count 1, added a Buff 3 = Size-3 and Count 0(Buff 2 and 3 need to coexist, but needed a way to space out the -3 size from happening twice). I timed it perfectly so that when Buff 1 expires naturally, Buff 3 applies, but there's always a tiny miniscule time difference and you get a cancellation, and then the validator bugs out.
EDIT 4: LOL.. stupid edits. Ok. Instead of using a Periodic Count on Buff 2, attempting to match the expiration of the first buff to apply buff 3, I did Buff 1 Expire Effect = Apply Buff 3, and it worked! No cancellation! However.... The validator doesn't work in this case and Buff 2 and 3 remain active forever. Will continue working on this...
EDIT 5: HA! Got it working perfectly!!! Apparently I changed the 'Equal To' in the validator to 'Less Than Or Equal To', so when I noticed that I changed it back. Presto chango, Perfecto!
Also attaching the second map... I just realized I have no clue why I did the second part... I mean... didn't the first work? Gah! Ideas distract me.
Oh right! Idea/Map #2 seems like your best bet. All you need now is the validator(each near identical, one for each Train ability) combined into a Combine Validator(Set to OR). This makes it easy to count 2 units being produced at once. What if a player doesn't have the resources to queue up 5 or 6 units, but really needs 2 units(which he has the resources for) to be trained simultaneously.
Your choice!
Thank you so much BorgDragon!
Since I want the ability to work on Barrack, Factory, Starport and Command center, I created more validators.
I create new validators that look exactly like the one you have, but I change the ability link to Starport - Train and Factory - Train. I add them all in one combined validator. I add the combined validator to queue buff #2.
The ability only still works in the barrack, not in the starport. If I train two marines, everything works! But if I train 2 units in the starport, only 1 keeps producing after 10 seconds. : /
I upload my changes in your test map here. (In this test map there are only 2 validators, one for barrack and one for starport.)
--------------------------------If it work together with your buff, I will use Queue slots 2 on all buildings as standard. In this way, players can either FIRST click to queue 2 units then drop the buff. OR they can drop the buff and then queue 2 units that starts being produced at once. If so, no more or less queue slots will be needed.
Also, it seems like the buffs don´t work if two units of different kinds are produced. If I start a marine & a marauder, the marauder gets canceled after 10 seconds. The utopia would be that the buff lasts until the second unit is completed, no matther what unit it is or what the first unit is. If this is possible. But you have helped me so much already, so if you don´t have time for it I will just take it for what it is. Right now this is more then I could imagine!
Example just to clearify: Queue size is always 2. I click on Dropship + Battlecruiser in the starport. The dropship starts to be produced as normal. I cast the buff on the starport. The battlecruiser starts aswell. No more units can be queued because of the queue size of 2.
Since the dropship finishes first, 1 queue slot is now free in the starport. I click to train 1 more dropship. Normally, that unit would just queue because the BC is already in production. But since the buff is still active (battlecruiser is still being built) the second dropships starts being produced immediately.
Finally the battlecruiser finishes. The buff expires and the production slots is reduced to 1 normal again. Which means that only the dropship that is under production can be produced. One other unit can be queued. When I cast the buff again, the cycle continues. If this made sense ^^
Took a quick look, and what you wrote pointed me in the right direction.
The field 'Ability Command Index' on the Unit Compare Order Count validator specifically refers to a certain unit from that ability.
For Barracks, 0 = Marine, 1 = Reaper, 2 = Ghost, etc.
Leaving that field at 0 allows 2 marines to be trained at once, but no other combination is possible like 2 marauders or 1marine&1marauder.
Changing it to 1 allows 2 reapers.
Here are the Command Index for each train ability and which number references which unit. I got these from going to the train ability and double clicking the field Info +, and looking in there. Train 01 = Command Index 0. Train 02 = Command Index 1.
What you will basically need is... Validators such as follows.
A Single and a Double validator for each unit type.
Many AND combine validators, like...
Single Marine AND Single Marauder, Single Marine AND Single Reaper, all put together into one massive OR Combine Validator along with the Double Marine, etc. And that's alot of validators for just the barracks.
I believe there is a limit or 32 possible max in the Combines + field. So you also basically need your ability to instead "Apply Queue 1", have it apply a Set Effect, one for Apply Queue Barracks(with filters allowing it only to be placed on Barracks), Apply Queue Factory, Apply Queue Starport. Or better yet, you leave the ability as is, you just change the Periodic Effect from Buff#1 to a Set Effect, applying a different buff for each building(again, filters).
I hope that is clear enough?
EDIT: Oh yea, I do not think it is possible to specify Queue Count Slot #2 being still in progress. I think the best we can get is a temporary Double Queue Count until 1 unit finishes and then the buff is removed.
It works perfect! The buildings I will use this buff on don´t have so many units to train in them. So making validators for them will be easy. I don´t think I will need to make more then perhaps 12-16 validators. And that is easy to make!
There is one small problem left, of an other kind...
Since there are 3 buffs being applied to the building, I can´t get the actor to work properly. I use the Calldown Supply - animation and model for this ability. When buff 1 is applied to a building, the calldown supply model lands on the roof. I made it last until buff 2 & 3 expires.
The problem is if I apply the buff on a building and then I don´t train anything.. If I dont train any units, buff 2 & 3 will not be applied, hence the model of buff 1 will not be removed.. It will stick forever on the building: /
Is there anyway to make the model expire "by itself" if it is not used?
Is there anyway to make the calldown supply - model vanish in a more good looking way, like a small smoke cloud appears or something? Right now, the model just disappears as the buff expires. It is just a minor problem, but it looks a bit weird.
(I upload a test map where I have experimented with the actors and some experiments with the validators and training from multiple buildings. It looks a bit sloppy, but this is not my major map. I´ve got the validators and training different units to work properly in my main map. The problem here is the actors )
So you are going with Configuration #2?
For the actor for your visual buff, do the following Actor Events+
Try adding these next few to your Actor Events+ of the buff model. I'm not even gonna look at the map, this should be straight forward enough.
Since Queue2 is applied just before Queue 1 expires, if Queue2 is applied, it sets the status to 0. If status remains 1, it destroys the visual buff.
However... if the buff Queue2 is applied and instantly removed, does it count? Well, If that doesn't work, you would need to throw in a timer to check the status increment slightly later.
It works perfect! I added the events to the actor of the ability. I have events that create the model once buff 1 is on. When buff 2 or 3 is off, they destroy the actor. Your events make them destroy the actor when buff 1 expires due to it times out. (If it was never used.)
Thank you for all the help!
Just a thought,
how come this won´t work if I use queue count 5? (The ordinary queue number of buildings)
I try to remove the negative value the buff gives to the queue size.
I queue up 5 units, applys the buff to the building and 2 units starts to train. But the buff never ends, all 5 units will be trained.
Is there any way to make the buff still work with queue count 5, but expire after it has trained 2 units and not all 5?
Note: The ability works fine for me, so nothing is broken! I just wonder if it would be possible to apply the buff to the ordinary queue system of 5, without reducing the queue slots. I´ve played around with it, but I can´t get it to work with queue 5. If it can´t be done, that is not a big deal.
Could always use the Ability - Info - Effect field to apply counter buff stacks when the last queue boosting buff is active. When there are two counters it removes the queue enhancing buff which in turn removes the counters.
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