HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Applying Upkeep to a Bounty or Reducing Bounty

06-23-2004, 09:31 PM#1
QuakeII_best
Here is what I want to do... I'm doing a Footman War map, for the most part I have no problems, but I had this idea...

I want that once you reach certain number of kills (say 200 kills), the gold you receive from bounties is reduced. But it should only effect the player that got the kills above 200 .

Can I use this action to reduce the amount of gold received from bounty?

Player - Divert (15])% of the Gold income of Player 1 (Red) to Neutral Extra


Is there a way to reduce the amount shown in the screen (yellow numbers upon death)? will this trigger modify the bounty shown in the screen?
06-23-2004, 10:54 PM#2
orcmasta
Did you do the Bounty's through triggers or object editor.
06-23-2004, 11:56 PM#3
QuakeII_best
Quote:
Originally Posted by orcmasta
Did you do the Bounty's through triggers or object editor.

I did the bounty through the object editor. I could do it through triggers but I thought it would generate more CPU constrain.
06-24-2004, 12:04 AM#4
th15
Well if you want to tax it you're gonig to have to do the whole thing in triggers. It won't use THAT much processing power.
06-24-2004, 12:30 AM#5
QuakeII_best
Quote:
Originally Posted by th15
Well if you want to tax it you're gonig to have to do the whole thing in triggers. It won't use THAT much processing power.

The way I wanted to do it didn't work :(

But I think I found an easier way... This is what I'm thinking:
Code:
    Events
        Unit - A unit Dies
    Conditions
        UpkeepKills[1] Not equal to 0  [b] I could probably remove this[/b]
    Actions
        Player - Add UpkeepKills[1] to Player 1 (Red) Current gold

The #1 will is the player #. UpkeepKills[#] is an integer array with the "gold penalty" per kill, it will be a negative number (assume -10 gold/kill).


Question: Player 1 must be replaced by "player that killed the unit". How can I do this?

EDIT: I just tested the trigger above and it works really well... all I need is to change "Player 1 (red)" to "Player that killed the triggering unit". How do I do this?
06-24-2004, 01:17 PM#6
th15
This about this way is that the gold bounty number still pops up, kinda weird if you get a "+10" but only get 5 gold.

But if you still wanna do it this way, use this instead of your action:

Pick every player matching (matching player = owner of killing unit) and do:
Add UpkeepKills[1] to Picked Player current gold.
06-24-2004, 02:03 PM#7
QuakeII_best
Quote:
Originally Posted by th15
This about this way is that the gold bounty number still pops up, kinda weird if you get a "+10" but only get 5 gold.


How can I make bounty through triggers so that the coins letter pop up during a kill?
06-24-2004, 11:03 PM#8
th15
Use WEU (look for the thread in the tools forum). It has an action specifically for simulating gold text, without all this mucking around with variables.
06-24-2004, 11:15 PM#9
Vexorian
It has?, cause I bet I made it:

Code:
function Bounty_child takes nothing returns nothing
local texttag t= bj_lastCreatedTextTag
local effect goldcoins=bj_lastCreatedEffect
local integer alpha=255
    call DestroyTrigger( GetTriggeringTrigger() )
    call TriggerSleepAction(2.00)
    loop
       set alpha=alpha - 64
       exitwhen alpha <= 0
       call SetTextTagColor(t,255,220,0,alpha)
       call TriggerSleepAction(0.01)
    endloop
call DestroyTextTag(t)
call DestroyEffect(goldcoins)
endfunction

function Bounty takes player whichplayer, integer bounty, real x, real y returns nothing
local texttag t=CreateTextTag()
local trigger child=CreateTrigger()
    set bj_lastCreatedEffect=AddSpecialEffect("UI\\Feedback\\GoldCredit\\GoldCredit.mdl",x,y)
    call SetTextTagVisibility(t,(GetLocalPlayer() == whichplayer))
    call AdjustPlayerStateBJ( bounty, whichplayer, PLAYER_STATE_RESOURCE_GOLD )
    call SetTextTagText(t,"+"+I2S(bounty),0.025)
    call SetTextTagPos(t,x,y, 0.00)
    call SetTextTagColor(t,255,220,0,255)
    call SetTextTagVelocity(t,0,0.02)
    call TriggerAddAction( child, function Bounty_child )
    set bj_lastCreatedTextTag=t
    call TriggerExecute( child )
