HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

how can i make a building upgrade when posessing certain items

10-01-2014, 11:33 PM#1
andreasaspenberg
i am working on a human sub faction that uses items as building requirements but, how can i create that system? here is how it is supposed to work: items are placed in the building by a unit and when enough items of specific types are present the building can upgrade. please help me figure this out.
10-02-2014, 02:45 PM#2
Anitarf
There is no way to enable an upgrade for a specific unit, only on a per-player basis. One way to work around this would be to have two different units, one with a disabled upgrade and another with an enabled one; then, when the first building gets enough items, chaos-morph it into the second one, thus enabling the upgrade for that building.
10-02-2014, 03:07 PM#3
andreasaspenberg
sounds good but please explain it in a bit more detail.
10-02-2014, 08:00 PM#4
Anitarf
Okay. Let's say you have building A which you want to be able to upgrade to building B once it has 6 items X in its inventory. To achieve this, I would make copies of buildings A and B, let's call them A' and B'. Then, make it so A upgrades to B' and A' upgrades to B. Now, create another unit/building, C, and let's give it a name "6 X". Use this building as a tech requirement for B'. Because C will never be made in-game, it will be impossible for players to upgrade A to B', but they will be able to see a tooltip for the upgrade that tells them they require 6 items X (since that's what C is named).

Now, make a trigger that detects when a building of type A acquires 6 items X and chaos-morph it to building A'. That building can now freely be upgraded to building B. Use another trigger to detect when a building of type A' drops an item so you can morph it back to A in this case. This should cover everything.