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: 199

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: 198

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: 193

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.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top