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

Tax equal to number of buildings

Status
Not open for further replies.
Level 12
Joined
Jun 1, 2010
Messages
748
I made a tax system but I want the tax to be equal to number of buildings. Without these buildings there is only 100 tax income, when there are 2 buildings 200 income, when 3 buildings, 300 income... I suppose that thing is made in conditions.
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
I assume you're looping through a unit group and are then using a condition which checks wether the units looped through are buildings?
Which then enables you to set the tax accordingly?

If you somehow can't seem to do it, post the trigger here so that we can have a look and correct the problem for you.
 
Last edited:
Level 9
Joined
Nov 19, 2011
Messages
516
Thats for 1 player. If you got more players use tables and conversion (Player index to Player)

  • Check
    • Events
      • ??
    • Conditions
      • None
    • Actions
      • Set Count = 0;
      • Unit Group - Pick evry unit in area (Playable map area) that belongs to player (Player X) and do
        • Actions
          • Set Count = Count + 1
        • Set Tax = Count * 100
 
Level 4
Joined
Aug 5, 2011
Messages
99
  • tax
    • Events
      • Unit - A unit Finishes construction
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is A structure) Equal to True
    • Actions
      • Set numberOfBuildings[(Player number of (Triggering player))] = ((Number of units in (Units owned by (Triggering player) matching ((((Matching unit) is A structure) Equal to True) and (((Matching unit) is alive) Equal to True)))) x 100)
  • add tax
    • Events
      • Time - Every 10.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • If (numberOfBuildings[(Integer A)] Equal to 0) then do (Set numberOfBuildings[(Integer A)] = 100) else do (Do nothing)
          • Player - Add numberOfBuildings[(Integer A)] to (Player((Integer A))) Current gold
          • Game - Display to (Player group((Player((Integer A))))) the text: (Your income: |cff00ff00 + (String(numberOfBuildings[(Integer A)])))
 

Attachments

  • test.w3x
    13.8 KB · Views: 47
Level 4
Joined
Aug 5, 2011
Messages
99
  • add tax
    • Events
      • Time - Every 10.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • If (numberOfBuildings[(Integer A)] Equal to 0) then do (Set numberOfBuildings[(Integer A)] = 100) else do (Do nothing)
          • Set tempPlayer = (Player((Integer A)))
          • Player - Add numberOfBuildings[(Integer A)] to tempPlayer Current gold
          • Set tempPlayerGroup = (Player group(tempPlayer))
          • Game - Display to tempPlayerGroup the text: (Your income: |cff00ff00 + (String(numberOfBuildings[(Integer A)])))
  • tax
    • Events
      • Unit - A unit Finishes construction
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is A structure) Equal to True
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Set numberOfBuildings[(Player number of (Triggering player))] = ((Number of units in (Units owned by (Triggering player) matching ((((Matching unit) is A structure) Equal to True) and (((Matching unit) is alive) Equal to True)))) x 100)
so that should be like this?
 
Level 12
Joined
Jun 1, 2010
Messages
748
  • tax
    • Events
      • Unit - A unit Finishes construction
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is A structure) Equal to True
    • Actions
      • Set numberOfBuildings[(Player number of (Triggering player))] = ((Number of units in (Units owned by (Triggering player) matching ((((Matching unit) is A structure) Equal to True) and (((Matching unit) is alive) Equal to True)))) x 100)
  • add tax
    • Events
      • Time - Every 10.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • If (numberOfBuildings[(Integer A)] Equal to 0) then do (Set numberOfBuildings[(Integer A)] = 100) else do (Do nothing)
          • Player - Add numberOfBuildings[(Integer A)] to (Player((Integer A))) Current gold
          • Game - Display to (Player group((Player((Integer A))))) the text: (Your income: |cff00ff00 + (String(numberOfBuildings[(Integer A)])))

I think you just added 100 tax more.
 
Level 4
Joined
Aug 5, 2011
Messages
99
are u using another trigger for the tax system? there shouldnt be need, besides the 2 i posted... if u do, post them and ile have a look
 
Status
Not open for further replies.
Top