• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Control points trigger help

Status
Not open for further replies.
Level 4
Joined
Jun 5, 2007
Messages
100
hi guys, I'm currently working on a map were you acquire resources by capturing control points. So far I've got two triggers.
one that is pretty simple,
  • events-
  • unit - circle of power - is attacked
  • conditions-
  • unit type of [triggering unit] equal to circle of power
  • actions-
  • set life of circle of power to 100%
  • change owner of circle of life to owner of attacking unit
which makes it so that if you attack a control point, you capture it.
but what I can't do is make it count how many you have and give you gold for it. does anyone have any ideas? there is no condition to check the owner of a unit, or I would have made it so that if you own the control point you start acquiring gold every 30 seconds from it. But I can't find the check owner condition.
 
Level 5
Joined
Jan 6, 2010
Messages
115
hi guys, I'm currently working on a map were you acquire resources by capturing control points. So far I've got two triggers.
one that is pretty simple,
  • events-
  • unit - circle of power - is attacked
  • conditions-
  • unit type of [triggering unit] equal to circle of power
  • actions-
  • set life of circle of power to 100%
  • change owner of circle of life to owner of attacking unit
which makes it so that if you attack a control point, you capture it.
but what I can't do is make it count how many you have and give you gold for it. does anyone have any ideas? there is no condition to check the owner of a unit, or I would have made it so that if you own the control point you start acquiring gold every 30 seconds from it. But I can't find the check owner condition.

The map Battledawn uses control points (check it out), although different conditions for control. You must simply store an "income"-variable which is given to each player/faction periodically in gold. When you take a control point, your income variable increases and your opponents decreases. It's pretty straightforward.
 
Level 4
Joined
Jan 9, 2010
Messages
89
Hey

You don't need to check the owner of a unit, but the number of units of a specific type owned by a player.

  • Untitled Trigger 001
    • Events
      • Time - Every 2.00 seconds of game time
    • Conditions
    • Actions
      • Set Integer = (Number of living Town Hall units owned by Player 1 (Red))
      • Player - Add Integer to Player 1 (Red) Current gold
Just change the interval to whatever you want.
 
Level 4
Joined
Jun 5, 2007
Messages
100
alright, thanks. but could someone please explain

Set Integer = (Number of living Town Hall units owned by Player 1 (Red))

to me? I don't know how to set that up
 
Level 2
Joined
Jan 24, 2010
Messages
16
"Integer" is just a name for a variable of the type >integer< (hence, the name).

use "Set Variable", insert the variable to be set (you should use one per player) and use the "count units matching conditions" (or something like that) function to count all units of type Circle of power AND owned by whatever player.

After that, decide on the value if gold per circle and insert whatever else you might want to.
 
Level 4
Joined
Jun 5, 2007
Messages
100
hate to double post but this has really stopped my progress, could anyone please explain how to go about making that trigger for me?
 
Level 2
Joined
Jan 24, 2010
Messages
16
First, make a new Trigger.
Then, select a "periodic event" - event. Set the number to the number of seconds you wish to have between your income (gold).

  • Time - Every (whatever) seconds of game time
After you have done this, create a new variable of the type "Integer" (if you don't know where, click the X - Button in the trigger manager) And add an Action:

In the first few lines, you will find the "Set variable" Action. Choose your variable ("Integer") as the variable to be set and set it (the option behind the "=") to
Unit - Count number of units in area matching condition (I think)

!Try to make one variable per player!

As conditions, set:
Unit type - Unit type of (Matching unit) = Control Point (or circle of power, however you named it)
AND
Player comprasion - Owner of (Matching unit) = (the player)


Finally, make another action:
Player - Add ("Integer") to (the player)'s gold

And you're done.

EDIT: At a second thought, quit the variable. Just make Player - Add ("Integer") to (the player)'s gold to Player - Add (Unit - Count number of units in area matching condition) to (the player)'s gold and use the same conditions as above. This way, you'll only have to make one trigger.
 
Last edited:
Level 3
Joined
Jan 4, 2010
Messages
42
You need to make a Variable (integer type) and in this case call it Integer.

Then use "Set variable" and choose your variable, then just make that equal to "Unit - Count Living Units Owned by Player" and choose the town hall building!

At the " Player - Add Integer to Player 1 (Red) Current gold" <-- Integer will your variable.
 
Level 4
Joined
Jun 5, 2007
Messages
100
ah, that worked! thanks mate.

another thing, for control points. Instead of putting down
event -
control point 16 is attacked
change ownership of [control point 16] to attacking player

can I have a trigger that applies to all of them at once? like, for example.
unit type [circle of power] is attacked
change ownership of unit-type [circle of power] to attacking player
 
Level 14
Joined
Aug 31, 2009
Messages
774
  • Events
    • Unit - A unit is attacked
  • Conditions
    • Unit type of (Triggering Unit) equal to Circle of Power
  • Actions
    • Unit - Change ownership of (Triggering Unit) to (Owner of (Attacking Unit)) and change color.
That will apply to all your circles now.
 
Status
Not open for further replies.
Top