• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

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
 
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?
 

Cokemonkey11

Spell Reviewer
Level 30
Joined
May 9, 2006
Messages
3,550
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?
 

Cokemonkey11

Spell Reviewer
Level 30
Joined
May 9, 2006
Messages
3,550
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