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

Gold system

Status
Not open for further replies.
Level 4
Joined
Oct 11, 2008
Messages
90
I think he is referring to generating gold/second for all players, but i may be wrong...
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
I think I may understand what you're trying to say o.o
You really aren't explaining this good, though.

So... do you want a system that gives all players gold when a creep is killed?
(Can you please send me the "Gold System" you're speaking of? I can't see it in the Spell Section and it's probably easier to understand what you want).
 
Level 5
Joined
Apr 8, 2008
Messages
88
This should work i think? Gives all players that got a unit within 600 range of the killed unit and is an ally of the owner of the killing unit 5 gold... I'm not sure if this trigger is leakless.
  • Event - Unit dies
  • Conditions - Owned of triggering unit equal to enemy
  • Actions
    • Unit Group - Pick every unit in (Units within 600.00 of (Position of (Triggering unit)) matching (((Owner of (Picked unit)) is an ally of (Owner of (Killing unit))) Equal to True)) and do (Actions)
      • Loop - Actions
        • Player Group - Pick every player in (Player group((Owner of (Picked unit)))) and do (Actions)
          • Loop - Actions
            • Player - Add 5 to (Picked player) Current gold
 
Last edited:
Level 14
Joined
Aug 31, 2009
Messages
775
I'm not sure if this trigger is leakless.
It is not leakless, but you've also got a glaring error in there.

If I have 2 units in range of the dying unit, I get 5 gold twice, and 3 times for 3 units etc etc.
You've also got some Matching unit and Picked units confused.

Try this:
  • Events -
    • Unit - A unit dies
  • Conditions
    • --- Add conditions here, such as owner of dying unit is owned by a certain player or whatever ---
  • Actions
    • For each integer A from 1 to 12 loop (Actions)
      • Loop - Actions
        • Set PlayerLooted[Integer A] = False
    • Set TempPoint = Position of (Triggering Unit)
    • Set TempGroup = (Units within 600.00 of TempPoint) matching (((Owner of (Matching)) is an ally of (Owner of (Killing unit))) Equal to True)) and do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else actions)
          • If - Conditions
            • PlayerLooted[Player Number of (Owner of Picked Unit)] equal to False
          • Then - Actions
            • Player - Add X to (Owner of (Picked Unit)) Current gold
          • Else - Actions
            • Set PlayerLooted[Player Number of (Owner of Picked Unit)] equal to True
    • Custom script: call RemoveLocation(udg_TempPoint)
    • Custom script: call DestroyGroup(udg_TempGroup)
PlayerLooted is a Boolean Array Variable
TempGroup is a Unit Group Variable.
TempPoint is a Point Variable.
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
For the floating text, it would be this:

  • Actions
    • Floating Text - Create floating text that reads |c00ffdc00+X|r at TempLoc with Z offset 10.00, using font size 9.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
    • Floating Text - Set the velocity of (Last created floating text) to 52.00 towards 90.00 degrees
    • Floating Text - Change (Last created floating text): Disable permanence
    • Floating Text - Change the fading age of (Last created floating text) to 2.00 seconds
    • Floating Text - Change the lifespan of (Last created floating text) to 3.00 seconds
I have checked it, everything should be a perfect copy of the normal bounty (the color, the speed, the lifespan and the fading age).

To add the floating text (which would probably be useful), copy these actions like this:

  • Actions
    • For each integer A from 1 to 12 loop (Actions)
      • Loop - Actions
        • Set PlayerLooted[Integer A] = False
    • Set TempPoint = Position of (Triggering Unit)
    • Floating Text - Create floating text that reads |c00ffdc00+X|r at TempLoc with Z offset 10.00, using font size 9.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency Floating Text - Set the velocity of (Last created floating text) to 52.00 towards 90.00 degrees
    • Floating Text - Change (Last created floating text): Disable permanence
    • Floating Text - Change the fading age of (Last created floating text) to 2.00 seconds
    • Floating Text - Change the lifespan of (Last created floating text) to 3.00
    • Set TempGroup = (Units within 600.00 of TempPoint) matching (((Owner of (Matching)) is an ally of (Owner of (Killing unit))) Equal to True)) and do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else actions)
          • If - Conditions
            • PlayerLooted[Player Number of (Owner of Picked Unit)] equal to False
          • Then - Actions
            • Player - Add X to (Owner of (Picked Unit)) Current gold
          • Else - Actions
            • Set PlayerLooted[Player Number of (Owner of Picked Unit)] equal to True
    • Custom script: call RemoveLocation(udg_TempPoint)
    • Custom script: call DestroyGroup(udg_TempGroup)
~Credits go to Damage for the trigger :D
(on a side-note: you can set the "Stats - Point Value" of the units to their bounty, that would make it easier for you).
 
Level 5
Joined
Feb 27, 2009
Messages
115
A quick question to you guys...

How would you alter the trigger to give gold based on the amount of damage a person does? With the way how it is written above, a person just has to be range. So a hero could just hide behind the creeps all day and rack up points.
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
A quick question to you guys...

How would you alter the trigger to give gold based on the amount of damage a person does? With the way how it is written above, a person just has to be range. So a hero could just hide behind the creeps all day and rack up points.
You need to:
1) have a damage detection system (there are plenty on the hive)
2) Once you have that, you need to calculate how much % damage someone deals to the creep
3) You need to add those percentages the entire time (could go over 100% due to regen).
4) when the creep is dead, give (bounty x percentage) gold to everyone. (yes. everyone: everyone on the map).

The best way to store those percentages could be either with hashtables or with indexing, I'd choose hashtables myself.
 
Status
Not open for further replies.
Top