How can i do this?

hugahug

New Member
Reaction score
3
:confused:How can i make a trigger like this

when a unit enters a cricle and if he stays there for 5 sec he captures the nearby towers and for each 10 sec he controll the tower he get 1 pont
 
D

DJ_Kalide

Guest
here is what you would do to get control of the tower:
Code:
Unit Stays 5 to get tower
    Events
        Unit - A unit enters [b]RegionName[/b]
    Conditions
    Actions
        Wait 5.00 seconds
        Unit - Change ownership of [b]TowerUnit[/b] to (Owner of (Triggering unit)) and Change color <-- one of these per tower
        Trigger - Turn on Ten Secs go by <gen>

2nd trigger(initially off):
Code:
Ten Secs go by
    Events
        Time - Every 10.00 seconds of game time
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions) <-- ONE If/Then/Else Multi Function per player
            If - Conditions
                (Owner of [b]TowerUnit[/b]) Equal to Player 1 (Red)
            Then - Actions
                Set Red_Score = (Red_Score + 1)
            Else - Actions
                Do nothing

there are alternatives to this, but this was the first way i thought of.
 

Komaqtion

You can change this now in User CP.
Reaction score
469
That won't work since he doesn't need tp stand in there for 5 seconds, only enter it and 5 seconds after he would get control of it.
 
D

DJ_Kalide

Guest
it will if he wants it like that =p and if he doesnt, he can make another trigger and use a 5 second wait event.
 

Komaqtion

You can change this now in User CP.
Reaction score
469
He asked for us to help him get a trigger right and you just give him a incorrect trigger and he might not even know how to change that!
BTW, is it a specific unit that will do this? like if it's for example a hero that enters it will change the owner but if it's a normal unit it wont?
and also, will each player have more than 1 of these units ?

This is how I probably would do it:
Code:
Change Owner
    Events
        Unit - A unit enters ([COLOR="Red"]Your Region[/COLOR])
    Conditions
    Actions
        Set Integer[(Player number of (Owner of (Triggering unit)))] = (Integer[(Player number of (Owner of (Triggering unit)))] + 1)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((Triggering unit) is A Hero) Equal to True // If You need it to be a hero for example, otherwise just skip this If condition =)
            Then - Actions
                Set Circle_Unit[Integer[(Player number of (Owner of (Triggering unit)))]] = (Triggering unit)
                Wait 5.00 seconds
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (([COLOR="Red"]Your Region[/COLOR]) contains Circle_Unit[Integer[(Player number of (Owner of (Triggering unit)))]]) Equal to True
                    Then - Actions
                        Unit - Change ownership of ([COLOR="Red"]Your Tower[/COLOR]) to (Owner of (Triggering unit)) and Change color
                    Else - Actions
            Else - Actions
 

Guk

New Member
Reaction score
1
Unit Stays 5 to get tower
Events
Unit - A unit enters RegionName
Conditions
Actions
Wait 5.00 seconds
Unit - Change ownership of TowerUnit to (Owner of (Triggering unit)) and Change color <-- one of these per tower
Trigger - Turn on Ten Secs go by <gen>

he could jsut make another triger than turns off first triger if unit leaves that rigeon
 

duderock101

Check out my 2 Player Co-op RPG!
Reaction score
71
There are already systems out there for this type of triggering. It can actually be quite complecated and i can't do it myself without the tut. Search for it.
 

Guk

New Member
Reaction score
1
Don't know will it help or make it worse but here

Start cooldown
ss
Events
Unit - A unit enters Region 000 <gen>
Conditions
Actions
Set urunit = (Triggering unit)
Trigger - Turn on ss1 <gen>
Wait 5.00 seconds
Unit - Change ownership of urunit to (Owner of (Triggering unit)) and Change color
Ends cooldown if unit leaves
ss1
Events
Time - Every 0.10 seconds of game time
Conditions
(Region 000 <gen> contains (Position of urunit)) Equal to False
Actions
Trigger - Turn off ss <gen>
Trigger - Turn off (This trigger)

But it will work only if 1 enters the region, if another unit will enter region at the time when first unit is still in that region, variable will change to second unit and , if 1 unit will leave that region cd won't stop and would seem like 2 unit that enterd even if it's ur enemy will take tower for u. So need some other triger to set variable. I'm no good with variables but idea isn't bad i think
 

hugahug

New Member
Reaction score
3
He asked for us to help him get a trigger right and you just give him a incorrect trigger and he might not even know how to change that!
BTW, is it a specific unit that will do this? like if it's for example a hero that enters it will change the owner but if it's a normal unit it wont?
and also, will each player have more than 1 of these units ?

This is how I probably would do it:
Code:
Change Owner
    Events
        Unit - A unit enters ([COLOR="Red"]Your Region[/COLOR])
    Conditions
    Actions
        Set Integer[(Player number of (Owner of (Triggering unit)))] = (Integer[(Player number of (Owner of (Triggering unit)))] + 1)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((Triggering unit) is A Hero) Equal to True // If You need it to be a hero for example, otherwise just skip this If condition =)
            Then - Actions
                Set Circle_Unit[Integer[(Player number of (Owner of (Triggering unit)))]] = (Triggering unit)
                Wait 5.00 seconds
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (([COLOR="Red"]Your Region[/COLOR]) contains Circle_Unit[Integer[(Player number of (Owner of (Triggering unit)))]]) Equal to True
                    Then - Actions
                        Unit - Change ownership of ([COLOR="Red"]Your Tower[/COLOR]) to (Owner of (Triggering unit)) and Change color
                    Else - Actions
            Else - Actions


but if the unit dies in the circle this trigger is canceld?
 

Komaqtion

You can change this now in User CP.
Reaction score
469
I think so, otherwise you could check if that unit is alive also
 

Vassilev

New Member
Reaction score
39
Fail fail... all is fail...

All of your triggers... it doesn't matter whether you put a wait function or not, as long as the unit enters the region, the trigger has fired, so the unit can exit, 5 seconds later allyourbasearebelong to us...

FIRST THINGS FIRST, you need to have a PERIODIC CHECKER to see whether the unit is still in the region

This is how you do it:

Trigger 1:
Event
Unit Enters a region
Conditions
Actions
set ConqueringUnit to Triggering Unit
Turn on Trigger 2


Trigger 2:
Event
Every 1.00 seconds of time <<< Every second
Conditions
Actions
If ConqueringUnit is NOT in Region <<< if the unit that entered is not in region
Then
set Counter[Owning Player of ConqueringUnit] = 0 <<< counter variable set to 0
Else
If ConqueringUnit is in Region and Counter[Owning Player of ConqueringUnit] < 5 <<< if the unit is in the region and the variable is less than 5
Then
Set Counter[Owning Player of ConqueringUnit] = Counter[Owning Player of ConqueringUnit] + 1 <<< add one to the counter
Else
If ConqueringUnit is in Region and Counter[Owning Player of ConqueringUnit] = 5 <<< if the unit is in the region for a total of 5 seconds
Give the building to Owning Player of Conquering Unit. <<< finally, give the building to the unit


Trigger 3
Event
Unit Leaves a Region
Condition - which region
Actions
Turn off trigger 2

you'd have to make a counter for each region so that it doesn't conflict while other players are conquering other places. Obviously you would need alot more conditions to make a complicated system but this is just a draft so you get an idea. You MUST use periodic checkers.
 
General chit-chat
Help Users

      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