Author Topic: [XP] Drago Limited Shop  (Read 6066 times)

Offline LiTTleDRAgo

  • Astral Trancist
  • *****
  • Posts: 841
  • LV: 514
  • Gender: Male
    • View Profile
    • ~
[XP] Drago Limited Shop
« on: March 17, 2013, 04:25:43 PM »
Limited Shop
Authors: LiTTleDRAgo
Version: 1.00
Type: Custom Shop System
Key Term: Custom Shop System

Introduction

In this shop, you can only buy items at limited amount before it is sold out
If you want to buy the same item, you must visit another store

Features

  • The Introduction says it all

Screenshots

(click to show/hide)
(click to show/hide)

Script

Ver 1
Ver 2

Instructions

Use script command
 
Script :
$limited_shop = {
  <times> => [................],
  <times> => [................],
  <times> => [................],
  <times> => [................],
  "G"        => ammount (Integer)
}

<times> =
0 means that item(s) can be bought as many as possible
1 means that item(s) can only be bought once in that shop
2 means 2 times, etc

......... = Array of Items/weapons/armors (ex = ['i1','i2','w8','a30'])
you can also use string instead of array (ex = "i1,i2,w2,a3" )

"G" = Shop's gold, if omitted, shop's gold will set as 0
you can't sell anything when shop's gold is 0
(this feature can be disabled if you set  SHOP_HAS_GOLD to false



Compatibility

Will have problem with other Custom Shop System

Credits and Thanks

  • LiTTleDRAgo
  • finalholylight for requesting
  • Falcon for his tax script

Author's Notes

Enjoy ~
« Last Edit: May 08, 2013, 05:21:32 PM by LiTTleDRAgo »

Offline finalholylight

  • Awakened Visionist
  • **
  • Posts: 77
  • LV: 0
    • View Profile
Re: [XP] Drago Limited Shop
« Reply #1 on: March 18, 2013, 05:19:14 AM »
Something wrong with sorting items, items are sorted by their limit, 0 to 1 to 2 ... , can you make it like the regular sorting, and, would you mind creating a number next to the item's name that display current quantity of that item.

Offline LiTTleDRAgo

  • Astral Trancist
  • *****
  • Posts: 841
  • LV: 514
  • Gender: Male
    • View Profile
    • ~
Re: [XP] Drago Limited Shop
« Reply #2 on: March 18, 2013, 09:08:41 AM »
script updated

-fix bug when data is not saved in save games
-sort item by item id
-added limit number in the window

Offline finalholylight

  • Awakened Visionist
  • **
  • Posts: 77
  • LV: 0
    • View Profile
Re: [XP] Drago Limited Shop
« Reply #3 on: March 18, 2013, 12:31:27 PM »
Yay, thanks a lot :)
Ah, how can I reset a shop, I want to set an event that check timer for a shop, after a specified time, that shop will come back as the first time.
A minor bug about sell item, Ex: I have 4 potions, and when I sell them, I only choose max to 3 potions to sell.
« Last Edit: March 23, 2013, 06:51:18 AM by finalholylight »

Offline LiTTleDRAgo

  • Astral Trancist
  • *****
  • Posts: 841
  • LV: 514
  • Gender: Male
    • View Profile
    • ~
Re: [XP] Drago Limited Shop
« Reply #4 on: March 24, 2013, 05:33:25 PM »
(click to show/hide)

instruction in the script

A minor bug about sell item, Ex: I have 4 potions, and when I sell them, I only choose max to 3 potions to sell.

fixed
« Last Edit: April 01, 2013, 04:30:13 PM by LiTTleDRAgo »

Offline Kiwa

  • Transcended Spirit
  • ***
  • Posts: 155
  • LV: 4
    • View Profile
Re: [XP] Drago Limited Shop
« Reply #5 on: March 31, 2013, 01:11:05 PM »
Wow. amazing you wrote this near the time i was looking for something just like this.
I guess other people have the same wavelength i do.

