Jump to content

Recommended Posts

Shop Taxes VX Ace

They're everywhere now!

Current Version: 1.8


Introduction

With this script, you can almost fully control prices for VX Ace. You can normally set prices and prices unique per shop, and this script adds the possibility to make taxes. With these taxes, you can easily change prices of all items in a shop, either higher or lower. It's as simple as that.


Features

  • Taxes and Discounts in percentages
  • Taxes and Discounts of certain amounts
  • <tax key item> tag to make an item unaffected by taxes
  • Customizable info about the taxes (position, vocab and if it is even shown at all)
  • Possibility to create items which alter taxes and add bonuses which will be stored next to the item tax changes
  • All the same functions for sold items

If you have any ideas for further features, just post them!


Script


You're free to use the script for any game, as long as you give credits

Code

 

Add-Ons

 


#============================================================================
# Shop Taxes VXA - Tax Count Add-On v1.0
# By Emerald
#
# Requires Shop Taxes VX Ace by Emerald
#----------------------------------------------------------------------------
# You're free to use the script for any game, as long as you give credits
#----------------------------------------------------------------------------
# Version History
# 1.0 -> Started add-on. All basic stuff added.
#----------------------------------------------------------------------------
# This is a simple add-on to Shop Taxes VX Ace. Therefore, it requires Shop
# Taxes VX Ace
#
# Instructions:
#
# Just as always, put this script between â–¼ Materials and â–¼ Main (you get a
# cookie if you knew that already). 
#
# If you want to know the total amount the player has payed in taxes, use a
# script command in an event list and write the following:
# $game_system.tax.total_taxes_paid
# 
# The same can be done for discounts with:
# $game_system.tax_total_discounts_received
#
# You can use (and manipulate) these values through scripting, or you could
# make a variable which sets itself to a script value.
#----------------------------------------------------------------------------
# Again, this script requires Shop Taxes VXA (by Emerald)
#============================================================================
 
class Game_System::Tax
  
  attr_accessor :total_taxes_paid
  attr_accessor :total_discounts_received
  
  alias eme_tax_addon_init initialize
  def initialize
    eme_tax_addon_init
    @total_taxes_paid = 0
    @total_discounts_received = 0
  end
 
end
 
class Scene_Shop
  
  alias  eme_tax_do_buy do_buy
  def do_buy(amount)
    eme_tax_do_buy(amount)
    taxes = @buy_window.taxes(@item)
    $game_system.tax.total_taxes_paid += taxes * amount if taxes > 0
    $game_system.tax.total_discounts_received -= taxes * amount if taxes < 0
  end
  
end

 

Special Thanks from me to
Falcon for the original XP version
Blizzard for his help with the XP version

Edited by Emerald

Share this post


Link to post
Share on other sites

Drat! The taxes are even making their way into RPG's now. It's a conspiracy I tell ya! Useful script though and I was hoping something like this would be out, thanks.

Share this post


Link to post
Share on other sites

Useful script! :D by the way i'm so curious why the version is still 0.5? shouldn't be it is 1.0 if already it is done? Is there still some error or compatibility issue?

Thanks anyway for sharing :D

Share this post


Link to post
Share on other sites

Well, it's v0.5 because my the original script was for XP and I first ported it to VX with extra functions. Now I've ported it to VX Ace with just some minor changes to make it compatible. But it will be v1.0 soon, I'm gonna add the following:

  • Make discount and tax information a bit more customizable (hope that's a word) to avoid compatibility issues
  • Make notetags to create items which alter discount and taxes

EDIT

 

Version 1.0 is out!

I've drastically changed the codes due to some problems I had with the taxes. This has made the script WAAAAAY shorter, HOWEVER! there's a higher possibility of compatibility issues. If you use any script which changes def price(item) in class Window_ShopBuy either put this script above the other script (requires that script to use an alias for the method) or add an alias.

 

In order to make up for this, I've made the information in Window_ShopStatus much more customizable. This should be a workaround for most, if not, any problems regarding the position of this information. (For example, if you use Yanfly's scripts which change the looks of the shop.) In order to do this, just change TAX_X, TAX_Y and TAX_INFORMATION.

 

Last, the <tax key item> is TEMPORARILY REMOVED. This is due I forgot to add its function in the new code, sorry guys. DX

I will re-add it in the next version, along with the possibility to get taxes/discounts by having certain items.

 

Anyways, that's it for now. Get the new version in the OP!

Edited by Emerald

Share this post


Link to post
Share on other sites

And updated to version 1.5!

 

 

