# How do I make a trader?

Get help using Construct 2

### » Sun May 31, 2015 7:33 pm

So, i've searched far and wide for the answer on the forums and youtube/google but to no avail. For the life of me, I couldn't find how to make a merchant/trader.
So, my goal is for both him and player have 4 same items and the buy/sell prices are the same (eg. he sells "meat", "helmet", "armor" and "sword" for 1, 2, 3, 4 gold respectfully, but buys the same things from you for the same price of 1, 2, 3, 4 gold respectfully).
I've made simple global variable to represent player's gold, items and their prices (Text object that has instance variable) and that's about it.

What I need is :
1) Make player's inventory (don't need picures or anything, just text saying "You have :X pieces of meat")
2) Have the prices vary on visit after a trigger (first time you visit him prices are 1,2,3,4 but if you come to him again after a day they get to 3,4,5,6. My idea is to make a fixed variable for each of the items representing it's base value and then add random number-from A to B, to prevent cheap stuff massivly overprice the usually more expensive stuff.
3) Have him have lmited number of each item to trade

ty for any help
B
3
Posts: 6
Reputation: 187

### » Mon Jun 01, 2015 6:53 am

You can always use random for price and amount.. like the variable MeatPrice could be Random(1,3). this would make the price be 1, 2 or 3 randomly. I made a REALLY simple space trader game that did this so different space stations would have different values each day. This way the player would have to travel each day to make a profit.

Does this help at all or should I make a quick example?
B
12
S
4
G
2
Posts: 132
Reputation: 1,749

### » Mon Jun 01, 2015 10:11 am

That's EXACTLY what i've been looking for! But i would love it if you gave me an example because my experience in C2 is literally less then a week
B
3
Posts: 6
Reputation: 187

### » Mon Jun 01, 2015 12:28 pm

https://www.dropbox.com/sh/eioscti86bpr ... 7YPza?dl=0
B
245
S
37
G
15
Posts: 1,939
Reputation: 40,087

### » Sun Jun 07, 2015 3:04 pm

ok, i need only 1 more thing.
how can i get a random number and then add it to an existing variable?
B
3
Posts: 6
Reputation: 187

### » Sun Jun 07, 2015 7:13 pm

jouzeph I have add this file in dropbox it's call 1 jouzeph for you

https://www.dropbox.com/sh/eioscti86bpr ... 7YPza?dl=0
B
245
S
37
G
15
Posts: 1,939
Reputation: 40,087

### » Sun Jun 07, 2015 9:55 pm

Message: jouzeph is not yet permitted to post plain text URLS (300 rep required). 1 URLS removed. Why?
Lordshiva1948 wrote:jouzeph I have add this file in dropbox it's call 1 jouzeph for you

Thank you man! you're the beast!
B
3
Posts: 6
Reputation: 187

### » Mon Jun 08, 2015 8:07 am

jouzeph most welcome
B
245
S
37
G
15
Posts: 1,939
Reputation: 40,087

### Who is online

Users browsing this forum: mrkaio, Zav and 1 guest