• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Control Point Income Trigger

Status
Not open for further replies.
Level 19
Joined
Jun 29, 2009
Messages
6,759
Hey all people, I am Amargaard, a loyal member of the Daily Peon, a social group here on HIVE. Some time ago I began making a map called DPW (Daily Peon Wars) dedicated to the group, meant to be like the popular map called Azeroth Wars on B.net ... But one of the most important things, the income, is kinda too hard for me to make the right way. I would be grateful if someone could help me out, and I'll of cause give you rep if you can succesfully teach me how to do it the right way :)

Take a look at my triggers:
174866-albums3028-picture36714.png


but In-game it looks like this:
174866-albums3765-picture36719.png


Help please with the following things:
1) There are too many timers - what should I change?
2) The timers just keep standing on zero, what's wrong?
3) How can I make a "Change owner AND set life on 100%" trigger?
 
Level 9
Joined
Oct 17, 2009
Messages
370
this would give +50 gold for every unit in that area, so spam units = more gold. and it creates a window for every unit, thats probably the wrong, also, the timer should be a repeating timer, not a one shot timer... and yea, use a if/then/else trigger and check if a unit is in the area, then add gold to the unit that is there.
 
Level 19
Joined
Jun 29, 2009
Messages
6,759
this would give +50 gold for every unit in that area, so spam units = more gold. and it creates a window for every unit, thats probably the wrong, also, the timer should be a repeating timer, not a one shot timer... and yea, use a if/then/else trigger and check if a unit is in the area, then add gold to the unit that is there.

You sounds like you know quite a lot about it. Can you make some screenies of the triggers as you want them to be and tell me what I have to change, please? That would be easier to "understand" ^^ :D
 
Level 12
Joined
Jan 30, 2009
Messages
1,067
Perhaps something like this:

  • Income Timer
    • Events
      • Time - Elapsed game time is 5.00 seconds
    • Conditions
    • Actions
      • Countdown Timer - Create a timer window for Income_Timer with title Income in:
      • Countdown Timer - Start Income_Timer as a Repeating timer that will expire in 30.00 seconds
  • Income
    • Events
      • Time - Income_Timer expires
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units of type Control Point (+50)) and do (Player - Add 50 to (Owner of (Picked unit)) Current gold)
Although, I think that'll only do it for that specific one (Control Point (+50)). You'll have to get a little more creative if you wish to have multiple control points. I'm not too incredible experienced in Triggers, so I may be wrong, :p I'd have to fiddle with it and test it and whatnot to get it to work for multiple points. And that's more time involved than I have available.

EDIT: Testmap in my next post (16) has working system for income and control change.
 
Last edited:
Level 9
Joined
Oct 17, 2009
Messages
370
This will solve 1 and 2:
You need 2 variables, One Timer, and one Boolean (true/false). Name them whatever you want. Mine is "Income_Timer" and "Incomealreadygiven"
First trigger is:
  • Timer Initialization
    • Events
      • Time - Elapsed game time is 5.00 seconds
    • Conditions
    • Actions
      • Countdown Timer - Start Income_Timer as a Repeating timer that will expire in 30.00 seconds
      • Countdown Timer - Create a timer window for Income_Timer with title Income in:
This will start the timer as a repeating timer so it will start when it reach 0, and create a timer window for it.

Second trigger:
  • Income
    • Events
      • Time - Income_Timer expires
    • Conditions
    • Actions
      • Set Incomealreadygiven = False
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (YOUR_REGION) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Incomealreadygiven Equal to False
            • Then - Actions
              • Set Incomealreadygiven = True
              • Player - Add 50 to (Owner of (Picked unit)) Current gold
            • Else - Actions
This will give 50 gold to the first unit in YOUR_REGION. The boolean (Incomealreadygiven) will make sure this will only give gold once.
  • Custom script: set bj_wantDestroyGroup = true
This will remove the unit group leak so it makes less lag.

To make another region that gives income just copy
  • Set Incomealreadygiven = False
    • Custom script: set bj_wantDestroyGroup = true
    • Unit Group - Pick every unit in (YOUR_NEW_REGION) and do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • Incomealreadygiven Equal to False
          • Then - Actions
            • Set Incomealreadygiven = True
            • Player - Add 50 to (Owner of (Picked unit)) Current gold
          • Else - Actions
and paste it under everything, so 2 regions will be
  • Income
    • Events
      • Time - Income_Timer expires
    • Conditions
    • Actions
      • Set Incomealreadygiven = False
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (YOUR_REGION) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Incomealreadygiven Equal to False
            • Then - Actions
              • Set Incomealreadygiven = True
              • Player - Add 50 to (Owner of (Picked unit)) Current gold
            • Else - Actions
      • Set Incomealreadygiven = False
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (YOUR_NEW_REGION) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Incomealreadygiven Equal to False
            • Then - Actions
              • Set Incomealreadygiven = True
              • Player - Add 50 to (Owner of (Picked unit)) Current gold
            • Else - Actions


To change the owner and give the unit 100% health use this (i use an integer to make it cleaner)
  • Actions
    • Set Tempunit = (Your unit)
    • Unit - Change ownership of Tempunit to (Your player) and Change color
    • Unit - Set life of Tempunit to 100.00%
 
Level 12
Joined
Jan 30, 2009
Messages
1,067
actually no timers are needed, but for the window u need a timer so thats why i use it

This is correct. There doesn't need to be an actual Countdown Timer for this system to work. The only use for this Timer is so the user knows when it's going to hit, so they can plan accordingly.

To put it simply: The Countdown Timer is an aesthetic feature.
 
Level 19
Joined
Jun 29, 2009
Messages
6,759
Wow, there has been a lot of posts since last time I was online, so thanks for helping all. I'm currently in Sweden on my dad's laptop. When I return to my homecountry, I'll try some of your suggestions out. If any good results, I'll ofcourse rep you ^^
 
Level 19
Joined
Jun 29, 2009
Messages
6,759
I'm back, and I'll test soon :]

EDIT: Have tested Vizel's shown trigger. It worked as intended. Now, I only need to know how to change owner of the control points when other players destroy them. Problem is that the average trigger which changes owner doesn't ressurect the control point also in the same second it was destroyed. Can you guys help with that too? I'll spread rep and give ya some in a few days if you succesfully help me ^^
 
Level 12
Joined
Jan 30, 2009
Messages
1,067
That's simple enough. Just do something like this:

  • Change ownership
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to (==) Scout Tower
    • Actions
      • Set SpawnPoint = (Position of (Triggering unit))
      • Unit - Remove (Triggering unit) from the game
      • Unit - Create 1 Scout Tower for (Owner of (Killing unit)) at SpawnPoint facing Default building facing (270.0) degrees
      • Custom script: call RemoveLocation(udg_SpawnPoint)
Remember the
  • Custom script: call RemoveLocation(udg_SpawnPoint)
is needed to remove the location leak.

In case you can't tell, "SpawnPoint" is a Point variable.

I've attached a test map in case you or anybody else would like to test it. Contains both the timer and the ownership change. Have fun! :)
 

Attachments

  • Change Ownership Test.w3x
    16.9 KB · Views: 7,090
Status
Not open for further replies.
Top