Author Topic: [XP] Hex's Token Shop  (Read 5029 times)

Offline (Hexamin)

  • Ethereal Devastator
  • ****
  • Posts: 369
  • LV: 21
  • Gender: Male
  • "Yar"
    • View Profile
[XP] Hex's Token Shop
« on: March 26, 2010, 02:29:27 PM »
Hex's Token Shop
Authors: (Hexamin)
Version: 1.1
Type: Custom Token Shop
Key Term: Misc. Add-on

Introduction

Updated:  Now allows for the buying of items, weapons, and armors.

So, some cat asked about a system like this, and since I've begun scripting now, it seemed like something I could take on.  It seems as if I've been successful, and here you have it folks, Hex's first submitted script!  It's pretty simple, and I made it in less than a day.  I may or may not tweak it later.  I guess that'll depend on if anyone wants me to or finds errors.  Well, I know its simple, but hope you enjoy!

Features

  • Use tokens to buy items!
  • Define what your tokens are called!
  • Define how much each item costs easily in the configuration!
  • Simple and easy to use!
  • Can be used for prize tokens, war trophies, or whatever you can imagine!
  • That's all the excitement I can handle!

Screenshots

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


Demo

~None~

Script

Place Script Below Scene_Debug
(click to show/hide)

Instructions

Instructions located in script!
(click to show/hide)

Compatibility

Haven't found any issues, please lemme know if you find any ^_^

Credits and Thanks

  • (Hexamin) @ Chaos-Project
  • Nope, just Hex!

Author's Notes

Hope someone finds this useful!  Just lemme know if you wanna see something else, I'll see what I can do to tweak it.  Keep in mind this is my first submitted script.  I'm quite the noob when it comes to scripting, so I'm sure there are lots of shortcuts that probably could've been used that weren't, better coding possible, la dee da.  Bottom line, its a working system, and that's what I was going for.  Enjoy! ^_^

Edit 1: Updated where the purchase window popped up.
« Last Edit: March 26, 2010, 08:53:49 PM by (Hexamin) »
Max 1111101000; characters remaining: 1110111000

Offline G_G

  • Green Gmod Game_Guy AKA G4 AKA hyper-G AKA G-force
  • Global Moderator
  • Chaos Ultimate
  • ****
  • Posts: 6591
  • LV: 407
  • Gender: Male
    • View Profile
Re: [XP] Hex's Token Shop
« Reply #1 on: March 26, 2010, 02:51:45 PM »
Theres a bug. You can have 0 Coins and still buy something.

EDIT: You can only buy items. What about weapons and stuff? Also there's an easier way then having all those arguments.
for initialize
Code: [Select]
def initialize(goods = [])
  goods.each{|i| 
  case i[0]
  when 0
  @data.push($data_items[i[1]])
  when 1
  @data.push($data_weapons[i[1]])
  when 2
  @data.push($data_armors[i[1]])
  end
  }
  #other stuff here
end

Then to call the script use you would make an array of arrays.
Code: [Select]
$scene = Scene_Prize.new([
[0, 1], [0, 2], [0, 3], [1, 1], [2, 1]
]
The 0 would be for items, 1 is for weapons and 2 is for armors. The 2nd number in the arrays are the item id.
[x, y]
x = 0 - items, 1 - weapons, 2 - armors
y = item id
« Last Edit: March 26, 2010, 02:57:35 PM by Hellfire's G_G »

Offline (Hexamin)

  • Ethereal Devastator
  • ****
  • Posts: 369
  • LV: 21
  • Gender: Male
  • "Yar"
    • View Profile
Re: [XP] Hex's Token Shop
« Reply #2 on: March 26, 2010, 03:37:54 PM »
I'm not getting the 0 token bug.

What instance are you getting that in?  And... I think I will take your advice and expand it to include weapons and armor, although I really just did this on a whim.  Thanks for the criticism though, I really appreciate it seeing as I am very new to scripting.  ^_^

Edit 1:  I'll update this in a bit.  i realized I need to go into module and fix the prices, and fix some other code if i'm going to implement weapons and armor.

I wasn't sure how {} works, but... this is getting me a little more familiar with it.  I know its a loop-type code...  Anyway.  Update to come.
« Last Edit: March 26, 2010, 03:41:45 PM by (Hexamin) »
Max 1111101000; characters remaining: 1110111000

Offline Trainer Zydragon

  • Transcended Spirit
  • ***
  • Posts: 183
  • LV: 2
  • Gender: Male
  • Sup :D
    • View Profile
Re: [XP] Hex's Token Shop
« Reply #3 on: March 26, 2010, 05:24:41 PM »
I think this would be good for buying skills too :P

Like an AP system, battles get you AP per monster, and you buy skill levels and stuff... Might be a good idea if it isnt already done XD

Offline (Hexamin)

  • Ethereal Devastator
  • ****
  • Posts: 369
  • LV: 21
  • Gender: Male
  • "Yar"
    • View Profile
Re: [XP] Hex's Token Shop
« Reply #4 on: March 26, 2010, 05:37:59 PM »
i've already got a skill buying system for ~DB~

maybe i'll change it from using gold to using some other currency  o.O
Max 1111101000; characters remaining: 1110111000

Offline Trainer Zydragon

  • Transcended Spirit
  • ***
  • Posts: 183
  • LV: 2
  • Gender: Male
  • Sup :D
    • View Profile
Re: [XP] Hex's Token Shop
« Reply #5 on: March 26, 2010, 05:52:21 PM »
Yeah, make it optional?

Cos I would personally prefer spending AP on skills :)

Makes killing things more worth it :P
Could use it to level up too? like go from Soldier to Paladin for a certain amount of AP

Offline (Hexamin)

  • Ethereal Devastator
  • ****
  • Posts: 369
  • LV: 21
  • Gender: Male
  • "Yar"
    • View Profile
Re: [XP] Hex's Token Shop
« Reply #6 on: March 26, 2010, 08:56:29 PM »
Updated to allow for buying of armor and weapons as well.

^_^

although i couldn't do it in a cool way like G_G was talkin' about...
Max 1111101000; characters remaining: 1110111000

Offline RogerSmith

  • Trained Member
  • *
  • Posts: 27
  • LV: 3
  • Gender: Male
    • View Profile
Re: [XP] Hex's Token Shop
« Reply #7 on: April 12, 2010, 02:58:37 AM »
How do you give tokens to players? Is there a call script for that?

Offline Aqua

  • Lexima Warrior
  • *******
  • Posts: 2554
  • LV: 118
  • Gender: Female
  • Quack!
    • View Profile
Re: [XP] Hex's Token Shop
« Reply #8 on: April 12, 2010, 03:06:03 AM »
They're just a game variable.

Offline G_G

  • Green Gmod Game_Guy AKA G4 AKA hyper-G AKA G-force
  • Global Moderator
  • Chaos Ultimate
  • ****
  • Posts: 6591
  • LV: 407
  • Gender: Male
    • View Profile
Re: [XP] Hex's Token Shop
« Reply #9 on: April 12, 2010, 03:06:09 AM »
Its controlled by a variable. Just add a number to the variable.

Offline RogerSmith

  • Trained Member
  • *
  • Posts: 27
  • LV: 3
  • Gender: Male
    • View Profile
Re: [XP] Hex's Token Shop
« Reply #10 on: April 12, 2010, 03:29:43 AM »
Got it. I never was one for variables, but after using Tidloc's Dynamic Shop script and Hex'sscript, it's getting easier to grasp.