Jump to content
Galv

Pawn Shop

Recommended Posts

Pawn Shop - Version 1.1

Galv

 

Introduction

This is the outcome of learning about how the shop works. A pawn shop that you can only sell specified items at.

 

 

Features

1. Sell only specified items by using the RPGMaker shop processing list and flipping a switch.

2. Set the selling rate of the items using a variable (so you can change any time in game).

3. Notetag armors, weapons and actors with bonuses or penalties to this selling rate.

4. Selling rate appears in the pawn shop scene and changes colors - to green if party has a bonus to the default or red if they are at a penalty.

5. Normal shop functionality remains the same while the switch is off.

 

Screenshots

 

 

galvs-pawn-shop.jpg

 

 

 

How to Use

Place script under Materials and above Main.

Read script instructions.

 

1. Set variable to be your selling price % (for pawn shop). (RPGMaker default is half an item's value, which would be variable = 50)

2. Notetag actors/weapons/armor with bonuses to selling price.

3. Set up a shop event as normal and turn a switch on before it to turn it into a pawn shop (don't forget to turn it off after).

 

 

Script

Get it here

 

 

FAQ

None yet.

 

 

Credit and Thanks

- Galv

- Tsukihime for the idea

 

Author's Notes

This is a learning script. I am aware there will likely be better ways to do things.

I'd gladly take advice from more experienced people on how my coding could improve.

 

Updates

2012-10-01 - Version 1.1 - I didn't see I broke it before releasing it. The bonuses/penalties weren't getting calculated to the actual price! Fixed now...

Edited by Galv

Share this post


Link to post
Share on other sites

I've made an addon to your script that allows users to set whether pawn shops are buy or sell shops:

http://www.rpgmakervxace.net/topic/23274-doublex-rmvxa-buy-addon-to-galvs-pawn-shop/

 

About your coding, I've an opinion about it although I'm far from being experienced:

 

 

The below 2 methods appeared in both class Scene_PawnShop and Window_Rate:

def equip_bonus
  mem = 0
  eqs = 0
  equip_bonus = 0
  no_equips = ($game_party.members.count) * ($game_party.members[0].equips.count)
 
  no_equips.times { |i|
    if $game_party.members[mem].equips[eqs] != nil
      equip_bonus += $game_party.members[mem].equips[eqs].pawn_bonus
    end
    if eqs < 5
      eqs += 1
    else
      eqs = 1
      mem += 1
    end
  }
  @equip_bonus = equip_bonus
end
def actor_bonus
  actor_bonus = 0
  no_actors = $game_party.members.count
 
  no_actors.times { |i|
    if $game_party.members[i] != nil
      actor_bonus += $data_actors[$game_party.members[i].id].pawn_bonus
    end
  }
  @actor_bonus = actor_bonus
end

You can write a new module including them in your script so other classes can just call them via the module, avoiding writing the same methods in different classes(especially those without direct relationships).

Coding this way can reduce the size of the script and time to maintain those methods as they're no longer duplicated. It also makes the script more 'other-scripter-friendly' if they've to touch those methods :)

 

 

Edited by DoubleX

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.

×