Jump to content
A.

Adriens Simple Shop

Recommended Posts

Adriens Simple Shop (BASIC)

Version: 1.0

Author: Adrien. (A.)

Usagage: Plug and Play

Blog: http://labs.adambala...ns-simple-shop/

 

Descrip: Adds very basic functionality to how you manipulate prices in the shop in terms of buying.

 

Note: very basic.

Comptaibility: No issue

FAQ: Seriously? If you have issues please ask, but instructions should be clear.

 

 

 


#==============================================================================
# â–  Adrien's Basic Shop
#
# Version 1.0
# Author: Adrien. (A.)
#------------------------------------------------------------------------------
# The worlds most simple shop changer for prices you have ever seen.
# essentially, set the module variables to the variables you want then
# add values to those variables.
#
#  TO DO:
#	 It seems with variables, and I could be wrong that: if, elsif and else
#	 does not like eachother in terms of dealing with one or more varaibles.
#	 Thus the if statements you see bellow cannot be combined or things get
#	 broken....
#
#
#==============================================================================


module STORE

 #--------------------------------------------------------------------------
 # â— VAR
 #	 --> INC =  Variable you set + Value you set to that variable
 #	 --> MULT = Variable you set + Value you set to that variable
 #--------------------------------------------------------------------------
 module VAR
INC = 1
MULT = 3
 end
end


class Window_ShopBuy

 #--------------------------------------------------------------------------
 # â— price(item)
 #	 item : item
 #	   The value willchange based on the variables and their values.
 #--------------------------------------------------------------------------
 alias adrien_price_change price
 def price(item)
if $game_variables[sTORE::VAR::INC]
  adrien_price_change(item) + $game_variables[sTORE::VAR::INC]
else
  adrien_price_change(item)
end

if $game_variables[sTORE::VAR::MULT]
  adrien_price_change(item) * $game_variables[sTORE::VAR::MULT]
else
  adrien_price_change(item)
end

if $game_variables[sTORE::VAR::MULT] && $game_variables[sTORE::VAR::INC]
  (adrien_price_change(item) + $game_variables[sTORE::VAR::INC]) * $game_variables[sTORE::VAR::MULT]
else
  adrien_price_change(item)
end

 end

end

 

 

Share this post


Link to post
Share on other sites

Seems good but if you are changing a method in a already existing class make sure you have the inheritance included as well. Like so:

[class Window_ShopBuy < Window_Selectable

Or else you might get some weird issues, i.e you are calling a specific method that exists in Window_Selectable and without the inheritance it will fail.

Edited by Niclas

Share this post


Link to post
Share on other sites

Nice idea of yours. Since I'm currently working on a multiply currencies script and thus will have to do currency-related shops (e.g. Stuff costs either 500 Gold or 123 Diamonds), I might take some inspiriation from this (even though it is really simple, because that, in my opinion, is the major plus factor).

Share this post


Link to post
Share on other sites

Seems good but if you are changing a method in a already existing class make sure you have the inheritance included as well. Like so:

[class Window_ShopBuy < Window_Selectable

Or else you might get some weird issues, i.e you are calling a specific method that exists in Window_Selectable and without the inheritance it will fail.

 

I've seen in other scripts and was told by other scriptors I don't have to do that oO

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