Message send from a loop fails

Discussion and feedback on Construct 2

Post » Tue Jun 17, 2014 9:31 pm

Capture.PNG


Hello, I've posted in the 'how do I' forum, but I suspect that this may be the more appropriate place. The loop in the image does what it should and creates 4 arrays, each 7 long. I tested this by putting a textbox on the layout that prints out randomizer.At(Mine) and cardArray.asjson. This is meant to copy the X dimension from a 2D array and send it via multplayer.
But only the last of the four outputs from the loop is ever actually sent. I have two questions please:
Most important, why would the sending fail? Could it be that the loop is too quick to send 4 messages?
And how else can I do this? Is there any better way to access parts of a 2D array and send without saving each part in a temporary 1D (thats all cardarray is for) array?
You do not have the required permissions to view the files attached to this post.
B
5
S
1
Posts: 8
Reputation: 291

Post » Tue Jun 17, 2014 9:45 pm

Based on your description it sounds like the Multiplayer plugin can only execute 1 tag per tick (make sense as i don't think it stacks information). So the last message you put in the "yourDeal" tag is what gets sent as everything else is just overwriten by it.

So you could either spread it out to 4 different tags IE "yourDeal1" ,"yourDeal2" etc... or try doing an Every Tick if some var less than 4 increment var and set the array and send that message... You will use 4 ticks, 1 to send each message.
B
20
S
7
G
1
Posts: 221
Reputation: 2,077

Post » Wed Jun 18, 2014 12:06 pm

thanks for that. First, none of the above worked, second I could mention that this same loop worked fine before I did 'something' couple days ago. Sadly I have no idea what something is.
The loop is within a function, which is also within a group. The function is called by a chain of three functions, on start of layout. Any difference?
B
5
S
1
Posts: 8
Reputation: 291


Return to Construct 2 General

Who is online

Users browsing this forum: Artpunk and 2 guests