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

Taxing System Help

Status
Not open for further replies.
Level 2
Joined
Jun 14, 2005
Messages
11
I was just wondering how a taxing system would work like in Village Builder.
I wanna know how I can make one unit once it is in play generate a certain amount of gold over time and keep doing it, once he dies i want him to stop generating gold.

EX: 5 peasents in play, each peasent makes 5 gold per 5 seconds, every 5 seconds i get 25 gold, one peasent dies, every 5 seconds i get 20 gold per second.

So far i was successful in making the tax system work, the only problem is they dont stop generating gold when they die.

My Trigger is like this

Trigger Name "Taxes"
(map=Region on whole map)

Events-
___Unit - a unit enters map <gen>
Conditions-
___(Unit-Type of (Triggering unit)) Equal to Peasent
Actions
___Wait 5.00 seconds
___Player - Add 10 to Player 1 (Red) Current gold
___If (Triggering unit) Equal to (Dying Unit)) Then do (skip remaining actions) else do (do nothing)
___Trigger - Run Taxes <gen> (Checking Conditions)
 
Level 16
Joined
Oct 30, 2004
Messages
1,277
First of all that
___If (Triggering unit) Equal to (Dying Unit)) Then do (skip remaining actions) else do (do nothing)
is useless, since how can an entering unit be dying unit? Anyway, here is my suggestion how u should do it:

U can do the taxing system with a variable, create a variable, integre type, default 0, name it for excample "Income".
Then make this trigger:

Events-
___Unit - a unit enters map <gen>
Conditions-
___(Unit-Type of (Triggering unit)) Equal to Peasent
Actions
___Set Variable "income" to "income" + 5

Then u need another trigger that goes like this:

Events-
___Every 5 seconds of game time
Conditions-
___None
Actions-
___Add to player1 gold amount "income"

Then u need a third trigger also:

Events-
___Unit Dies
Conditions-
___Triggering unit type equal to Peasant
Actions-
___Set Variable "income" to "income" - 5

I know i didnt use the "trigger language" but i presume u can find those triggers.
 
Level 2
Joined
Jun 14, 2005
Messages
11
Trigger failure

The set of triggers you posted work, but in the way i dont want them to.

#1
The Income didnt stack, no matter how many peasents you have, they still generate 5 gold per 5 seconds
#2
When the peasent dies, instead of stoping the income it takes away from the stockpile and neither does this one stack

the 3 trigggers you told me to make are as followed

Region map=(Region covering the whole map)
Variable income=(An interger Variable)

Trigger "Taxes"
Events
___Unit - A unit enters map <gen>
Conditions
___(Unit-Type of (Triggering unit)) Equal to Peasent
Actions
___Set income = 5

Trigger "Taxes Collected"
Events
___Time - Every 5.00 Seconds of game time
Conditions
Actions
___Player - Add income to Player 1 (Red) Current Gold

Trigger "Dead Tax Payer"
Events
___Unit - A unit owned by Player 1 (Red) Dies
Conditions
___Unit-type of(Triggering unit)) Equal to Peasent
Actions
___Set income to =-5

Now this makes sense that it messes up, since it isnt adding to income or subtracting from it, its seting it, Please correct this trigger or give me instructions to a new set that works properly, thank you anyways for trying to help me Mini-Me :D
 
Level 16
Joined
Oct 30, 2004
Messages
1,277
Ehm, well, i see we had here a misunderstanding problem. When i typed Set Income to Income + 5 , i actually ment "income PLUS 5", and when i said to Set income to income - 5 i ment to set it as "income MINUS 5". Sorry about my lazyness, maybe i should have explained it better.

Events-
___Unit - a unit enters map <gen>
Conditions-
___(Unit-Type of (Triggering unit)) Equal to Peasent
Actions
___Set Variable income to (income + 5)

Then u need another trigger that goes like this:

Events-
___Every 5 seconds of game time
Conditions-
___None
Actions-
___Add to player1 gold amount "income"

Then u need a third trigger also:

Events-
___Unit Dies
Conditions-
___Triggering unit type equal to Peasant
Actions-
___Set Variable income to (income - 5)
 
Level 2
Joined
Jun 14, 2005
Messages
11
Yay, It Worked!

Hey mini-me Thanks for the help! It worked, now i can make a map like village builder, just not as cheap with more races and a better looking terrain set! Again thank you! :D
 
Level 13
Joined
May 5, 2004
Messages
1,330
OK, it's already answered, but wouldn't this trigger be easier?


Events
Time - Every 5.00 seconds of game time
Actions
Player - Add ((Number of living Peasent units owned by Player 1 (Red)) x 5) to Player 1 (Red) Actual Gold

(those actions for every player, of course)
 
Level 2
Joined
Jun 14, 2005
Messages
11
I'll try that out too.

I guess I can try that trigger out too, I'm working on a map just like village builder, just with actual work done on it, so far right now It's epic 256x256 and i finished the terrain, got a snowy region, watery region, forest region, mountain region, and a desert region.

In the game I plan to add 10 Town builders which I call and 2 barbarians. All town builders start in the middle of the map and choose from a varaity of races which I shall make personally and most should beable to branch off into different types of that race.

-----------------------------------------------

-Humans
Humans are known for government and society, they collect more taxes than other races but are weaker than most races.

Warlock Society
A corrupted society, adept at magic and weaker in military soldiers

Paladin Society
The brings of the light, the ones who wish to banish all hell spawn from the world and bring peace to the land they live in, adept at military power and some healing.

