General - Bounty and Units

ReVolver

Mega Super Ultra Cool Member
Reaction score
608
Table of Contents

1. Finding the Trigger Editor
2. Adding the trigger
3. Editing the bounty



Step 1 - Finding the Trigger Editor

Like every WE and WEU out there, the Trigger Editor is found at the top left corner of the
main page of the editor as shown here.

Bounty-1.png


Step 2 - Adding the trigger

Add this trigger to your map to make all enemy units give bounty. Without this trigger, only Neutral Hostile
creeps give bounty. Note that the last action is called
'Player - turn flag on/off for player,' and 'gives bounty' is one of the player flags and we also *if you want* destroy the trigger. (follow steps 1-3)

1.


Bounty-2.png

2.

Bounty-3.png

3.

Bounty-4.png


End Results


Bounty-5.png


Step 3 - Editing the bounty

"Bounty is a random value between 'base + dice' and 'base + dice * sides' "
Every unit has a specific amount of gold they give away by default, but If you what them to drop more gold change it in the object editor.
Recommend Heroes : 200 gold , Hard Creeps : 100 gold and easy creeps or units for 45-60 gold.

Bounty-6.png


Edit: Second Way (Require JASS knowledge)

If you don't want to do it using the first method I mentioned you can use this way.

This is a function made by Vexorian that is very useful: I have added the function and showed an example on how to use it.

JASS:
function Bounty takes player whichplayer, integer bounty, real x, real y returns nothing
 local texttag t=CreateTextTag()
 local string s="+"
    call AdjustPlayerStateBJ( bounty, whichplayer, PLAYER_STATE_RESOURCE_GOLD )
    if bounty<0 then
        set s=""
    endif
    call SetTextTagText(t,s+I2S(bounty),0.025)
    call SetTextTagPos(t,x,y, 0.00)
    call SetTextTagColor(t,255,220,0,255)
    call SetTextTagVelocity(t,0,0.03)
    if (GetLocalPlayer()==whichplayer) then
        call SetTextTagVisibility(t,true)
        set s="UI\\Feedback\\GoldCredit\\GoldCredit.mdl"
    else
        call SetTextTagVisibility(t,false)
        set s=""
    endif
    call DestroyEffect(AddSpecialEffect(s,x,y))
    call SetTextTagFadepoint(t,2)
    call SetTextTagLifespan(t,3)
    call SetTextTagPermanent(t,false)
 set t=null
endfunction



This will give you 20 gold if you kill a Footmen unit type.

JASS:
function Conditions takes nothing returns boolean
    return GetUnitTypeId(GetTriggerUnit()) == 'hfoo' 
endfunction

function Actions takes nothing returns nothing
    call Bounty(GetOwningPlayer(GetKillingUnit()),20,GetUnitX(GetTriggerUnit()),GetUnitY(GetTriggerUnit()))
endfunction

//===========================================================================
function InitTrig_BountySystem takes nothing returns nothing
    local trigger trig = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ( trig, EVENT_PLAYER_UNIT_DEATH )
    call TriggerAddCondition( trig, Condition( function Conditions ) )
    call TriggerAddAction( trig, function Actions )
endfunction
 

ReVolver

Mega Super Ultra Cool Member
Reaction score
608
Sure I fix everything and add the pull down menu at the trigger editor
 

Rad

...
Reaction score
228
Hmm thats funny, Ryoko said to downscale the images before he submitted my RPG tutorial and you take his and its all goofy looking... it doesnt even fit into the page... Fix it up!!
 
E

Eilhal

Guest
Great tutorial... I already figured this one out on my own but I wish I would have found this before I wasted all that time working on it without any guidance :p
 

Bird

Ultra Cool Member
Reaction score
29
I was serarching for a solution to a problem I had and this solved it! Thank you.
 

holy_spirit

New Member
Reaction score
25
why u put it in a loop ?? it must works without it cuz ( pick every player ) then ( gives bounty on for picked player )
thats mean every player bountys will turn on and that doesn't need any loop
is that right my friend ????????????? ( im just a beginner in this craft -MAPPING- )
 

Andrewgosu

The Silent Pandaren Helper
Reaction score
716
If you loop for every player, it gives bounty on for all players.

If you just turn bounty on for neutral (passive or hostile), it turn bounty or neutral, meaning you get gold only for killing neutral, not all the players. :p
 

Hero

─║╣ero─
Reaction score
250
Nice tut...even though I figured this out a long time ago..anyways

+rep
 

ReVolver

Mega Super Ultra Cool Member
Reaction score
608
That is my old tutorial b4 I submitted it to TH :D
 

Oninuva

You can change this now in User CP.
Reaction score
221
What is the forumla to calculate the bounty rate?

Bounty + (Dice x Sides) ?
 

Halo_king116

Working As Intended
Reaction score
153
This is probably pointless, but I would suggest putting...

"Bounty is a random value between 'base + dice' and 'base + dice * sides' "

...Into the actual tutorial. It would defiantly help readers out, and not everyone checks all the posts. Just a suggestion.

Another suggestion is to mention that Player Groups create a Memory Leak (According to Rad's Memory Leak Tutorial)

Just putting those somewhere within the tutorial would only take a moment, and well worth that small amount of time to help beginners. I know the leak is nothing, but hey, whatever. :p

My thoughts. :)
 

ReVolver

Mega Super Ultra Cool Member
Reaction score
608
This is probably pointless, but I would suggest putting...

"Bounty is a random value between 'base + dice' and 'base + dice * sides' "

...Into the actual tutorial. It would defiantly help readers out, and not everyone checks all the posts. Just a suggestion.

Another suggestion is to mention that Player Groups create a Memory Leak (According to Rad's Memory Leak Tutorial)

Just putting those somewhere within the tutorial would only take a moment, and well worth that small amount of time to help beginners. I know the leak is nothing, but hey, whatever. :p

My thoughts. :)

Will do! :rolleyes: Old Tutorial = Old Orc_Tamer :p
 

ReVolver

Mega Super Ultra Cool Member
Reaction score
608
-Bump

Added a second method using a bounty JASS function.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top