Author Topic: [XP] Tax  (Read 9595 times)

Offline Falcon

  • Trained Member
  • *
  • Posts: 43
  • LV: 7
    • View Profile
[XP] Tax
« on: September 07, 2008, 03:44:11 PM »
Tax
Authors: Falcon
Version: 2.0
Type: Shop Add-on
Key Term: Custom Shop System

Introduction

This Script allows the user to add a sales tax to items that are sold in a shop.
In addition, the user may use negative taxes, for discount shops.
The user can easily change the tax rate using call script.


Features

  • Change the tax rate to anything you want. (Even negative for discounts!)


Screenshots

(click to show/hide)


Script

(click to show/hide)


Instructions

Place this above main, below everything else and it should work fine :)
To use the sales tax:
call script:
$game_system.tax = TAXRATE


Compatibility

Should work with all custom shop systems, however the window that displays the tax/discount rate will probably not appear.


Credits and Thanks

Thanks to Mega Flare for requesting this, and thanks to SephirothSpawn for helping me with an error!

Special thanks goes to Blizzard, who motivated me to write version 2.0
« Last Edit: February 18, 2013, 08:59:09 PM by KK20 »

Offline Starrodkirby86

  • Kirby de Varita Estelar
  • Guardian of Chaos
  • ********
  • Posts: 3282
  • LV: 194
  • Gender: Male
  • ~!
    • View Profile
    • The Archive of Starrodkirby86
Re: [XP] Tax
« Reply #1 on: September 07, 2008, 04:50:48 PM »
Now THIS is a script I've been wanting in RMXP for a while, shop-wise at least. Taxes is another way to have dynamic prices, and I love those. I found some other script in another RM community, but I can't remember where it is and whether it's SDK compliant or not...BUT! This one proves to be very simplistic and optimal, excellent script. >:3

What's osu!? It's a rhythm game. Thought I should have a signature with a working rank. ;P It's now clickable!
Still Aqua's biggest fan (Or am I?).



Offline Falcon

  • Trained Member
  • *
  • Posts: 43
  • LV: 7
    • View Profile
Re: [XP] Tax
« Reply #2 on: September 07, 2008, 05:59:50 PM »
I think someone built it in to their own script at .org, I think this is the only one for the default system though.

Offline Hellfire Dragon

  • Astral Trancist
  • *****
  • Posts: 768
  • LV: 24
  • Gender: Male
    • View Profile
Re: [XP] Tax
« Reply #3 on: September 08, 2008, 10:58:49 AM »
Hey now this is great. I've been looking for something like. D
« Last Edit: September 08, 2008, 07:50:43 PM by Hellfire Dragon »

Offline TheHackMan

  • Awakened Visionist
  • **
  • Posts: 53
  • LV: 1
  • Gender: Male
    • View Profile
    • 9 Lord Rescue
Re: [XP] Tax
« Reply #4 on: September 08, 2008, 01:31:19 PM »
Yah, this doesn't work with custom shop scripts but its still awesome! Will switch back to old shop screen just for some nice and friendly taxes on the products >D

Edit: I did a little messing around and whatnot and there might be a way to have this work with custom shop scripts although it will only factor in the tax to the items price in the shop window, not display the current tax percentage as that would most likely be different for each custom shop edit.
In the custom shop edit, find the following lines in
#  Window_Shop_List:
Code: [Select]
  def draw_item(index)
  item = @data[index]
The right below those two lines insert:
Code: [Select]
  item.price = Integer(item.price * ( (100 + $game_system.tax) / 100.0))
« Last Edit: September 08, 2008, 01:55:39 PM by TheHackMan »

Offline Blizzard

  • This sexy
  • Administrator
  • has over 9000 posts
  • *****
  • Posts: 19929
  • LV: 642
  • Gender: Male
  • Magic midgets.
    • View Profile
    • You're already on it. (-_-')
Re: [XP] Tax
« Reply #5 on: September 08, 2008, 03:11:57 PM »
Hey Falcon, have you tried modifying stuff in the RPG:: classes directly? If you edit the price before you access it, it would work with any shop system.

Code: [Select]
class RPG::Weapon
 
  def price
    return (@price * $game_system.tax / 100)
  end
 
end

You might another additional condition that checks whether you are buying or selling.
Check out Daygames and our games:

King of Booze      King of Booze: Never Ever      Pet Bots
Drinking Game for Android      Never have I ever for Android      Pet Bots for Android
Drinking Game for iOS      Never have I ever for iOS      Pet Bots for iOS
Drinking Game on Steam


Quote from: winkio
I do not speak to bricks, either as individuals or in wall form.

Quote from: Barney Stinson
When I get sad, I stop being sad and be awesome instead. True story.

Offline Falcon

  • Trained Member
  • *
  • Posts: 43
  • LV: 7
    • View Profile
Re: [XP] Tax
« Reply #6 on: September 08, 2008, 11:12:12 PM »
@THM
Yeah, you can do that, the problem is the window; custom shops won't display the tax %.


@Blizzard
Holy shit. 2.0 may be coming soon XD

The shop system would still need to be edited for the tax % to appear though.

Offline Blizzard

  • This sexy
  • Administrator
  • has over 9000 posts
  • *****
  • Posts: 19929
  • LV: 642
  • Gender: Male
  • Magic midgets.
    • View Profile
    • You're already on it. (-_-')
