The editor is either mocking me or I'm doing something horribly wrong. Can anyone confirm that the game completely disregards the alliance Target Filters for Interact abilities?
See, I have this Interact ability to which I set the Target Filters to "Ally", yet everyone (including enemies) still gets to interact with the unit. I tried to think of solutions but all are rather clunky and the one I tried didn't work.
Ok, so let me be more specific since my original post didn't garner much response.
How would you make a player-controlled shop for your heroes to use? Since it is built by the player then enemies shouldn't be allowed to purchase items off it, but testing suggests that it is impossible at the moment to do it like that because the Interact ability lets everyone use it.
One solution, and likely the one you've already thought of and labeled 'clunky', is triggers. Trigger handlers for all interaction, with switching cases and if-then's galore. I respect that; data solutions are always more elegant.
A data solution would then have to be custom validators or requirements, I would think, attached to your shop's button displays. Caveat: I've never tried this, so it's all hand-waving at this point.
By the way, guys, I did manage to find a workaround for this. It's very complex but it somewhat gets the job done. It uses an "elegant" mixture of data and triggers but it works.
Yes, yes, don't worry. It'll be there when I upload the map since it isn't very "presentable" for now. Let's see if I manage to explain it:
Aim: I have a Barracks shop which "sells" marines to allied players.
1. Shops, including the barracks, have an Ability "Start Shopping" that is autocast on allied targets.
2. The player's hero has an ability "Barracks - Purchase Marine" but it isn't on the command card.
3. When the Barracks casts its ability on the hero, the hero gets a behaviour, "Barracks Shopper". This behaviour has its Validator (Remove) set to a validator that checks whether the source shop gets too far away so it is removed automatically when the hero gets too far.
4. Now, there is a trigger that watches for these Shopper behaviours on the heroes. When it notices that Barracks Shopper was applied, because it actually changes a hidden attribute on the hero, it shows the Barracks Shop UI for the player.
5. Say, the player wants a marine so he clicks the respective button which has the hero cast its Purchase Marine ability meaning that the spawning marine is owned by the hero's player.
That's mostly it in a few sentences but there's a bit more automatic stuff going on. When the map is ready it'll be all there for you guys to see but I do think that Blizzard will have fixed the Interact ability by the time we get there, anyway.
I recently realized that autocast validators doesn't work either, so we need to use "validators" field instead.
Also, there was something strange with the ability itself. Somehow it affects other abilities even after being triggerly disabled. I have a simple effect-instant->apply behavior to caster->behavior chain, and it refused to work when the interact ability is present, even if it's disabled. I've managed to fix this, but I don't know how, and I'm not sure it won't be buggged again ;/
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
The editor is either mocking me or I'm doing something horribly wrong. Can anyone confirm that the game completely disregards the alliance Target Filters for Interact abilities?
See, I have this Interact ability to which I set the Target Filters to "Ally", yet everyone (including enemies) still gets to interact with the unit. I tried to think of solutions but all are rather clunky and the one I tried didn't work.
Ok, so let me be more specific since my original post didn't garner much response.
How would you make a player-controlled shop for your heroes to use? Since it is built by the player then enemies shouldn't be allowed to purchase items off it, but testing suggests that it is impossible at the moment to do it like that because the Interact ability lets everyone use it.
If the building you are giving the ability to is neutral who is it's enemy?
@adovid: Go
It's not neutral. It's a building on the same team as the player.
One solution, and likely the one you've already thought of and labeled 'clunky', is triggers. Trigger handlers for all interaction, with switching cases and if-then's galore. I respect that; data solutions are always more elegant. A data solution would then have to be custom validators or requirements, I would think, attached to your shop's button displays. Caveat: I've never tried this, so it's all hand-waving at this point.
By the way, guys, I did manage to find a workaround for this. It's very complex but it somewhat gets the job done. It uses an "elegant" mixture of data and triggers but it works.
it would help the community if you would share your "fix" :)
Yes, yes, don't worry. It'll be there when I upload the map since it isn't very "presentable" for now. Let's see if I manage to explain it:
Aim: I have a Barracks shop which "sells" marines to allied players.
1. Shops, including the barracks, have an Ability "Start Shopping" that is autocast on allied targets.
2. The player's hero has an ability "Barracks - Purchase Marine" but it isn't on the command card.
3. When the Barracks casts its ability on the hero, the hero gets a behaviour, "Barracks Shopper". This behaviour has its Validator (Remove) set to a validator that checks whether the source shop gets too far away so it is removed automatically when the hero gets too far.
4. Now, there is a trigger that watches for these Shopper behaviours on the heroes. When it notices that Barracks Shopper was applied, because it actually changes a hidden attribute on the hero, it shows the Barracks Shop UI for the player.
5. Say, the player wants a marine so he clicks the respective button which has the hero cast its Purchase Marine ability meaning that the spawning marine is owned by the hero's player.
That's mostly it in a few sentences but there's a bit more automatic stuff going on. When the map is ready it'll be all there for you guys to see but I do think that Blizzard will have fixed the Interact ability by the time we get there, anyway.
I recently realized that autocast validators doesn't work either, so we need to use "validators" field instead.
Also, there was something strange with the ability itself. Somehow it affects other abilities even after being triggerly disabled. I have a simple effect-instant->apply behavior to caster->behavior chain, and it refused to work when the interact ability is present, even if it's disabled. I've managed to fix this, but I don't know how, and I'm not sure it won't be buggged again ;/