• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[General] Select Patron - Select Unit - Shop Mechanics

Status
Not open for further replies.

Remixer

Map Reviewer
Level 33
Joined
Feb 19, 2011
Messages
2,112
Hello, I'm currently trying to achieve following setup on a shop:
Desired situation:
1. Does not display "select unit" button in the unit interface (as it reduced purchasable item count by 1)
2. Can select patron by right-clicking units within the selection range.

Problems:
1. Hiding Select Unit button in the "Shop Share" (or other alternatives) disables the option to select patron via right-clicking.
2. Select Unit button cannot be hidden in any other way, not by setting button coordinates to (0, -11) or adding it into a spellbook.
3. Triggers do not not have option to "Select patron for unit", at least not GUI

Work-arounds (tried):
1. Make the "Shop Share" ability have two levels, one with shown button, one without and toggle them via triggers - does not work - button won't get hidden.
2. Removing and adding different variations of "Shop Share" does not work - the abilities get mixed up.

Question:
Is there any possible way to achieve the situation I mentioned? Apart from an ultimate work-around:

Ultimate Work-around:
Create a fake "Select Patron" ability that activates when player right-clicks on a unit. Then detect that unit's inventory and duplicate all items into an inventory of a dummy unit that is the actual patron of the shop. When purchases are made then detect the inventory of the dummy patron and duplicate the items in its inventory into the inventory of the actual unit being used. Ehhhh? Complicated? Yes?
 
Level 45
Joined
Feb 27, 2007
Messages
5,578
Selecting a unit to sell to is an order with an orderid (integer) but no orderstring. You should be able to figure out what it is by searching, or you can write a trigger to display the issued order with this action:

Custom script: call BJDebugMsg(I2S(GetIssuedOrderId()))

Then you just need to order the shop to do that order on the unit you want to select. GUI will not let you use the order ID so you'll need to use one of the JASS functions for orders. I believe IssueNeutralTargetOrder(), though it could also be IssueTargetOrderById().
 
Status
Not open for further replies.
Top