Conquer building by remain in its range (more complicated than this)

Smitty

Member
Reaction score
20
Hmm, yes, if you have 2 allied players there isn't a check for that. That's because It gives the building to AllianceUnitCheck, which is a randomly chosen unit from all the units capturing the tower. Not sure how to make a good workaround for this, let's see what I can do. What do you want to happen in this situation?

Also, I should have said;

"Then run an alliance comparison with AllianceUnitCheck against all units from AllianceCheck"
 

polo2005

Wana start playing LoL? http://tinyurl.com/369as27
Reaction score
97
my version of it is done, if i understod it correctly :p

the unit will only be captured if a there is only allied ENEMY units close to the building, and if all units around the building moves away before its captured, the capturing time resets.

all buildings need a mana pool to work correctly.

if 2 allied players omves in to capture a point, the first owner of the unit who comes first becomes the owner, even if all his unit dies and only units owned by his ally is left.

the capturing time stops if an enemy force approaches the player who is trying to capturing the building.
 

Attachments

  • capture building.w3x
    22.4 KB · Views: 198

Tothumn

New Member
Reaction score
4
What do you want to happen in this situation?

Well... give the building to the unit who arrived first. Currently the buildings mana decreases by 1 / sec for every enemy unit in range. So if I come with more units I need less time to capture, and if a third enemy appears I also need less time.The second thing is a little bit annoying but I do not want to seem to be captious.Its not that important.

polo:
Its quite good but it will take me some time to understand...
I only noticed one bug:
the capturing time does not continue when I kill the defender unit, even if I re-enter the area.
didnt test whether it continues when the defender flees from the area.
 

polo2005

Wana start playing LoL? http://tinyurl.com/369as27
Reaction score
97
should be working now :)


edit: wops dubbel post

edit of an edit:

Code:
setup v2
    Events
        Unit - A unit Finishes construction
    Conditions
        ((Constructed structure) is A structure) Equal to True
    Actions
        Set Count = (Count + 1)
        Unit Group - Add (Triggering unit) to OnCapture[Count]
        Unit Group - Add (Triggering unit) to CapturePoints_group
        [U][B]Trigger - Add to Capture <gen> the event (Unit - A unit comes within 300.00 of (Triggering unit))[/B][/U]
        Unit - Set mana of (Triggering unit) to 100.00%
        [B][U]Unit - Set the custom value of (Triggering unit) to 350[/U][/B]
        --------   --------
        If (Count Equal to 999) then do (Trigger - Turn on setup <gen>) else do (Do nothing)
should be changed to
Code:
        Trigger - Add to Capture <gen> the event (Unit - A unit comes within (Real((Capture_range - 50))) of (Triggering unit))

        Unit - Set the custom value of (Triggering unit) to Capture_range

feel free asking if there is something you want to know about it, and please tell me if you find a bug :)
 

Attachments

  • capture building.w3x
    26.5 KB · Views: 195

Tothumn

New Member
Reaction score
4
It is perfect! +rep given

Could you please explain me what does this custom text do exactly?
Trigger:
  • Custom script: set bj_wantDestroyGroup=true


there is only one thing left; i do not want computer players to be able to capture anything, they shouldnt affect the capturing at all.
I dont not know exactly where to add the condition which checks whether the triggering(or picked?) unit is controlled by a computer.

and does this 999 value interger variable affects the memory or CPU usage badly? Im pretty sure my map will always have less than 200 buildings at once.

Trigger:
  • If (Count Equal to 999) then do (Trigger - Turn on setup &lt;gen&gt;) else do (Do nothing)


Instead of turning on Setup i think you wanted to run it, but its really a little oversight :)

Before I thougt Im pretty good at GUI, but I ran into very complicated problems and now I see that its pretty easy for others.
I have an inferiority complex :D
 

polo2005

Wana start playing LoL? http://tinyurl.com/369as27
Reaction score
97
It is perfect! +rep given

...

Before I thougt Im pretty good at GUI, but I ran into very complicated problems and now I see that its pretty easy for others.
I have an inferiority complex :D

well glad you liked it :p

