| 04-18-2004, 10:36 AM | #1 |
On my map insects will be allowed to raid eachothers nest, and while doing that they can steal a single egg. The egg is an item and I do not want heroes to be able to carry more than one. If you can explain how to make it so only 1 of a certain item can be carried at a time that would be great! E-mail me at [email protected] or just reply either is goody ^_^ Thanks, Kiradacon |
| 04-18-2004, 05:41 PM | #2 |
I think you must use triggers to check how many eggs the hero has and if it is more then one, drop it. Or create another systhem that involves dummy eggs and a spell to claim them, that only works if the hero hasn't any eggs yet. |
| 04-18-2004, 06:02 PM | #3 |
I believe this occurs after the item is in the inventory. Ah. Now I remember. [code] Egg Events Unit - A unit Acquires an item Conditions (Item-type of (Item being manipulated)) Egg Actions Set EggCount[player number of (Hero Manipulating Item)] to eggcount[" "] + 1 If (All Conditions are True) then do (Then Actions) else do (Else Actions) If - Conditions Eggcount > 1 Then - Actions Hero - Drop (Item being manipulated) from (Hero manipulating item) Set EggCount = 1 Else - Actions Do Nothing [code] |
| 04-20-2004, 04:11 AM | #4 |
I know you explained it very well, but I'm still stuck a bit. I found out everything I know by trial and error, and made 3 pretty nice maps out of it. Unforturnetly I didnt teach myself something you mentioned I need to do. I do not understand how to Set the egg count :( Please explain to a person new to Variables/Arrays. -Kiradacon |
| 04-20-2004, 02:13 PM | #5 |
Make a variable named Eggcount and set its type to integer and make it an array with the size of how many players you have. Then you should be able to make the triggers. |
| 04-20-2004, 05:17 PM | #6 |
Note that this is a simple solution that will only allow a player's heros to carry one egg total, even if a player can have multiple heros. Making it so that each hero can carry one egg, and one player can have more heros, is slightly more complicated (but nothing new, you only need one more unit-variable array) |
