Warcraft III resources & community, 2003–2006 · archived

Triggering Question

5 posts
#1

Triggering Question

How would I make it so:

Every 60 seconds all settlements (a unit bulding) are selected for a particular player, and all units owned by player 10 in a range of 1000 around the settlements grant the owner of the settlement 1 gold for each unit of player 10 around the settlement.

So... For example:

There are 5 units owned by player 10 within 1000 range of a settlement owned by player 1. Player 1 gets 5 gold (one for each unit owned by player 10). I hope that was made clear.

Thanks!!
#2
Are the settlements buildable? You might want to try using some limitations on settlements

Add (number of units within 1000 of (unit) matching (conditions) to owner of (unit)
#3
The settlements are unbuildable, they are all pre-set in the game. I could create a trigger for each one, but that would be a lot of work and I don't think that is nessesary. I have tried somthing very similar to what you have said- but I will give it a shot.
#4
Variables for each settlement, and lastly, an integer loop to cover for each unit
#5
Suprisingly- I was able to pull it off without any variables what so ever. I used what you gave me as a code for the events- and altered it slightly. Here is what it looks like, incase you are wondering:

(add(number of units in (units in (reigon centered at (position of (random 30 units owned by Player 1 of type Settlement) with size 8000.00, 8000.00 owned by player 10))) to player 1 current gold)

Perhaps one of the largest triggers I have ever used... but this gives me the option of generating settlements at random in the start of the game as opposed to preseting them. A player needs to capture 30 settlements to win a game, so I do not need to add any more than "random 30 units owned by player 1". Thanks for the help Eusira!