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

Help Income GUI Trigger

Status
Not open for further replies.
Level 2
Joined
Mar 15, 2011
Messages
7
Alright, so these triggers only work for red and no other players. How do I fix these triggers or is there an easier / better way.
  • Initialization
  • Events
  • Map Initialization
  • Conditions
  • Actions
  • Set PlayerS[1] = red
  • Set IncomeUNIT_TYPE[1] = Tavern
  • Set IncomeMoney[1] = 125
  • Income
  • Events
  • Conditions
  • Actions
  • For each (Integer B) from 1 to 8, do (Actions)
    • Loop - Actions
      • Unit Group - Pick every unit in (Units of type IncomeUNIT_TYPE[(Integer B)] and do (Actions)
        • Loop - Actions
          • Player - Add IncomeMoney[(Integer B)] to (Owner of (Picked unit)) Current gold
  • For each (Integer B) from 9 to 18, do (Actions)
    • Loop - Actions
ect ect same as the 1 to 8
So in the map initialization I have 18 different UNIT_TYPE variables set 1-8L then 9-18G. Afterwards the Income trigger which I typed out the lumber one, the gold one is exactly the same except changes
  • For each (Integer B) from 9 to 18, do (Actions)
So anyway that someone can help me fix this set of triggers to work for all players would be nice.
 
Level 2
Joined
Mar 15, 2011
Messages
7
First, you want this line:

  • Custom script: set bj_wantDestroyGroup = true
Before the "pick all units" loop.
Ok, I have that in the script, but it still doesn't work. Red gets the income like it should but none of the other players receive income.
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
What is the event of the second trigger? When does it run?
It works when I use your trigger just like you wrote it there (with Bribe's additional set bj_wantDestroyGroup = true to remove the leak and a timed event, of course).

In case you're not familiar with easy trigger copy-pasting: you can right-click the trigger name above "events" and select "copy as text", then you can easily paste it here and wrap trigger-tags around it.
 
Level 2
Joined
Mar 15, 2011
Messages
7
What is the event of the second trigger? When does it run?
It works when I use your trigger just like you wrote it there (with Bribe's additional set bj_wantDestroyGroup = true to remove the leak and a timed event, of course).

In case you're not familiar with easy trigger copy-pasting: you can right-click the trigger name above "events" and select "copy as text", then you can easily paste it here and wrap trigger-tags around it.
There is no event for it, It runs from the start and the income timer is set into the map initialization. Should I change that and make the trigger itself run with the initialization or just have the income box added into this trigger?
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,201
You need to make the timer run it when it expires...
In GUI there is an event for when a timer expires. Timers do not run code unless you tell them to. Alternativly you can start the timer with the function you want to run (JASS way) which has the same results as hooking a trigger to a timer experation event with the action of the function.
 
Status
Not open for further replies.
Top