Im Making a gold fountain! plz help

Exuro.

New Member
Reaction score
5
Hey again again

I have placed a Gold Mine on my map and removed all the abilities and stuff on it!

then i placed a region around it!

Now i want a trigger to give 1 gold every second of game time to owners of the units standing in that region!

how do i do that?

thanks
 
Code:
E: Every 1 second
A: Custom script: set bj_wantDestroyGroup = true*
   Pick every unit in the region and do:
   Add [U]Owner of picked unit[/U] to [PlayerGroupVariable]
   Pick every player in [PlayerGroupVariable] and do:
   Add 1 gold to [U]picked player[/U]**
   Clear [PlayerGroupVariable]

*Idk if this is the right syntax (case sensitivity)
**This may be (Set property of some player to (Property of some player + 1))

Obviously [PlayerGroupVariable] is a Player Group variable :p
 
Do you want to give gold for every unit, or only if there is 1 or more units?

I presume just if the player has at least one unit in the region?


Code:
Gold Fountain
    Events
        Time - Every 1.00 seconds of game time
    Conditions
    Actions
        For each (Integer A) from 1 to 12, do (Actions)
            Loop - Actions
                Set ug = (Units in <Gold Region> owned by (Player((Integer A))))
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Number of units in ug) Greater than 0
                    Then - Actions
                        Player - Add 1 to (Player((Integer A))) Current gold
                    Else - Actions
                        Do nothing
                Custom script:   call DestroyGroup(udg_ug)

"ug" is a unit-group variable.
 
1 unit is all they have!

there are 3 teams, and their all trying to capture this gold fountain! so it doesnt matter who stands in it, every unit in the region shall recieve 1g per second
 
Maybe this works...

Code:
Gold Trigger
    Events
        Time - Every 1.00 seconds of game time
    Conditions
    Actions
        Unit Group - Pick every unit in (Units in Rect 000 <gen>) and do (Player - Add 1 to (Owner of (Picked unit)) Current gold)
But it will give 1 of gold to all the units of the player in that area, not only one per player.

EDIT: It will work but i think that it will leak.
 
ye Leo, think your trigger might do the trick! thanks a ton to everyone!

Best fu***** forum this is :)
 
Code:
Gold Trigger
    Events
        Time - Every 1.00 seconds of game time
    Conditions
    Actions
     Set TempPoint = Rect 000   
     Unit Group - Pick every unit in TempPoint and do (Player - Add 1 to (Owner of (Picked unit)) Current gold)
     Custom Script: call RemoveLocation (udg_TempPoint)

Here's the leakless version. :D
 
Now i think you should worry about if it leak or not, i recomend to use Leak Checker v3

EDIT: The rendendaru trigger will work
 
I posted a trigger that fixed the location leak.
 
Code:
Gold Trigger
    Events
        Time - Every 1.00 seconds of game time
    Conditions
    Actions
     Set TempPoint = Rect 000   
     Unit Group - Pick every unit in TempPoint and do (Player - Add 1 to (Owner of (Picked unit)) Current gold)
     Custom Script: call RemoveLocation (udg_TempPoint)

Here's the leakless version. :D

Rect isn't point man,the unit group is leaking
 
i never fixed leaks in my maps as im new and i get to confused heh!
but on the other hand, i never had problems with leaks! or dont think i have heh!

isent leaks only important to worry about if u got lots of stuff going on in a big map?
 
i never fixed leaks in my maps as im new and i get to confused heh!
but on the other hand, i never had problems with leaks! or dont think i have heh!

isent leaks only important to worry about if u got lots of stuff going on in a big map?

There are many aspects to decide whether or not a leak is minor.
For instance, if you have map that generally lasts 1 1/2 to 2 hours, a few little leaks will add up. Also, triggers that happen consistantly with a set time
(Every 1 second) should be watched out for.
 
Code:
Gold Trigger
    Events
        Time - Every 1.00 seconds of game time
    Conditions
    Actions   
     Unit Group - Pick every unit in Rect 000 <gen> and do (Player - Add 1 to (Owner of (Picked unit)) Current gold)
     Set TempGroup = (Picked Unit)
     Custom Script: call DestroyGroup (udg_TempGroup)

That look good now?
 
Code:
Gold Trigger
    Events
        Time - Every 1.00 seconds of game time
    Conditions
    Actions   
     Unit Group - Pick every unit in Rect 000 <gen> and do (Player - Add 1 to (Owner of (Picked unit)) Current gold)
     Set TempGroup = (Picked Unit)
     Custom Script: call DestroyGroup (udg_TempGroup)

That look good now?
You're joking right? :D Right?
 
Yea, I'm not thinking right. I'm not good at simple triggers... I like having loops and such.
 
Yea, I'm not thinking right. I'm not good at simple triggers... I like having loops and such.

Ye :)
Apparently no one wants to post the leak-proof version,so...
Code:
Gold Trigger
    Events
        Time - Every 1.00 seconds of game time
    Conditions
    Actions   
     Custom script - set bj_wantDestroyGroup = true
     Unit Group - Pick every unit in Rect 000 <gen> and do (Player - Add 1 to (Owner of (Picked unit)) Current gold)

In case ne1 needs it
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    News portal has been retired. Main page of site goes to Headline News forum now
  • The Helper The Helper:
    I am working on getting access to the old news portal under a different URL for those that would rather use that for news before we get a different news view.
  • Ghan Ghan:
    Easily done
    +1
  • The Helper The Helper:
    https://www.thehelper.net/pages/news/ is a link to the old news portal - i will integrate it into the interface somewhere when i figure it out
  • Ghan Ghan:
    Need to try something
  • Ghan Ghan:
    Hopefully this won't cause problems.
  • Ghan Ghan:
    Hmm
  • Ghan Ghan:
    I have converted the Headline News forum to an Article type forum. It will now show the top 20 threads with more detail of each thread.
  • Ghan Ghan:
    See how we like that.
  • The Helper The Helper:
    I do not see a way to go past the 1st page of posts on the forum though
  • The Helper The Helper:
    It is OK though for the main page to open up on the forum in the view it was before. As long as the portal has its own URL so it can be viewed that way I do want to try it as a regular forum view for a while
  • Ghan Ghan:
    Yeah I'm not sure what the deal is with the pagination.
  • Ghan Ghan:
    It SHOULD be there so I think it might just be an artifact of having an older style.
  • Ghan Ghan:
    I switched it to a "Standard" article forum. This will show the thread list like normal, but the threads themselves will have the first post set up above the rest of the "comments"
  • The Helper The Helper:
    I don't really get that article forum but I think it is because I have never really seen it used on a multi post thread
  • Ghan Ghan:
    RpNation makes more use of it right now as an example: https://www.rpnation.com/news/
  • The Helper The Helper:
  • The Helper The Helper:
    What do you think Tom?
  • tom_mai78101 tom_mai78101:
    I will have to get used to this.
  • tom_mai78101 tom_mai78101:
    The latest news feed looks good

      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