• 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.

[Trigger] Bounty on non-neutral units, how?

Status
Not open for further replies.
Level 2
Joined
Mar 27, 2010
Messages
22
Hello, I,d like to know if there is a simple way to put a bounty on units (If the units are owned by Player (Dark green)) I tied to make it this way:

(Roughly what I did, I don't have my map in front of me)

  • Trigger :
    • Unit - Unit is attacked
  • Conditions :
    • Unit type of (Triggering Unit) is equal to Wild Wolf
  • Actions :
    • Wait for Attacked Unit is Dead is equal to TRUE checking for condition every 1.00 second
    • Player - Add 10 gold to (Owner of (Attacking Unit))
    • Game - Show the message : +10 Gold for 4.00 second
    • Special Effect - Play BountyArt on Attacking Unit
And it failed, I think I know where the problem is (Wait for attaked unit... blablah), but I don't know how to solve it. Some help would be REALLY appreciated! (Btw I tried to change the delay of condition check to 0.50, 1.50,2.00 and it didn't help.)

Edit: Forgot to tell it works, I get the gold, when I kill one at time. mass attacks is a mess on this sytem, I get 20x (for 5 ennemies) +10 Gold T,T.
 
Last edited:
Use trigger tags next time.
If you want to add bounty to owner of killing unit when given unit dies just use event:
  • Events
    • Unit - Unit dies
And leave rest of the actions as they were removing just the Wait one.

However, you you want to add bounty on attacks (while dealing damage) you will have to use some kind of damage detecting system. For GUI users I recommend this system.

Using that system your trogger will should be somewhat like this:
  • init
    • Events
      • Game - GDD_Event becomes equal to 0.00
    • Conditions
      • Unit type of (GDD_DamageSource) is equal to Wild Wolf
    • Actions'
      • Player - Add 10 gold to (Owner of (GDD_DamageSource))
      • Game - Show the message : +10 Gold for 4.00 second
      • Special Effect - Play BountyArt on GDD_DamageSource
 
Last edited:
Level 2
Joined
Mar 27, 2010
Messages
22
give X gold to Owner of...

Use trigger tags next time.
If you want to add bounty to owner of killing unit when given unit dies just use event:
  • Events
    • Unit - Unit dies
And leave rest of the actions as they were removing just the Wait one.

However, you you want to add bounty on attacks (while dealing damage) you will have to use some kind of damage detecting system. For GUI users I recommend this system.

Using that system your trogger will should be somewhat like this:
  • init
    • Events
      • Game - GDD_Event becomes equal to 0.00
  • Conditions
    • Unit type of (GDD_DamageSource) is equal to Wild Wolf
  • Actions'
    • Player - Add 10 gold to (Owner of (GDD_DamageSource))
    • Game - Show the message : +10 Gold for 4.00 second
    • Special Effect - Play BountyArt on GDD_DamageSource

1st - I want to have the bounty on death, like when you kill a neutral monster.
2nd - I could use Unit Dies, but in that case, how could I give gold to the owner of "killing" unit, is there a trigger to define owner of killing unit?

Edit: Also, I got a older version of the editor, I don't have the hashtables. Maybe I didn't found the right trigger because of that?
 
Last edited:
I said: leave rest actions alove just remove the Wait one..

  • init
    • Events
      • Unit - A Unit dies
    • Conditions
      • (Unit type of (Killing unit)) is equal to Wild Wolf
      • (Owner of (Triggering unit)) Equal to Neutral enemy
    • Actions
      • Player - Add 10 gold to (Owner of (Killing unit))
      • Game - Show the message : +10 Gold for 4.00 second
      • Special Effect - Play BountyArt on (Killing unit)
 
Last edited:
Level 2
Joined
Mar 27, 2010
Messages
22
I said: leave rest actions alove just remove the Wait one..

  • init
    • Events
      • Units - Unit dies
    • Conditions
      • (Unit type of (Killing unit)) is equal to Wild Wolf
      • (Owner of (Triggering unit)) Equal to Neutral enemy
    • Actions
      • Player - Add 10 gold to (Owner of (Killing unit))
      • Game - Show the message : +10 Gold for 4.00 second
      • Special Effect - Play BountyArt on (Killing unit)

Thanks alot, that worked. Sorry for beign a little slow today. :thumbs_up:
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
Or you could just turn on bounty for the player and set the unit to give 10 gold in the object editor...

