I have gotten team shops set up in my map that are owned by the AI, but there is a small issue with the shops that I really am trying to figure out.
I have set the purchase range of the shops to 3. If you are out of range, the buttons are greyed out and you can't click them. However, if an ally is within 3 range and you are not, you can click on those buttons and they are not greyed out. What I want to do is to make sure that even if an ally is using the shop and you are out of range, the buttons will be greyed out for the player out of range.
It checks for a buff a player applies just by being near it, so the nearest player will apply the buff and others won't need to, which is where it gets all weird. I don't think it uses "autocast-share-control" since it's a team shop owned by another player (the AI) that has been given shared control and spending of the player's resources. I am trying to figure out a way to make the buttons grey out for everyone out of the purchase range.
Ah, so the AI already has permanent shared control, meh. What I don't know with autocast-share-control is how to show greyed-out buttons in the "inactive" state, shop control would otherwise work like you want it to if set up properly.
The problem is you don't have an "other unit" scope in your enable/disable check. I think you can't check "buff caster in range" outside of the buff aplication chain either. If the original buff is applied by the player unit you can at least check the owning player within that chain, but the Requirement on the shop won't have access to that scope.
I don't know how "Count Behavior" requirement nodes act if you assign a non-"at Unit" condition, if you're lucky they might iterate over all player units. "Behavior Allowed" might also help depending on where it draws its scope from. I at least assume it checks the Requirement and Validator fields on the specified Behavior, but can it grab the scope of an existing instance of said buff?
I created an aura that the shop generates and gives a buff to any hero within 3 range. However, it seems that the requirements tab doesn't have a way to check if the clicking unit has the buff in order to make the buttons clickable in the shop. It appears that the "Count Behavior" will only check if the shop has the buff. I thought I was on the right track but now I am not sure how to proceed.
Put the aura on the hero, and add a check on the applied buff (which goes on the shop) for "Caster within range of target" (try to convert a LocationRange validator into a Requirement, and put that on the buff). Then try "Behavior Allowed: aura buff" as the button Requirement. Will probably fail horribly, but worth a try.
I would say have a trigger check the distance of the hero and the shop upon unit selection. If they aren't close enough, have an action that deselects the shop. Should work. I actually like to make most of my purchases in dialogs :D cuz I'm silly like that.
I don't want to use a dialog based shop. I was looking over the issue again. Is there a way to trigger it such that buttons in a shop are greyed out if a player clicks on the shop further than a certain distance:
For instance, if I am more than 3 range away and I click on the shop, the buttons will be grey until I move closer.
There certainly is if the player had their own shop. (disable ability for player and other tech related triggers). But with a shared shop you'd have to disable it for the owner of the shared shop which would prevent everyone from purchasing (including those close to the shop). That's why I suggested not allowing far away players to even select the shop.
That's perfectly viable with Data though, Interact ability or the like.
Some passive effects have display buttons visible to enemies, right? Try placing those underneath the active ones along with an Interact/Share Control setup, but if it works you could even import artificially greyscaled ones.
I have gotten team shops set up in my map that are owned by the AI, but there is a small issue with the shops that I really am trying to figure out.
I have set the purchase range of the shops to 3. If you are out of range, the buttons are greyed out and you can't click them. However, if an ally is within 3 range and you are not, you can click on those buttons and they are not greyed out. What I want to do is to make sure that even if an ally is using the shop and you are out of range, the buttons will be greyed out for the player out of range.
What's the best way to approach this?
How do the shops work? Still that ancient setup of "autocast-share-control"? (haven't looked into shops since WoL release era)
Buttons being greyed out means you have a Requirement/Validator on them, correct? What exactly does that check for?
It checks for a buff a player applies just by being near it, so the nearest player will apply the buff and others won't need to, which is where it gets all weird. I don't think it uses "autocast-share-control" since it's a team shop owned by another player (the AI) that has been given shared control and spending of the player's resources. I am trying to figure out a way to make the buttons grey out for everyone out of the purchase range.
Ah, so the AI already has permanent shared control, meh. What I don't know with autocast-share-control is how to show greyed-out buttons in the "inactive" state, shop control would otherwise work like you want it to if set up properly.
The problem is you don't have an "other unit" scope in your enable/disable check. I think you can't check "buff caster in range" outside of the buff aplication chain either. If the original buff is applied by the player unit you can at least check the owning player within that chain, but the Requirement on the shop won't have access to that scope.
I don't know how "Count Behavior" requirement nodes act if you assign a non-"at Unit" condition, if you're lucky they might iterate over all player units. "Behavior Allowed" might also help depending on where it draws its scope from. I at least assume it checks the Requirement and Validator fields on the specified Behavior, but can it grab the scope of an existing instance of said buff?
I created an aura that the shop generates and gives a buff to any hero within 3 range. However, it seems that the requirements tab doesn't have a way to check if the clicking unit has the buff in order to make the buttons clickable in the shop. It appears that the "Count Behavior" will only check if the shop has the buff. I thought I was on the right track but now I am not sure how to proceed.
Put the aura on the hero, and add a check on the applied buff (which goes on the shop) for "Caster within range of target" (try to convert a LocationRange validator into a Requirement, and put that on the buff). Then try "Behavior Allowed: aura buff" as the button Requirement. Will probably fail horribly, but worth a try.
Just do it with triggers, much easier to make sth like this, if the hero or the unit u want is near the shop change ownership of the shop.
I would say have a trigger check the distance of the hero and the shop upon unit selection. If they aren't close enough, have an action that deselects the shop. Should work. I actually like to make most of my purchases in dialogs :D cuz I'm silly like that.
there are good dialog based shops (already finished) out there. the data only has too many drawbacks
I don't want to use a dialog based shop. I was looking over the issue again. Is there a way to trigger it such that buttons in a shop are greyed out if a player clicks on the shop further than a certain distance:
For instance, if I am more than 3 range away and I click on the shop, the buttons will be grey until I move closer.
@Stormahawk: Go
There certainly is if the player had their own shop. (disable ability for player and other tech related triggers). But with a shared shop you'd have to disable it for the owner of the shared shop which would prevent everyone from purchasing (including those close to the shop). That's why I suggested not allowing far away players to even select the shop.
@MaskedImposter: Go
That's perfectly viable with Data though, Interact ability or the like.
Some passive effects have display buttons visible to enemies, right? Try placing those underneath the active ones along with an Interact/Share Control setup, but if it works you could even import artificially greyscaled ones.
Alternatively if players only have one unit, you could not share vision.