caboose1 Posted December 18, 2013 Report Share Posted December 18, 2013 Hi I was wondering if there is anyway to make a script maybe that changes the prices in traders over the course of server uptime. I dont know if you played drug wars but you buy something then after a while the price goes up or down. I was thinking this would make people be "out and about" a little more. Also i think it would add another dimension to a already awesome mod. Link to comment Share on other sites More sharing options...
MatthewK Posted December 18, 2013 Report Share Posted December 18, 2013 Having prices change with demand would be a cool feature. The more of something your traders have, the less is costs. The less of something they have, the more it costs. Real life economics :) Link to comment Share on other sites More sharing options...
Defent Posted December 18, 2013 Report Share Posted December 18, 2013 I think that would be possible in a SQL event actually. Say you take the update stock daily and remake it abit: (Updates stock) UPDATE `Traders_DATA` SET qty=100 WHERE qty<50 AND afile<>'trade_any_vehicle' AND afile<>'trade_any_boat' and make it UPDATE `Traders_DATA` SET buy='[10,"ItemGoldBar",1]' where qty <10 AND afile<>'trade_any_vehicle' AND afile<>'trade_any_boat' This would of course set ALL items to cost 10 gold bars when quantity is below 10.THE ONLY PROBLEM IS THAT THIS IS NOT APPLIED UNTIL AFTER RESTART. I'm not sure if you can make price update instant but if you have a server that restarts often it might be ok. This means that you cant update trader quantity every restart but instead have to have it on like a daily schedule. caboose1 1 Link to comment Share on other sites More sharing options...
caboose1 Posted December 18, 2013 Author Report Share Posted December 18, 2013 I think that would be possible in a SQL event actually. Say you take the update stock daily and remake it abit: (Updates stock) UPDATE `Traders_DATA` SET qty=100 WHERE qty<50 AND afile<>'trade_any_vehicle' AND afile<>'trade_any_boat' and make it UPDATE `Traders_DATA` SET buy='[10,"ItemGoldBar",1]' where qty <10 AND afile<>'trade_any_vehicle' AND afile<>'trade_any_boat' This would of course set ALL items to cost 10 gold bars when quantity is below 10.THE ONLY PROBLEM IS THAT THIS IS NOT APPLIED UNTIL AFTER RESTART. I'm not sure if you can make price update instant but if you have a server that restarts often it might be ok. This means that you cant update trader quantity every restart but instead have to have it on like a daily schedule. You would need something that tells it where to put the price back too, or to increase so a default amount! Link to comment Share on other sites More sharing options...
Defent Posted December 18, 2013 Report Share Posted December 18, 2013 You would need something that tells it where to put the price back too, or to increase so a default amount! That could be solved aswell. If the qty drops to 1 then update back to qty=100 and price to default so basically: UPDATE `Traders_DATA` SET buy='[1,"ItemGoldBar",1]'and qty=100 where qty <1 AND afile<>'trade_any_vehicle' AND afile<>'trade_any_boat' I'm not 100% sure you can do it like that, but you get the general idea. caboose1 1 Link to comment Share on other sites More sharing options...
caboose1 Posted December 18, 2013 Author Report Share Posted December 18, 2013 im going to have to consoult my sql admin @) Link to comment Share on other sites More sharing options...
Axe Cop Posted December 18, 2013 Report Share Posted December 18, 2013 I would not use a SQL query for this, as it will only be applied after a server restart as already said and that is to slow in my opinion, also you need many queries for all different items or price ranges at least. since all trading stuff is handled with ingame scripts it should be possible to change the values there (in real time whenever you talk to a trader). there is only one small problem: the different metal currencies, its not easy to add 10% to a gold bar or stuff like that so you have to be clever when dynamically changing the prices, any ideas? :D Link to comment Share on other sites More sharing options...
caboose1 Posted December 18, 2013 Author Report Share Posted December 18, 2013 I would not use a SQL query for this, as it will only be applied after a server restart as already said and that is to slow in my opinion, also you need many queries for all different items or price ranges at least. since all trading stuff is handled with ingame scripts it should be possible to change the values there (in real time whenever you talk to a trader). there is only one small problem: the different metal currencies, its not easy to add 10% to a gold bar or stuff like that so you have to be clever when dynamically changing the prices, any ideas? :D HI A price rise could be triggered by the purchase of an item, either at that trader or them all. If its that trader then the buyer might be more inclined to take a trip to the next trader. If all the traders increase there price by the same amount, mr shopper might aswell stay there. But if you buying something triggered a Christmas sale, then he may go on his travels to find a better deal. If its a higher populated server he runs the risk of geting to the next place to find the goods already sold and the price increased as they haven't much stock left. Or it could be worked in that if people are going crazy buying/selling the same goods then the price is inflated/deflated.to mak I just think it would add a nice little bit on the side of epoch, your meant to be scraping a living so treking across the map for a extra bit of shiny seems worth it. Money wise you would just have to up the price by bars 10 %= one bar be it a 10oz or standard. Im trying to set it so you can only buy certain goods by selling other goods like a swapsys system, like in origins in the fact that bandit hand hero lvl two house produce different goods which is ( i think ) meant to promote interaction. Link to comment Share on other sites More sharing options...
Axe Cop Posted December 19, 2013 Report Share Posted December 19, 2013 Yeah well you could do what you want, you just have to figure out a system that will work. Imagine you just have the buy, sell and qty values from the database, e.g. sell price 2 gold bar, buy price sell price 2 gold bar and qty 23, what would you do with that? YOu can manipulate that values before they are displayed at the trader so double the buy price if the qty drops belop 10 or whatever you know.. the complicated part is to fire out a working system in my opinion.. but this way you only have to tweak some scripts and not the change the database or anything, btw every trader has its own items (qty) so you could get better prices at a trader with more items at stock. Link to comment Share on other sites More sharing options...
DNightmare Posted January 2, 2014 Report Share Posted January 2, 2014 Kinda reminds me of my old currency topic ;) Only problem is the caching of the DB-queries (that's why you'd have to wait until restart) and redo the tradeobject bits'n'pieces Link to comment Share on other sites More sharing options...
(GSG) Az Posted January 29, 2014 Report Share Posted January 29, 2014 I think a custom HIVE call allowing updating of prices on the fly would be the best way to handle this, then simply make a script that calculates the supply and demand. If I could find the Hive source I could easily do this (I haven't looked as of yet). I've already got something like this functioning on my server, but with a custom Hive.dll with CHILD:999 enabled (A very bad idea if you dont know what you are doing!) Link to comment Share on other sites More sharing options...
Firefly Posted January 29, 2014 Report Share Posted January 29, 2014 Sounds like a good idea, I prefer setting everything to zero and having the traders populate the stocks rather than refilling everyday. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now