• 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.

Ordering a Shop to cast "Select Hero" ?

Status
Not open for further replies.

Sverkerman

Hosted Project: BoW
Level 17
Joined
Feb 28, 2010
Messages
1,325
Hey!

So I'm in quite a special situation. The ability "Select Hero" is enabled and my store has it, however I cannot have the button shown since I'm using all the space within the store for items to be bought. Therefore the user cannot use the spell within the store to select which hero should be doing the buying.

Now in my map you have several heroes and I've made an ability based on Channel to trigger who the stores should have selected to do the buying, so that the user can choose who should be doing the buying, but it doesn't work.

I'm currently using:
call IssueTargetOrderById(udg_Unit_TempCastingUnit, 'Aneu', udg_Unit_TempTargetedUnit)

But it wont work?

Anyone that has any idea as of how to trigger a store to use Select Hero on a specific target?
+rep to any advice! :)
 

Sverkerman

Hosted Project: BoW
Level 17
Joined
Feb 28, 2010
Messages
1,325
Just tried something, I used the events
Unit - A unit is issued an order targeting an object
Unit - A unit is issued an order targeting a point
Unit - A unit is issued an order with no target

and it returned "netutralinterract" when using Select Hero.
Is there any way to trigger a unit to use "neutralinterract" ?
 

Sverkerman

Hosted Project: BoW
Level 17
Joined
Feb 28, 2010
Messages
1,325
@Tasyen Hey and thank you for your reply! Is there any way to edit object data within JASS? Because then I would need to make the button visible --> do the code --> hide the button.
Is there any way to do this?

I took ur tip and am currently using
call IssueNeutralTargetOrderById(udg_Player_TempShopper, udg_TempUnitStoreSelect, 852566 , udg_Unit_TempUnitTarget)
within a loop. Just like you said it works when the button is shown.

EDIT: Perhaps there is a way to make the Select Hero button have a wierd button position that doesn't collide with other buttons?
 
Last edited:

Sverkerman

Hosted Project: BoW
Level 17
Joined
Feb 28, 2010
Messages
1,325
@MyPad Hi again :) I just tried your suggestion and the button is still shown. I appreciate the effort, perhaps there is another way? I heard something about Stacking Buttons which involves importing a .txt file, but I can't recall if they've removed it with the latest patch?
 

Sverkerman

Hosted Project: BoW
Level 17
Joined
Feb 28, 2010
Messages
1,325
Okay so an idea, what if the store has a spellbook hidden from all the players except Neutral Passive and the spellbook contains the Hero Selection?
The spellbook cannot be opened by trigger - cast ability but it can be opened by forcing Neutral Passive to press the hotkey for the spellbook, such as Q.
Now I just need to call IssueNeutralTargetOrderById(udg_Player_TempShopper, udg_Unit_TempUnitStoreSelect, 852566 , udg_Unit_TempUnitTarget) and that should be it right? I'll try once I'm free again and update you guys.
 
Level 13
Joined
May 10, 2009
Messages
868
I just tested it with a Goblin Merchant, and made sure the "Select Hero" had its field "Data - Show Select Unit Button" was set to "True". Then, I added another item to the shop (Claws of Attack), and the button was "gone" (Due to lack of available room for it). At last, I used this function
JASS:
call IssueNeutralTargetOrderById(Owner of Hero, TheShop, 852566 , HeroToBeSelected)
It worked as intended.

JASS:
//                               Player Red (me), pre-placed Goblin Merchant, Aneu Order, pre-placed Firelord
call IssueNeutralTargetOrderById(Player(0), gg_unit_ngme_0000, 852566 , gg_unit_Nfir_0001)

EDIT: Is there a particular reason for forcing the shop to select a hero? I mean, if you select it and right click a hero, it'll switch to that hero.
 
Last edited:

Sverkerman

Hosted Project: BoW
Level 17
Joined
Feb 28, 2010
Messages
1,325
@MyPad Thank you for actually stressing the matter and letting me know! :)
@BloodSoul "I added another item to the shop (Claws of Attack), and the button was "gone" - Expand further on this please, it sounds very interesting as it might solve my problem, did you have 11 items to sell in the shop, then Select Hero had button position X = 3 Y = 2 and then you added a item for the shop to sell (Claws of Attack) with button position X= 3 Y = 2 also? If so this is a wonderful workaround, please let me know! Also, when you say "if you select it and right click a hero, it'll switch to that hero" does this require the shop to be owned by the player doing the buying or can it also be an ally of him? If so this is also, a very good workaround.
@Tasyen Thank you for staying with me in search for a solution!

EDIT: So I managed to find a solution to my problem! The solution was built on the fact that when a store has the ability "Sell Items" your inventory will be shown while interracting with it without the store needing to sell any items. I removed the "dummy item" which was some lore about the shop, made the Select Hero button visible, added "Sell Items" as an ability to the store and I'll eventually trigger the lore about each store to be shown when interracting with them. Thanks everyone that replied to the thread and took interest in helping me to solve my problem. I've added +4 rep to each and every one of you - Thank you! :)
 
Last edited:
Level 13
Joined
May 10, 2009
Messages
868
did you have 11 items to sell in the shop
Yes, and I just added a Claws of Attack +15 (0,0), even though it replaced the Select Hero button. If you adjust its position to X:3 and Y:2, it also replaces the select hero button anyway.
Also, when you say "if you select it and right click a hero, it'll switch to that hero" does this require the shop to be owned by the player doing the buying or can it also be an ally of him? If so this is also, a very good workaround.
No, the shop belonged to the neutral passive player when I tested it.
 
Status
Not open for further replies.
Top