Shop Demo

Questions about how to create your own dungeons and replacement graphics and sounds.

Moderator: George Gilbert

Forum rules
Please read the Forum rules and policies before posting. You may Image to help finance the hosting costs of this forum.
Post Reply
User avatar
Sophia
Concise and Honest
Posts: 4307
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Shop Demo

Post by Sophia »

Here is an RTC 0.37 shop, with the ability to sell multiple copies of an item, accept different currency, as well as give change.

I wouldn't recommend borrowing any of these mechanics, with 0.38 and its vastly improved counter mechanisms just around the corner, but it remains an interesting demonstration of what is already possible... :)

(I had actually made this long before any of that was even announced!)

http://www.ojnk.net/dm/shop_demo.txt
User avatar
TheMormegil
Adept
Posts: 213
Joined: Thu Apr 10, 2003 10:23 am
Location: Wales

Post by TheMormegil »

RTC Madskillz!! :shock:
User avatar
Gambit37
Should eat more pies
Posts: 13773
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Post by Gambit37 »

Yeah, looks good. Bit 'smooshy' though (performance takes a hit when claculating change and the mouse shudders to keep up if you're moving it about).

I checked out the mechanics in the editor and have no clue what's going on :shock:
User avatar
Sophia
Concise and Honest
Posts: 4307
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Post by Sophia »

Gambit37 wrote:I checked out the mechanics in the editor and have no clue what's going on
The absurd amount of things going on in this dungeon in order to simulate reading from a counter are the cause of the slowness. ;)

Basically:

Three counters keep track of the amount of coins put in. One is there to be able to reset the counter, one is there to vend an item when the correct amount is reached, and the third one is set to the price+1 in order to give change.

Change is given the same way, with a 5-count to give silver coins for change, and then an iterative counter reset (by means of a fireball launcher) to give any copper coins for change amounts < 5.

To keep the mechanisms generic, the shop originally sells you a generic "VENDED_ITEM" item which is then globally swapped for what you actually wanted to buy. This is the reason the chest pops up momentarily. It's to work around a mechanics issue, but it actually looks cool. :)
Post Reply