Hey no problem! I've actually devised a much better way of doing this I believe. I'll explain here, and then see if it works later as I don't really have the time right now.
This method will be a combination of the Data Editor and the Trigger Editor. Last night I was trying to find ways to do what I've done more efficiently. What I ended up with was a building that gave off an aura that granted a buff that did nothing. This buff would hit all units in the area. I had then created triggers to figure out if units had the buff. If they did, they activated triggers to gain score towards capturing the point.
I thought about this for a moment, and realized IT WAS EXACTLY THE SAME AS BEFORE! Only thing now was I replaced the If Unit comes with in X range of Unit event with a periodic event that checked for buffs. So this was silly I thought, maybe using the data editor was dumb I thought. But then, as I was trying to fall asleep I had a brain storm.
What I should be doing, is using the triggers that check for buffs AND the triggers to check for range. As well as making a building that grants an aura that the triggers check, I'm going to create unit buffs that do nothing that they have by defult. They will be called things like "Worth 1 Capture Point". So heres my plan:
Create a Variable to store the combined "worth" of units. This Variable will only have a number in it when units are in range. Maybe I could use an Array to store a value for each building, so that I don't need 5 Variables.
Create a Trigger that goes of anytime a unit enters the range of the capturable building. (copy this event for each building. This allows you to run the trigger every time some one comes in range of any of the capturable buildings)
This trigger then checks to see if:
This Unit Belongs to X player
This Unit has X Buff (this might be a bit redundant but I'll be necessary I think.)
Then I will check to see if this unit has X Tower Buff (then copy and paste this for each tower I have, changing the buff to that towers unique buff)
If all this holds true then it adds X to the Worth Variable (in a part of the array that is associated with the tower its in range of)
Then, there will be a trigger that is always running. 5 of them to be exact. This trigger activates ever second and says this: (keep in mind I've never worked with Arrays so I'm not sure how this part will work)
Every Second Activate this trigger
Modify Variable +(X+0) (X in this trigger is the total worth of the units in the area. I'll just point this trigger to the part of the array that has the stored value of all units in the area.)
If: Variable = 20
Then Change Ownership to X player.
Else
If Variable = 0
Then Change Ownership for Y player
I'll then have a trigger that does the reverse of the trigger that adds to the worth variable. That way, when players leave the area, or die they will remove they're worth from the pool and the capture will go slower.
The Variable for Capture will start at 10. What this will do is this: Units will walk in to the area of a building. The game will add up all the buffs they have in to a Variable Array. (some units will be worth less then others. Players will be worth 1. Creep waves will be 1 divided by they're size, once I figure out how big they are. This way creep waves are worth 1 player at full strength.) That number is then added to the periodic event that adds points towards capturing a building. When nothing is in an area, the trigger adds +0.
This leaves me with vary few triggers, BUT it also becomes really flexible in terms of what I can do. Once you have triggers set up for the buffs on the units you can change how much they're worth really easily in the triggers. If you need to add a location it'll be easy too. I'll make a video showing you how it CURRENTLY works, and then I'll make a video showing you how it works after I get what I just explained to work.
It seems to me that the event "Unit Enters/Leaves Point" does not count death as leaving the area. This will cause problems in an actual combat scenario, since when a unit comes in range of the tower, then gets killed, it will keep capturing. Any ideas for a workaround?
check out mine http://forums.sc2mapster.com/resources/tutorials/13223-how-to-multiple-region-capture-capturing/#p2
i know it's not the most easy to follow and user friendly tutorial, i'll probably rewrite it later. But it covers all the bases such as units dying while capturing, units that are allowed to block captures, dynamic capturing (something walks in to block, but when they leave the progress resumes rather than starting from scratch), multiple regions within the same trigger and so on
Check out the demo map it's probably the easiest to understand
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
@cptbuggernuts: Go
Hey no problem! I've actually devised a much better way of doing this I believe. I'll explain here, and then see if it works later as I don't really have the time right now.
This method will be a combination of the Data Editor and the Trigger Editor. Last night I was trying to find ways to do what I've done more efficiently. What I ended up with was a building that gave off an aura that granted a buff that did nothing. This buff would hit all units in the area. I had then created triggers to figure out if units had the buff. If they did, they activated triggers to gain score towards capturing the point.
I thought about this for a moment, and realized IT WAS EXACTLY THE SAME AS BEFORE! Only thing now was I replaced the If Unit comes with in X range of Unit event with a periodic event that checked for buffs. So this was silly I thought, maybe using the data editor was dumb I thought. But then, as I was trying to fall asleep I had a brain storm.
What I should be doing, is using the triggers that check for buffs AND the triggers to check for range. As well as making a building that grants an aura that the triggers check, I'm going to create unit buffs that do nothing that they have by defult. They will be called things like "Worth 1 Capture Point". So heres my plan:
Then, there will be a trigger that is always running. 5 of them to be exact. This trigger activates ever second and says this: (keep in mind I've never worked with Arrays so I'm not sure how this part will work)
I'll then have a trigger that does the reverse of the trigger that adds to the worth variable. That way, when players leave the area, or die they will remove they're worth from the pool and the capture will go slower.
The Variable for Capture will start at 10. What this will do is this: Units will walk in to the area of a building. The game will add up all the buffs they have in to a Variable Array. (some units will be worth less then others. Players will be worth 1. Creep waves will be 1 divided by they're size, once I figure out how big they are. This way creep waves are worth 1 player at full strength.) That number is then added to the periodic event that adds points towards capturing a building. When nothing is in an area, the trigger adds +0.
This leaves me with vary few triggers, BUT it also becomes really flexible in terms of what I can do. Once you have triggers set up for the buffs on the units you can change how much they're worth really easily in the triggers. If you need to add a location it'll be easy too. I'll make a video showing you how it CURRENTLY works, and then I'll make a video showing you how it works after I get what I just explained to work.
New video up! Check it out.
@sorcelator: Go
Part one:
Part two:
It seems to me that the event "Unit Enters/Leaves Point" does not count death as leaving the area. This will cause problems in an actual combat scenario, since when a unit comes in range of the tower, then gets killed, it will keep capturing. Any ideas for a workaround?
check out mine http://forums.sc2mapster.com/resources/tutorials/13223-how-to-multiple-region-capture-capturing/#p2
i know it's not the most easy to follow and user friendly tutorial, i'll probably rewrite it later. But it covers all the bases such as units dying while capturing, units that are allowed to block captures, dynamic capturing (something walks in to block, but when they leave the progress resumes rather than starting from scratch), multiple regions within the same trigger and so on
Check out the demo map it's probably the easiest to understand