Demo Map GetBounty

BloodyMary

New Member
Reaction score
0
Jesus4Lyf said:
Actually, no. The only use of this is to modify the given bounty by disabling the bounty and using this to assign it - there's probably no other way to get the yellow +gold text to display correctly.

not exactly sure what you trying to say here but you can make you own gold text...
 

Sevion

The DIY Ninja
Reaction score
413
What yellow gold text? That's easy >_> I've done it in EGUI. All of the text tag settings are in UI files ;) A bit of digging and I found the exact settings Bliz uses.
 

Jesus4Lyf

Good Idea™
Reaction score
397
not exactly sure what you trying to say here but you can make you own gold text...
Precisely what I'm getting at.

If a unit died giving 10 bounty and you wanted a 20% increase, you'd need to add 2 gold. But the death bounty message would still display 10 in Warcraft3. So the point of this snippet would be that you could disable the bounty, have a trigger saying on death call GetBounty, multiply it by 1.2, add the gold and display the yellow +gold message yourself. Then it would all appear correctly. :)
 

BloodyMary

New Member
Reaction score
0
@jesus4lyf
yep but like i said in a earlier post people might have there map with loads of units and rather not trigger all the bounty bases.

@sevion
thats the way to do it.

@Hellohihi
yes but vamp fire I'm sure uses total bounty from each player taken Blue fed X gold teal fed X gold etc not last bounty. though you could use this to tally it up.
 

Jesus4Lyf

Good Idea™
Reaction score
397
>I dunno.. I was using a texttag of the extra percent added so people would see 2 o-o.
For my example, I'd like to see "+10+2" as a player. Not "++120" or some jumble of whatever vaguely displays on screen (from overlapping the texttags). :p
@jesus4lyf
yep but like i said in a earlier post people might have there map with loads of units and rather not trigger all the bounty bases.
... That's exactly my point. You don't need to change a thing this way. Still all object data. I'm saying DISABLE "gives bounty" and do it manually yourself so everything displays neatly.
 

BloodyMary

New Member
Reaction score
0
>I dunno.. I was using a texttag of the extra percent added so people would see 2 o-o.
For my example, I'd like to see "+10+2" as a player. Not "++120" or some jumble of whatever vaguely displays on screen (from overlapping the texttags). :p
agreed. or at least +10
..........................+2

>... That's exactly my point. You don't need to change a thing this way. Still all object data. I'm saying DISABLE "gives bounty" and do it manually yourself so everything displays neatly.

ok, so let me clarify if I'm understanding you, turn off bounty, a player kills a unit, the dummy unit kills the other dummy unit to check the gold then that gold is then given to the player who killed the unit while it manually shows the gold. thus making it more accurate?
 

Jesus4Lyf

Good Idea™
Reaction score
397
ok, so let me clarify if I'm understanding you, turn off bounty, a player kills a unit, the dummy unit kills the other dummy unit to check the gold then that gold is then given to the player who killed the unit while it manually shows the gold. [DEL]thus making it more accurate?[/DEL]
No, thus allowing the map writer to multiply the gold by a factor first, or manipulate it however they like. The sole use for any of these GetBounty snippets as far as I am aware.

>gsnc getbounty

Yeah I butcher the name too. I don't think it's even an acronym.

And I expect them both to be graveyarded unless people start saying they might be useful and how. I may approve this because you documented the cons, letting us work on it to remove them. You need to update your documentation a lot. There should be no discussion of accuracy anywhere. Either get the bounty given BY the death of the last unit, or get the bounty a unit type gives (including full random factors). This should do one or the other, or both as two separate functions (unless I hear some reasons otherwise).
 

Hellohihi

New Member
Reaction score
42
@Hellohihi
yes but vamp fire I'm sure uses total bounty from each player taken Blue fed X gold teal fed X gold etc not last bounty. though you could use this to tally it up.

Um, no.

They uses point-value that are set to every unit in the object editor.
 

SerraAvenger

