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

how can i make a building increase income

Status
Not open for further replies.

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,183
i think he means taht every X soconds all players get X gold based on building and other factors.
  • income change
    • Events
      • Unit - A unit Finishes construction
    • Conditions
      • (Unit-type of (Constructed structure)) Equal to Lumber Mill
    • Actions
      • Set income[(Player number of (Owner of (Triggering unit)))] = (income[(Player number of (Owner of (Triggering unit)))] + 10.00)
  • loop
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Player - Add (Integer(income[(Player number of (Picked player))])) to (Picked player) Current gold
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
I don't know if there's a "Gold" upgrade... This is the best solution I can give you:

  • Melee Initialization
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players matching (((Race of (Matching player)) Equal to Undead) or ((Race of (Matching player)) Equal to Night Elf))) and do (Actions)
        • Loop - Actions
          • Set p = (Picked player)
          • Set pn = (Player number of p)
          • Set i[pn] = ((p Current gold) + Income[pn])
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (p Current gold) Greater than CurrentGold[pn]
            • Then - Actions
              • Player - Set p Current gold to i[pn]
            • Else - Actions
          • Set CurrentGold[pn] = (p Current gold)
This should check every 0.03 seconds the current gold of the Players, and sets that gold into a Integer Variable (Current Gold). When your workers gets the gold, the current gold of the player will be higher than the Gold the player had 0.03 seconds, then, and the trigger will add your income amount (won't display it though).

All these variables are "Integer" if you see them having a '[]' it's because they're an array.
You just have to

You just have to set the trigger that increases "Income[Player Number]" of the player you want to increase income.



Another solution wold be messing with the workers harvest abilities and finding a way to replace it or give some other values...
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Look under "Player" actions. I think there's a "Player - Set research level" Do it under the 'Race' comparison, as showed in my trigger example.
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Dear lord...

  • Melee Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players matching ((Race of (Matching player)) Equal to Undead)) and do (Actions)
        • Loop - Actions
          • Player - Set the current research level of Unholy Armor to 1 for (Picked player)
Change "Unholy Armor" for your custom upgrade, and the Race of Matching Player to whatever you want.
 
Level 21
Joined
Mar 2, 2010
Messages
3,069
if you cant help me but must harass me please leave this topic alone. i still dont know how to add a gold upgrade to the undead. i dont need script to research something because the undead can research. i dont however know how the amount of gold produced by a haunted gold mine can be upgraded through research.
 

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,183
I know how to do this.

i did modify the human upgrade improve lumber harvest.
change the "effect 1" from "lumber harvest" to gold harvest"
now the peasant will gather 15 gold.
bellow the edited field there is 2 new rows called effect 1 also ther you edit the base gold collected.


NOTE, i think the ability give 50% bonus collecting of the base gold collected
 
Level 21
Joined
Mar 2, 2010
Messages
3,069
i know that that wont help because race only decides what menu the upgrade appears on. (upgrades with human as race have worked on all races.) what it affects is decided by assigning the upgrade to units. my problem is that i cant figure out what units to assign it to to get it to increase the amount of gold extracted.
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
I think units have a Data Field to tell wich upgrades affects them. Also buildings have a field to tell which upgrades can be researched there.
 
Status
Not open for further replies.
Top