senjo's Forum Posts

  • 8 posts
  • anyone?

  • hello, i am experimenting (new to C2) with multiplayer in a turn-based 4 player game. one sprite is synced across all players, and usually works. i noticed that occasionally, dont know why, it stops syncing for one or two players: the unsynced player's actions appear for the host and other players but the unsynced player doesnt see his own plays. (its turn-based so each player messages the host what he plays, and the host does the actual playing and syncs this so everyone sees each play)

    then today i realized that the collision check says NaN/tick, see image. none of my sprites have any physics and i dont require collision checking, so never turned this on or have any code requiring collision checks.

    [attachment=0:57k56jh2][/attachment:57k56jh2]

    any idea whats going on here? is the NaN issue likely related? seems so.

  • 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?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • [attachment=0:115jee4o][/attachment:115jee4o]

    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?

  • [attachment=0:19fekekv][/attachment:19fekekv]

    Had errors with array names, and I have found using browser logs that the loop works fine (had browser print out the loop and the cardArray, and those are all formed well), but messages still only go to the last messagee (ie: randomizer.At(3). randomizer stores PeerIDs in an array. The IDs are correct.

    If in the messaging action I replace randomizer.At(2) manually it still never sends to player 2. Neither player 1.

    I replaced randomizer with built-in PeerID.At and still, only ..At(3) gets a message.

    Confused. Any light would be appreciated.

  • [attachment=0:1ed82xj1][/attachment:1ed82xj1]

    I think this should send 4 arrays as json, each 7 values long, but its only sending the last one. Can anyone explain why this is not doing what I think it should?

  • thanks. the variables were set on spawning, and are different for each. and as mentioned it seems to pick the sprite fine via this variable, but after picking the instance i need to modify, i just cant set the other variable.

  • Hello, I have a problem altering an instance variable. I've spawned 7 sprites on the layout, each with 2 instance variables. In a function, I pick a sprite with a particular variable set (var1 = 0) and try to change var2 of that instance. It never works. I've added a text field on the pick event and set the text to change if picked, and it changes, so I suspect the instance is being picked, but the var2 just stubbornly refuses to cooperate. Am I missing things?

  • 8 posts