Tax system for bounties?

Ouguiya

New Member
Reaction score
11
Hello everyone!

The question I wish to ask here is simply: Is there a way to "tax" the amount of bounty which a player receives from killing a unit?

It doesn't have to be a complex system. A simple trigger which simply would allow me to substract a variable tax rate from a unit's bounty would be sufficient.

Unfortunately I have only found "Divert player income", which however, I am not sure if it taxes bounty, and if it takes the "give player xxx money" system, which blizzard recently implemented that a player with an income tax loses some of the money given to him by another player (something which I really cannot have in this map).

Thanks in advance!

Yours,

Ouguiya
 

Larcenist

REP: Respect, Envy, Prosperity?
Reaction score
211
If you wish for the tax to be a percentage of each unit type's actual bounty, you could either add some average bounty amount as the point value of each unit and use that through triggers, or you could trigger bounties completely which'll make tax manipulation easier as well as giving you the opportunity to use random bounty high/low bounds.
 

Fire-Wolf

S.P.D Smoke Pot Daily, Legalize It!
Reaction score
54
Well you could trigger the bounty, then set the amount of money earned, then subtract it by like 5% of it or something. If you need help later I could show you.
 

tom_mai78101

The Helper Connoisseur / Ex-MineCraft Host
Staff member
Reaction score
1,713
I think there's a trigger action called Player - Divert Tax:

"Player - Divert 10% of the Gold income of Player 1 (Red) to Neutral Passive"

This needs math.

You can trigger the total of something (statistics), then use different tax values for each of them, diverting the gold to Neutral Passive, and resetting Neutral Passive's gold value back to 0.
 

Ouguiya

New Member
Reaction score
11
Hello all! Thanks for the replies!

What would of course be most acceptable is the system which uses a trigger, since it allows great control over how much money is awarded.

However, I have a question here:

How can you make it so the "bounty" still shows above the unit, as it does with the normal game system?

If anyone could tell me how to do that, all my problems would be solved at once.

Thanks again!

Yours,

Ouguiya
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Well, this is how EGUI does the bounty text, maybe a modification would make this usable for you :S
JASS:
function CreateTextTagBounty takes string s, location loc returns texttag
    local texttag t = CreateTextTag()
    
    call SetTextTagText(t, s, 0.023)
    call SetTextTagPos(t, GetLocationX(loc), GetLocationY(loc), 0)
    call SetTextTagColor(t, 255, 220, 0, 255)
    call SetTextTagVelocity(t, 0, 0.036)
    call SetTextTagPermanent(t, false)
    call SetTextTagLifespan(t, 2.00)
    call SetTextTagFadepoint(t, 1.00)
    
    return t
endfunction
 

Ouguiya

New Member
Reaction score
11
Hello there!

Thanks for the reply.

This looks good, but unfortunately, I really know very very little about JASS.

I can sort of understand how the thing works, setting paramters for delay, life time etc. but what I don't see is where the system gets the "bounty" from.

After all, it's: "call SetTextTagText(t, s, 0.023)", which, as a JASS newbie, doesn't tell me anything ^^.

In either case, thanks. I will try to use this.

If anyone can give any guidance to what I outlined above, I would be very grateful.

+Rep to you, Komaqtion. Thanks again.

Yours,

Ouguiya
 

Ouguiya

New Member
Reaction score
11
Update:

I have made a GUI system, but are having a few problems and questions with and about it.

Here it is:

Trigger:
  • Blub
    • Events
    • Conditions
    • Actions
      • Floating Text - Create floating text that reads (+ + <bounty>) above (Dying unit) with Z offset 0.00, using font size 10.00, color (100.00%, 86.27%, 0.00%), and 0.00% transparency
      • Floating Text - Show (Last created floating text) for (All allies of (Owner of (Killing unit)))
      • Floating Text - Set the velocity of (Last created floating text) to 0.00 towards 0.04 degrees
      • Floating Text - Change (Last created floating text): Disable permanence
      • Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
      • Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
      • Special Effect - Create a special effect attached to the overhead of (Triggering unit) using UI\Feedback\GoldCredit\GoldCredit.mdl
      • Set Removable_Special_effect = (Last created special effect)
      • Wait 0.25 seconds
      • Special Effect - Destroy Removable_Special_effect


