Author Topic: [XP] Custom Prices  (Read 3359 times)

Offline KK20

  • Master Scripter Fixer
  • Global Moderator
  • Lexima Warrior
  • ****
  • Posts: 2988
  • LV: 369
  • Gender: Male
  • Bringer of Salt
    • View Profile
[XP] Custom Prices
« on: November 26, 2013, 12:53:22 AM »
Custom Prices
Authors: KK20
Version: 1.1
Type: Shop Add-On
Key Term: Custom Shop System

Introduction

RPG Maker only allows items to have one set of prices. The sell price of items is half the price set in the database. With this script, you can modify the prices of items, weapons, and armors to whatever you want. The change is only temporary, so you can have shops sell certain items at unique prices. You can also change the sell price to anything. Make an item cost a high amount, but make it unavailable to sell. Have shops buy specific kinds of items. The choice is up to you!

I made this script because I figured it was simple enough to do and I couldn't find another script that did anything like this.

Features

  • Define new purchase prices for your items, weapons, and armors
  • Use a custom sell price rather than the default "half of item's price"
  • Changes are temporary--reverts prices back to database prices when you close the shop (v1.0)
  • Changes are permanent--carry over in saved games. Only change back when you let them (v1.1)
  • Configure default prices for your items, giving them unique buy/sell prices (v1.1)

Screenshots

None

Demo

None

Script

(click to show/hide)
Version 1.0

Instructions

In script. Script calls are
Code: [Select]
price(TYPE, ID, BUY_PRICE)
price(TYPE, ID, BUY_PRICE, SELL_PRICE)
reset_prices

Compatibility

May be compatible with some Custom Shop Systems. The more exotic, the less likely.
Should work fine with most other scripts.

Credits and Thanks

  • KK20 - for script
  • firevenge007 - for requesting

Author's Notes

Want to make a list of scripts this is/isn't compatible with? Post your results!
« Last Edit: August 24, 2016, 01:07:50 AM by KK20 »



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 Heretic86

  • Astral Trancist
  • *****
  • Posts: 733
  • LV: 29
    • View Profile
Re: [XP] Custom Prices
« Reply #1 on: November 26, 2013, 11:00:27 AM »
There is another script out there that tries to do something similar, but by comparison, just flat out SUCKS.  Having Total Control over the Prices at each Shop is a fantastic idea.

+Rep
Current Scripts:
Heretic's Moving Platforms

Current Demos:
Collection of Art and 100% Compatible Scripts

(Script Demos are all still available in the Collection link above.  I lost some individual demos due to a server crash.)

Offline KK20

  • Master Scripter Fixer
  • Global Moderator
  • Lexima Warrior
  • ****
  • Posts: 2988
  • LV: 369
  • Gender: Male
  • Bringer of Salt
    • View Profile
Re: [XP] Custom Prices
« Reply #2 on: November 30, 2013, 02:39:54 AM »
Ah, I see what you meant with that post in your demo collections. The similar script has less features and relies on the SDK.
Glad you think it's a good idea :)



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 Heretic86

  • Astral Trancist
  • *****
  • Posts: 733
  • LV: 29
    • View Profile
Re: [XP] Custom Prices
« Reply #3 on: November 30, 2013, 02:42:46 AM »
When I recover from my burnout, would you mind if I include this script in the "Collection" Demo?  You'll be credited, of course, and I want to get rid of ALL SDK dependancies while either maintaining or increasing functionality.
Current Scripts:
Heretic's Moving Platforms

Current Demos:
Collection of Art and 100% Compatible Scripts

(Script Demos are all still available in the Collection link above.  I lost some individual demos due to a server crash.)

Offline KK20

  • Master Scripter Fixer
  • Global Moderator
  • Lexima Warrior
  • ****
  • Posts: 2988
  • LV: 369
  • Gender: Male
  • Bringer of Salt
    • View Profile
Re: [XP] Custom Prices
« Reply #4 on: November 30, 2013, 02:44:52 AM »
Of course. I see no harm done.



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

Anasky

  • Guest
Re: [XP] Custom Prices
« Reply #5 on: June 13, 2014, 09:49:28 AM »
First off, sorry for the necropost.

Is there any way to set certain global prices, and only change specific ones for certain shops?

Example:
I want all my items to give 25% of the value when sold, and at a specific shop I want the gardening seeds to cost half the price.

Thanks in advance :)
Anasky

Offline LiTTleDRAgo

  • Astral Trancist
  • *****
  • Posts: 837
  • LV: 514
  • Gender: Male
    • View Profile
    • ~

Offline KK20

  • Master Scripter Fixer
  • Global Moderator
  • Lexima Warrior
  • ****
  • Posts: 2988
  • LV: 369
  • Gender: Male
  • Bringer of Salt
    • View Profile
Re: [XP] Custom Prices
« Reply #7 on: June 14, 2014, 05:21:44 AM »
Script calls would probably look something like this:
Code: [Select]
for i in 1..$data_items.size
buy_price = $data_items[i].price
price(0, i, buy_price, buy_price / 4)
end
for i in 1..$data_weapons.size
buy_price = $data_weapons[i].price
price(1, i, buy_price, buy_price / 4)
end
for i in 1..$data_armors.size
buy_price = $data_armors[i].price
price(2, i, buy_price, buy_price / 4)
end
Code: [Select]
for i in STARTING_SEED_INDEX..LAST_SEED_INDEX
buy_price = $data_items[i].price
price(0, i, buy_price / 2)
end



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 KK20

  • Master Scripter Fixer
  • Global Moderator
  • Lexima Warrior
  • ****
  • Posts: 2988
  • LV: 369
  • Gender: Male
  • Bringer of Salt
    • View Profile
Re: [XP] Custom Prices
« Reply #8 on: August 23, 2016, 09:25:03 AM »
Update to 1.1

Changes have been made to make the script a bit more compatible with custom shop systems.
Uses an entirely new architecture for changing items' prices (mainly to address the above).
Changes are now carried over in save files. Prices no longer reset after leaving a shop.
Added default price configuration option.



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 Heretic86

  • Astral Trancist
  • *****
  • Posts: 733
  • LV: 29
    • View Profile
Re: [XP] Custom Prices
« Reply #9 on: August 24, 2016, 12:04:12 AM »
I updated the Collection also since I just put in version 1.0.  Now it contains version 1.1 of this script.  Thank you for supporting your scripts and fixing bugs when found as well as adding features.

NOTE: I did have to start a New Game to prevent a script error with "has_key?" which may cause script users to scratch their heads.  That is fairly typical with many scripts.  Installing a new script and using a current save game can cause a lot of errors during development so it is recommended for pretty much any script installation to start a New Game.
Current Scripts:
Heretic's Moving Platforms

Current Demos:
Collection of Art and 100% Compatible Scripts

(Script Demos are all still available in the Collection link above.  I lost some individual demos due to a server crash.)

Offline KK20

  • Master Scripter Fixer
  • Global Moderator
  • Lexima Warrior
  • ****
  • Posts: 2988
  • LV: 369
  • Gender: Male
  • Bringer of Salt
    • View Profile
Re: [XP] Custom Prices
« Reply #10 on: August 24, 2016, 01:08:15 AM »
Oh whoops forgot a line. Script should work with saved games now.



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