How do I Send value to host?

Get help using Construct 2

Post » Wed Jan 25, 2017 9:29 pm

What i'm trying to do is send the host a message with a value.

On LMB Clicked > Send message to host > Message "UID"

It tells me it can't send a value only a string so my question is how do you send a value to the host?

More Details:


I have multiples of the same item in the game so I'm using the UID system instead of sync values.
B
23
S
8
Posts: 115
Reputation: 2,640

Post » Wed Jan 25, 2017 10:06 pm

bump
B
23
S
8
Posts: 115
Reputation: 2,640

Post » Thu Jan 26, 2017 2:27 am

bump 2
B
23
S
8
Posts: 115
Reputation: 2,640

Post » Thu Jan 26, 2017 8:19 am

If necessary, you can convert a value to a string using the str() expression and a string back into a value using the int() expression.

Generally speaking, sync is the probably the more proper way method for send values - either via instance variable, or inside a data object like an array or dictionary. That is more for host->peer data though. I think it is not common practice for peers to send anything besides input values to the host, unless you don't care about having an authoritative host, but that's up to you. Having an authoritative host keeps things much cleaner logically in terms of peer/host events (or at least it does for me).
Mistakes were made.
B
51
S
25
G
107
Posts: 1,581
Reputation: 60,458

Post » Thu Jan 26, 2017 3:30 pm

oosyrag wrote:If necessary, you can convert a value to a string using the str() expression and a string back into a value using the int() expression.

Generally speaking, sync is the probably the more proper way method for send values - either via instance variable, or inside a data object like an array or dictionary. That is more for host->peer data though. I think it is not common practice for peers to send anything besides input values to the host, unless you don't care about having an authoritative host, but that's up to you. Having an authoritative host keeps things much cleaner logically in terms of peer/host events (or at least it does for me).


Thank you for the help. As you can tell from the bumps I been stuck on this problem for a little bit now.
B
23
S
8
Posts: 115
Reputation: 2,640


Return to How do I....?

Who is online

Users browsing this forum: lukewasthefish and 10 guests