[General] Adding/Removing units/items from a shop - How ?

Status
Not open for further replies.

Ardenian

A

Ardenian

Hello,

While the question seems obvious and easy, I thought it is not possible to add or remove items or units from a shop.

But, YouTD uses a system that gives a new item/unit to a shop or increases the stack of it if the shop already has the item/unit.
Basically each round an item/unit is randomized and given to the shop.
The gold, wood and food cost is displayed.

How is this possible ?
 
Level 12
Joined
Nov 3, 2013
Messages
989
There should be actions under category "neutral buildings" for the job.

Yep. Also do note that you can only remove ones that were added through triggers (So don't add them in object editor.) and that, for some reason, units that were added through triggers can't be bought using hotkeys.
 

Ardenian

A

Ardenian

There should be actions under category "neutral buildings" for the job.

Also do note that you can only remove ones that were added through triggers (So don't add them in object editor.)

Ahh, this explains a lot. I wasn't aware they differ between neutral buildings and others in triggers.
Thank you!

Hm, now a new question pops up. If the building is a neutral building, then everyone can buy from it, can't one ?
How do I make a building being affected by the 'neutral building' trigger but only usable for one specific player ?
 
Level 23
Joined
Feb 6, 2014
Messages
2,466
Also do note that the tooltip will have no color when the item is added via trigger. Also, IIRC, the items will disappear when its stock reaches zero.


Hm, now a new question pops up. If the building is a neutral building, then everyone can buy from it, can't one ?
How do I make a building being affected by the 'neutral building' trigger but only usable for one specific player ?

I guess you have to trigger it. Make the shop unselectable to other players.
 
Level 12
Joined
Nov 3, 2013
Messages
989
How do I make a building being affected by the 'neutral building' trigger but only usable for one specific player ?
I guess you have to trigger it. Make the shop unselectable to other players.

Shop Sharing (Player shops in melee like Ancient of Wonders use this.) is for allies only.

edit: Oh wait it has to be owned by neutral passive? In that case you can create a dummy unit. When the player selects it make them select another neutral building (one for each team or player depending on what you need) with 0.01 size (to still show the portrait without being seen) that you've placed in the same location. To not have it's health bar show you could either add locust, hide the unit, remove locust and then unhide it or I saw the other day that according to Shadow Flux you can simply set the selection size to -1 instead.
 
Level 12
Joined
May 22, 2015
Messages
1,051
Could you make it neutral, add the item/unit, and then switch it back to the original owner?

I might be using this sort of thing in the future, and I think needing multiple units per building will be annoying lol.
 
Level 12
Joined
Nov 3, 2013
Messages
989
Could you make it neutral, add the item/unit, and then switch it back to the original owner?

No reason to make it a neutral owner to begin with in that case.
Use select hero/unit for neutral, shop sharing to limit purchases to the owner's allies, and if you want specific players to have their own specific conditions; make dummy units appropriately (Technically you could change remove/add units/items sold when a player selects the building but then you would need to know that another player wouldn't also select it while the previous person still has it selected.).
 
Status
Not open for further replies.
Top