Cuz I can
Reaction score
234
I'm still for just attaching the bounty to the rawid >_>

If you trigger the bounty then, you can even change it ingame : )
 

Sevion

The DIY Ninja
Reaction score
413
All I can really see any bounty systems usefull for is for balancing. But then again, that's a huge important part, isn't it ;)
 

Nestharus

o-o
Reaction score
84
The debate here is the usefulness of getting a bounty via the raw id.

If you need to get the bounty of a unit, then that unit most probably died, and so Jesus4Lyf argues that it is better to get the bounty of a unit via damaged units and killed units with recorded costs of the source. He says the extraneous text tags are bad.

The next argument was this-
The text tags still show when using that method

So now the new argument is this-
Manipulating bounty before it is added to the player

Well, this design can be used for that, but the design proposed by Jesus4Lyf cannot.

So now the final argument is-
How can this be useful?

Well, this idea, manipulating bounty before it is added to the player, was already presented as a viable option by the person who presented the argument in the first place, so that argument is void =). But how can that feature be useful in a game? Multiple people have already stated how that feature can be useful in a game, including the one who presented the argument =).

Also
>gsnc getbounty

Yeah I butcher the name too. I don't think it's even an acronym.

Actually, it is an acronym-
G- Get
C- Costs
S- States
N- Nestharus

or

Get Costs and States by Nestharus

Next-
Just saying: Nestharus has been stealing my ideas from this topic and using it in gsnc getbounty.. >_>

I'm not even going to go in that. Yes, of course I've been using ideas from this thread. Who wouldn't? I'm a programmer. Am I going to stop? Of course not, your system is pretty much the exact same as a feature in mine, lol. I didn't know this was a competition and I've been saying things like good job and defending you =). Also, let it be stated that no code was copied or looked at and that the only thing that was taken as an idea from this thread was the Gold Coin animation.

I build things for the community, not for my own pride and glory. If people don't care about getting the costs of items and units and what have you without getting memory leaks, then let them graveyard mine, it's their decision, not mine.

Next-
All I can really see any bounty systems usefull for is for balancing. But then again, that's a huge important part, isn't it

I believe this was already stated somewhere in the thread Sevion ^_^.

Also, this system, GetBounty, can be improved further-
1. Don't create the dummy attacker every time it runs, just have a constant one... it'll be faster

2. Make the dummy attacker target acquisition 0, or it could mess up

3. Make the bounty loop a parameter in the function. This will mean people can either get an averaged result or an on the whim result.

4. The first time people use get average result, you need to cache that result and use that result instead of calling the function every time there after -.-.

That's about all I can see right now =).
 

SerraAvenger

Cuz I can
Reaction score
234
2. Make the dummy attacker target acquisition 0, or it could mess up

Will also set attack range to 0 unless you do that with triggers.
 

Nestharus

o-o
Reaction score
84
2. Make the dummy attacker target acquisition 0, or it could mess up

Will also set attack range to 0 unless you do that with triggers.

It's done using a the Damage function, so the range should be 0 =).
 

Hellohihi

New Member
Reaction score
42
@Nestharus,

Everybody's codes here are sort of like open source.

So actually, it was wrong of me to be unhappy when you took my idea.

Also, i never thought of it as a competition with you.
 

Jesus4Lyf

Good Idea™
Reaction score
397
Everybody's codes here are sort of like open source.
Very much so (open source).

But our respectful convention is to give thankyou notes to people who deserve them. It encourages contribution.
Just quietly:
>Actually, it is an acronym-
>...
>N- Nestharus
>...
>I build things for the community, not for my own pride and glory.
I don't think anyone has ever put their name in the acronym of their system before, so hm not too sure.
Except Romek in IRIS. But that's unreleased. xD
 

Larcenist

REP: Respect, Envy, Prosperity?
Reaction score
211
I don't think anyone has ever put their name in the acronym of their system before, so hm not too sure.
Except Romek in IRIS. But that's unreleased. xD