-Elves
An agile race, faster units than other races. They have more magic in their disposal than other races.

High Elves
These are the ones who are the greatest at magic than any other race, they have many spell casters but fewer military units

Night Elves
The tree huggers of the world, they are a hunter based society, making them even faster and they have high lines of sight, weaker in melee but stronger in ranged combat.

-Orcs
The Brutish Civilized Race of the world, they have the strongest small melee units with the highest HP than any other normal race.

Shamen Society
Shamenistic and wish to keep them selves pure and not in eternal bloodlust. These orcs have more magic in the druidistic and shamenistic side than anyother side, and they still have nice melee.

Fel Orc Society
If you wish to execl at melee combat, this is your race. These Orcs always lust for blood making them killing machines, they have high Hp and High damage and skilled in some warlock magic.

-Trolls
A hunter society, like the elves, they excel at ranged and also have high lines of sight. They arnt as fast as the elves but they are stronger in melee than elves and are skilled in Voodoo magic. Their units also have high HP regeneration rates.

-Naga
The water creatures of the world, they can build on rivers and shores, most of their units are also amphibious making them great at water regions, they do not have ships since they never are in need of them. Their race is trained in water magic.

-Demons
The demons are skilled in the ways of the warlock more than any other race, they have big units and magical units, most of their units cost high gold though and they dont collect as much gold than other races.

Rebels
These few but still plenty demons do not wish to be mindless and in complete mind control of the demon lords, these demons arnt as evil as the others making them less skilled in the ways of the warlock, but they collect taxes like any other race since they are no longer in complete mind control.

Burning Legion
These go even farther in the ways of the warlock research and have even larger and more powerful demons at their disposal, they still are bad at collecting taxes.

-Dragons
A very powerful race, all units have high Hp and high damage but are costy, they are skilled in little magic. The king of the dragons is uniqe compared to the others as in he can fly and other kings cannot. they collect less taxes than other races

-Treants
The trees that get hugged by the tree huggers. This race is powerful yet slow, their buildings can uproot and move with the rest of their people, since their buildings are alive and are not hollow, their buildings cannot be entered, leaving your king in the open all the time, the king though is fast and powerful compared to all other kings.

--------------------------------------------

Each Town builder starts with a king,(As said with the dragons and treants), he is a hero, if he dies, you loose. Each race will create buildings and make civilians. Civilians are tax payers and later if you build barracks or stables you can,(Not decided yet), Train your civilians into a unit type with the research for that unit done or create units from the barracks or other buildings. People in order to keep their kings safe can put their king in any building since all buildings will hold units,(besides the treants, their king shall just be big meaning he is fast and powerful).

----------------------------------------------

There are 2 barbarians, one starts in the snowy region and one starts in the desert region. Each barbarian is solo and must kill all other players, even the other barbarian clan, because of this I plan to make the barbarians stronger than Town builders. Each barbarian type shall has have his own set of races, and they too shall have a king. The races I have thought up for the desert barbarians are.

----------------------------------------------

-Humans (Arabic)
These humans are less consintrated in government and are a clan based society, they are nomadic and excel in desert regions and are weaker in cold regions.

-Ogres
A large and brutish race, they are extremly stupid making them skilled in no magic at all, the only one skilled in magic is the Magi, which is the king. Their units are all melee and no ranged, they have high Hp and Damage. These people arnt nomadic, they settle in one area.

-Centaur
A fast race, all their units are considered cavalry making all their units fast. These people are nomadic unlike the ogre. Their units are normal in melee and normal in ranged and since are fast are good for hit and run tactics.

-------------------------------------------------

What I thought up for the Snowy Barbarians are.

-------------------------------------------------

-Humans (Norse)
Very strong Nomadic type on people. They are the strongest of all human societies. They excel in melee combat, all units can go in a berserker rage. They also have fast ships.

-Undead
Yes, the undead. I planned to make them Town, but they didnt seem so townish, and the way I plan to make them isnt very nice, something a raider type person would do. The undead are weaker than most people and produce people on their own very slowly. The way the undead grow in numbers fast is by raiding people and raising the dead as undead citizens. They are skilled the most in necromacy.

-Still thinking

---------------------------------------------
Man, :roll: just noticed I thought up of alot of races! I'm ganna be working my a** off for this game, if you have suggestions or wanna help in anyway(minorly, cause I plan to do most of the work, I want this to be my project and of course I shall thank you in the quest log, you are already going in it Mini-Me :wink: ).
My B.net account is Dead_Troll, and PM me if you got suggestions or post here or IM me on AIM.


P.S. :( Man I wrote alot........
 
Level 2
Joined
Jun 14, 2005
Messages
11
Ok, so Im trying what dark shadow told me just to see how it is, but how do you multiply the number of peasents inorder to get the amount of taxes collected?

I found all the triggers you listed but the only problem is trying to multiply those damn peasents.
 
Level 13
Joined
May 5, 2004
Messages
1,330
There's a function called "Arithmetic". You start that trigger with a "Player - Add ... to player gold". For ..., you put the Arithmetic function, then you should have something like "value + 1". For value, you put that "number of living peasents"-function, then you change the + to a x and at last the 1 to a 5. Done.
 
Level 2
Joined
Jun 14, 2005
Messages
11
Wow, neat, finally found it and it saves so much more work and triggers, thanks dark shadow, I'll be sure to thank both you and Mini-Me once I get my first Beta Version done. If ya'll have any opinions or ideas for my map, PM me or post it here, I'll maybe take your comments into consideration when I'm making my map.
 
Status
Not open for further replies.
Top