Now, first of all, it would be great if anyone could comment on the attributes I have set, and if they match the ones which Komaqtion gave.

Second, I know that the Special effect will create a leak, which I hope to squish. what bothers me is the wait action, which I would really love to avoid.

Thirdly, can anyone tell me if there will be other leaks (like location leaks from the position of the unit, even though I hope that the system is able to avoid the leak by itself, since I didn't enter any specific location.

Thanks in advance!

Yours,

Ouguiya
 

wellwish3r

wishes wells.
Reaction score
52
use the JASS snippet. as the GUI one is ugly, and not safe when many units die in a short time, it might fail.

to use the jass one, just make a trigger convert it to custom text, and copy the jass block into it. Then in your GUI function you make a custom script like this:

Trigger:
  • Set damage_string = (String((Point-value of (Triggering unit))))
    • Set unitloc = (Position of (Triggering unit))
    • Custom script: call CreateTextTagBounty(udg_damage_string,udg_unitloc)
    • Custom script: call RemoveLocation (udg_unitloc)


as for the jass snippet change it to this:

JASS:
function CreateTextTagBounty takes string s, location tloc returns nothing
    local texttag t = CreateTextTag()
    local location loc = tloc
    call SetTextTagText(t, s, 0.023)
    call SetTextTagPos(t, GetLocationX(loc), GetLocationY(loc), 0)
    call SetTextTagColor(t, 255, 220, 0, 255)
    call SetTextTagVelocity(t, 0, 0.036)
    call SetTextTagPermanent(t, false)
    call SetTextTagLifespan(t, 2.00)
    call SetTextTagFadepoint(t, 1.00)
    call RemoveLocation (loc)
    set loc = null
endfunction


it does not neeed to return anything
 

Ouguiya

New Member
Reaction score
11
Hi there!

Thanks for the reply!

This looks like a very short one. Will this create the same effect as the entire GUI function which I posted (which means, the gold-bounty special effect, the +xxx yellow text above the unit, the short-life of the whole etc. etc. etc.)

This also seems like a no-brainer, but I still would like to be sure:

So, I first create a trigger, with no content (say: Trigger blabla).

In this trigger blabla, I copy the text which you provided.

Then, in my "Unit dying trigger", let's say that this is the trigger which is launched when a unit dies, I use the 4 GUI-functions which you provided, and that does it.


Lastly, since I do not really want to use the point value of the unit (this is already used for something else), is it any problem if I use a mathematical function instead of "Point-value of triggering unit".



Thanks again, and so long (+rep to you).

Yours, Ouguiya



PS: Should I use "triggering" unit or "dying unit" or is there no difference at all?

Thanks

Ouguiya
 

wellwish3r

wishes wells.
Reaction score
52
DyingUnit/TriggeringUnit doesn't matter, i always go with Triggering Unit as it is more consistent, but who gives a crap, its both MUI^^.

It doesn't matter if u use a formula for the bounty, or point value, as long ass you pass a string to the function.

for the +XXX you would have to edit the Jass function slightly to
JASS:
function CreateTextTagBounty takes string s, location tloc returns nothing
    local texttag t = CreateTextTag()
    local location loc = tloc
    call SetTextTagText(t, "+"+s, 0.023)   
    call SetTextTagPos(t, GetLocationX(loc), GetLocationY(loc), 0)
    call SetTextTagColor(t, 255, 220, 0, 255)
    call SetTextTagVelocity(t, 0, 0.036)
    call SetTextTagPermanent(t, false)
    call SetTextTagLifespan(t, 2.00)
    call SetTextTagFadepoint(t, 1.00)
    call RemoveLocation (loc)
    set loc = null
endfunction


for a golden colour you can play around with the RGB values in this line:

JASS:
call SetTextTagColor(t, 255(Red), 220(Green), 0(Blue), 255(Transparency))
 

Ouguiya

New Member
Reaction score
11
Thank a lot!

I will try this as soon as I am able to (on Linux right now, so I can't edit maps at the moment).

I will follow all your instructions, you have definitely earned that +rep.

Thank you very much indeed.

See you later

Yours,

Ouguiya
 

Ouguiya

New Member
Reaction score
11
Hello again!

As was to be expected, I got into trouble. JASS really is not something I am good at.

Ok, I will first post everything I have done, and the error output. (oh yes, I want to mention: When it comes to JASS, i am a complete and utter newbie, I don't have the smightest idea about it :D)

ok, here goes: First, the GUI triggers look like this:

Trigger:
  • Set damage_string = (String(Money_Bounty))
    • Set unitloc = (Position of (Dying unit))
    • Custom script: call CreateTextTagBounty(udg_damage_string,udg_unitloc)
    • Custom script: call RemoveLocation (udg_unitloc)


Ok, then, the JASS trigger:

JASS:
function CreateTextTagBounty takes string s, location tloc returns nothing
    local texttag t = CreateTextTag()
    local location loc = tloc
    call SetTextTagText(t, "+"+s, 0.023)   
    call SetTextTagPos(t, GetLocationX(loc), GetLocationY(loc), 0)
    call SetTextTagColor(t, 255, 220, 0, 255)
    call SetTextTagVelocity(t, 0, 0.036)
    call SetTextTagPermanent(t, false)
    call SetTextTagLifespan(t, 2.00)
    call SetTextTagFadepoint(t, 1.00)
    call RemoveLocation (loc)
    set loc = null
endfunction

//===========================================================================
function InitTrig_CreateTextTagBounty takes nothing returns nothing
    set gg_trg_CreateTextTagBounty = CreateTrigger(  )
    call TriggerAddAction( gg_trg_CreateTextTagBounty, function Trig_CreateTextTagBounty_Actions )
endfunction


Saving this outputs me with two errors:

Both times, it's the error "expected a function name"

The lines shown are:

JASS:
->set udg_damage_string = I2S(udg_Money_Bounty)
        set udg_unitloc = GetUnitLoc(GetDyingUnit())
        call CreateTextTagBounty(udg_damage_string,udg_unitloc)
        call RemoveLocation (udg_unitloc)


and

JASS:
//===========================================================================
->function InitTrig_CreateTextTagBounty takes nothing returns nothing
    set gg_trg_CreateTextTagBounty = CreateTrigger(  )
    call TriggerAddAction( gg_trg_CreateTextTagBounty, function Trig_CreateTextTagBounty_Actions )
endfunction


The arrow in this case points to the line where the system sees the syntax error.

I hope that someone can help me here.

Yours,

Ouguiya
 

Komaqtion

You can change this now in User CP.
Reaction score
469
First, do you have JASS Newgen Pack ??? And are you saving the map when these errors occur ??

Secondly, this JASS script isn't supposed to be put into a trigger, but in the map header.
JASS:
function CreateTextTagBounty takes string s, location tloc returns nothing
    local texttag t = CreateTextTag()
    local location loc = tloc
    call SetTextTagText(t, "+"+s, 0.023)   
    call SetTextTagPos(t, GetLocationX(loc), GetLocationY(loc), 0)
    call SetTextTagColor(t, 255, 220, 0, 255)
    call SetTextTagVelocity(t, 0, 0.036)
    call SetTextTagPermanent(t, false)
    call SetTextTagLifespan(t, 2.00)
    call SetTextTagFadepoint(t, 1.00)
    call RemoveLocation (loc)
    set loc = null
endfunction


Only that, and the map header is where the map's name is in the trigger editor, just above the first trigger(category) :D

And maybe you could show us the whole trigger, instead of just those four actions... like maybe the conditions and event :D
 

Ouguiya

New Member
Reaction score
11
Hello!

Ok this provided some insight.

First, I don't use JASSNewGenPack, I use WE Unlimited (yes yes, I know, it's not good, but since I started the map with it already, it would be very hard to switch back, and since I know nothing of JASS, there was no real need to take JASSNewGenpack)

Secondly, this trigger doesn't have any conditions, and the event simply is "A unit dies", the "Money bounty"-variable first is calculated via a mathematical function (which I doubt is wrong), and the rest works fine, if I skip those custom scripts.

Third, I didn't know it was supposed to be inserted into the map header. wellwish3r told me to create a new trigger, convert it to custom text and insert this, so I did, which I probably misunderstood...

Hope this is of any help.

Yours,

Ouguiya
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Well, if you'd have JNGP then you could, instead of using the outdated WEU for GUI stuff, use EGUI which provides many new GUI actions, which also are up-to-date :D

But, back to topic... Ok, well then it's enough to just provide the actions, but if you do what i suggested, then it should be fine, i believe :D
 

Ouguiya

New Member
Reaction score
11
Hello there!

Well I will have a look at EGUI, but can this also take a map which was made in WEU and open it? (JassNewGenPack fails to open a map which has been made in WEU)

Ok, I have two little questions left:

I tried to do what you said (put it into the header), and this worked beautifully. Now there are just two things I would like to change, but don't really know how:

First, the amount of bounty should normally only be visible to the player doing the killing, right now, everyone can see it. In a map where hundreds of units can die within minutes, this is quite frustrating. Is there anyway I can tell the system to ONLY show this floating text to the player who actually killed the unit?

Second: When a unit dies, a special effect is played, which looks like gold coins flying in the air. They quickly vanish, but still provide that extra little animation.

I know the path of this special effect, but wouldn't know how to insert it into the system.

If anyone can be of any guidance, I would be very grateful.

Thanks alot and see you!

Yours,

Ouguiya
 

wellwish3r

wishes wells.
Reaction score
52
firstly, it does not matter weather you put that script into the header or not (not in JNGP maybe WEU has some trouble with that). Anyways...

for showing the floating text only to the killer, you would have to use GetLocalPlayer, and alter the jass function a bit, and for the special effect you just have to add three lines :
JASS:
function CreateTextTagBounty takes string s, location tloc,player p returns nothing
    local texttag t = CreateTextTag()
    local location loc = tloc
    local effect sfx
    set sfx =  AddSpecialEffect("UI\\Feedback\\GoldCredit\\GoldCredit.mdl",GetLocationX(loc), GetLocationY(loc))
    call SetTextTagText(t, "+"+s, 0.023)   
    call SetTextTagPos(t, GetLocationX(loc), GetLocationY(loc), 0)
    call SetTextTagColor(t, 255, 220, 0, 255)
    call SetTextTagVelocity(t, 0, 0.036)
    call SetTextTagPermanent(t, false)
    call SetTextTagLifespan(t, 2.00)
    call SetTextTagFadepoint(t, 1.00)
    if GetLocalPlayer() == p then
        call SetTextTagVisibility(t,true)
    else
        call SetTextTagVisibility(t,false)
    endif
    call RemoveLocation (loc)
    set loc = null
    call DestroyEffect(sfx)
    set sfx = null
endfunction


now there is a new argument to the function, all you have to do is instead of just calling:
JASS:
call CreateTextTagBounty(udg_damage_string,udg_unitloc)


you have to pass 3 arguments:

Trigger:
  • Set KillingPlayer = OwningPlayer(KillingUnit)
    • Custom Script: call CreateTextTagBounty(udg_damage_string,udg_unitloc,udg_KillingPlayer)
 

Ouguiya

New Member
Reaction score
11
Hi there again, Wellwish3r!

I managed to get it to work, and it works nicely. The +xxx shows only for the one player who did the killing.

There is one exception though, and that is the special effect: It still doesn't appear.

I suspect that this is because it gets removed as soon as it is created, but I am unsure.

Hope you can be of any more guidance here.

yours,

Ouguiya
 

wellwish3r

wishes wells.
Reaction score
52
just add a wait before the destruction of the effect like this:

JASS:
function CreateTextTagBounty takes string s, location tloc,player p returns nothing
    local texttag t = CreateTextTag()
    local location loc = tloc
    local effect sfx
    set sfx =  AddSpecialEffect("UI\\Feedback\\GoldCredit\\GoldCredit.mdl",GetLocationX(loc), GetLocationY(loc))
    call SetTextTagText(t, "+"+s, 0.023)   
    call SetTextTagPos(t, GetLocationX(loc), GetLocationY(loc), 0)
    call SetTextTagColor(t, 255, 220, 0, 255)
    call SetTextTagVelocity(t, 0, 0.036)
    call SetTextTagPermanent(t, false)
    call SetTextTagLifespan(t, 2.00)
    call SetTextTagFadepoint(t, 1.00)
    if GetLocalPlayer() == p then
        call SetTextTagVisibility(t,true)
    else
        call SetTextTagVisibility(t,false)
    endif
    call RemoveLocation (loc)
    set loc = null
    call TriggerSleepAction(1)
    call DestroyEffect(sfx)
    set sfx = null
endfunction
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      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