• 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.

Death Tax Trigger

Status
Not open for further replies.
Level 2
Joined
Sep 2, 2008
Messages
19
Ok, I need help for a really weird trigger. Here it is:

When a Hero dies, I want to

1. Announce that that player/hero is dead
2. Calculate a death tax which is the level of the hero x 10/ number of players
3. Announce that every player must pay the death tax to revive the hero

I know how to do all that. BUT: How do I keep track of who has paid and who hasn't? I have absolutely no clue. I tried making a multiboard and failed miserably. :sad: Please help me!
 
Level 28
Joined
Jun 4, 2007
Messages
1,480
To keep track of who payed.
Make a variable named Tax_Payed or something. Check the array box when you create the vaiable. Set the variable type to boolean.

Then when someone payed you make this action:
Set variable - Set Tax_Payed (player number of (paying player, I don't know your event so I don't know that one either) = True

The red part will appear after you selected the Tax_Payed variable in the list.
Blue means you can change it.
Red means you must change it.
 
Level 8
Joined
May 27, 2007
Messages
170
Use two Integer variables to keep track of how many players have payed the tax and how many need to pay it in total. Something like this, using whatever events you need:

  • Death Tax
    • Events
    • Conditions
      • PayedTax[(Player number of (Triggering player))] Equal to False
    • Actions
      • Set PayedTax[(Player number of (Triggering player))] = True
      • Set TaxesPayed = (TaxesPayed + 1)
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Player((Integer A))) slot status) Equal to Is playing
            • Then - Actions
              • Set TaxesRequired = (TaxesRequired + 1)
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TaxesPayed Equal to TaxesRequired
        • Then - Actions
          • Hero - Instantly revive (Last created unit) at (Center of (Playable map area)), Hide revival graphics
          • Set TaxesRequired = 0
          • Set TaxesPayed = 0
          • For each (Integer A) from 1 to 12, do (Actions)
            • Loop - Actions
              • Set PayedTax[(Player number of (Player((Integer A))))] = False
        • Else - Actions
PayedTax is a Boolean Array and ensures each player can only pay the tax once

TaxesPayed is an Integer variable used to count how many players have oayed the tax so far

TaxesRequired is another Integer variable set to the number of players who are active in the game

So in short, whenever someone pays their tax, this trigger sets their bollean to true to ensure they only pay once, adds 1 to the total number of taxes that have been paid so far, and then checks to see if everyone has paid. If everyone has paid the hero is revived and the values are all reset ready for the next Death Tax
 
Status
Not open for further replies.
Top