1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still haven't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. Rubbed the right way, the genie is out of its lamp! The 12th Concept Art Contest Results have been announced.
    Dismiss Notice
  4. Race against the odds and Reforge, Don't Refund. The 14th Techtree Contest has begun!
    Dismiss Notice
  5. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

how can i make a building increase income

Discussion in 'World Editor Help Zone' started by andreasaspenberg, Oct 22, 2011.

  1. andreasaspenberg

    andreasaspenberg

    Joined:
    Mar 2, 2010
    Messages:
    3,015
    Resources:
    0
    Resources:
    0
    i mean a bit like the refinery, lumber mill and keep in warcraft 2.
     
  2. Spartipilo

    Spartipilo

    Joined:
    Jul 14, 2011
    Messages:
    3,190
    Resources:
    0
    Resources:
    0
    Eh... give more details.

    What do you mean with Income? What exactly you want to achieve?
     
  3. Chaosy

    Chaosy

    Joined:
    Jun 9, 2011
    Messages:
    10,718
    Resources:
    18
    Maps:
    1
    Spells:
    11
    Tutorials:
    6
    Resources:
    18
    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
     
  4. andreasaspenberg

    andreasaspenberg

    Joined:
    Mar 2, 2010
    Messages:
    3,015
    Resources:
    0
    Resources:
    0
    i want the players to get extra gold for transporting the gold to a certain building. the night elves and undead will get some kind of upgrade instead but how do i upgrade the gold extraction of a haunted gold mine.
     
  5. Spartipilo

    Spartipilo

    Joined:
    Jul 14, 2011
    Messages:
    3,190
    Resources:
    0
    Resources:
    0
    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...
     
  6. andreasaspenberg

    andreasaspenberg

    Joined:
    Mar 2, 2010
    Messages:
    3,015
    Resources:
    0
    Resources:
    0
    there isnt a gold upgrade but i can create it. it is one of the unused upgrade possibilities. i dont however know how to apply it to the undead.
     
  7. Spartipilo

    Spartipilo

    Joined:
    Jul 14, 2011
    Messages:
    3,190
    Resources:
    0
    Resources:
    0
    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.
     
  8. andreasaspenberg

    andreasaspenberg

    Joined:
    Mar 2, 2010
    Messages:
    3,015
    Resources:
    0
    Resources:
    0
    the undead can research but i dont know how to apply a gold mining upgrade to them.
     
  9. Spartipilo

    Spartipilo

    Joined:
    Jul 14, 2011
    Messages:
    3,190
    Resources:
    0
    Resources:
    0
    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.
     
  10. andreasaspenberg

    andreasaspenberg

    Joined:
    Mar 2, 2010
    Messages:
    3,015
    Resources:
    0
    Resources:
    0
    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.
     
  11. Chaosy

    Chaosy

    Joined:
    Jun 9, 2011
    Messages:
    10,718
    Resources:
    18
    Maps:
    1
    Spells:
    11
    Tutorials:
    6
    Resources:
    18
    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
     
  12. Spartipilo

    Spartipilo

    Joined:
    Jul 14, 2011
    Messages:
    3,190
    Resources:
    0
    Resources:
    0
    OH! I'm sorry andreasaspenberg. I didn't understand what you were saying =). Good to know Darkgrom found a solution.
     
  13. andreasaspenberg

    andreasaspenberg

    Joined:
    Mar 2, 2010
    Messages:
    3,015
    Resources:
    0
    Resources:
    0
    i have done that thing myself but i couldnt figure out how to add the same kind of bonus to undead. only humans, orcs and night elves. that is what i need help with. adding a gold mining bonus to undead.
     
  14. Chaosy

    Chaosy

    Joined:
    Jun 9, 2011
    Messages:
    10,718
    Resources:
    18
    Maps:
    1
    Spells:
    11
    Tutorials:
    6
    Resources:
    18
    copy>pase the ability and change race to undead?

    EDIT there is a common slection at race i think that might work
     
  15. andreasaspenberg

    andreasaspenberg

    Joined:
    Mar 2, 2010
    Messages:
    3,015
    Resources:
    0
    Resources:
    0
    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.
     
  16. Spartipilo

    Spartipilo

    Joined:
    Jul 14, 2011
    Messages:
    3,190
    Resources:
    0
    Resources:
    0
    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.
     
  17. andreasaspenberg

    andreasaspenberg

    Joined:
    Mar 2, 2010
    Messages:
    3,015
    Resources:
    0
    Resources:
    0
    i know that already. buildings also have a field that tell what upgrades they are affected by. what i need to know is what unit or building i need to affect in order to increase gold mined from the haunted gold mine.
     
  18. Spartipilo

    Spartipilo

    Joined:
    Jul 14, 2011
    Messages:
    3,190
    Resources:
    0
    Resources:
    0
    Workers...?

    Undead = Acolyte?
     
  19. andreasaspenberg

    andreasaspenberg

    Joined:
    Mar 2, 2010
    Messages:
    3,015
    Resources:
    0
    Resources:
    0
    i tried that but it didnt work.
     
  20. BonerBoo

    BonerBoo

    Joined:
    Jun 19, 2011
    Messages:
    24
    Resources:
    0
    Resources:
    0
    Hey how to create add(integer) in your last trigger ?