Posted by Bountywolf
Would it be possible to make a trading sort of system using p2p, ds grid, and game inis

Replies (3)

Last message on 26 Dec 2017

PenguinPalaceGame on 25 Dec 2017, 21:43:33
I'm guessing if your storing your items within PlayerINI's, you might be able to transfer your items to another players account via P2P someway? Looking into it myself, actually
Size43 (Administrator) on 26 Dec 2017, 12:35:34
I'd recommend doing something like this:

Using only p2p messages, where the notation is Sender -> Receiver: id([arg1], [arg2], ...)

I'm using names for the ids, you'd need to define macros for each of the ids with a unique number between 0 and 255.

A -> B: p2p_my_items(string_with_item_ids_a_will_give_to_b)
B -> A: p2p_my_items(string_with_item_ids_b_will_give_to_a)
[repeat those messages as long as players keep adding items to the things they want to trade]

[When one of the two players clicks "confirm"]:
A -> B: p2p_confirm_request()
B -> A: p2p_confirm()
A -> B: p2p_confirm()

When A and B receive the p2p_confirm message, they will update their inventory. If B doesn't agree to the trade, something like this should happen:

A -> B: p2p_confirm_request()
B -> A: p2p_cancel_trade()
Size43 (Administrator) on 25 Dec 2017, 14:42:38
This would be possible. Any particular part that you're having trouble with?