Restocking shops in play

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.
Post Reply
User avatar
PaulH
Ghastly gastropod
Posts: 3763
Joined: Wed Aug 07, 2002 10:27 pm
Location: Level 6

Restocking shops in play

Post by PaulH »

I don't quite fully understand the mechanics of the shop system in RTC - it is what it is - but is there anyway of adding numbers to the shop inventory via a trigger? For example, the keeper gets stock after a certain point in the game, or after an item is used.
User avatar
Saumun
High Lord
Posts: 2238
Joined: Fri Feb 20, 2009 3:03 am
Location: The Ether

Re: Restocking shops in play

Post by Saumun »

Depends on exactly how you want it to work.
You could add a new shop stock object with the same item, but keep it invisible. Then activate the new stock and deactivate the old one to make the old one invisible.
This is definitely doable because I activated and deactivated shop stock in part 2 of The Trail (though I wasn’t adding extra stock... I was switching what was available between weapons/armour/food/misc using wall buttons, but it’s the same principle).

A more elegant solution would be to add directly to the amount of an existing stock, but I don’t know if it can be done.
I haven’t tried this, but can the shop stock number be replaced by an object reference number?
That way you could create a unique counter and use it’s ref number instead of an integer in the shop stock, then add and subtract to the counter via an action object as you please.

I’m not at my computer and can’t check if this can be done at the moment. To be honest, I doubt it (I think the input field is only 2 or 3 characters) but might be worth a look.
“Grynix Ernum Quey Ki Skebow Rednim U Os Dey Wefna Enocarn Aquantana” - Anon
User avatar
Saumun
High Lord
Posts: 2238
Joined: Fri Feb 20, 2009 3:03 am
Location: The Ether

Re: Restocking shops in play

Post by Saumun »

Forget that last part.
I just tried it, and it has to be an integer.

So at the moment, the only method I can think of is to create multiple SHOP_STOCK objects of the same item with a set number, then activate and deactivate as required.
I can’t see a way of tracking the amount of any stock except for within the SHOP_STOCK object itself.
“Grynix Ernum Quey Ki Skebow Rednim U Os Dey Wefna Enocarn Aquantana” - Anon
User avatar
PaulH
Ghastly gastropod
Posts: 3763
Joined: Wed Aug 07, 2002 10:27 pm
Location: Level 6

Re: Restocking shops in play

Post by PaulH »

Thanks for the reply. Basically I wanted a fail safe mechanism so a shop couldn't run out of an item, without having to give it a very large number of items. The reason was that you had to buy an item to solve a puzzle, but the item could be used elsewhere potentially dead ending the game. My initial thoughts were to have the action of the object activate a relay that would add in stock. Money creation is possible, but painful!

However, your suggestions are most helpful and I think I can com u with something :-)
User avatar
Saumun
High Lord
Posts: 2238
Joined: Fri Feb 20, 2009 3:03 am
Location: The Ether

Re: Restocking shops in play

Post by Saumun »

Aah, I’ve misunderstood.
Set the number in the shop stock item to -1 and it will never run out.
“Grynix Ernum Quey Ki Skebow Rednim U Os Dey Wefna Enocarn Aquantana” - Anon
User avatar
PaulH
Ghastly gastropod
Posts: 3763
Joined: Wed Aug 07, 2002 10:27 pm
Location: Level 6

Re: Restocking shops in play

Post by PaulH »

You've definitely understood :). I didn't want to overstock the shop in order to stop the player carrying too many of the object and unbalancing the game - basically the (simple) puzzle is as follows:

You are in a mine and you need to clear some boulders with dynamite. You find a small supply, but you can use them as a time delay bomb on monsters too. The shop sells them - I just wanted the shop to refresh with stock as you use them so the shop or either yourself always has one.

But I can make other modifications to the game try and prevent them being completely exhausted.

PS I've just started The Trail after last playing it a few years ago, very impressive so far!
User avatar
Saumun
High Lord
Posts: 2238
Joined: Fri Feb 20, 2009 3:03 am
Location: The Ether

Re: Restocking shops in play

Post by Saumun »

I see what you’re saying.
I suppose you could create many shop stock objects of the dynamite with the same amount, but have them invisible.
If your dynamite targets a specific counter in the ‘break’ tab or upon expiry, you could track how many have been used.
Then with a trigger near the shop, you could have it activate a relay that looks at the counter with a ‘LESS THAN’ condition, then deactivate the old stock and activate a new one.

