- Joined
- Jun 10, 2007
- Messages
- 780
Creating a looping income
This tutorial will show you how to make a income system that will loop after a certain amount of time and your amount earned will be determined by your condition. This tutorial would be the best for games like Hero Line Wars or tower defenses.
First, I will show you how to create an income system based on a unit you buy. This again is the best for tower defenses or Hero Line War types of games. Before triggering you will need a variable that is an integer and is at 0 default. First you will need an event... We will make it so when a unit enters a specific region it will trigger.
-Income or .Myincome and it will show there income then and there.
This tutorial will show you how to make a income system that will loop after a certain amount of time and your amount earned will be determined by your condition. This tutorial would be the best for games like Hero Line Wars or tower defenses.
First, I will show you how to create an income system based on a unit you buy. This again is the best for tower defenses or Hero Line War types of games. Before triggering you will need a variable that is an integer and is at 0 default. First you will need an event... We will make it so when a unit enters a specific region it will trigger.
- Unit - A unit enters TriggerRegion <gen>
- ((Entering unit) is A structure) Equal to False
- If ((Unit-type of (Entering unit)) Equal to Peon) then do (Set Income[(Player number of (Owner of (Entering unit)))] = (Income[(Player number of (Owner of (Entering unit)))] + 1)) else do (Do nothing)
- Set TriggerRegion = (Random integer number between 1 and 2)
-
Income
-
Events
- Time - Every 10.00 seconds of game time
- Conditions
-
Actions
- For each (Integer A) from 1 to 10, do (Player - Add Income[(Integer A)] to (Player((Integer A))) Current gold)
- For each (Integer A) from 1 to 10, do (Game - Display to (Player group((Player((Integer A))))) the text: (Your income is : + (String(Income[(Integer A)]))))
-
Events
-Income or .Myincome and it will show there income then and there.
-
income
-
Events
- Player - Player 1 (Red) types a chat message containing -income as An exact match
- Player - Player 2 (Blue) types a chat message containing -income as An exact match
- Player - Player 3 (Teal) types a chat message containing -income as An exact match
- Player - Player 4 (Purple) types a chat message containing -income as An exact match
- Player - Player 5 (Yellow) types a chat message containing -income as An exact match
- Player - Player 6 (Orange) types a chat message containing -income as An exact match
- Player - Player 7 (Green) types a chat message containing -income as An exact match
- Player - Player 8 (Pink) types a chat message containing -income as An exact match
- Player - Player 9 (Gray) types a chat message containing -income as An exact match
- Player - Player 10 (Light Blue) types a chat message containing -income as An exact match
- Conditions
-
Actions
- For each (Integer A) from 1 to 10, do (Game - Display to (Player group((Triggering player))) for 6.00 seconds the text: (((String((Integer A))) + ) ) + (String(Income[(Integer A)]))))
-
Events