• Check out the results of the Techtree Contest #19!
  • Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Income

Status
Not open for further replies.
Level 5
Joined
Jan 15, 2018
Messages
130
For some reason this script is giving me 315 gold instead of the wanted 25 gold

What am i doing wrong

  • DolG25
    • Events
      • Time - Every 60.00 seconds of game time
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Custom script: set bj_wantDestroyGroup = true
          • Unit Group - Pick every unit in (Units in (Playable map area) matching (((Unit-type of (Matching unit)) Equal to Dol Goldur 25g (CP)) and ((Owner of (Matching unit)) Equal to (Picked player)))) and do (Actions)
            • Loop - Actions
              • Player - Add 25 to (Picked player).Current gold
 
There's no need for the Pick every player function, simply add 25 gold to the Owner of the Picked Unit.

  • Custom script: set bj_wantDestroyGroup = true
  • Unit Group - Pick every unit in (Units in (Playable map area) matching (((Unit-type of (Matching unit)) Equal to Dol Goldur 25g (CP)) and do (Actions)
    • Loop - Actions
      • Player - Add 25 to (Owner of (Picked unit)).Current gold
Edit: Unless you want it so that players only get 25 gold regardless of how many they own. Then you can do something like this:
  • Actions
    • Player Group - Pick every player in (All players) and do (Actions)
      • Loop - Actions
        • Set VariableSet TempGroup = (Units owned by (Picked player) of type Dol Goldur 25g (CP))
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Number of units in TempGroup) Greater than 0
          • Then - Actions
            • Player - Add 25 to (Picked player).Current gold
          • Else - Actions
        • Custom script: call DestroyGroup (udg_TempGroup)
Keep in mind that you aren't filtering out dead units so they will get grouped as well.
 
Last edited:
ok so i removed the player group section and it is still giving me an absurd amount of gold. (over 200)

I cant seem to figure it out

Any ideas?
 
It will give the Player 25 gold for each Dol Goldur 25g that belongs to them. Unless you use my second trigger which will only give 25 gold as long as they control at least 1.

Also, make sure to filter out DEAD units since they can be put in the Unit Group as well.
 
There is only one Dol Guldur control point, and it is giving me 315 gold which is not divisible by 25. Kinda frustrating

There is another trigger which allows the Control Point to change owners, but i dont think this is doing anything.

here is the guide i followed: Control Point Income?
 
  • BaradDur25
    • Events
      • Time - Every 60.00 seconds of game time
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units in (Playable map area) matching ((Unit-type of (Matching unit)) Equal to Barad-dûr (CP))) and do (Actions)
        • Loop - Actions
          • Player - Add 25 to (Owner of (Picked unit)).Current gold
  • BaradurCP
    • Events
      • Unit - Barad-dûr (CP) 1109 <gen> Is attacked
    • Conditions
      • (Life of Barad-dûr (CP) 1109 <gen>) Less than 350.00
    • Actions
      • Unit - Change ownership of Barad-dûr (CP) 1109 <gen> to (Owner of (Attacking unit)) and Change color
      • Unit - Set life of Barad-dûr (CP) 1109 <gen> to 100.00%
 
Is this: Barad-dûr (CP)

The same as this: Dol Goldur 25g (CP)

Also, try it without "set bj_wantDestroyGroup = true" and see what happens.

Additionally, create a text message that displays the name of the picked unit and maybe create a special effect at the position of the picked unit. This will help figure out what's going on.
 
yeah they are the same, there are a bunch of Control Points with the same trigger.

Ill test it out real quick

Edit: ok didnt work. i guess ill have to mess with the gold amount and see if that does anything because i am clueless. Its a big map, idk if i can send it to you
 
Last edited:
Yeah, I just tested it with a Footman using this:
  • Untitled Trigger 001
    • Events
      • Time - Every 5.00 seconds of game time
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units in (Playable map area) matching ((Unit-type of (Matching unit)) Equal to Footman)) and do (Actions)
        • Loop - Actions
          • Player - Add 25 to (Owner of (Picked unit)).Current gold
And it worked fine.

Maybe you have some other trigger interfering?
 
yes something is definitely messed up, i set the CP to 3 gold and it still gave me 293 gold.

How would you recommend checking for things that change this?

Ive looked through all my triggers nothing is affecting these triggers in particular and everyone of my control points giving an absurd amount of gold. (Ive tested the whole northeast side of the map)

Could it be something in the specs for the game?
 
Hmm no, i havent really messed with gold, this is the only thing remotely pertinent

  • Melee Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Melee Game - Set starting resources (for all players)
      • Melee Game - Limit Heroes to 1 per Hero-type (for all players)
      • Game - Set time of day speed to 75.00% of the default speed
EDIT: Ok i set the add property amount to -265 and that gave me 25 gold. So i guess that works. But im going to be doing this like 40 times. would a negative value be bad for this trigger?
 
Last edited:
Hmm no, i havent really messed with gold, this is the only thing remotely pertinent

  • Melee Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Melee Game - Set starting resources (for all players)
      • Melee Game - Limit Heroes to 1 per Hero-type (for all players)
      • Game - Set time of day speed to 75.00% of the default speed
EDIT: Ok i set the add property amount to -265 and that gave me 25 gold. So i guess that works. But im going to be doing this like 40 times. would a negative value be bad for this trigger?
That's fine, but it's still odd that this is happening. It has to be a trigger or weird Gameplay Constants or something.
 
Hey again,
I finished the rest of the control points in Mordor and its seems to have bugged out the whole system.
This same trigger is now resetting the picked players gold to 0. (the same trigger you showed me)

This is messed up man, could the map be corrupted or something?

Would you be willing to take a quick look at it?
 
Status
Not open for further replies.
Back
Top