Could you please explain me what does this custom text do exactly?
Trigger:
  • Custom script: set bj_wantDestroyGroup=true

Custom script: set bj_wantDestroyGroup=true

works the same as set "unit_group_varrible = units xxx..." and then when your done call DestroyForce(udg_unit_group_varrible).
though its a a more "sloppy" version of it (you wont notice any diffrence) and a bit more lazy version.

it basicly clear up memory leaks that are created everytime you run a group function. works with player groups to.

though DO NOT USE both this and set/destoy group to clear up leaks. bj are mostly avoided and are concidering bad by jass users.

there is only one thing left; i do not want computer players to be able to capture anything, they shouldnt affect the capturing at all.
I dont not know exactly where to add the condition which checks whether the triggering(or picked?) unit is controlled by a computer.

well there is some places you need to do some changes:

first one:
place this if then else at the start of the trigger "Capture"
Code:
Capture
    Events
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((Owner of (Triggering unit)) controller) Equal to Computer
            Then - Actions
                Skip remaining actions

second:
in the trigger "Capture v2" in the first unit group loop right after "Set temp_point[0] = (Position of temp_unit)"
Code:
Unit Group - Pick every unit in (Units within (Real((Custom value of temp_unit))) of temp_point[0] matching (((((Matching unit) is A structure) Equal to False) and (((Matching unit) is alive) Equal to True)) and [B]((Matching unit) Not equal to temp_unit))[/B]) and do (Actions)
    Loop - Actions
        If (All Con...
change out that line too:
Code:
((Owner of (Matching unit)) controller) Not equal to Computer))
its under the condion "Player controller comparison"

3d:
the If All Conditions are True then right under that looks like this
Code:
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    If - Conditions
       [B] ((Units within (Real((Custom value of temp_unit))) of temp_point[0] matching (((Matching unit) belongs to an enemy of (Owner of temp_unit)) Equal to True)) is empty) Equal to True[/B]
should look like this:
Code:
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    If - Conditions
        ((Units within (Real((Custom value of temp_unit))) of temp_point[0] matching ((((Matching unit) belongs to an enemy of (Owner of temp_unit)) Equal to True) and (((Owner of (Matching unit)) controller) Not equal to Computer))) is empty) Equal to True
    Then - Actions
        Set temp_Flag_Boolean = False
    Else - Actions
and the last one: at the end of the trigger the:
Code:
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    If - Conditions
        [B]((Units within (Real((Custom value of temp_unit))) of temp_point[0] matching ((((Matching unit) belongs to an enemy of (Owner of temp_unit)) Equal to True) and (((Matching unit) is alive) Equal to True))) is empty) Equal to True[/B]    Then - Actions
        Unit Grou...
should look like:
Code:
        ((Units within (Real((Custom value of temp_unit))) of temp_point[0] matching ((((Matching unit) belongs to an enemy of (Owner of temp_unit)) Equal to True) and ((((Matching unit) is alive) Equal to True) and (((Owner of (Matching unit)) controller) Not equal  Equal to True

this should do the trick.


and does this 999 value interger variable affects the memory or CPU usage badly? Im pretty sure my map will always have less than 200 buildings at once.

yeah the map will take up 4kb more!!!11!1 no seriously, you wont notice any diffrence, though i wouldn't set it OVER 9000 (1000) it always **** up the triggers for me, so avoid putting it over 999.

Trigger:
  • If (Count Equal to 999) then do (Trigger - Turn on setup &lt;gen&gt;) else do (Do nothing)


Instead of turning on Setup i think you wanted to run it, but its really a little oversight :)

ah.. :p my bad. yeah your correct it should be run checking condicons.

Edit:

darn yeah you got to change the "unit dies" trigger too, will look over it when i wake up tomorrow :)



Edit:::

Okay its done, computer players should not affect the capturnig at all now.
 

Attachments

  • capture building.w3x
    29.3 KB · Views: 192

Smitty

Member
Reaction score
20
You know, I completely forgot you could add events. Wow I'm special XD

Well done on this, sorry mine wasn't better, but glad to have helped :) God luck with your mapping :D
 
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

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top