Chaos Project

RPG Maker => RPG Maker Scripts => Script Requests => Topic started by: Ctrl_Alt_Defeat on January 19, 2015, 08:06:56 am

Title: Supply and Demand [RPGXP]
Post by: Ctrl_Alt_Defeat on January 19, 2015, 08:06:56 am
 After doing some digging I wasn't able to find a supply and demand script but some good concepts behind it with simple tricks to simulate it.

I'm not really looking for a dynamic pricing system (it could work too but I figure that'd be harder to do/find) but more of a price for an item that differs for where you're at. If you're in the middle of a huge desert, water would cost more compared to being in a moderate town next to a huge river :P

I'm still going to keep digging in case I missed scripts but basically what I was told could work is a script that sets item sell and buy prices before the player enters shop o.o

ANYWAYS if you guys know of something that'll do the trick, let me know!
Title: Re: Supply and Demand [RPGXP]
Post by: Soulshaker3 on January 19, 2015, 09:08:49 am
That would be easy to do, since I'm not really into RMXP I'm going to write how I would do it, syntax isn't correct

In the script call:

@items  = [id, buy, sell, id, buy sell, ...]
@script = Change_Prices.new(@items)

Open shop then another scriptcall:

@script.ChangeBack()


On the script itself

@itemsBefore = [];

def initialize(items)
    for i in 0...items.size i+=3
       @itemsBefore.push(i); // id
       @itemsBefore.push(i+1); //buy price before
       @itemsBefore.push(i+2); //sell price before
       set_item_buy(i,i+1) //new buy price
       set_item_sell(i,i+2) //new sell price
    end
end

def ChangeBack()
    for i in 0... @itemsBefore.size i+=3
       set_item_buy(i,i+1) //normal buy price
       set_item_sell(i,i+2) //normal sell price
    end
end
Title: Re: Supply and Demand [RPGXP]
Post by: KK20 on January 19, 2015, 02:56:28 pm
http://forum.chaos-project.com/index.php/topic,13681.0.html
Title: Re: Supply and Demand [RPGXP]
Post by: Ctrl_Alt_Defeat on January 19, 2015, 04:53:08 pm
Thanks for the suggestions!

I remember looking up your script KK2 but some one told me it isn't exactly what I was looking for and over looked it but after looking again that works perfectly lol  :^_^':

I've put the event you suggested to use soulshaker and with a little editing I was able to make that work!

Thanks to both of you!