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

Gold Regen System

Status
Not open for further replies.

Em!

Em!

Model Reviewer
Level 29
Joined
Jan 9, 2004
Messages
789
I need a trigger that recognizes the owner of the building generating gold and when it is built.

For instances
-The event
That the Hq finishes construction
-The condition
That the trigger recognizes the owner
-Action
Trigger:New Event
Periodic Event,every X seconds
Add gold to *player matching condition*

and also

The Event
a unit *building* changes owner
the condition that the trigger recognizes which owner
Action
Trigger:New Event
Periodic Event,every X seconds
Add gold to *player matching condition*

and if the building is captured by another the Gold regen stops for x player but begins for y player.
I bet there are variables involved, i am not too shabby with variables :hohum:
 
Level 21
Joined
Aug 21, 2005
Messages
3,699
  • Events
    • Every X seconds of game time
  • Conditions
  • Actions
    • Unit Group - Pick every unit in (units of type Farm - or any other condition, idk) and do actions:
      • Loop - actions
        • Player - add 50 gold to owner of picked unit
This question has been answered many times before, please search next time...

Note: this trigger leaks a unitgroup, you might want to get it fixed.
 

Em!

Em!

Model Reviewer
Level 29
Joined
Jan 9, 2004
Messages
789
This is not what i am looking for.
First of all the building in question won´t be ingame at first and it will only regen after its built so it requires the event unit finishes construction. If i add another event through trigger\action it does not function right, and i need the trigger to be able to identify who is the owner of constructed building cause i can´t find it in the condition event.

The Second trigger is similar but it requires to be captured first.
 

Em!

Em!

Model Reviewer
Level 29
Joined
Jan 9, 2004
Messages
789
Doesn´t work anyhow
Gold
Events
Unit - A unit Finishes construction
Conditions
(Unit-type of (Triggering unit)) Equal to Unholy Church
Actions
Trigger - Add to (This trigger) the event (Time - Every 5.00 seconds of game time)
Unit Group - Pick every unit in (Units owned by (Triggering player) of type Unholy Church) and do (Actions)
Loop - Actions
Player - Add 150 to (Triggering player) Current gold

oh wait i think i see the error, no still nothing even if i changed it to (Unit-type of (Constructed structure)) Equal to Unholy Church
the loop trigger thats supposed to feed me gold does it only once
 
Level 19
Joined
Aug 24, 2007
Messages
2,888
off-topic: What is the point of creating an unit variable to fix the leak (too many people does that)
just add Custom script: set bj_wantDestroyGroup = true

to Cannibal: Do the Eleandor's way or SUFFER TO DEATH
 

Em!

Em!

Model Reviewer
Level 29
Joined
Jan 9, 2004
Messages
789
off-topic: What is the point of creating an unit variable to fix the leak (too many people does that)
just add Custom script: set bj_wantDestroyGroup = true

to Cannibal: Do the Eleandor's way or SUFFER TO DEATH

To Need_02 i would if it would only work!, i am suffering!

Gold
Events
Time - Every 5.00 seconds of game time
Conditions
Actions
Unit Group - Pick every unit in (Units of type Unholy Church) and do (Actions)
Loop - Actions
Player - Add 150 to (Picked player) Current gold
:sad: what am i doing wrong :cry::cry:

Edit: Btw i did search around for similar trigger but either its a very old thread or not in this section
 
Status
Not open for further replies.
Top