The only problem with that is you’d have to target specific shop stocks, so you’d probably need multiple triggers near the shop that become active/deactivated as necessary.

It’s messy, but I’m sure I could be made to work.

Finally, thank you for your kind words about The Trail. I’m pretty sure 99% of any bugs have been ironed out now.
Not easy until a few people have played. I am aware of one in Part 2 that I’m not sure how to get around, but is not a game breaker.
“Grynix Ernum Quey Ki Skebow Rednim U Os Dey Wefna Enocarn Aquantana” - Anon
User avatar
PaulH
Ghastly gastropod
Posts: 3763
Joined: Wed Aug 07, 2002 10:27 pm
Location: Level 6

Re: Restocking shops in play

Post by PaulH »

Yeah, I keep getting the occasional bug or dead end in my work - when you have multiple triggers and relays, and the resulting possibilities, you literally have to think of every outcome! I'm finding it fun and challenging - but it is taking longer than I envisaged. I'm certainly enjoying conjuring up spell effects and monster AI/attacks!
User avatar
Saumun
High Lord
Posts: 2238
Joined: Fri Feb 20, 2009 3:03 am
Location: The Ether

Re: Restocking shops in play

Post by Saumun »

Fun and challenging. I'd definitely agree with that.
I love RTC, but it can take a lot of hackery to get what you want. DSB is better, but unfortunately I have no coding skills (I have put out two DSB dungeons... but the first was completed almost entirely with ESB, and for the second I had to ask for Sophia's help almost every step of the way).
That said, I do get a rush of satisfaction when I manage to hack around an RTC limitation, so there IS that.

I thought The Trail would be my last due to lack of interest, but the creation bug still plagues me. I have a dungeon on the go at the moment, but it's something I'm doing on the fly, and when the mood takes me. No grand plan, but a few new spells I'm trying to incorporate.

Though I have no idea of the scale of your dungeon, I would advise (and you may already be aware of this) to be careful not only of the amount of objects in it, but also the amount of custom content (when I created Underverse I ran out of objects with it 85% complete (this includes relays, actions, etc) and with The Trail: Part 2, I was forced to delete a lot of stuff to make it work because I had added so many custom graphics).
Unless it's absolutely huge, I'm sure it will be fine.

Shame Adamski isn't around. He seems to be able to make huge dungeons full of custom content in a single .RTC file. Must be very good at simplifying mechanics.
Chaos-Shaman did some very nice work concerning monster AI in RTC, but he's another that hasn't been around much.

Anyway... If there is anything I can help with, I'd be happy to. Similarly, if you nail a nice workaround for something, I'd be very interested to see it.
“Grynix Ernum Quey Ki Skebow Rednim U Os Dey Wefna Enocarn Aquantana” - Anon
User avatar
PaulH
Ghastly gastropod
Posts: 3763
Joined: Wed Aug 07, 2002 10:27 pm
Location: Level 6

Re: Restocking shops in play

Post by PaulH »

I have no coding skills either and felt that DSB wouldn't be the right platform for me, despite it being ultimately superior. But as you say, when you look at what Adamski achieved with RTC, then it is capable of producing some stunning results.

I'm keeping half an eye on the objects, and am trying to reduce the numbers of trigger/relays etc. This in itself is not a bad thing as it helps you produce clean and elegant solutions for the effect you are trying to achieve, and a less complicated array. Easier to find the culprit should you make an error!

It is a shame that George had to abandon RTC as I have nothing but praise for the effort he has put in. A v.50 with more objects would have been nice, and tidying up a few other areas. I just hope he gets to see Adamski's work at some point.

Thank you for the offer of help, much appreciated, and I'll certainly be in touch I imagine. And if I find something, I'll of course let you know :-)
User avatar
Chaos-Shaman
High Lord
Posts: 2642
Joined: Wed May 03, 2006 7:26 pm
Location: The Gates of Hell

Re: Restocking shops in play

Post by Chaos-Shaman »

Nothing like cracking a wishbone over this. GG would have an army of followers if he ever came back to have fun with his creation. To me it is the size limitation, just think of how much interesting programming that can be done if he'd increase all the size limitations, most of the problems do have a solution, and solutions take up size limitations. Wish, you got that right.
keep your gor coin handy
Post Reply