Shared gold help

Lmfaocj

Active Member
Reaction score
1
Hey, I am making a shared gold trigger where every unit in 900 range of the dead unit gets gold and owner of killing unit gets gold, but for some reason some times when I kill a unit i won't get gold

Trigger:
  • Share gold
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Owner of (Triggering unit)) Equal to (==) Neutral Hostile
      • ((Killing unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to (==) True
    • Actions
      • Set TempGroup = (Units within 900.00 of (Position of (Triggering unit)) matching (((Matching unit) belongs to an ally of (Owner of (Killing unit))) Equal to (==) True))
      • Unit Group - Pick every unit in TempGroup and do (Set TempPGroup = (All players matching ((Matching player) Equal to (==) (Owner of (Picked unit)))))
      • Set AATempInteger = (Number of players in TempPGroup)
      • Set Gold_Rate = (((Point-value of (Triggering unit)) / AATempInteger) x Gold_Event)
      • Player Group - Pick every player in TempPGroup and do (Player - Add Gold_Rate to (Picked player) Current gold)
      • Floating Text - Create floating text that reads (|cffffcc00 + ((String(Gold_Rate)) + + Gold|r)) above (Triggering unit) with Z offset 0.00, using font size 8.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Floating Text - Change (Last created floating text): Disable permanence
      • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
      • Floating Text - Change the fading age of (Last created floating text) to 4.00 seconds
      • Floating Text - Change the lifespan of (Last created floating text) to 5.00 seconds
      • Floating Text - Hide (Last created floating text) for (All players)
      • Floating Text - Show (Last created floating text) for TempPGroup
      • Custom script: call DestroyForce(udg_TempPGroup)
      • Custom script: call DestroyGroup(udg_TempGroup)
 

rotten

New Member
Reaction score
2
in the player group action, shouldn't you do Player - Set Property - Set current player gold to (current player gold + Gold_Rate)?
 

Lmfaocj

Active Member
Reaction score
1
in the player group action, shouldn't you do Player - Set Property - Set current player gold to (current player gold + Gold_Rate)?

o.o I guess I will try that now. I didn't know it mattered witch one you used.
 

rotten

New Member
Reaction score
2
Oh. I don't think Event Response - Triggering Unit is the best idea for the dying unit. Use Event Response - Dying Unit instead.

This includes all conditions and events.

Another possible mistake is that you try to count the players in TempGroup, when it is defined as an unit group. I don't think this works that way, but I could be wrong. If I am not, it could be fixed by creating another temp group for players.
 

Jedi

New Member
Reaction score
63
Try that,
Trigger:
  • Unit Group - Pick every units in TempGroup and do (Player Group - Add (Owner of (picked unit)) to TempPGroup
 
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