| 07-19-2004, 01:14 PM | #1 |
Im trying to make an income trigger that gives a player 10 gold every 5 seconds, but I want this amount to be increased if a player has a specific upgrade, and increased further everytime the player upgrades further. |
| 07-19-2004, 02:07 PM | #2 |
set an integer variable and call it "income" or soemthing, and set it to 10 by default. Then create a trigger with periodic event (every 5 seconds) and as action make it give player "income" amount of gold. Then set other triggers checking when players finishes researching the upgrades that you need and when that happens set income to income+ the amount from upgrades. |
| 07-19-2004, 02:07 PM | #3 |
EDIT: Lol you posted while i was typing this post... Code:
Every 5 sec Add (Income_Variable) to player (1?) current gold This trigger will give the player the amount inside the variable in gold every 5 sec. Code:
Unit finishes a research If (upgrade being researched) equal to (Income_Increase) then do set (Income_Variable) to (Income_Variable) + 10 When a unit finished researching the research called "income_increase" it will add 10 to the income variable which gives gold. If you want different increase of gold each level of upgrade, you can make another variable which counts how many times he has researched, and then add/remove from the gold added depending on how many times he has researched. Hope u understand ^^ |
| 07-19-2004, 03:08 PM | #4 |
Code:
Unit finishes a research If (upgrade being researched) equal to (Income_Increase) then do set (Income_Variable) to (Income_Variable) + 10 At the part "Unit finishes a research" it forces me to define a unit, and the only choice is "no unit". Am I doing something wrong? |
| 07-19-2004, 03:18 PM | #5 |
You must be using specific unit event instead of generic unit event. The later doesn't require you to specify a unit. |
| 07-19-2004, 03:23 PM | #6 |
Ahh yes thanks Anitarf. Also, is it possible to research an upgrade off a nuetral merchant? |
| 07-19-2004, 03:55 PM | #7 |
I think i screwed up wanting it as an upgrade because it conflicts with other plans, so here is what I have so far... First Trigger: Code:
Event: Time - Every 5.00 seconds of game time Conditions: Actions: Player - Add Income_Variable to Player 1 (Red) Current gold "Income_Variable" is an integer variable equal to 10 Second Trigger: Code:
Event: Unit - A unit owned by Player 1 (Red) Uses an item Condition: (Item-type of (Picked item)) Equal to Income Increase Action: Set Income_Variable = (Income_Variable + 2) "Income Increase" is an item based off of Chest of Gold with no abilities, I believe its called a "dummy?", and im using this item "Income Increase" in order to trigger a +2 integer value to "Income_Variable". The end result im trying to get is that if Player 1 (Red) uses the item "Income Increase" he will gain a permanent +2 increase to the income he recieves every 5.00 seconds of game time. ...Although its not working :( Can anyone help me fix it? |
| 07-19-2004, 05:05 PM | #8 |
(Item-type of (event response - item being manipulated)) Equal to Income Increase |
| 07-19-2004, 05:25 PM | #9 |
still doesnt work... :( |
| 07-19-2004, 05:27 PM | #10 |
Try giving the item an ability (for example, a modified gold-gain that gives 0 gold, or any other item ability; just give it something, maybe the item-use isn't detected because it has no abilities :/ ). |
| 07-19-2004, 05:37 PM | #11 |
dam that didnt work either :( |
| 07-19-2004, 05:44 PM | #12 |
Try putting in debug messages (game - display message to all players) that show the status of variables whenever triggers run, to see if the triggers even run, and what do they change. |
| 07-19-2004, 05:48 PM | #13 |
how do I do that? |
| 07-19-2004, 06:08 PM | #14 |
hell yeah its working now for some reason the game doesnt think that "Use Automatically when acquired" counts as using it thanks for the help anitarf :D |
