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

Shared Bounty Help

Status
Not open for further replies.
Level 2
Joined
Jul 21, 2022
Messages
6
I have searched the entire web and can't find a working solution.

I want a system where the gold bounty from killing mobs in my TD to be evenly distributed to all 4 active players.
(Doesn't have to be full amount, but at least some.)

Gold bounty per kill is 1+ and every unit has base bounty changed in Object Editor, progresses up to 9+ depending on level.

Was working on a trigger but scrapped it out of frustration.

I would really appreciate help this is the final piece of my map before it's complete, been stuck for days.
 
Last edited:

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,570
It's definitely a division issue. Gold is an integer so you can't get half of 1 gold for example. You should add an If Then Else after setting Bounty to make sure it's not Equal to 0, if it is then Set it back to 1.

If that doesn't fix it then you're making a mistake with your Conditions in Shared Bounty. Also, make sure you're not messing with TotalUsers/ActiveUsers in some other trigger(s). You can use the Object Manager to find where you're Setting these variables.

Some other random notes:

1) You're adding Bounty to all four players rather than the players that are actually in the game. You can use a Pick Every Player action to Loop over ActiveUsers and award each (Picked player) gold.

2) You're setting Bounty in the Setup ActiveUsers trigger which looks like something you forgot to delete. It does nothing.

3) This one is nitpicky but checking if the (Owner of (Killing unit)) is in ActiveUsers seems a bit expensive to run every single time an enemy unit dies. You could maybe simplify this by using another method. For example, give each User-owned unit a hidden passive ability which you then check for -> If level of Player Class for (Killing unit) Equal to 1. I assume that'd be more efficient. Or maybe check which Team the Owner of the (Killing unit) is on.
 
Last edited:
Status
Not open for further replies.
Top