[System] Capture System Help.

cleeezzz

The Undead Ranger.
Reaction score
268
Code:
Player Colors
    Events
        Time - Elapsed game time is 0.10 seconds
    Conditions
    Actions
        Set Player_Colors[1] = |c00ff0000
        Set Player_Colors[2] = |c000033ff
        Set Player_Colors[3] = |c0000ffff
        Set Player_Colors[4] = |c009900ff
        Set Player_Colors[5] = |c00ffff00
        Set Player_Colors[6] = |c00ff9900
        Set Player_Colors[7] = |c0000ff00
        Set Player_Colors[8] = |c00ff66ff
        Set Player_Colors[9] = |cff959697
        Set Player_Colors[10] = |cff7ebff1
        Set Player_Colors[11] = |cff106246
        Set Player_Colors[12] = |cff4e2a04
Code:
Setup
    Events
        (Run from another Trigger, this does work btw, i tested it)
    Conditions
    Actions
        Set Capture_String = llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
        Unit Group - Pick every unit in (Units in (Playable map area) matching (((Unit-type of (Matching unit)) is A structure) Equal to True)) 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)
                Floating Text - Create floating text that reads (Player_Colors[(Player number of (Owner of (Picked unit)))] + (Substring(Capture_String, 1, Capture_Time[i]))) 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[i] = (Last created floating text)
                Set Capture_Progress[i] = 0
Picks all structures and creates bar and sets varables
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)
        Floating Text - Create floating text that reads (Player_Colors[(Player number of (Owner of (Constructed structure)))] + (Substring(Capture_String, 1, Capture_Time[i]))) above (Constructed structure) with Z offset 0.00, using font size 4.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
        Set Capture_Bar[i] = (Last created floating text)
        Set Capture_Progress[i] = 0
Creates bar and sets variables when a structure is built
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
Destroys bar when a structure dies
Code:
Fog Hide
    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 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
                                Floating Text - Hide Capture_Bar[(Custom value of (Picked unit))] for (Player Group (Picked Player))
                            Else - Actions
                Custom script:   call RemoveLocation(udg_Temp_Point)
Hiding bars that are in fog of war
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 alive) Equal to True))))
                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
                                ((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)
                Custom script:   call DestroyGroup(udg_Capture_Group)
                Custom script:   call RemoveLocation(udg_Temp_Point)
                Set Temp_Player = (Random player from Player_Group)
                Player Group - Pick every player in Player_Group and do (Actions)
                    Loop - Actions
                        Set Picked_Player = (Picked player)
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                ((Picked player) is an enemy of (Owner of (Picked unit))) Equal to True
                            Then - Actions
                                Set Enemy = True
                                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
                                                (Picked_Player is an ally of (Picked player)) Equal to True
                                            Then - Actions
                                                Set Enemy_Allied = True
                                            Else - Actions
                                                Set Enemy_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
                        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
                        Set Capture_Progress[(Custom value of (Picked unit))] = (Capture_Progress[(Custom value of (Picked unit))] + Rate)
                        Floating Text - Destroy Capture_Bar[(Custom value of (Picked unit))]
                        Floating Text - Create floating text that reads (((((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))])]) + (Substrin 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)
                        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
                                Floating Text - Destroy Capture_Bar[(Custom value of (Picked unit))]
                                Floating Text - Create floating text that reads (Player_Colors[(Player number of (Owner of (Picked unit)))] + (Substring(Capture_String, 1, Capture_Time[(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)
                            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
                                Capture_Progress[(Custom value of (Picked unit))] Greater than 0
                            Then - Actions
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        Capture_Progress[(Custom value of (Picked unit))] Less than 0
                                    Then - Actions
                                        Set Capture_Progress[(Custom value of (Picked unit))] = 0
                                        Floating Text - Destroy Capture_Bar[(Custom value of (Picked unit))]
                                        Floating Text - Create floating text that reads (Player_Colors[(Player number of (Owner of (Picked unit)))] + (Substring(Capture_String, 1, Capture_Time[(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)
                                    Else - Actions
                                        Set Capture_Progress[(Custom value of (Picked unit))] = (Capture_Progress[(Custom value of (Picked unit))] - Rate)
                                        Floating Text - Destroy Capture_Bar[(Custom value of (Picked unit))]
                                        Floating Text - Create floating text that reads (((((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))])]) + (Substrin 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)
                            Else - Actions
Capture trigger, detects units that are close and fills up the bar

for some reason, after a few mins or so, a lot of the bars disappear. its supposed to create bars above every structure, and if a enemy unit gets near, it fills the bar up, when its full, its captured.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Still lurking
    +3
  • 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