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

[General] Income System?

Status
Not open for further replies.
Level 18
Joined
Feb 19, 2009
Messages
800
I'm working on a map with no way to gather gold from mines or lumber from trees. The idea is, the player will receive income every sixty seconds. They can increase this income by capturing a number of "Control Towers" spread all around the map.

The problem is, I have no idea how to do this.

I want to know how to pull this off. How do I give the player a periodic income that's multiplied by the number of a certain type building the player owns?
 
Level 12
Joined
Dec 11, 2014
Messages
662
Whenever the timer expires add "income" to their gold. Income should be a variable. And whenever they capture the tower add some value to the Income variable. Timer should also have its own variable if you want it to have a window and not bee invisible (not sure about this)
 
Level 10
Joined
Apr 4, 2010
Messages
509
  • Income
    • Events
      • Time - Every 60.00 seconds of game time
    • Conditions
    • Actions
      • Set TempGroup = Every unit in entire map matching Unit-Type of matching unit is equal to Control Tower Gold or Control Tower Wood
      • Pick every unit in TempGroup and do Actions
        • Loop
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Unit-Type of picked unit is equal to Control Tower Wood
            • Then - Actions
              • Add Wood Income to owner of picked unit
            • Else - Actions
              • Add Gold Income to owner of picked unit
      • Custom script: call DestroyGroup (udg_TempGroup)
 
Last edited:
Status
Not open for further replies.
Top