• 🏆 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] how can i make lumber generate more than once

Status
Not open for further replies.
Level 21
Joined
Mar 2, 2010
Messages
3,069
i am working on a new project where resources is generated rather than gathered. i am using a periodic timer to generate lumber while reducing gold but lumber is only generated once while gold is being reduced as intended. how can i make the lumber generate as intended.(every 2 seconds)
 
Level 12
Joined
Mar 13, 2012
Messages
1,121
  • lumber
    • Events
      • Time - Every 2.00 seconds of game time
    • Conditions
    • Actions
      • Player - Add 1 to Player 1 (Red) Current lumber
?

Btw, it seems you didnt read or ignored the wc3 question I pm'ed you : o
 
Level 12
Joined
Mar 13, 2012
Messages
1,121
i am using i timer like that but it still happens only once. i also use a trigger that adds 40 for each town hall a player controls but it happens once only.

You should run it more than once then.

Rly, provide something in any way useful and you might get anwers..
 
Level 12
Joined
Mar 13, 2012
Messages
1,121
You have two triggers affecting lumber

  • oxigen generation
    • Events
      • Time - Every 2.00 seconds of game time
    • Conditions
    • Actions
      • Player - Add -40 to Player 1 (Red) Current lumber
      • Player - Add ((Number of units in (Units owned by Player 1 (Red) of type Greenhouse)) x 40) to Player 1 (Red) Current gold
and
  • carbondioxide generation
    • Events
      • Time - Every 2.00 seconds of game time
    • Conditions
    • Actions
      • Player - Add ((Number of units in (Units owned by Player 1 (Red) of type Town Hall)) x 40) to Player 1 (Red) Current lumber
So every two seconds we have -40 lumber and additionally +40 only if Player 1 controlls a Human Town Hall. So that results in either -40 or +0 every 2 seconds.
 
Level 13
Joined
Jul 16, 2012
Messages
679
  • Untitled Trigger 002
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer Lumber) from 1 to 12, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Player(Lumber)) slot status) Equal to Is playing
            • Then - Actions
              • Player - Set (Player(Lumber)) Current gold to (((Player(Lumber)) Current gold) - 1)
              • Player - Set (Player(Lumber)) Current lumber to (((Player(Lumber)) Current lumber) + (Number of living Town Hall units owned by (Player(Lumber))))
            • Else - Actions
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
  • Untitled Trigger 002
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer Lumber) from 1 to 12, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Player(Lumber)) slot status) Equal to Is playing
            • Then - Actions
              • Player - Set (Player(Lumber)) Current gold to (((Player(Lumber)) Current gold) - 1)
              • Player - Set (Player(Lumber)) Current lumber to (((Player(Lumber)) Current lumber) + (Number of living Town Hall units owned by (Player(Lumber))))
            • Else - Actions

Anything used twice or more should be stored into a variable and the variable should be used. Example: Store this into a player variable. (Player(Lumber))
Also you should just use a temp integer.
 
Level 21
Joined
Mar 2, 2010
Messages
3,069
i solved the original problem but i got another one. now lumber wont go below 40 times the number of town halls.(1 townhall and it doesnt go below 40, 2 townhalls and it doesnt go below 80, 3 townhalls and it doesnt go below 120 and 4 townhalls and it doesnt go below 160.)
 
Level 12
Joined
Mar 13, 2012
Messages
1,121
i solved the original problem but i got another one. now lumber wont go below 40 times the number of town halls.(1 townhall and it doesnt go below 40, 2 townhalls and it doesnt go below 80, 3 townhalls and it doesnt go below 120 and 4 townhalls and it doesnt go below 160.)

As in the first problem the mistake is again in your trigger logic. Sit down, think about what your trigger exactly does and correct it. It might sound a bit rude but this trigger is easy and if you want to learn making maps you have to do such things on your own. (Im a bit confused though as you have 2000 posts :huh:..)
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
last time i posted triggers i got harassed so i dont dare post triggers anymore.

I can't help you fix your problem then. And if you think someone is harassing you then just report them.
You should notice though that many people were telling you the same thing and you never even looked for a condition to match that.

If you want help then post the triggers if not then good luck is the best I can offer.
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
if you have warcraft 3 you could just install it and use it to open the map.(or just use it if it is already installed.) warcraft 3 works perfectly in windows 7 at the very least.

I have it installed on my pcs. But I am on my phone most of the time or coding in c# xna on my pc and I don't want to be bothered opening wc3 to download a map and open it just to look at triggers that could easily be posted by the one asking help.
 
Level 21
Joined
Mar 2, 2010
Messages
3,069
i am not very brave so when people harass me over something i avoid doing it again. i have also been harassed more than usual so i am more scared than usual. it isnt however that difficult to look at a map to find bugs. if someone else posted a map and asked me to look at it to find an issue i would. i am therefore asking for something that i am willing to do myself.
 
Status
Not open for further replies.
Top