• 🏆 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!

Need an Income trigger

Status
Not open for further replies.
Level 3
Joined
Jul 8, 2006
Messages
26
You know the type, a trigger that gives you money each few seconds. I want one like in tree tag, so if I have certain buildings, I get more gold. Like, if I have 3 farms, and each farm gives an extra 2 gold per interval, then I get 6 more gold per interval. Can't find a tutorial on this.
 
Level 4
Joined
Jan 23, 2005
Messages
65
event: every 2 seconds
action: pick every unit in (all units of type "rssource hall") an do
add (200 Gold) to (owner of (picked unit)) gold
add (50 Gold) to (owner of (picked unit)) lumber

here u go ^^
(quite easy version but could lagg if periodic time is too low)
 
Level 27
Joined
Feb 22, 2006
Messages
3,052
Code:
Events
Time - Every (X) Seconds
Conditions
Actions
Pick every unit in (Units of Type (Farm)) and do (Actions)
Actions
Add (X) gold to (Owner of (Picked Unit))

You'll have to modify the (X)'s to your liking, but that's the general idea.
If you want it leak free, then do
Code:
Events
Time - Every (X) Seconds
Conditions
Actions
Set (VARIABLE_UNIT_GROUP)= (Units of Type (Farm))
Pick every unit in (VARIABLE_UNIT_GROUP) and do (Actions)
Actions
Add (X) gold to (Owner of (Picked Unit))
Custom script:   call DestroyGroup(VARIABLE_UNIT_GROUP)
--donut3.5--
 
Level 4
Joined
Jan 23, 2005
Messages
65
donut3.5 said:
Code:
Events
Time - Every (X) Seconds
Conditions
Actions
Pick every unit in (Units of Type (Farm)) and do (Actions)
Actions
Add (X) gold to (Owner of (Picked Unit))

You'll have to modify the (X)'s to your liking, but that's the general idea.
If you want it leak free, then do
Code:
Events
Time - Every (X) Seconds
Conditions
Actions
Set (VARIABLE_UNIT_GROUP)= (Units of Type (Farm))
Pick every unit in (VARIABLE_UNIT_GROUP) and do (Actions)
Actions
Add (X) gold to (Owner of (Picked Unit))
Custom script:   call DestroyGroup(VARIABLE_UNIT_GROUP)
--donut3.5--

ehm... nearly the same as i posted...
and if u gonna destroy the variable, can u still use it? rally?
 
Level 9
Joined
Nov 27, 2004
Messages
465
Saiyuki said:
donut3.5 said:
Code:
Events
Time - Every (X) Seconds
Conditions
Actions
Pick every unit in (Units of Type (Farm)) and do (Actions)
Actions
Add (X) gold to (Owner of (Picked Unit))

You'll have to modify the (X)'s to your liking, but that's the general idea.
If you want it leak free, then do
Code:
Events
Time - Every (X) Seconds
Conditions
Actions
Set (VARIABLE_UNIT_GROUP)= (Units of Type (Farm))
Pick every unit in (VARIABLE_UNIT_GROUP) and do (Actions)
Actions
Add (X) gold to (Owner of (Picked Unit))
Custom script:   call DestroyGroup(VARIABLE_UNIT_GROUP)
--donut3.5--

ehm... nearly the same as i posted...
and if u gonna destroy the variable, can u still use it? rally?

mass trigger leak will kill him ^_^

he will need at least 2(3) triggers
1 for condtructing(add group)
1 for destroying\upgrading (remove from group)
1 for income (use group)
 
Status
Not open for further replies.
Top