Gold income for building?

YezItsMe

New Member
Reaction score
0
Hi :)
I'm a bit new at editing maps, and I'm starting to learn triggers.
But why wont THIS trigger work? What do I have to do with it?
Helpp.png
 

B0ndo

New Member
Reaction score
4
That action doesn't tell the trigger to anything, it picks evey unit of type tent and add 1 to player bla bla gold? Uhmm That's not possible, what is it you need? I'll need more information if you need help.
 

YezItsMe

New Member
Reaction score
0
I need a tent to give +1 gold every 1 second for every player that has the tent, but here I only showed red.
 

B0ndo

New Member
Reaction score
4
Then it's a very easy trigger, shall there be a delay before players start recieving the gold or just as soon as the map starts and then every second?

Trigger:
  • Trigger
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Player - Add 1 to (Picked player) Current gold


This trigger is what you're looking for.
 

YezItsMe

New Member
Reaction score
0
Well yeah it should be, I can do harder triggers than this one. I don't know why I can't do this one..
But players are supposed to recieve the gold as soon as they build the building ^^
 

B0ndo

New Member
Reaction score
4
Oh then you need a varible, hold on a minute and i'll fix the triggers for you.
 

B0ndo

New Member
Reaction score
4
If you do it my way (I don't know if there are any other ways actually, lol) Then you'll need an integer array variable, call it anything you'd like.

Trigger:
  • Trigger
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players matching (Your_Variable_Here[(Player number of (Matching player))] Equal to 1)) and do (Actions)
        • Loop - Actions
          • Player - Add 1 to (Picked player) Current gold


Trigger:
  • Variable
    • Events
      • Unit - A unit Finishes construction
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Tent
    • Actions
      • Set Your_Variable_Here[(Player number of (Owner of (Triggering unit)))] = 1
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
613
It would be so much simpler to just do this:
Trigger:
  • Add Gold
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Set TempUnitGroup = (Units owned by (Picked player) of type Tent)
          • For each (Integer A) from 1 to (Number of units in TempUnitGroup), do (Actions)
            • Loop - Actions
              • Player - Add 1 to (Picked player) Current gold
          • Custom script: call DestroyGroup(udg_TempUnitGroup)
 

B0ndo

New Member
Reaction score
4
Both codes are equally long hehe, the only difference is that my version needs 2 triggers :) and a bit less WC3 editor knowledge. Hehe.
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
613
Yours only adds 1 gold per player; mine adds 1 gold per tent. Which one was he actually asking for, anyway???
 

B0ndo

New Member
Reaction score
4
1 gold per player. His post was not that descriptive so I got confused several times. But I think he got it working now.
 

YezItsMe

New Member
Reaction score
0
Umm... SORRY GUYS, but I fail at trigger editor, lol. How do I "Set TempUnitGroup"? or "Set Variable"? It confuses me a bit. Everything else is fine
 

YezItsMe

New Member
Reaction score
0
Its like, I have to name it, then I have to name a type, and then there's something with Array and a size
 

B0ndo

New Member
Reaction score
4
Alright, but use my triggers, the one KaerfNomekop showed you adds 1 gold for every Tent a player has. Just have the browser window open below the trigger editor and follow what it says :)

I hope I helped you :)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top