• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Fake bounty system?

Status
Not open for further replies.
Level 13
Joined
Oct 16, 2010
Messages
737
Hi,

I've been making a map for a while and have recently decided that bounty from creeps and things needs to start increasing later on in the game as it ends up being impossible to get any money without killing enemy Heroes.

However, I have no idea how to make a fake bounty system! I have a few ideas but no real idea of how to make this work. The bounty given would have to depend on the units level and the level of 2 different upgrades (attack and armor). These upgrades cost 1000 each and go up to 50 each. However the upgrades are only given to set computer players so I'm guessing it'd have to detect the dying units' computer ally to get the upgrade levels? I'm honestly not sure!!!

So if anyone can help me that'd be great!!

- Must work on all units except Heroes.
- Bounty dependant on Heroes.
- Bounty dependant on specific upgrade.
 
Level 10
Joined
Apr 18, 2009
Messages
601
Please expand on:
the upgrades are only given to set computer players
What is a set computer player? Just a normal computer controlled player? How would this be any different from checking the level of the upgrade of a regular player?

I'm guessing it'd have to detect the dying units' computer ally to get the upgrade levels
I don't understand this, how would that help you?

There is this integer comparison that might be interesting:
  • (Current research level of Bounty Upgrade for Player X) Equal to Number
Another approach would be to use this event:
  • Unit - A unit Finishes an upgrade
I would probably use the last event with a condition checking for the right kind of upgrade, incrementing a variable every time as the action. That variable could then be meaningful in the gold calculation part.
 
Level 17
Joined
Mar 21, 2011
Messages
1,611
al Licheus said:
use that "Unit - A unit Finishes an upgrade" as an Event of a trigger
as the Action, just do an Integer Variable and increase it by 1
Set Var_Integer = (Var_Integer + 1)
Now create another trigger.
Events:
-Unit dies
Conditions:
-Hero equal to false
Actions:
Set Owner of killing units current gold to current gold + (( 5 x level of dying unit ) x Var_Integer)

or something like that, you can change the nubers however you want
 
Level 13
Joined
Oct 16, 2010
Messages
737
Okay so the set up for the map is that it's a 4 vs 4. Where each player picks a hero and so on. And they have a computer player that attacks the enemy base with simple creeps.

I guess I could do the integer thing to work out what level they are on but what I was worried about was getting the corresponding players across. So if say Player 1 has a summoned unit that is killed then it's bounty will depend its level and the upgrades of the computer player, Player 11.

Most of this I should be able to do but I was wondering how to add in the text to make it look and feel like it is real bounty. So numbers appearing and things. I know about floating text but I've never really understood it.

Hope this helps.
 
Level 10
Joined
Apr 18, 2009
Messages
601
Okay, thanks for the explanation.

Let's say that Player 11 is your computer controlled player. Then what you do in the trigger with the event "A unit dies" is eather use a condition that makes sure that the triggering (dying) unit is owned by Player 11, or you use a different event saying "A unit owned by Player 11 dies". That trigger will then only run when a unit owned by player 11 dies. Something like this:

  • Player 11 Bounty
    • Events
      • Unit - A unit owned by Player 11 (Dark Green) Dies
    • Conditions
    • Actions
      • Player - Add ((Creeps_AttackUpgadeLevel x 10) + ((Creeps_AttackUpgadeLevel x 10) + ((Creeps_DefenceUpgadeLevel x 10) + ((Level of (Triggering unit)) x 50)))) to (Owner of (Killing unit)) Current gold
      • -------- Add code for floating text at the point of triggering unit here --------

If you want to make the floating text look as good as the standard yellow "bounty for creeps" floating text that blizzard uses, you'll have to learn how to create the text, set velocity and fade out with those corresponding floating text actions in the trigger editor. However if you're new to triggering you're in for some research because it's not that intuitive. Can be done with a bit of work though.
 