any way.. i really like this script thanks for making it!
i was looking around in it for the shop to have 0 of an item.
let me explain.

I'm laying out plans for an online game.
My intention is for the city to have a trader.
this char will buy and sell items.

say i find some nifty shiny rock... i find its taking up my limited item space ( given to me by your lovely item system)
i feel its worthless.
so i visit Mr. Trader
the items assigned in Mr.Traders event

limited_shop = {
4 => ['i1','i2','i3','i4']  # hey nice! 4 of each of these items!
}

Mr trader is willing to buy my item for a set price of say 20gold
then it APPEARS on his market for others to buy for say...30gold

so what im asking is:
Is there a way i can set his item shop to accept items that i have layed in an array without having to quantify it?
in shot.... start at 0 stock but accepting to buy.
when i tested ..he wouldn't stock the items that weren't listed in the array.

Thank you :D

Offline LiTTleDRAgo

  • Astral Trancist
  • *****
  • Posts: 841
  • LV: 514
  • Gender: Male
    • View Profile
    • ~
Re: [XP] Drago Limited Shop
« Reply #6 on: March 31, 2013, 05:23:41 PM »
basically, you have shop

{
4 => ['i1','i2','i3','i4'], 
}

then you sell w1 for 3 times, the shop changed to

{
3 => ['w1'],
4 => ['i1','i2','i3','i4'],
}

unless I'm wrongly interpreting your requests

Offline finalholylight

  • Awakened Visionist
  • **
  • Posts: 77
  • LV: 0
    • View Profile
Re: [XP] Drago Limited Shop
« Reply #7 on: March 31, 2013, 06:29:27 PM »
I think his request is: shop that sell i1,i2, then it will only store i1,i2 in it's stock when player sell i1,i2, and he want when player sell w1 (out of list of that shop), w1 will be stored in that shop,too, then player can buy back that w1 if he want.
« Last Edit: March 31, 2013, 06:31:36 PM by finalholylight »

Offline LiTTleDRAgo

  • Astral Trancist
  • *****
  • Posts: 841
  • LV: 514
  • Gender: Male
    • View Profile
    • ~
Re: [XP] Drago Limited Shop
« Reply #8 on: March 31, 2013, 08:25:32 PM »
script updated


Code: [Select]
  SHOP_HAS_GOLD = true
  # basically if false, you can sell anything as you please
  GET_SOLD_ITEM = 1
  # 0 : Item sold won't be added into buy list
  # 1 : Item sold will added into buy list
  #     (you sold x items outside the list and that item will appeared in the
  #      buy list with limit of x)
  # 2 : Item sold will added into buy list unlimitedly
  #     (you sold  at least 1 items outside the list and that item will appeared in the
  #      buy list without item limit and can be bought as many as possible)

is this what you mean?

Offline KK20

  • Master Scripter Fixer
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3038
  • LV: 372
  • Gender: Male
  • Bringer of Salt
    • View Profile
Re: [XP] Drago Limited Shop
« Reply #9 on: April 01, 2013, 05:53:37 AM »
Made two stores: (A) sells the item once, (B) has no limit of this item. I buy from (B) and sell it to (A). Draws two instances of this item in the buy window in (A). And when I go back to (B) to buy the same item, I can only buy 1 at a time.

'Exit' doesn't work when you select it ($limited_shop = nil is missing?).



Other Projects
RPG Maker XP AceUpgrade RMXP to RMVXA performance!
XPA TilemapTilemap rewrite with many features, including custom resolution!


NNID: KK20-CP
Discord: KK20 Tyler#8901
Join the CP Discord Server

Offline LiTTleDRAgo

  • Astral Trancist
  • *****
  • Posts: 841
  • LV: 514
  • Gender: Male
    • View Profile
    • ~
Re: [XP] Drago Limited Shop
« Reply #10 on: April 01, 2013, 03:36:38 PM »
fixed

Offline Kiwa

  • Transcended Spirit
  • ***
  • Posts: 155
  • LV: 4
    • View Profile