JASS:
PLAYER_STATE_GIVES_BOUNTY
native SetPlayerState takes player whichPlayer,playerstate whichPlayerState,integer value returns nothing

And I am sure there is a GUI way to do this as well (no custom script).
 
Level 12
Joined
Feb 22, 2010
Messages
1,115
If what doctor's said is true, I understood question correctly lol :ogre_haosis:

  • PDGB
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Player - Turn Gives bounty On for Player 11 (Dark Green)
 
Level 2
Joined
Mar 27, 2010
Messages
22
Good but not variable

If what doctor's said is true, I understood question correctly lol :ogre_haosis:

  • PDGB
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Player - Turn Gives bounty On for Player 11 (Dark Green)

That's a way. But the one which uses:

  • Bounty
    • Events
      • Unit - A Unit dies
    • Conditions
      • (Triggering Unit) is owned by (Ennemies) is equal to TRUE
      • (Unit Type of(Triggering Unit) is equal to Wil Wolf
    • Actions
      • Game - Show the message: +10 Gold for 4.00 seconds for (Owner of(Killing Unit))
      • Player - Add 10 gold to (Owner of(Killing Unit))
      • Special Effect - Create special effect on overhead of (Killing Unit) using BountyArt.mdx
That way you can always change the ammount of gold you want them to give. Useful, because there's some boss that now give 500 gold instead of 10! (That would be cheap... 10 gold for a boss...) Anyway, I didn't saw any leaks yet.
 
You leak effect handle. You have to destroy your special effect especialy if it's just a temporary one.
  • Special Effect - Destroy (Last created special effect)
And 'Turn on/off bounty' function works fine as well. But in this case you have to set the bounty for given unit manualy. To do so, go to Object Editor -> Unit section -> select your unit and customize bounty via fields:
- Stats - Bounty Awarded - Base
- Stats - Bounty Awarded - Number of Dice
- Stats - Bounty Awarded - Sides per Die

Formula for bounty: BASE + Random integer number between(NOD and (NOD x SPD))
Where NOD is number of dice and SPD Sides per Die.
 
Level 2
Joined
Mar 27, 2010
Messages
22
You leak effect handle. You have to destroy your special effect especialy if it's just a temporary one.
  • Special Effect - Destroy (Last created special effect)

Your probably right, BUT, if it create the effect and then destroy ir right after, there is no effect at all (I tried, and there is no effect, it WILL show it, but for like 0,0001 seconds. Human eyes cant see that).
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
It works only if the special effect has no death animation.

Creating a special effect will cause its birth animation to play once and then its stand to run for its entire life. Removing a special effect instantly causes its death animation to play before it vanishes.

Thus you can instantly remove explosion special effects as they have no death animation. However if you do the same for a unit special effect, it will just play its death animation before disappearing.
 
Level 2
Joined
Mar 27, 2010
Messages
22
It works only if the special effect has no death animation.

Creating a special effect will cause its birth animation to play once and then its stand to run for its entire life. Removing a special effect instantly causes its death animation to play before it vanishes.

Thus you can instantly remove explosion special effects as they have no death animation. However if you do the same for a unit special effect, it will just play its death animation before disappearing.

I think I understand... But if I take bountyart for example (the gold pieces that pops up). This animation has a death animation, because it vanishes right after. But, does this leak if I put an animation like bountyart or thunderclap without destroying it after? I tried on those and finally, they don't disapear in 0,00001 seconds. But is it completely necessary?
 
Level 17
Joined
Nov 26, 2007
Messages
1,964
That's a way. But the one which uses:

  • Bounty
    • Events
      • Unit - A Unit dies
    • Conditions
      • (Triggering Unit) is owned by (Ennemies) is equal to TRUE
      • (Unit Type of(Triggering Unit) is equal to Wil Wolf
    • Actions
      • Game - Show the message: +10 Gold for 4.00 seconds for (Owner of(Killing Unit))
      • Player - Add 10 gold to (Owner of(Killing Unit))
      • Special Effect - Create special effect on overhead of (Killing Unit) using BountyArt.mdx
That way you can always change the ammount of gold you want them to give. Useful, because there's some boss that now give 500 gold instead of 10! (That would be cheap... 10 gold for a boss...) Anyway, I didn't saw any leaks yet.


You can just set how much gold they give in the object editor.

There's no need to trigger this, just turn bounty on.
 
Status
Not open for further replies.
Top