System Melee Map + Capture System! [GUI]

cleeezzz

The Undead Ranger.
Reaction score
268
UPDATED V1.21 See change log at post #10

MUI: Yes (Buildings and up to the max array limit, although i doubt you will have 8000 buildings.)
GUI/JASS?: GUI
Leakless?: I think


This is an interesting system i made that works surprisingly well in melee maps.

Basically, it takes all the structures in the map, sets a capture amount (Max HP/10) and creates nice little bars above the structures. If an enemy unit stands next to the building, the bar will slowly fill up (faster with more units around). The bar will freeze (stop capturing) if an enemy comes in range of the building. It will resume after only 1 team is around the building. (1 team means, if red and blue are allies, they both can capture, which ever player get there first gets the building, if both players are there, it randomly picks a player) If an enemy player fills the bar but runs away or dies before it is captured, the owner (or allies) of the unit will have to stand next to the building to Recapture the building.

hard to show in screen shots, just play the map with an AI or something.

(in the demo map, i used phantomgrove but you can use anything, to import, go to your WE, go to File -> Preferences and checkmark Create Variables unknown to the editor, then just simply copy and paste all the triggers (except the triggers in the folder Initialization)

CODE:
Code:
Player Colors
    Events
        Time - Elapsed game time is 0.10 seconds
    Conditions
    Actions
        For each (Integer A) from 1 to 12, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Color of (Player((Integer A)))) Equal to Red
                    Then - Actions
                        Set Player_Colors[(Integer A)] = |c00ff0000
                    Else - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                (Color of (Player((Integer A)))) Equal to Blue
                            Then - Actions
                                Set Player_Colors[(Integer A)] = |c000033ff
                            Else - Actions
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        (Color of (Player((Integer A)))) Equal to Teal
                                    Then - Actions
                                        Set Player_Colors[(Integer A)] = |c0000ffff
                                    Else - Actions
                                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                            If - Conditions
                                                (Color of (Player((Integer A)))) Equal to Purple
                                            Then - Actions
                                                Set Player_Colors[(Integer A)] = |c009900ff
                                            Else - Actions
                                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                    If - Conditions
                                                        (Color of (Player((Integer A)))) Equal to Yellow
                                                    Then - Actions
                                                        Set Player_Colors[(Integer A)] = |c00ffff00
                                                    Else - Actions
                                                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                            If - Conditions
                                                                (Color of (Player((Integer A)))) Equal to Orange
                                                            Then - Actions
                                                                Set Player_Colors[(Integer A)] = |c00ff9900
                                                            Else - Actions
                                                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                    If - Conditions
                                                                        (Color of (Player((Integer A)))) Equal to Green
                                                                    Then - Actions
                                                                        Set Player_Colors[(Integer A)] = |c0000ff00
                                                                    Else - Actions
                                                                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                            If - Conditions
                                                                                (Color of (Player((Integer A)))) Equal to Pink
                                                                            Then - Actions
                                                                                Set Player_Colors[(Integer A)] = |c00ff66ff
                                                                            Else - Actions
                                                                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                                    If - Conditions
                                                                                        (Color of (Player((Integer A)))) Equal to Gray
                                                                                    Then - Actions
                                                                                        Set Player_Colors[(Integer A)] = |cff959697
                                                                                    Else - Actions
                                                                                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                                            If - Conditions
                                                                                                (Color of (Player((Integer A)))) Equal to Light Blue
                                                                                            Then - Actions
                                                                                                Set Player_Colors[(Integer A)] = |cff7ebff1
                                                                                            Else - Actions
                                                                                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                                                    If - Conditions
                                                                                                        (Color of (Player((Integer A)))) Equal to Dark Green
                                                                                                    Then - Actions
                                                                                                        Set Player_Colors[(Integer A)] = |cff106246
                                                                                                    Else - Actions
                                                                                                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                                                            If - Conditions
                                                                                                                (Color of (Player((Integer A)))) Equal to Brown
                                                                                                            Then - Actions
                                                                                                                Set Player_Colors[12] = |cff4e2a04
                                                                                                            Else - Actions
