How do I send value in multiplayer message.

Get help using Construct 2

Post » Thu Mar 24, 2016 3:43 pm

What I'm trying to do is broadcast a message from the host to the peer but not being a string but a value.

I'll give you an example:

In my game there is like 10 banks and each bank holds it's own value which players can change around as they play. There is a dedicated host so the host will always have the proper number in each bank but my problem is when a new player joins I need to tell that peer what the value is in each bank but when trying to use the broadcast message and placing a instance value inside of it it tells me it can't send values but must be a string.

A little more:
Now I know I could make a crazy system where it changes words into numbers but I feel that is a bit much when you take into consideration that well I'd have to make hundreds of these convert expressions.

Thank you for your help!
B
23
S
8
Posts: 115
Reputation: 2,640

Post » Thu Mar 24, 2016 4:20 pm

The System object already has built in expressions for converting between strings and numbers: int(x), float(x), and str(x). You can check the manual for more info.
Moderator
B
113
S
41
G
20
Posts: 1,586
Reputation: 19,116


Return to How do I....?

Who is online

Users browsing this forum: Kin, mickclarke, TRMG and 50 guests