Re: [XP] Drago Limited Shop
« Reply #11 on: April 01, 2013, 03:43:45 PM »
basically, you have shop

{
4 => ['i1','i2','i3','i4'], 
}

then you sell w1 for 3 times, the shop changed to

{
3 => ['w1'],
4 => ['i1','i2','i3','i4'],
}

unless I'm wrongly interpreting your requests
That sounds about right drago. i'll update the script soon to try it out.
Thanks for looking into it for me :D


Made two stores: (A) sells the item once, (B) has no limit of this item. I buy from (B) and sell it to (A). Draws two instances of this item in the buy window in (A). And when I go back to (B) to buy the same item, I can only buy 1 at a time.

'Exit' doesn't work when you select it ($limited_shop = nil is missing?).

I also had this issue. lol.


once again. thanks a lot fellas :D

*************EDIT**************
Beautiful! BEAUTIFUL!!!
Thanks exactly it Drago.
Thanks for another wonderful script and fantastic help!
« Last Edit: April 01, 2013, 03:49:32 PM by Kiwa »

Offline LiTTleDRAgo

  • Astral Trancist
  • *****
  • Posts: 841
  • LV: 514
  • Gender: Male
    • View Profile
    • ~
Re: [XP] Drago Limited Shop
« Reply #12 on: May 08, 2013, 05:22:19 PM »
added ver 2


Offline syldocaine

  • Awakened Visionist
  • **
  • Posts: 59
  • LV: 1
    • View Profile
Re: [XP] Drago Limited Shop
« Reply #13 on: July 11, 2014, 08:47:14 PM »
For shops with a few items this script works really fine.

But if I wanna do a shop with alot of Items with the same limit (for example 30 Items,and all of them can be bought only once) the script input window of RMXP is messing up with it's space.

Is there any workaround?

Offline LiTTleDRAgo

  • Astral Trancist
  • *****
  • Posts: 841
  • LV: 514
  • Gender: Male
    • View Profile
    • ~
Re: [XP] Drago Limited Shop
« Reply #14 on: July 12, 2014, 12:39:04 AM »
you can do it like this

Code: [Select]
$limited_shop = {
  1 => "i1,i2,i3,i4,i5,i6,i7,i8,i9,"+
"i10,i11,i12,i13,i14,i15,i16,i17,"+
"i18,i19,120,i21,i22,i23,i24,i25", # Automatically converted into array in the script
}

or you can also do it like this

Code: [Select]
@i1 = (1..25).to_a.map {|i|"i#{i}"} # This means ["i1","i2",....,"i25"]
@i2 = (1..25).to_a.map {|i|"w#{i}"} # This means ["w1","w2",....,"w25"]

$limited_shop = {
  1 => @i1,
  2 => @i2,
}

if somehow the script command isn't have enough space &
you're using Drago Core Engine or Longer Script Call,

you can stack the script calls :

Code: [Select]
@>Script:$limited_shop = {
@>Script: 1 => (1..10).to_a.map {|i|"w#{i}"},
@>Script: 10 => [3,6,10].map {|i|"i#{i}"},
@>Script: 20 => [2,5,7].map {|i|"i#{i}"},
@>Script: 50 => [1,4,9].map {|i|"i#{i}"},
@>Script:}

Offline syldocaine

  • Awakened Visionist
  • **
  • Posts: 59
  • LV: 1
    • View Profile
Re: [XP] Drago Limited Shop
« Reply #15 on: July 12, 2014, 01:18:32 AM »
Well,this will help alot. Thx!

Yes,im using Drago Core Engine and Longer Script Calls,so i can use the stacks.

Offline LiTTleDRAgo

  • Astral Trancist
  • *****
  • Posts: 841
  • LV: 514
  • Gender: Male
    • View Profile
    • ~
Re: [XP] Drago Limited Shop
« Reply #16 on: July 12, 2014, 06:42:40 AM »
you don't have to use both, if you use Drago Core Engine, you can discard Longer Script Calls