endfunction

It surely leaks a trigger action but that's a mistake from blizzard
06-25-2004, 03:19 PM#10
th15
You're probably just confusing the poor guy Vex. I like using WEU's built in floating text actions, saves me a lot of mucking about with variables.
06-26-2004, 01:19 AM#11
QuakeII_best
Quote:
Originally Posted by th15
You're probably just confusing the poor guy Vex. I like using WEU's built in floating text actions, saves me a lot of mucking about with variables.


Yea, take pitty of my poor little brain. I'm "familiar" with programming but that's as far as I go... I can understand code if someone explains it to me first. I have a fair grasp of Visual Basic C++ but that all I know. For example I know the bottom part of that code tells the game how to make the text... I have no clue what the top part does (does it call the bounty function upon units' death?).

I'll check the Tools forum to see what I can find

EDIT: I'm using WEU and I'm switching all my bounties to triggers, it seems like it will work quite well... thanks for the help.
06-26-2004, 05:37 PM#12
QuakeII_best
Thanks for all the help... I used the WEU utility and switched all the bounties to triggers.

Everything worked ok until I saw something that surprised me... The bounty letters show up for everyone in the screen... and not only the person that got the kill.

I receive the amount of money I'm suppose to receive. Is there a way to:
a) Avoid the text from popping up to non-killing players
or
b) Remove the text immediately after it pop ups for non-kiling players.

This the the WEU code I'm using:
Code:
Gold Reward and Bounty
    Events
        Unit - A unit Dies
    Conditions
        (Owner of (Killing unit)) Not equal to (Owner of (Triggering unit))

        ((Owner of (Killing unit)) is an ally of (Owner of (Triggering unit))) Equal to False
False
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Or - Any (Conditions) are true
                    Conditions
                        (Unit-type of (Dying unit)) Equal to Water Elemental (Level 1)
                        (Unit-type of (Dying unit)) Equal to Spirit Wolf (Level 1)
            Then - Actions
                Player - Add ((10 x (100 - Upkeep))/100) to (Owner of (Killing unit)) Current gold
                Advanced - Simulate receipt of ((10 x (100 - Upkeep))/100)  gold at point ((X of (Triggering unit)),(Y of (Triggering unit)))
            Else - Actions
06-26-2004, 09:58 PM#13
Vexorian
lol, pitzermike didn't use my function? this is actually going to be difficult to fix in WeU, try using my function, it only shows the text to the player that gets the money
02-13-2005, 10:01 PM#14
QuakeII_best
This is an old old post... anyways... I have learnt a bit since then and now I know what a memory leak is...

Do I have to fix the memory leaks for the bounty? It is just that the trigger is quite long and I really don't know how to manipulate the custom script that Lord Vexorian wrote for me (where do I put the variable with the amount of gold?=


I'm using this as the actions (coupled with some conditions so the text shows to the non-allies only)

Code:
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    If - Conditions
        Or - Any (Conditions) are true
            Conditions
                (Unit-type of (Dying unit)) Equal to Barracks (Mad)
    Then - Actions
        Player - Add ((350 x (100 - (Upkeep_ByKills[(Player number of (Owner of (Killing unit)))] + Upkeep_Leader[(Player number of (Owner of (Killing unit)))]))) / 100) to (Owner of (Killing unit)) Current gold
        Advanced - Simulate receipt of ((350 x (100 - (Upkeep_ByKills[(Player number of (Owner of (Killing unit)))] + Upkeep_Leader[(Player number of (Owner of (Killing unit)))]))) / 100) gold at point ((X of (Triggering unit)),(Y of (Triggering unit)))
    Else - Actions