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

Building with two pages.

Level 8
Joined
May 13, 2007
Messages
392
TWO PAGES IN ITEM SHOP

This is a tutorial to create a building that has two pages for spells,items etc.This is for someone that doesnt know the Jass codes.

---------------------------------------------------------------------

IMPORTANT :

This tutorial will get updated any time that I get to find better ways to make the same thing with less triggers, variables, time and with less leaks.

Two Pages in a Shop :

1) First of all, create 2 shops, with the same model, same name, scale, color and other. Must be the same building. The editor name though must be different. For example :

Game Name \ Editor Name |
Shop \ Shop[1]
Shop \ Shop[2]

Each shop of course must have different items.

NOTE : Both of the shops must have at least 1 free slot, to put the Next/Previeous Page button.

2) Create two items. The first must be Next Page and the second Previeous Page. Both items must have the ability of the normal tomes, just that they dont give any bonuses.
Now create a dummy or a variable that when you change the page, the dummy or the variable will be placed on the previews building.

Now create triggers that look like these :

  • Trigger 1
  • Events
    • Unit - A unit [COLOR="Blue"]sells an item (from shop)[/COLOR]
  • Conditions
    • Item Comparison - Sold item equal to (Next Page)
  • Actions
    • Unit - Create 1 (Dummy) at position of (Shop[1])
    • Unit - Remove (Shop[1]) from the game
    • Wait - Wait 0.10 seconds
    • Unit - Create 1 (Shop[2]) at position of (Dummy)
    • Wait - Wait 0.50 second(s)
    • Selection - Select (Shop[2]) for Owner of (Buying unit)
Make the same thing for the Previeous Page shop. Though this time where there is Shop[1] use Shop[2] and where there is Shop[2] use Shop[1].
Use the same trigger for buildings that have abilities instead of items.

IMPORTANT :

This triggers wont work if the building is being built by a unit and is not preput ingame. This trigger may have few leaks like:
-when changing page, it MIGHT create in another place (near the dummy) another building, instead of replacing the initial one.

--------------------------------------------------------------------------
For Built Objects (Coming Soon)

This tutorial is under construction, I need a bit of time to work it out.


Thank you for reading my Tutorial.
 
Last edited:
Level 8
Joined
May 13, 2007
Messages
392
Hmmm ... i didnt think of that ... Initially i tried to set both buildings in the same spot, one to cover the other, and when changing page, it will change only for the selected hero cus it would work like this :

  • Trigger Test
  • Events - (Basically the trigger in my tutorial)
  • Conditions -
  • Actions -
    • Selection - Select (the shop based on the next,previeous page item) for owner of buying unit
 
Level 21
Joined
Jan 5, 2005
Messages
3,515
i know there are a few different ways of doing this based on an idea similar to yours..i dont know which one i would do tho. check examples on other maps/sources to see how other people have done it. perhaps you might be able to combine the ideas to make an even better solution.
 
Level 21
Joined
Jan 5, 2005
Messages
3,515
Why remove it at all?

Just make them upgrade to each other.

this causes 2 problems. firstly, as already metioned, if two hero try to buy at the same time, the shop will be locked to the page it was switched to for both players. secondly, there will be a short delay between the upgrade which isnt necessary. purplepoots method will work and it is the most effective, it was one of the things i was thinking about when i said there were a few ways.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,259
This tutorial is not very good.
Firstly the method is very buggy is un needed delay, secondly it leaks and thirdly it does nto support 2 players.

The best methood for a 2 page system is like stated allready, just have 2 units and one for each page and switch betwene them. by forcing sellection, but anyway this is so easy and not even jass is needed so do we really need a tutorial for this, you will need to improve this A LOT if you want it to be worth excepting.
 
Last edited:
Top