General - Bounty and Units

ReVolver

Mega Super Ultra Cool Member
Reaction score
607
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.



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.



2.


3.



End Results




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.



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
607
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
Staff member
Reaction score
714
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
251
Nice tut...even though I figured this out a long time ago..anyways

+rep
 

ReVolver

Mega Super Ultra Cool Member
Reaction score
607
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
152
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
607
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
607
-Bump

Added a second method using a bounty JASS function.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    Happy Sunday!
    +1
  • The Helper The Helper:
    I will be out of town until Sunday evening
    +1
  • The Helper The Helper:
    I am back! Did you miss me LOL
    +1
  • jonas jonas:
    where did you go?
  • The Helper The Helper:
    Jefferson TX on a Paranormal Investigation of a haunted bed and breakfast - I got some friends that are paranormal investigators and they have an RV and do YouTubes
    +1
  • The Helper The Helper:
    It was a lot of fun. The RV was bad ass
  • jonas jonas:
    That sounds like fun!
    +1
  • The Helper The Helper:
    it was a blast!
  • The Helper The Helper:
    I am going to post the Youtube of the investigation in the forums when it is ready
    +1
  • jonas jonas:
    cool!
  • vypur85 vypur85:
    Sounds cool TH.
  • tom_mai78101 tom_mai78101:
    I was on a Legend of Zelda marathon...
  • tom_mai78101 tom_mai78101:
    Am still doing it now
    +1
  • jonas jonas:
    which one(s) are you playing?
  • jonas jonas:
    I played a little bit of the switch title two weeks ago and found it quite boring
  • The Helper The Helper:
    just got back from San Antonio this weekend had the best Buffalo Chicken Cheesesteak sandwhich in Universal City, TX - place was called Yous Guys freaking awesome! Hope everyone had a fantastic weekend!
    +1
  • The Helper The Helper:
    Happy Tuesday!
  • The Helper The Helper:
    We have been getting crazy numbers reported by the forum of people online the bots are going crazy on us I think it is AI training bots going at it at least that is what it looks like to me.
  • The Helper The Helper:
    Most legit traffic is tracked on multiple Analytics and we have Cloud Flare setup to block a ton of stuff but still there is large amount of bots that seem to escape detection and show up in the user list of the forum. I have been watching this bullshit for a year and still cannot figure it out it is drving me crazy lol.
    +1
  • Ghan Ghan:
    Beep boop
    +1
  • The Helper The Helper:
    hears robot sounds while 250 bots are on the forum lol
  • The Helper The Helper:
    Happy Saturday!
    +1

    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