Code:
Setup
    Events
    Conditions
    Actions
        Set Capture_String = llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
        Set Temp_Group = (Units in (Playable map area) matching ((((Matching unit) is A structure) Equal to True) and (((Owner of (Matching unit)) Not equal to Neutral Passive) and (((Matching unit) is alive) Equal to True))))
        Unit Group - Pick every unit in Temp_Group and do (Actions)
            Loop - Actions
                Set i = (i + 1)
                Unit Group - Add (Picked unit) to Building_Group
                Unit - Set the custom value of (Picked unit) to i
                Set Owner[i] = (Owner of (Picked unit))
                Set Capture_Time[i] = ((Integer((Max life of (Picked unit)))) / 10)
                Set Capture_Bar_Show[i] = (Player_Colors[(Player number of (Owner of (Picked unit)))] + (Substring(Capture_String, 1, Capture_Time[i])))
                Set Temp_Point = (Position of (Picked unit))
                Set Capture_Progress[i] = 0
                Unit - Make (Picked unit) Invulnerable
        Custom script:   call DestroyGroup(udg_Temp_Group)
Code:
Setup 2
    Events
        Unit - A unit Finishes construction
    Conditions
    Actions
        Set i = (i + 1)
        Unit Group - Add (Constructed structure) to Building_Group
        Unit - Set the custom value of (Constructed structure) to i
        Set Owner[i] = (Owner of (Constructed structure))
        Set Capture_Time[i] = ((Integer((Max life of (Constructed structure)))) / 10)
        Set Capture_Bar_Show[i] = (Player_Colors[(Player number of (Owner of (Constructed structure)))] + (Substring(Capture_String, 1, Capture_Time[i])))
        Set Capture_Progress[i] = 0
        Unit - Make (Picked unit) Invulnerable
Code:
Update
    Events
        Time - Every 0.50 seconds of game time
    Conditions
    Actions
        Unit Group - Pick every unit in Building_Group and do (Actions)
            Loop - Actions
                Floating Text - Destroy Capture_Bar[(Custom value of (Picked unit))]
                Floating Text - Create floating text that reads Capture_Bar_Show[(Custom value of (Picked unit))] above (Picked unit) with Z offset 0.00, using font size 4.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
                Set Capture_Bar[(Custom value of (Picked unit))] = (Last created floating text)
                Set Temp_Point = (Position of (Picked unit))
                Player Group - Pick every player in (All players) and do (Actions)
                    Loop - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                Or - Any (Conditions) are true
                                    Conditions
                                        (Temp_Point is fogged for (Picked player)) Equal to True
                                        (Temp_Point is masked for (Picked player)) Equal to True
                            Then - Actions
                                Set Temp_Force = (Player group((Picked player)))
                                Floating Text - Hide Capture_Bar[(Custom value of (Picked unit))] for Temp_Force
                                Custom script:   call DestroyForce(udg_Temp_Force)
                            Else - Actions
                Custom script:   call RemoveLocation(udg_Temp_Point)
Code:
Death
    Events
        Unit - A unit Dies
    Conditions
        ((Triggering unit) is A structure) Equal to True
    Actions
        Floating Text - Destroy Capture_Bar[(Custom value of (Triggering unit))]
        Unit Group - Remove (Triggering unit) from Building_Group
