| 09-17-2006, 08:53 PM | #1 |
Hello. I'm making an epic Co-op zombie map (491 Triggers thus far), and even though it's late into development, I decided to add a new element. I want to have Health units that the players can find at rest stops and use them to replenish their health (Ã* la Half-Life 2). Each health unit will have a limited stock of 10 charges (free items), each that restore 250 health. My problem, however, is that when I have: Events: Time - Elapsed game time is 1.00 seconds Actions: Unit Group - Pick every unit in (Units of type Health Unit) and do (Actions) Loop - Actions Neutral Building - Add Health to (Picked unit) with 10 in stock and a max stock of 10 ...then it glitches up. When I have a player take one item, the item disappears from the shop! I tried it with other items that aren't automatically used when acquired. For instance, when i gave it 10 clips of ammo, it did the same thing. Gave me one and threw the other nine into the abyss. I was thinking about pulling together some system involving custom values, etc, but I'd like to do it as simply as possible. Any help? Thanks! |
| 09-18-2006, 02:58 AM | #2 |
I've actually been working on the same problem myself. I have no trouble adding units to stock, but items have the same effect as you explained. I'll let you know what I figure out, when I do. |
| 09-18-2006, 03:34 PM | #3 |
Okay, set the value of the item-type to the number of stock you want, whenever a unit purchases a item, set the value to (value-1) and add the item again, if the items value is 0 dont add. If you want to add stock after a certain amount of time (like it does normally), create a periodic trigger for each item that sets its value +1. |
| 09-18-2006, 09:22 PM | #4 |
Is that just a workaround for another problem though? It seems unnecessary, but maybe I'm wrong. Isn't there a setting or ability maybe that the shop needs to have to keep it from doing that? |
| 09-20-2006, 03:23 AM | #5 |
I used Tidehunter's method (as was my original idea) and it worked fine. But one would think there'd be an easier way to do this. Thanks for the help, guys. |
| 09-20-2006, 06:17 AM | #6 |
Give your shop to Neutral Extra. Optionally with some alliance changes so he's actually neutral, don't want a red mouse cursor on a shop... |
| 09-20-2006, 06:20 AM | #7 |
Marketplaces automagically sell an item only once, theres no way around this. |