Re: [XP] Tax
« Reply #7 on: September 09, 2008, 03:04:48 PM »
That's true, but I think you can do it using an extra window. That might even work with custom shop systems.
Check out Daygames and our games:

King of Booze      King of Booze: Never Ever      Pet Bots
Drinking Game for Android      Never have I ever for Android      Pet Bots for Android
Drinking Game for iOS      Never have I ever for iOS      Pet Bots for iOS
Drinking Game on Steam


Quote from: winkio
I do not speak to bricks, either as individuals or in wall form.

Quote from: Barney Stinson
When I get sad, I stop being sad and be awesome instead. True story.

Offline Falcon

  • Trained Member
  • *
  • Posts: 43
  • LV: 7
    • View Profile
Re: [XP] Tax
« Reply #8 on: October 03, 2008, 12:50:46 AM »
Version 2.0 is out.

This version will increase compatibility; allowing it to work with some custom shop systems.

Offline TheHackMan

  • Awakened Visionist
  • **
  • Posts: 53
  • LV: 1
  • Gender: Male
    • View Profile
    • 9 Lord Rescue
Re: [XP] Tax
« Reply #9 on: October 03, 2008, 04:03:31 AM »
Just tried putting in this script and something doesn't add up.
I used the call script command to set the tax rate to 7
Whenever I go into a shop to buy an item the price is at a rate such that the tax would have to be 22.4
Price w/out tax = 500
Tax Rate = 7
Price w/ tax should be = 535
Price w/ tax actually = 612
Then after buying 1 item at the 612 price, the price goes up to 699.
Also, it seems to go up when I have more money and even after I sell an item
« Last Edit: October 03, 2008, 04:08:53 AM by TheHackMan »

Offline Falcon

  • Trained Member
  • *
  • Posts: 43
  • LV: 7
    • View Profile
Re: [XP] Tax
« Reply #10 on: October 03, 2008, 11:37:40 PM »
I'll look into that.

I think you've screwed this up, it's working for me. Post whatever event commands you're using.
« Last Edit: October 03, 2008, 11:40:33 PM by Falcon »

Offline TheHackMan

  • Awakened Visionist
  • **
  • Posts: 53
  • LV: 1
  • Gender: Male
    • View Profile
    • 9 Lord Rescue
Re: [XP] Tax
« Reply #11 on: October 04, 2008, 04:09:52 AM »
Hmmm, I think it was something with the custom shop edit I had.
I was messing around with a few of the scripts I had and took out the custom shop script and now everything seems to be back on track and working normally.

Offline Falcon

  • Trained Member
  • *
  • Posts: 43
  • LV: 7
    • View Profile
Re: [XP] Tax
« Reply #12 on: October 04, 2008, 01:39:12 PM »
Post the custom shop script, I'm curious to see what they did to fuck up my tax script.

Offline TheHackMan

  • Awakened Visionist
  • **
  • Posts: 53
  • LV: 1
  • Gender: Male
    • View Profile
    • 9 Lord Rescue
Re: [XP] Tax
« Reply #13 on: October 05, 2008, 11:16:39 PM »
Sure, here you go:

(click to show/hide)

Offline Falcon

  • Trained Member
  • *
  • Posts: 43
  • LV: 7
    • View Profile
Re: [XP] Tax
« Reply #14 on: October 06, 2008, 12:43:36 PM »
There's the problem, it looks like this script changes the price based on an amount of items. So it's probably adding that to the tax.

Offline Kiwa

  • Transcended Spirit
  • ***
  • Posts: 155
  • LV: 4
    • View Profile
Re: [XP] Tax
« Reply #15 on: January 15, 2013, 04:25:03 PM »
Hey friends.

I was just wondering if anyone still has this script laying around because this link is broken ):

I would like to use this script for my game :)

TYSM! :D

Offline LiTTleDRAgo

  • Astral Trancist
  • *****
  • Posts: 841
  • LV: 514
  • Gender: Male
    • View Profile
    • ~
Re: [XP] Tax
« Reply #16 on: January 15, 2013, 04:52:47 PM »

Offline Blizzard

  • This sexy
  • Administrator
  • has over 9000 posts
  • *****
  • Posts: 19929
  • LV: 642
  • Gender: Male
  • Magic midgets.
    • View Profile
    • You're already on it. (-_-')
Re: [XP] Tax
« Reply #17 on: January 15, 2013, 05:12:21 PM »
I have edited the first post and inserted the script instead of the link so people have no problem getting the script in the future.
Check out Daygames and our games:

King of Booze      King of Booze: Never Ever      Pet Bots
Drinking Game for Android      Never have I ever for Android      Pet Bots for Android
Drinking Game for iOS      Never have I ever for iOS      Pet Bots for iOS
Drinking Game on Steam


Quote from: winkio
I do not speak to bricks, either as individuals or in wall form.

Quote from: Barney Stinson
When I get sad, I stop being sad and be awesome instead. True story.

Offline Kiwa

  • Transcended Spirit
  • ***
  • Posts: 155
  • LV: 4
    • View Profile
Re: [XP] Tax
« Reply #18 on: January 19, 2013, 05:01:17 AM »
Thanks. You know i love you guys! (Nohomo)
Ill give it a try later when i get home from work.

Offline Kiwa

  • Transcended Spirit
  • ***
  • Posts: 155
  • LV: 4
    • View Profile
Re: [XP] Tax
« Reply #19 on: January 19, 2013, 01:20:45 PM »
Thanks fellas..

I put it in and played with it for a bit. works :D
thanks :D