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

Income Trigger

Status
Not open for further replies.
Level 6
Joined
Apr 1, 2009
Messages
201
I'm working on a map currently that requires an income trigger and are having problems developing one. I searched the tutorials and the spell section but found nothing of what I wanted. What I'm looking for is a system that uses around 16 different income structures. Half the structures give gold and the other half give lumber. Every 45 seconds of the game a trigger will count the number of each type of structure for every player and give them there income based on how much each structure gives them. Any help at all would be greatly appreciated.
 
Level 8
Joined
Jun 16, 2008
Messages
333
Well idk no if this works but you need to change the units point vaule to what ever you want and make this trigger
  • Untitled Trigger 001
    • Events
      • Unit - A unit Finishes construction
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of (Triggering unit)) Equal to Player 1 (Red)
        • Then - Actions
          • Set redincome = (redincome + (Point-value of (Constructed structure)))
        • Else - Actions
AND a trigger
  • Untitled Trigger 002
    • Events
      • Time - Every 10.00 seconds of game time
    • Conditions
    • Actions
      • Player - Add redincome to Player 1 (Red) Current gold
 
Level 6
Joined
Apr 1, 2009
Messages
201
Not really what I was looking for but, some structures are already placed and the first trigger wouldn't count that. What I need is something that counts all completed structures which each have a set value for the amount of gold or lumber you receive from it.
 
Level 14
Joined
Nov 18, 2007
Messages
1,084
Something like this?
  • Income
    • Events
      • Time - Every 45.00 seconds of game time
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units in (Playable map area) matching ((((Matching unit) is A structure) Equal to True) and (((Matching unit) is alive) Equal to True))) and do (Actions)
        • Loop - Actions
          • Player - Add (Point-value of (Picked unit)) to (Owner of (Picked unit)) Current gold
You need to modify Point-value of every structure unit to give the correct amount of gold.
Unfortunately, this doesn't account for unfinished structures.
 
Level 14
Joined
Nov 18, 2007
Messages
1,084
This may not be the best way.

I would give all structure units that are supposed to give lumber a dummy ability. The ability should be pretty much useless in terms of actual gameplay and shouldn't appear in the unit's info card. (One good ability to base it off of is Sphere)

Then, in the triggers:
  • Income
    • Events
      • Time - Every 45.00 seconds of game time
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
        • Unit Group - Pick every unit in (Units in (Playable map area) matching ((((Matching unit) is A structure) Equal to True) and (((Matching unit) is alive) Equal to True))) and do (Actions)
          • Loop - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (Level of LumberClassification for (Picked unit)) Greater than 0
              • Then - Actions
                • Player - Add (Point-value of (Picked unit)) to (Owner of (Picked unit)) Current lumber
              • Else - Actions
                • Player - Add (Point-value of (Picked unit)) to (Owner of (Picked unit)) Current gold
 
Status
Not open for further replies.
Top