HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Shop Upgrade Problem/Selection Problem

08-08-2004, 10:49 AM#1
Rith
Hello.

I have this problem in my map. It's kind of based on HOMM3. You got this main, in which you build other buildings to gain unit spawning. This is represented through putting items, that look like buildings, in your main (which has an inventory *duh*). These items are sold by the main itself.

Problem 1 - The Main can't select itself, so there always has to be another unit around to buy the items and put it into the main. I'd like the main to work individual. Any thougths?

However, you can also upgrade your main -- allowing more buildings. Lets say Main level 1 has itemA and B, the upgraded form Main level 2 should have item A, B, C and D. But when Main level 1 upgrades in level 2 it doesn't has the new items. But when Main level 2 is in the game already, and not accomplished through an upgrade, so just placed in editor, everything works fine.

Problem 2 - How can I fix this bug?

(Notice; the Main doesn't work as a shop, you can't pawn items, if you could then it wouldn't be able to take any items in it's inventory)

Thanks
08-08-2004, 11:14 AM#2
Grater
Maybe if you make the main "Build" the items rather than "Sell" the items, when you buy a "Builded" item, it drops straight to the ground - no nearby unit required. One problem is that I dont know what event can be used to detect when an item is bought in that way - other than using "Unit is issued an order with no target" - and the order has no string so you'll need to use an order comparison using JASS/Custom Script. So detect the order then look for the item lying on the ground next to the main and put it in the mains inventory. A short wait may be nessecary - if this means the item becomes visible for a moment, just give it no model.

As for the upgrade problem, prehaps when the upgrade is complete, use the "Replace Unit" trigger so that the main is replaced by a duplicate of itself, thus it is considered "new" rather than "upgraded".

Hope this helps...
08-08-2004, 11:22 AM#3
Rith
Quote:
Originally Posted by Grater
Maybe if you make the main "Build" the items rather than "Sell" the items, when you buy a "Builded" item, it drops straight to the ground - no nearby unit required. One problem is that I dont know what event can be used to detect when an item is bought in that way - other than using "Unit is issued an order with no target" - and the order has no string so you'll need to use an order comparison using JASS/Custom Script. So detect the order then look for the item lying on the ground next to the main and put it in the mains inventory. A short wait may be nessecary - if this means the item becomes visible for a moment, just give it no model.

As for the upgrade problem, prehaps when the upgrade is complete, use the "Replace Unit" trigger so that the main is replaced by a duplicate of itself, thus it is considered "new" rather than "upgraded".

Hope this helps...

The first one is kind of sucky, since it'll take me a place for the rally point of building units. Which I am trying to avoid

the second thing I already tried. But what should be the event?
Unit finishes constructing? upgrade?
..
maybe I made a mistake in the event..
08-09-2004, 01:31 AM#4
Grater
Quote:
The first one is kind of sucky, since it'll take me a place for the rally point of building units. Which I am trying to avoid
I'm not sure what you mean by that. "Items Built" does not effect rally points in any way..
Actually, hold on, I was using the wrong names.
Usually a shop uses "Items Made", but if you instead use the "Items Sold" field the items drop straight to the ground. So it's the "Items Sold" field you want to use.

For catching the upgrade, I do believe "Unit - Unit finishes an upgrade" is the event your looking for. I use it in one of my maps, so it's definitely for buildings upgrading not the research upgrades. Btw if the building gets "teleported" when you replace it, try hiding all nearby units, do the replace, then unhide the nearby units.