Level 13
Joined
Oct 16, 2010
Messages
737
I've been doing this for a while so I know quite a bit about triggering. I've just never used any floating text before!!!

I'll try it anyway.

Also the upgrades are done as items. So that the computer will buy it when they have the money and players can also buy the upgrades for their computer if they wanted too.

I've now finished the trigger (I think) so thanks for the help! :D

  • Unit is killed
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Owner of (Dying unit)) Not equal to Player 10 (Light Blue)
      • ((Dying unit) is A structure) Not equal to True
      • ((Dying unit) is Mechanical) Not equal to True
      • ((Dying unit) is A Hero) Not equal to True
    • Actions
      • Set BountyKilledUnit = (Dying unit)
      • Set BountyKilledPlayer = (Owner of BountyKilledUnit)
      • Set BountyKilledPoint = (Position of BountyKilledUnit)
      • Set BountyKilledLevel = (Level of BountyKilledUnit)
      • Set BountyKillingUnit = (Killing unit)
      • Set BountyKillingPlayer = (Owner of BountyKillingUnit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • BountyKilledPlayer Equal to Player 11 (Dark Green)
              • BountyKilledPlayer Equal to Player 12 (Brown)
        • Then - Actions
          • Set BountyCompPlayer = BountyKilledPlayer
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • BountyKilledPlayer Equal to Player 1 (Red)
                  • BountyKilledPlayer Equal to Player 2 (Blue)
                  • BountyKilledPlayer Equal to Player 3 (Teal)
                  • BountyKilledPlayer Equal to Player 4 (Purple)
            • Then - Actions
              • Set BountyCompPlayer = Player 11 (Dark Green)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Or - Any (Conditions) are true
                    • Conditions
                      • BountyKilledPlayer Equal to Player 5 (Yellow)
                      • BountyKilledPlayer Equal to Player 6 (Orange)
                      • BountyKilledPlayer Equal to Player 7 (Green)
                      • BountyKilledPlayer Equal to Player 8 (Pink)
                • Then - Actions
                  • Set BountyCompPlayer = Player 12 (Brown)
                • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (BountyKilledPlayer is an enemy of BountyKillingPlayer) Equal to True
          • BountyKilledPlayer Not equal to BountyKillingPlayer
        • Then - Actions
          • Set BountyUpgradeLevel = ((Current research level of Coral Blades for BountyCompPlayer) + (Current research level of Coral Scales for BountyCompPlayer))
          • Set BountyMin = ((Integer((4.00 x (1.00 + (0.25 x (Real(BountyUpgradeLevel))))))) x BountyKilledLevel)
          • Set BountyMax = ((Integer((8.00 x (1.00 + (0.25 x (Real(BountyUpgradeLevel))))))) x BountyKilledLevel)
          • Set BountyGiven = (Random integer number between BountyMin and BountyMax)
          • Player - Add BountyGiven to BountyKillingPlayer Current gold
          • Floating Text - Create floating text that reads (+ + (String(BountyGiven))) at BountyKilledPoint with Z offset 4.00, using font size 10.00, color (100.00%, 100.00%, 0.00%), and 0.00% transparency
          • Floating Text - Change (Last created floating text): Disable permanence
          • Floating Text - Change the lifespan of (Last created floating text) to 3.00 seconds
          • Floating Text - Change the fading age of (Last created floating text) to 2.00 seconds
          • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
          • Floating Text - Hide (Last created floating text) for (All players)
          • Floating Text - Show (Last created floating text) for (Player group(BountyKillingPlayer))
        • Else - Actions
 
Last edited by a moderator:
Destroy the Leaks like this :
JASS:
call RemoveLocation(udg_YourVar)//Location, replace YourVar with the Variable
call DestroyForce(udg_YourVar)//Player Groups, don't destroy All Players
Put these in the end of the trigger using custom scripts (or when you are going to change a variable's reference)
 
Status
Not open for further replies.
Top