# 1.5 -> Again, further edits due to slight problems. But aside from that,

# you can use <tax key item> again. Also added possibility to create

# items which alter taxes. DRASTICALLY changed Instructions, be sure to

# read it thoroughly.

#----------------------------------------------------------------------------

# With this script, you can almost fully control prices for VX Ace. You can

# normally set prices and prices unique per shop, and this script adds the

# possibility to make taxes. With these taxes, you can easily change prices of

# all items in a shop, either higher or lower.

#

# Instructions:

#

# Just as always, put this script between â–¼ Materials and â–¼ Main. If the

# information about the taxes is not shown correctly in shops, you can change

# it below.

#

#

# In order to add taxes, use the call script method within an event. Use

# the following codes codes:

#

# $game_system.tax.percent = x

# Where x > 100 results in a tax with x% the normal price

# Where x < 100 results in a discount with x% the normal price

#

# $game_systeme.tax.direct = y

# Where y > 0 results in a tax which adds y to every price

# Where y < 0 results in a discount which subtracts y to every price

#

# WARNING

# For n = the price of an item,

# If n - y equals 0, the item becomes free

# If n - y < 0, the item becomes free AND you GET money (why doesn't that happen

# in real life)

# If x = a negative value then you'll GET money (x% the normal price)

#

# ALWAYS!!, unless you're SURE the player can't have any items which alter taxes,

# add $game_system.tax.perbon to percentage taxes and $game_system.tax.dirbon to

# direct taxes. Else, the changes of the items ARE NOT APLIED!!

# END WARNING

#

#

# <tax key item>

# Use the above tag if you don't want that the price of that item can be changed

# by taxes. Useful for items which the player may not sell.

#

#

# <tax +/-x>

# Use the above tag to make items which will alter direct taxes. Use + to make

# it higher, - to make it lower. Enter a value for x.

#

# <tax +/-x%>

# Use the above tag to make items whcih will alter percentage taxes. Use + to

# make it higher, - to make it lower. WARNING!! The value you enter for x will

# be ADDED or SUBSTRACTED of the current tax.percent!!

# Examples:

# $game_system.tax.percent = 150 & an item with <tax +20%> will result in a tax

# of 170%.

#

# $game_system.tax.percent = 100 (/no value set) & an item with <tax -42%> will

# result in a tax of 58%.

#

# NOTE that if the player gets any items with these tags, the amount he/she has

# of the item determines how many times the taxes will be altered! Two of the

# same items in Example 1 will result in a tax of 190% instead of 170%.

# Also, if the player gets any items with these tags, the changes to taxes will

# be stored in $game_system.tax.perbon and $game_system.tax.dirbon for

# percentage and direct taxes respectively. Always add these variable to

# $game_system.tax.percent and $game_system.tax.direct respectively if changes

# to these two are made. Don't change perbon and dirbon as they only handle the

# changes made by items.

 

#----------------------------------------------------------------------------

 

 

All needed information is in the spoiler. Be sure to read instructions carefully, as I have drastically changed them!

 

List of changes:

  • Again, cleaner codes to solve some stupid problems (should be fine now)
  • <tax key item> can be used again!
  • added $game_system.tax.perbon and $game_system.tax.dirbon. These two variables are used to record all changes to taxes made by items and any other changes which should not change when you change tax value. (Refer to the instructions when to use the variable).
  • Added possibility to alter taxes by the use of items
  • AGAIN I DRASTICALLY changed Instructions, READ THEM OR YOU CAN GET PROBLEMS WITH CERTAIN THINGS, especially read WARNINGs and NOTES

Edited by Emerald

Share this post


Link to post
Share on other sites

Bump for notice on:

 

UPDATE V1.6!

 

This update only adds taxes for items which you sell (and makes <key_item> some more useful), so you only have to update if you want to. Use the following functions: (if you've used the previous functions, you already no what what does. If not, refer to instructions)

 

$game_system.selltax.percent = x

$game_system.selltax.direct = y

$game_system.selltax.perbon = x

$game_system.selltax.dirbon = y

<selltax +/-x%>

<selltax +/-x>

 

NOTE

First comes the price halving, then comes the percentage change, then comes the direct change.

Share this post


Link to post
Share on other sites

On line 227, it is necessary to change "unless @key_item = true" to "unless @key_item" in order for the sell taxes to work :)

Share this post


Link to post
Share on other sites

Thanks for noticing me!

 

Update to v1.7

Bugfix, and items which have the key item class in the database do not require the <tax key item> tag any longer.

Edited by Emerald

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
Top ArrowTop Arrow Highlighted