• 🏆 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!

[Solved] Custom items, shop & trigger

Status
Not open for further replies.
Level 4
Joined
Apr 12, 2011
Messages
12
Hi everyone,

I am working on map for my cousine as a birthday gift, he love rpg maps, so I decided to create one. I've made some new items (like Sword +1, Sword +2 etc.) and put them in custom shop with trigger. I also used some variables. Let me explain on, for example, Sword:

1. I made variable "A_Sword" which is Item-Type variable, and putted in this variable self-created item: Sword +1

2. I created trigger:
--- Event: "Map Initialization"
--- Action "Neutral Building - Add [A_Sword] to [my shop] with 1 in stock and a max stock of 1"

3. I wanted to change the item when hero gain 5 levels, so I've created trigger:
--- Event: "Hero gain new level"
--- Condition: Level = 5
--- Actions:
------ Neutral Building - Remove [A_Sword] from [my shop]
------ Set A_Sword = Sword +2
------ Neutral Building - Add [A_Sword] to [my shop] with 1 in stock and a max stock of 1"

OK, that works perfectly and items in shop changes when hero gain this level. But I cannot understand why items disappear when hero buy it? I've tried with max stock of 10, but it didn't help.

PS. I've got polish version of Warcraft, so I intentionally wrote the whole problem without screen becouse Trigger Editor is also in polish, and I bet you won't understand it :p
 
Level 26
Joined
Mar 19, 2008
Messages
3,140
Witam ziomka, gadaj jaki problem na pm'emie.
Widze ze nie chce Ci sie używać
  • tagów.
  • Ja wszystko transletuje na eng bo inaczej nie mogłbym pracować. Choć teraz i tak tylko w jassie siedze.
  • Guy, problem handled - since I'm from the same country as pandino it will be much easier to deal with issue. I gonna post solution (for further purposes) as soon as I fix this.
  • [b]EDIT:[/b]
  • The problem lies in Sell Items ability. It's default Market Square ability - and if you want to know mechanic thats it:
  • Market does not own any item when placed on map (it's pool is emty). Game rolls the random items and gives those it maket via functions. The 'Sell Items' ability causes the item to be buy-able only once (no matter how high the current stock number is) and removes item from building's pool afterwards. New item is rolled and added to maker to fill empty space.
  • Unlike the maker square, goblin shop does not have mentioned ability and has set whole item pool by default - thats why those items don't disappear after buying any.
  • One of solutions is to create multiple shops and combine these with action Unit - Replace Unit.
 
Last edited:
Level 26
Joined
Mar 19, 2008
Messages
3,140
I'm double posting only to ensure that question has been answered, so anyone who searches forum for such information will be informed and get the solution.

The problem lies in Sell Items ability. It's default Market Square ability - and if you want to know mechanic thats it:
Market does not own any item when placed on map (it's pool is emty). Game rolls the random items and gives those it maket via functions. The 'Sell Items' ability causes the item to be buy-able only once (no matter how high the current stock number is) and removes item from building's pool afterwards. New item is rolled and added to maker to fill empty space.

Unlike the maker square, goblin shop does not have mentioned ability and has set whole item pool by default - thats why those items don't disappear after buying any.

One of solutions is to create multiple shops and combine these with action Unit - Replace Unit.
 
Status
Not open for further replies.
Top