• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

My shop system isn't working, please help a brotha

Status
Not open for further replies.
Level 4
Joined
Nov 22, 2011
Messages
73
So here's my shop system that I made for my moba map. It has a main shop unit with abilities that if cast will spawn dummy shop units which are selected. So far I have 2 categories which mean two different abilites and two different dummy units as shops. But what happens is that the only one I can get to work is "Common Items". "Rare Items" has yet to spawn and I checked that it was selling the correct items. The shop is also never removed as I am trying to do in the trigger.
  • ShopNavigation
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Common Items
        • Then - Actions
          • Unit - Remove ShopCurrent[1] from the game
          • Unit - Create 1 Common Items for (Owner of (Casting unit)) at (Position of (Casting unit)) facing Default building facing degrees
          • Selection - Select (Last created unit) for (Owner of (Casting unit))
          • Set ShopCurrent[1] = (Last created unit)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Rare Items
        • Then - Actions
          • Unit - Remove ShopCurrent[1] from the game
          • Unit - Create 1 Rare Items for (Owner of (Casting unit)) at (Position of (Casting unit)) facing Default building facing degrees
          • Selection - Select (Last created unit) for (Owner of (Casting unit))
          • Set ShopCurrent[1] = (Last created unit)
        • Else - Actions
I can upload the map if necessary. Thanks in advance for any help. Cheers!
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
Except for location leaks and redundant Get functions, I can't see any problem in this trigger.

Make sure that your shops sell the proper items and stuff.
And make sure that the shop its properly selected.


What you could do as well is use a spellbook and add abilities based of "Charge Gold and Lumber" and if such an ability is cast, you check if the unit has a free slot and give the item.
That way, you have navigation with esc and stuff and you never have problems with creating and removing units.
 
Level 4
Joined
Nov 22, 2011
Messages
73
Except for location leaks and redundant Get functions, I can't see any problem in this trigger.

Make sure that your shops sell the proper items and stuff.
And make sure that the shop its properly selected.


What you could do as well is use a spellbook and add abilities based of "Charge Gold and Lumber" and if such an ability is cast, you check if the unit has a free slot and give the item.
That way, you have navigation with esc and stuff and you never have problems with creating and removing units.
Is there any good finished shop system in gui?
 
Status
Not open for further replies.
Top