Sign In Register

How can we help you today?

Start a new topic
Answered

How to implement trading functionality?

 Where should I begin if I want to implement a trading functionality between players with the virtual currency, goods, items etc?



Best Answer
Hi Ondrej,

To get started setting up a trading system in your game I would recommend looking at the SparkPlayer. More specifically the following functions:

- addVGood: adds virtual good(s) to the players existing virtual goods.
- useVGood: removes virtual good(s) from the players existing virtual goods.
- credit1: credits the player's currency1 (there are similar functions for all currencies).
- debit1: debits the player's currency1 (there are similar functions for all currencies).

The specific way you implement these would depend on how you want the flow of control for your trading system to work. You could create custom events for trade proposals and acceptances, maybe create custom messages for the same. It's really up to how you'd like it to work.

If you need any pointers on a more specific implementation let us know.

Regards,
Vinnie


 


Answer
Hi Ondrej,

To get started setting up a trading system in your game I would recommend looking at the SparkPlayer. More specifically the following functions:

- addVGood: adds virtual good(s) to the players existing virtual goods.
- useVGood: removes virtual good(s) from the players existing virtual goods.
- credit1: credits the player's currency1 (there are similar functions for all currencies).
- debit1: debits the player's currency1 (there are similar functions for all currencies).

The specific way you implement these would depend on how you want the flow of control for your trading system to work. You could create custom events for trade proposals and acceptances, maybe create custom messages for the same. It's really up to how you'd like it to work.

If you need any pointers on a more specific implementation let us know.

Regards,
Vinnie


 


1 person likes this
Perfect answer, many thanks.

 

Login to post a comment