- Joined
- Jun 10, 2007
- Messages
- 780
Creating a Looping Income
Don't vote on numbers, but on how it would help someone in need of this. Even if this wouldn't help you, it just might help somebody else. Don't write retarded comments like "Oh my god so easy!!1". I DON'T care if you know how to do it. If you can, good for you.
Requirements
World Editor [Comes with Wc3]
General Trigger Knowledge
General Variable Knowledge
Difficullty:3/10
Contents
Hold Ctrl and press F to skip to a section.
-Introduction
-Step 1
-Step 2
-Step 3
-Extras
-Closing
Introduction
Income is an amount of money (gold in this case ) that you obtain over a certain period of time. In this short tutorial, I will show you the basics of making an income that can loop if needed.
Step 1
Before we make any part of the income, we will need a variable, which stores the amount of income.
Steps
1)Open the trigger editor
2)Press Ctrl+B
Once your there you create a new variable. I'm naming mine Income just for the purpose of the tutorial. Now, make the variable an integer because its storing a number (our income number). Make it array if you have multiple incomes.
Now your variable should look a little like this:
Change the initial value if you want to have a starting income. Now that we have the variable we can move onto step 2.
Step 2
Now we will need to diagnose what we need the income for. Some may need a looping income for a tower defense, some may need it for there job income. Ill show you the basic use for it.
Step 3
Create a new trigger and name it adding income or something by that means. You will need a specific event for giving income. Heres a small example
All you have to do is give value to the integer and it will give income! to add to an already existing income then do this
Extras
I have some extra actions and information if you would like to add them to your triggers.
Having an initial income value
If you would like your players to start out with an initial (beginning) income value, there are two ways of doing it.
1:Go into your variable editor and change the income variables default value to any number.
2: Use this trigger
Closing
I hoped this tutorial has helped someone and thanks for reading! Reply in the thread so that I can make this tutorial better!
UPDATE: I added more to the testmap and fixed things up a bit. I added some more sections as well . Heres the demo map for the income View attachment Income Version 2.0.w3x
OLD VERSION: View attachment Income.w3x
Don't vote on numbers, but on how it would help someone in need of this. Even if this wouldn't help you, it just might help somebody else. Don't write retarded comments like "Oh my god so easy!!1". I DON'T care if you know how to do it. If you can, good for you.
Requirements
World Editor [Comes with Wc3]
General Trigger Knowledge
General Variable Knowledge
Difficullty:3/10
Contents
Hold Ctrl and press F to skip to a section.
-Introduction
-Step 1
-Step 2
-Step 3
-Extras
-Closing
Introduction
Income is an amount of money (gold in this case ) that you obtain over a certain period of time. In this short tutorial, I will show you the basics of making an income that can loop if needed.
Step 1
Before we make any part of the income, we will need a variable, which stores the amount of income.
Steps
1)Open the trigger editor
2)Press Ctrl+B
Once your there you create a new variable. I'm naming mine Income just for the purpose of the tutorial. Now, make the variable an integer because its storing a number (our income number). Make it array if you have multiple incomes.
Now your variable should look a little like this:
Change the initial value if you want to have a starting income. Now that we have the variable we can move onto step 2.
Step 2
Now we will need to diagnose what we need the income for. Some may need a looping income for a tower defense, some may need it for there job income. Ill show you the basic use for it.
-
Income Give
-
Events
- Time - Every 30.00 seconds of game time
- Conditions
- Actions
-
Events
- For each (Integer A) from 1 to 6, do (Player - Add Income[(Integer A)] to (Player((Integer A))) Current gold)
Step 3
Create a new trigger and name it adding income or something by that means. You will need a specific event for giving income. Heres a small example
-
Example1
-
Events
- Unit - A unit Dies
-
Conditions
- ((Owner of (Killing unit)) is an ally of (Owner of (Dying unit))) Equal to False
- (Owner of (Killing unit)) Not equal to (Owner of (Dying unit))
-
Actions
- For each (Integer A) from 1 to 6, do (If ((Owner of (Killing unit)) Equal to (Player((Integer A)))) then do (Set Income[(Player number of (Owner of (Killing unit)))] = Income[(Income[(Player number of (Owner of (Killing unit)))] + 1)]) else do (Do nothing))
-
Events
All you have to do is give value to the integer and it will give income! to add to an already existing income then do this
Extras
I have some extra actions and information if you would like to add them to your triggers.
Having an initial income value
If you would like your players to start out with an initial (beginning) income value, there are two ways of doing it.
1:Go into your variable editor and change the income variables default value to any number.
2: Use this trigger
- For each (Integer A) from 1 to 10, do (Set Income[(Integer A)] = 30)
Closing
I hoped this tutorial has helped someone and thanks for reading! Reply in the thread so that I can make this tutorial better!
UPDATE: I added more to the testmap and fixed things up a bit. I added some more sections as well . Heres the demo map for the income View attachment Income Version 2.0.w3x
OLD VERSION: View attachment Income.w3x
Last edited: