• 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.

Dominance map

Status
Not open for further replies.
Level 1
Joined
May 4, 2014
Messages
5
Hello guys. I'm creating a map and need to know how i create bases wich one player can dominate and increses income. ex: i putted many buildings in the map, and this buildings, when dominated (standing near it) increses your incoming gold/lumber. If you losse this building to other player, descreses your income. Your gold income is based in the number of buildings you have dominated. I tried many ways to do this, but, i am new in world editor, someone help me?
 
Level 1
Joined
May 4, 2014
Messages
5
well, i even know if i am in the correct way.

Trigger 1:
--Events:
Time, every 15sec of game of time
--Conditions: None
--Actions:
Add 25 to player 1(red) Current gold.

Trigger 2:
--Event:
Unit comes within 256.00 of (Unit)
--Condition:
(owner of (triggiring unit)) equal to player 1
--Action:
Unit: Change ownership of (unit) to player 1 and change color.
Player: Add 50 to player 1 current gold
 
Add 25 to player 1(red) Current gold.

Well, this just adds 25 gold for player 1 every 15 seconds.

What you really want is to add 25 gold to *each* player for *each* unit they own.

Try this:

* Unit Group: Pick every unit of type <income unit>
* Add 25 gold to *owner of picked unit* gold

Done!
 
Level 1
Joined
May 4, 2014
Messages
5
The ideia is to create bases, i dont know with i do it with regions or buildings. And the player can "conquest" the region, just passing trought. More regions conquested, more incoming. If other player conquest his region, he decresses the incoming. I gess this triggers are far to get it right. No?
 
The ideia is to create bases, i dont know with i do it with regions or buildings. And the player can "conquest" the region, just passing trought. More regions conquested, more incoming. If other player conquest his region, he decresses the incoming. I gess this triggers are far to get it right. No?

Yes, I only helped you with one trigger so far.

Quick question: Are the contestable buildings static? Or are they created throughout the game?
 
Level 1
Joined
May 4, 2014
Messages
5
Is a static building. I had a better ideia. The "bases" will be circles of power. When you dominate a circle of power, you raise your income. Do you know a trigger for this?
 
Is a static building. I had a better ideia. The "bases" will be circles of power. When you dominate a circle of power, you raise your income. Do you know a trigger for this?

It makes no difference.

Just create a trigger: (Note that if I type "//" it means the following is a comment in plain text)

* Generic Unit event: A unit enters within x range of (static building 1)

* Condition: Owner of (triggering unit) is not equal to (owner of (static building 1))

* Action:

// Here we must only change owners if the unit is dominated - that means the current owner has no units near the static unit

* Variable - Set (integer variable z) = 0

* Unit Group - For each unit in x range of (static building 1) do:

* If (Get Owning Player (Picked Unit)) == Get Owning Player (static building 1) do:

* Variable - Set (integer variable z) = (integer variable z) + 1

// Now that we've counted the number of units, just check the value of z:

* If z == 0 then

* Unit - Set Owner of (static building 1) to (Owner of (Triggering Unit))

// done. Make a trigger like this for all your static units

This is not perfect, and by no means how I would solve the problem, but it should serve as a starting point :) Good luck.
 
Status
Not open for further replies.
Top