| 01-23-2004, 07:51 AM | #1 |
Here is What i Want to Do: I have a Farm (building) that every day at 6 am spawn a baby pig. and next day at 6 am baby pig become small pig. and then next day small pig become pig. and then next day pig become Big pig. Big pig do not evolve any more. the hard thing is that to spawn pig or evolve pig it cost food. babypig = 10 food smallpig = 15 food pig = 20 food Bigpig = 30 food i don't want people to upgrade themself the pig, i want the pig to only upgrade if it is feed, i want the pig to upgrade at 6 am . so the trigger should start upgrading the Pig, then the small pig, then the baby pig, then spawn babypig, so that a dayly born baby pig wouldn't be upgraded three time and become a big pig. but also the trigger should check each time before to upgrade pig that there is enough food, and this, for all pig one by one, so if you have 3 pig to upgrade into Big pig and only 60 food it will upgrade 2 pig into Big pig (60food) and leave one unupgraded because of lack of food...and also skip all smaller pig upgrade because there shouldn't be any food left for them too. there is 8 player that can make only one farm each, each farm spawn at max 10 pig. How can i trigger this (the most difficult for me is to check pig one by one) should i track them in an array? Please help me..... (VERY IMPORTANT: I USE CUSTOM RESSOURCES: FOOD (gold) WOOD (wood) STONE (integer variable) GOLD (integer variable) So When I Say Pig Cost Food I Mean Pig Cost (Gold))... |
| 01-23-2004, 12:27 PM | #2 |
Do pigs need to do anything? If they don't do anything besides wander around, you can give them an upgrade, the same way that towers do. Make the upgrade time impossibly long (as high as the value will go). They're not going to actually complete the upgrade, you'll just give it to them at 6 am. Make the upgrades cost the appropriate amount of gold (food). Event: Unit begins an upgrade Condition: Upgrade = Little pig -> Medium pig Action: Add pig to UpgradingMediumPigs (a unit group variable). Event: Unit cancels an upgrade Condition: Upgrade = Little pig -> Medium pig Action: Remove pig from UpgradingMediumPigs (a unit group variable). Event: Game Time of Day = 6.00 Action: Pick every pig in UpgradingMediunPigs and do: Replace picked unit with Medium pig Do this for the other pig evolutions, and you should be in ok shape. Since the "feeding" upgrade was never cancelled, you shouldn't get your money back for it, so the pigs spend all day eating, and are instantly replaced by the more mature form at dawn. But why dawn? You might just have them have a very long upgrade time, so that if you get a piglet at 5:59 AM, it doesn't instantly evolve up. |
