| 05-29-2003, 12:24 AM | #1 |
Well I want to create a trigger that gives 30 gold for every free supply there is for every 60 seconds. Is that possible? |
| 05-29-2003, 12:32 AM | #2 |
Im not sure, i dont have WE open, but i think if you convert real to integer, then theres a max supply and supplies used, so just subtract. If that doesnt work, then you could select all units and add the supplies used by picked unit, then select all of the moon wells or whatever and find the amount used and subtract those. |
| 05-29-2003, 12:54 AM | #3 | |
Quote:
You bet... EVENTS Every 60 seconds of Game Time CONDITIONS N/A ACTIONS for each Integer A from 1 to 12 do (Add (30 * (Player(Integer A) food cap - Player(Integer A) food used) to Player(Integer A)'s current gold Though, it is important to note that since it is possible to have the food used higher than the food cap, this would result in gold being taken away. If you don't want this behavior, you will also have to add in an if statement to check that. Also, using the for loop, this would work for all players (user and computer). If you want it to only work for user players, just replace the for loop with Player Group - Pick every player matching (Picked player is a user) ... |
| 05-29-2003, 03:11 AM | #4 | |
Quote:
|
| 05-29-2003, 08:40 AM | #5 | |
Quote:
There is, but the question still remains, do you want to give gold to a player if their food used is above their food cap? |
| 05-29-2003, 10:42 AM | #6 |
You count with food basicly. You can set whatever cap you want to use yourself. Take their current food use, then take your cap of food, subtract the cap with current food use. Then store the outcome in a variable. Give 30 x The Variable you stored in to player X's gold. Simple as that. Basic math as well. |
| 05-29-2003, 11:53 AM | #7 | |
Quote:
No I do not. Well I got it work in a way but it only gives 1 gold for every free food there is. Event Time- Every 60 seconds of game time Condition N/A Action For each (integer A) from 1 to 12 do (Player Add(Min((Player 1 Red, Food Cap),(Player 1 Red Food Used))) to player 1 Red Current gold Set integer=30 Player 1 Red Current Gold Anyone can help? |
| 05-29-2003, 12:13 PM | #8 |
Soooo... For every food that IS used or every food that is NOT used without a cap? If you do it for all food that is not used WITHOUT A CAP you can't calculate it. Rofl, that's obviouse. If you want 30 gold per USED food, then do Actions Set player X gold to (Player X used food X 30) Then redo for all players. If you intend to have it for all non-used food, give me a cap and I can do the calculating (and give you an exact trigger) for you. |
| 05-29-2003, 07:30 PM | #9 |
OK how can I make this simple. Lets the player has 11 food used and his cap is 35. 35 - 11 times 30 is how I want this to work. And it is possible 'cause obisouly you didn't read rwxr-xr-x post. I jus' can't get it to give 30 gold per free food. It just gives one Edit:I GOT IT TO WORK!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! It was very very easy. Action For each (integer A) from 1 to 12, do (Player-Add(Min((Player 1 (Red),(Player 1 (Red) Food used))) x 30) to Player 1 (Red) Current Gold Edit 2: Will this trigger only give gold based on player 1 free food? |
| 05-29-2003, 07:50 PM | #10 |
There is a much easier way to do this you moron. Which I also tried to state. And to do this WITHOUT A CAP IS IMPOSSIBLE. Because you can not calculate it without a cap. But since you have one, this is easy. You take your max-food and divide it by the used food. Then you take the outcome of that, store it in a varieble and Set Proptery gold for player X + Variable X 30 |
| 05-29-2003, 08:19 PM | #11 |
Actually that is incorrect Dead-Inside. Max food is the maximum amount of food you can accrue, which by default is 90 unless you specificly set it to something else. The food cap is the amount of food you have available to you to train units. The food cap is determined by the number of supply units you have (farms for human, moon wells for NE, etc...). More simply, if you have 3 farms, and 1 footman, you would have... FOOD USED: 2 FOOD CAP: 18 FOOD MAX: 90 In this case, Radesh is wanting to give 30 gold to every unused amount of food (18 - 2 = 16). So 16 * 30 would be the gold that he gives. Now, if one farm is destroyed, the food cap is now 12, and the amount of gold given would be 12 * 30, etc... Also Radesh, I'm surprised my action didn't work for you. I did it up in WE and tested it out before I posted, and it worked like a charm. Even appropriately gave me the correct amount of gold if I built/destroyed a farm. |
| 05-30-2003, 06:35 AM | #12 |
Aww crap, I was reffering to the Max Food. Oh well, never mind, my bad. You can still count on the food cap though. Just take the current food cap by player X - the food used by player X and then multiply the outcome with 30 and give it back as gold... Gaaaah. Regards Dead-Inside |