Nonsense :D I totally needed an L from somewhere :(

And I'd probably go with a triggered bounty system if I'd ever need to return the bounty value (which I probably never will), but that's only my opinion.
 

Jesus4Lyf

Good Idea™
Reaction score
397
You could have a global OnDamage trigger which saves the damage source's gold before the damage is dealt, and a trigger for on death which compares it against the player's new gold value...

Way better. And accurate.
And I'd probably go with a triggered bounty system if I'd ever need to return the bounty value (which I probably never will), but that's only my opinion.
ARGHHH!!!!

This madness is driving me to jump...

Into doing it myself!
JASS:
library DyingBounty initializer OnInit uses Damage
    globals
        private integer array LastGold
        private player TempPlayer
    endglobals
    private function OnDamage takes nothing returns boolean
        set TempPlayer=GetOwningPlayer(GetEventDamageSource())
        set LastGold[GetPlayerId(TempPlayer)]=GetPlayerState(TempPlayer,PLAYER_STATE_RESOURCE_GOLD)
        return false
    endfunction
    private function OnInit takes nothing returns nothing
        local trigger t=CreateTrigger()
        call TriggerAddCondition(t,Filter(function OnDamage))
        call Damage_RegisterEvent(t)
    endfunction
    function GetDyingBounty takes nothing returns integer
        set TempPlayer=GetOwningPlayer(GetKillingUnit())
        return GetPlayerState(TempPlayer,PLAYER_STATE_RESOURCE_GOLD)-LastGold[GetPlayerId(TempPlayer)]
    endfunction
endlibrary

Example use:
Trigger:
  • Untitled Trigger 002
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Custom script: call BJDebugMsg("Bounty on death: "+I2S(GetDyingBounty()))

20 lines of code. HAPPY REDUNDANCY DAY!

QUICK, STEAL IT FOR YOUR OWN GLORY!
OR I'LL GRAVEYARD THIS.

In all seriousness though, consider putting this up as well as your snippet. So users can use whichever is appropriate for themselves.

Oh, requires Damage.

Alternative worse, original code:
JASS:
library DyingBounty initializer OnInit uses Damage, AIDS
    private struct GoldStore extends array
        integer gold
        
        static method init takes nothing returns nothing
            local trigger t=CreateTrigger()
            call TriggerAddCondition(t,Filter(function thistype.onDamage))
            call Damage_RegisterEvent(t)
            set t=null // Personal habit. Aaand a good one.
        endmethod
        //! runtextmacro AIDS()
        private static method onDamage takes nothing returns boolean
            set GoldStore[GetTriggerUnit()].gold=GetPlayerState(GetOwningPlayer(GetEventDamageSource()),PLAYER_STATE_RESOURCE_GOLD)
            return false
        endmethod
    endstruct
    private function OnInit takes nothing returns nothing
        // Because those init functions on structs fire way too early.
        call GoldStore.init()
    endfunction
    
    globals
        private unit TempUnit
    endglobals
    function GetDyingBounty takes nothing returns integer
        set TempUnit=GetKillingUnit()
        
        if TempUnit==null then
            // Killed with triggers or whatever.
            return 0
        endif
        
        return GetPlayerState(GetOwningPlayer(TempUnit),PLAYER_STATE_RESOURCE_GOLD)-GoldStore[GetDyingUnit()].gold
    endfunction
endlibrary
 

Larcenist

REP: Respect, Envy, Prosperity?
Reaction score
211
What I meant was: Why go with a single GetbountyWhatever system/snippet/fooshizzle, when you can trigger your own, or use someone else's already made system which would handle anything ever related to giving something to a player, be that hero exp, bounty, lumber, or something else.

For this particular reason (talking about this snippet now, not the forementioned) there would be no reason at all to trigger the whole bounty-thingie.

Tl;dr: I myself will not find this useful for I will never be limited to only needing to get the bounty. And if I actually needed it, I'd fuse it with some other library for player resources that I'd write myself. Hence I do not find this useful for me, but someone else might.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      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