I want to create an item-combining system like it was in the wc3 battleships map - so you need e.g. two standart cannons to buy a ultra cannon - as long as you dont have these two standart cannons the buy-button of the ultra cannon is greyed out, but visible.
In my map there is a shop system with neutral shops with a "shop interact"- ability (share control for heroic units within 3 range). Weapons in the inventory are giving behaviours to the carrier - so it might be possible to count this behaviours in a requirement?
I tried to use a requirement in the shop train ability, but the problem is, that it counts the behaviours on the shop, not on the unit that wants to buy.
This has long been a problem with SC2 neutral shops, that requirements don't work like you would think. There are tutorials for workarounds if you search. Basically what people do is make an invisible shop for each player, and when they click the neutral shop triggers redirect their selection to the invisible shop. Since the invisible shop belongs to them, requirements work correctly.
Secondly, you no longer need to check for behaviors to see if a unit is carrying an item. Patch 1.5 added a validator that checks for an item in the unit's inventory, and even before patch 1.5 it was possible to check for items using requirements by doing: CountUnit(Item,CompleteOnlyAtUnit).
Another option is to use triggers the whole way, but this is not preferable. In order to be certain that a purchase is cancelled when someone attempts it without proper requirements, a small creation time needs to be added to the item, so that it takes 1 second for the shop to produce it. During this 1 second triggers can cancel the purchase if requirements aren't met. But it's annoying. I'd go the invisible shop way if this is going to be a major part of your map.
Your information is a bit outdated. You can make inventory systems entirely without triggers now. See above link. :)
@Freddy2287: Go
The above link should help you some. You wont be able to use requirements for your item because, like you said, it detects the shop, not the player triggering the buy. The only downside to this is you cant gray out the button. However, using validators, you can spew out a custom error message if the triggering player doesnt have the correct amount of items.
Could he not give the shop buffs that have Ennumerate Area validators that searches for the items in the inventory container (via hidden required) that the requirements then use to grey out the button?
Rollback Post to RevisionRollBack
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
Enumerate area counts how many units are in the area that meet certain further validation. The solution I suggested would not be good for multiple units holding items for the formula but it could detect if all the compnents are nearby. This would then activate a buff on the shop that the requirement counts and then adjusts the button usability.
Rollback Post to RevisionRollBack
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
Because the way with validators did not work the way I want it (or i didnt figure out how to make it the way I want it :) ) I've decided to switch to a recipe/blueprint based system.
I created an "ability-item" that is linked to an "effect-instant" ability - you have to buy this blueprint-item as a normal item in a shop, then you can activate it by clicking it in the inventory - I want to use the ability for a trigger that does the actual combining action.
Now something i dont understand happens - when I buy the item in the shop, the trigger seams to run (I use the "any unit" uses "ability" at "generic 3- execute"), but when I click the item it does not... any ideas what I've done wrong or what I should do to fix the problem?
Hey there,
I want to create an item-combining system like it was in the wc3 battleships map - so you need e.g. two standart cannons to buy a ultra cannon - as long as you dont have these two standart cannons the buy-button of the ultra cannon is greyed out, but visible.
In my map there is a shop system with neutral shops with a "shop interact"- ability (share control for heroic units within 3 range). Weapons in the inventory are giving behaviours to the carrier - so it might be possible to count this behaviours in a requirement?
I tried to use a requirement in the shop train ability, but the problem is, that it counts the behaviours on the shop, not on the unit that wants to buy.
Does somebody has a solution for this problem?
@Freddy2287: Go
This has long been a problem with SC2 neutral shops, that requirements don't work like you would think. There are tutorials for workarounds if you search. Basically what people do is make an invisible shop for each player, and when they click the neutral shop triggers redirect their selection to the invisible shop. Since the invisible shop belongs to them, requirements work correctly.
Secondly, you no longer need to check for behaviors to see if a unit is carrying an item. Patch 1.5 added a validator that checks for an item in the unit's inventory, and even before patch 1.5 it was possible to check for items using requirements by doing: CountUnit(Item,CompleteOnlyAtUnit).
Another option is to use triggers the whole way, but this is not preferable. In order to be certain that a purchase is cancelled when someone attempts it without proper requirements, a small creation time needs to be added to the item, so that it takes 1 second for the shop to produce it. During this 1 second triggers can cancel the purchase if requirements aren't met. But it's annoying. I'd go the invisible shop way if this is going to be a major part of your map.
Try this tutorial, it allows for validation.
http://www.sc2mapster.com/forums/resources/tutorials/40918-triggerless-items-shops-new-method-unique-items-full/#p1
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg
@TrenchaunT: Go
Your information is a bit outdated. You can make inventory systems entirely without triggers now. See above link. :)
@Freddy2287: Go The above link should help you some. You wont be able to use requirements for your item because, like you said, it detects the shop, not the player triggering the buy. The only downside to this is you cant gray out the button. However, using validators, you can spew out a custom error message if the triggering player doesnt have the correct amount of items.
Could he not give the shop buffs that have Ennumerate Area validators that searches for the items in the inventory container (via hidden required) that the requirements then use to grey out the button?
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg
okay thats stuff to work with -> I'll try when I have time. Thanks so far.
So I think for my normal items I can use the good old train ability!?
But for combining items I need this method with the item in inventory validator!?
@DrSuperEvil: What do you exactly mean? I didnt use validators that much until now. ^^
Enumerate area counts how many units are in the area that meet certain further validation. The solution I suggested would not be good for multiple units holding items for the formula but it could detect if all the compnents are nearby. This would then activate a buff on the shop that the requirement counts and then adjusts the button usability.
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg
Hm yeah thats a problem - the shops should be usable by up to 4 players simutaniously...
Because the way with validators did not work the way I want it (or i didnt figure out how to make it the way I want it :) ) I've decided to switch to a recipe/blueprint based system.
I created an "ability-item" that is linked to an "effect-instant" ability - you have to buy this blueprint-item as a normal item in a shop, then you can activate it by clicking it in the inventory - I want to use the ability for a trigger that does the actual combining action.
Now something i dont understand happens - when I buy the item in the shop, the trigger seams to run (I use the "any unit" uses "ability" at "generic 3- execute"), but when I click the item it does not... any ideas what I've done wrong or what I should do to fix the problem?
Want me to move this to the triggers forum?
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg
if its helpful... please do so ;)
No ideas? What is the best way to make a trigger work when you click an item in your inventory? Is an ability-item the wrong way?
okay I figured out what to do. If somebody is interested:
I used a "any unit uses any item" trigger with condition "unit type of triggering inventory item is..."