Code:
Capture
    Events
        Time - Every 1.00 seconds of game time
    Conditions
    Actions
        Unit Group - Pick every unit in Building_Group and do (Actions)
            Loop - Actions
                Set Enemy = False
                Set Allied = False
                Set Enemy_Allied = False
                Set Enemy_Enemy = False
                Player Group - Remove all players from Player_Group
                Set Temp_Point = (Position of (Picked unit))
                Set Capture_Group = (Units within 512.00 of Temp_Point matching (((Matching unit) Not equal to (Picked unit)) and ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is an illusion) Equal to False) and ((((Matching unit) is Summoned) Equal to False) and (((
                Custom script:   call RemoveLocation(udg_Temp_Point)
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Capture_Group is empty) Equal to False
                    Then - Actions
                        Unit Group - Pick every unit in Capture_Group and do (Actions)
                            Loop - Actions
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        Or - Any (Conditions) are true
                                            Conditions
                                                (Owner of (Picked unit)) Equal to Neutral Hostile
                                                (Owner of (Picked unit)) Equal to Neutral Victim
                                                (Owner of (Picked unit)) Equal to Neutral Extra
                                                (Owner of (Picked unit)) Equal to Neutral Passive
                                    Then - Actions
                                        Unit Group - Remove (Picked unit) from Capture_Group
                                    Else - Actions
                                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                            If - Conditions
                                                ((Owner of (Picked unit)) is in Player_Group) Equal to False
                                            Then - Actions
                                                Player Group - Add (Owner of (Picked unit)) to Player_Group
                                            Else - Actions
                        Set Rate = (Number of units in Capture_Group)
                        Player Group - Pick every player in Player_Group and do (Actions)
                            Loop - Actions
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        ((Owner of (Picked unit)) is an enemy of (Picked player)) Equal to True
                                    Then - Actions
                                        Set Enemy = True
                                    Else - Actions
                                        Set Allied = True
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                Enemy Equal to True
                                Allied Equal to False
                            Then - Actions
                                Set Temp_Player = (Random player from Player_Group)
                                Player Group - Pick every player in Player_Group and do (Actions)
                                    Loop - Actions
                                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                            If - Conditions
                                                (Temp_Player is an ally of (Picked player)) Equal to True
                                            Then - Actions
                                                Set Enemy_Allied = True
                                            Else - Actions
                                                Set Enemy_Enemy = True
                            Else - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                Enemy Equal to True
                                Allied Equal to False
                                Enemy_Allied Equal to True
                                Enemy_Enemy Equal to False
                            Then - Actions
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        (Capturer[(Custom value of (Picked unit))] is in Player_Group) Equal to False
                                    Then - Actions
                                        Set Capturer[(Custom value of (Picked unit))] = Temp_Player
                                    Else - Actions
                                Unit - Cause (Random unit from Capture_Group) to damage (Picked unit), dealing 0.00 damage of attack type Spells and damage type Normal
                                Custom script:   call DestroyGroup(udg_Capture_Group)
                                Set Capture_Progress[(Custom value of (Picked unit))] = (Capture_Progress[(Custom value of (Picked unit))] + Rate)
                                Set Capture_Bar_Show[(Custom value of (Picked unit))] = ((((((Player_Colors[(Player number of Capturer[(Custom value of (Picked unit))])] + (Substring(Capture_String, 1, Capture_Progress[(Custom value of (Picked unit))]))) + |r) + Player_Colors[(Player number of Owner[(Custom value of (Picked unit))])]) + (Substri
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        Capture_Progress[(Custom value of (Picked unit))] Greater than or equal to Capture_Time[(Custom value of (Picked unit))]
                                    Then - Actions
                                        Unit - Change ownership of (Picked unit) to Capturer[(Custom value of (Picked unit))] and Change color
                                        Set Owner[(Custom value of (Picked unit))] = Capturer[(Custom value of (Picked unit))]
                                        Set Capture_Progress[(Custom value of (Picked unit))] = 0
                                        Set Capture_Bar_Show[(Custom value of (Picked unit))] = (Player_Colors[(Player number of (Owner of (Picked unit)))] + (Substring(Capture_String, 1, Capture_Time[(Custom value of (Picked unit))])))
                                    Else - Actions
                            Else - Actions
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        Enemy Equal to False
                                        Allied Equal to True
                                        Or - Any (Conditions) are true
                                            Conditions
                                                Capture_Progress[(Custom value of (Picked unit))] Greater than or equal to 0
                                                Capture_Progress[(Custom value of (Picked unit))] Less than or equal to 0
                                    Then - Actions
                                        Unit - Make (Picked unit) Invulnerable
                                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                            If - Conditions
                                                Capture_Progress[(Custom value of (Picked unit))] Less than or equal to 0
                                            Then - Actions
                                                Set Capture_Bar_Show[(Custom value of (Picked unit))] = (Player_Colors[(Player number of (Owner of (Picked unit)))] + (Substring(Capture_String, 1, Capture_Time[(Custom value of (Picked unit))])))
                                                Set Capture_Progress[(Custom value of (Picked unit))] = 0
                                            Else - Actions
                                                Set Capture_Progress[(Custom value of (Picked unit))] = (Capture_Progress[(Custom value of (Picked unit))] - Rate)
                                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                    If - Conditions
                                                        Capture_Progress[(Custom value of (Picked unit))] Less than or equal to 0
                                                    Then - Actions
                                                        Set Capture_Bar_Show[(Custom value of (Picked unit))] = (Player_Colors[(Player number of (Owner of (Picked unit)))] + (Substring(Capture_String, 1, Capture_Time[(Custom value of (Picked unit))])))
                                                        Set Capture_Progress[(Custom value of (Picked unit))] = 0
                                                    Else - Actions
                                                        Set Capture_Bar_Show[(Custom value of (Picked unit))] = ((((((Player_Colors[(Player number of Capturer[(Custom value of (Picked unit))])] + (Substring(Capture_String, 1, Capture_Progress[(Custom value of (Picked unit))]))) + |r) + Player_Colors[(Player number of Owner[(Custom value of (Picked unit))])]) + (Substri
                                    Else - Actions
                    Else - Actions
                        Unit - Make (Picked unit) Invulnerable
Code:
Invulnerable Off
    Events
        Unit - A unit Is issued an order targeting an object
    Conditions
        ((Target unit of issued order) is A structure) Equal to True
        ((Owner of (Triggering unit)) is an enemy of (Owner of (Target unit of issued order))) Equal to True
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Issued order) Equal to (Order(smart))
            Then - Actions
                Unit - Make (Target unit of issued order) Vulnerable
            Else - Actions

Screenies! (It is still difficult to see everything)
WC3ScrnShot_050408_115425_01.jpg
WC3ScrnShot_050408_115457_02.jpg
WC3ScrnShot_050408_115530_03.jpg
WC3ScrnShot_050408_115533_04.jpg
WC3ScrnShot_050408_115615_05.jpg
WC3ScrnShot_050408_115623_06.jpg
WC3ScrnShot_050408_115724_07.jpg
WC3ScrnShot_050408_115802_08.jpg
WC3ScrnShot_050408_115805_09.jpg
WC3ScrnShot_050408_115852_11.jpg
WC3ScrnShot_050408_115859_12.jpg

If anyone finds bugs or leaks (or suggestions, including optimization) please tell me!
 

tom_mai78101

The Helper Connoisseur / Ex-MineCraft Host
Staff member
Reaction score
1,715
I wonder what would the capture system do, if there are multiple of units in the range, having a melee war?
 

cleeezzz

The Undead Ranger.
Reaction score
268
like 2 enemies and 2 allies? the capture does not take place, the bar will stay the same (will not go up or down) until only 1 team is within range.
 

UndeadDragon

Super Moderator
Reaction score
447
Sounds like a good concept, I'm sure it will help a lot of people.
 

Mr.Tutorial

Hard in the Paint.
Reaction score
42
I haven't tested it because I know what it does already, and it's an awesome idea, would be fun to add in a map too.
 

PurgeandFire

zxcvmkgdfg
Reaction score
509
There is Steel's floating bar system already. :p

But I just have to wonder, how is this more beneficial over a simple ALT? (Other than color of course)
 

cleeezzz

The Undead Ranger.
Reaction score
268
its not a health bar, its a capture bar,


But I just have to wonder, how is this more beneficial over a simple ALT? (Other than color of course)

so you can take over the building....?

seems beneficial to me. capture their farms so they cant make units...capture barracks and make units of a different race...
 

cleeezzz

The Undead Ranger.
Reaction score
268
thanks Updated,

V1.21 (See post 1)
Changes:
*Removed 2 VERY useless but long loops
*Added a Invulnerable feature, (Buildings are now invulnerable so you dont destroy it while trying to capture it, HOWEVER, if you want to kill the building, issue the order (Smart) or right click the building, it will become vulnerable.)
*Reduced amount of floating texts being created to 2 per building every second.
*Added feature where if a Neutral Hostile unit is attacked by a building, it will become vulnerable (specifically for night elf buildings so they cant creep)
*Easier to customize which Players can capture (neutral hostile, passive)
 
Reaction score
456
The first trigger is awful. Of course Player 1 Red colour is RED, so no need for loops and if-then-elses. It could be ran at map init.
 

cleeezzz

The Undead Ranger.
Reaction score
268
hm. are you sure? you can change the color of your units in the beginning of the game.

my friend (player 2) changed his color to teal and the bars showed up blue. Remember that i didn't touch anything else except triggers. (no custom forces)


@reflexar hmm i tried doing this too, but thats the smallest i could get the font before it just dissapears. i would recommend not changing the size (font/length of the bar). Instead, in the capture trigger, you can find a variable called Rate. maybe change it to Number of Units/2 or 3.

that should increase the amount of time to capture significantly.
 

Reflexar

New Member
Reaction score
12
@reflexar hmm i tried doing this too, but thats the smallest i could get the font before it just dissapears. i would recommend not changing the size (font/length of the bar). Instead, in the capture trigger, you can find a variable called Rate. maybe change it to Number of Units/2 or 3.


then 1 unit can't capture i think. but that's not a big problem


EDIT: And i hope the system works in a map with 10 players? :D
 

cleeezzz

The Undead Ranger.
Reaction score
268
im pretty sure it does, ive tested 2v2, 4 player FFA, i dont think 10 player will be much different

and you are right about "1 unit cant capture"

which just brought me to a new idea.. if i make Capture_Progress a real variable, then decimals will be allowed....allowing 1 unit to capture...eventually

Might update later
 

cleeezzz

The Undead Ranger.
Reaction score
268
thats up to you, its easy to customize,

in the trigger capture, it creates a unit group in the beginning and then i made a IF/THEN/ELSE loop to remove unwanted units (for easy customization). So just add a classification condition.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top