Shopmenus?

BrokenX

New Member
Reaction score
26
Hehe, i got this idea, yes, again. What if i made a dialog, so when a hero types -shopmenu, it makes a dialog with items they can buy telling them the price beside it? Would that be cool you think? Sort of like Counter-strike in those warcraft3 mods.
 

SilverHawk

General Iroh - Dragon of the West
Reaction score
89
Personally, I think it depends on what you're playing. In some maps it would be awesome, but in my map, for instance, it would be unfair for a player to buy items anywhere but at a shop. I think it would be especially good in DOTA-type games. Great idea! :)
 

BrokenX

New Member
Reaction score
26
Well i am making an AoS, that is where I thought i would use it ;). So yes :/ it is sort of cool, cause you can buy items without having to go back. Non-stop killing lol.
 
H

Hell-Pleaque

Guest
I think that having to go back in town to shop just balances the game a little, so this way when a hero is really alot stronger than the others, while he shops it gives the others time to kill and get some gold. But it's a good idea still, even though you'd need a huge dialog O_O
 

BrokenX

New Member
Reaction score
26
Theres nothing huger then the dialog i already have made, so they can choose from 18 heroes at the start. Its about, page and a half long of trigger, just to show the dialog.


Having some difficulty making the buttons show, I created two buttons to test it, but they don't show for some reason?
 

Rinpun

Ex TH Member
Reaction score
105
You've got to have a dialog variable. You've got to chain in the dialog button variables with the dialog, and then you have to show the dialog.

It's not too hard to do actually. With the power of strings you can simplify your whole dialog box if you have a whole bunch of string/integer variables set several seconds into the game.
 

Rinpun

Ex TH Member
Reaction score
105
As a matter-of-fact, this should/will work. It's tedious I know, but it will be cool in the game.

In case you're wondering why TheShoppe has that interesting condition, it's because you can activate this even before you choose your avatar, and most likely the game will crash or get confused when you tell it to create an item and give it to nobody. So, the menu won't activate until your dude is chosen.

Also, I was lazy on the events here. TheShoppe needs every player who has a hero to have it as an event. I only set it to player red because I didn't feel like adding in all the other 9 to 11 players.

I also noticed I left out an exit button. I may add one to these triggers in the future, but it is quite simple what you have to do. State one as exit and put it on every menu. Then, if it doesn't quit the menu already when you press the button (nothing's going to happen in ShoppeButtonClick), you can tell it to hide ShopMenus[0] through all the other ShopMenus.

ShopMenus -- Dialog Array for how many different pages of menu you want.
MenuButtons -- Dialog Button Array for the number of buttons on all of your menus totaled up.
Hero -- Unit Array for the number of players. He's the dude who will receive this crud, so set him as your chosen avatar.

Code:
TheShoppe
    Events
        Player - Player 1 (Red) types a chat message containing -shopmenu as An exact match
    Conditions
        Hero[(Player number of (Triggering player))] Not equal to No unit
    Actions
        Dialog - Clear ShopMenus[0]
        Dialog - Change the title of ShopMenus[0] to Basic Equipment
        Dialog - Create a dialog button for ShopMenus[0] labelled Basic Sword -- 300 Gold
        Set MenuButtons[0] = (Last created dialog Button)
        Dialog - Create a dialog button for ShopMenus[0] labelled Basic Bow -- 300 Gold
        Set MenuButtons[1] = (Last created dialog Button)
        Dialog - Create a dialog button for ShopMenus[0] labelled Basic Staff -- 300 Gold
        Set MenuButtons[2] = (Last created dialog Button)
        Dialog - Create a dialog button for ShopMenus[0] labelled Basic Armor -- 500 Gold
        Set MenuButtons[3] = (Last created dialog Button)
        Dialog - Create a dialog button for ShopMenus[0] labelled Advanced Equipment
        Set MenuButtons[4] = (Last created dialog Button)
        Dialog - Show ShopMenus[0] for (Triggering player)

ShoppeButtonClick
    Events
        Dialog - A dialog button is clicked for ShopMenus[0]
        Dialog - A dialog button is clicked for ShopMenus[1]
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Clicked dialog button) Equal to MenuButtons[0]
                ((Triggering player) Current gold) Greater than or equal to 300
            Then - Actions
                Hero - Create Basic Sword and give it to Hero[(Player number of (Triggering player))]
                Player - Add -300 to (Triggering player) Current gold
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Clicked dialog button) Equal to MenuButtons[1]
                ((Triggering player) Current gold) Greater than or equal to 300
            Then - Actions
                Hero - Create Basic Bow and give it to Hero[(Player number of (Triggering player))]
                Player - Add -300 to (Triggering player) Current gold
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Clicked dialog button) Equal to MenuButtons[2]
                ((Triggering player) Current gold) Greater than or equal to 300
            Then - Actions
                Hero - Create Basic Staff and give it to Hero[(Player number of (Triggering player))]
                Player - Add -300 to (Triggering player) Current gold
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Clicked dialog button) Equal to MenuButtons[3]
                ((Triggering player) Current gold) Greater than or equal to 500
            Then - Actions
                Hero - Create Basic Armor and give it to Hero[(Player number of (Triggering player))]
                Player - Add -500 to (Triggering player) Current gold
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Clicked dialog button) Equal to MenuButtons[4]
            Then - Actions
                Dialog - Clear ShopMenus[1]
                Dialog - Change the title of ShopMenus[1] to Advanced Equipment
                Dialog - Create a dialog button for ShopMenus[1] labelled Advanced Sword -- 750 Gold
                Set MenuButtons[5] = (Last created dialog Button)
                Dialog - Create a dialog button for ShopMenus[1] labelled Advanced Bow -- 750 Gold
                Set MenuButtons[6] = (Last created dialog Button)
                Dialog - Create a dialog button for ShopMenus[1] labelled Advanced Staff -- 750 Gold
                Set MenuButtons[7] = (Last created dialog Button)
                Dialog - Create a dialog button for ShopMenus[1] labelled Advanced Armor -- 1000 Gold
                Set MenuButtons[8] = (Last created dialog Button)
                Dialog - Create a dialog button for ShopMenus[1] labelled Basic Equipment
                Set MenuButtons[9] = (Last created dialog Button)
                Dialog - Show ShopMenus[1] for (Triggering player)
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Clicked dialog button) Equal to MenuButtons[5]
                ((Triggering player) Current gold) Greater than or equal to 750
            Then - Actions
                Hero - Create Advanced Sword and give it to Hero[(Player number of (Triggering player))]
                Player - Add -750 to (Triggering player) Current gold
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Clicked dialog button) Equal to MenuButtons[6]
                ((Triggering player) Current gold) Greater than or equal to 750
            Then - Actions
                Hero - Create Advanced Bow and give it to Hero[(Player number of (Triggering player))]
                Player - Add -750 to (Triggering player) Current gold
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Clicked dialog button) Equal to MenuButtons[7]
                ((Triggering player) Current gold) Greater than or equal to 750
            Then - Actions
                Hero - Create Advanced Staff and give it to Hero[(Player number of (Triggering player))]
                Player - Add -750 to (Triggering player) Current gold
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Clicked dialog button) Equal to MenuButtons[8]
                ((Triggering player) Current gold) Greater than or equal to 1000
            Then - Actions
                Hero - Create Advanced Armor and give it to Hero[(Player number of (Triggering player))]
                Player - Add -1000 to (Triggering player) Current gold
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Clicked dialog button) Equal to MenuButtons[9]
            Then - Actions
                Trigger - Run TheShoppe <gen> (ignoring conditions)
            Else - Actions
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top