Biscotto's Recent Forum Activity

  • I understand, so my suspicions were right.

    If I need to insert a wait between one message and another with the same tag, I must necessarily save all the values in a list first, and then run each message by cycling through the created list. Right? Or are there better methods?

  • I was testing all day to figure out where the problem was, but I couldn't.

    However, I made a discovery: if when the peer receives a series of messages, it has in its message receive event an Alert, only the first Alert is correctly displayed with the right Multiplayer.Message, the other Alerts, are all read with the content of the last received Multiplayer.Message.

    If the Alert is removed, everything seems to work correctly.

    Since my explanation is not very clear, I have modified the official C3 chat example to reproduce this problem. Just go to the Peer window, select the text field and press Enter. It will automatically send 10 messages to the host via a for loop.

    File: dropbox.com/s/fo11q00fwsjihux/Multiplayer%20chat%20example%281%29.c3p

    Sorry to tag you Ashley, but I think only you can give me a correct answer and help me.

    Thanks in advance!

    Edit:

    I understand that if I insert some particular event (like "Alert" or "Wait" events) into the read event of the message sent by the host, the event fails to queue and read more than one message properly.

    Is this normal or a bug? If this is normal, is it possible to understand why and how can I work around this problem? For example, if I want to insert a wait between the execution of multiple messages with the same tag, how can I do that?

  • Happy to have helped you!

    Be careful when using the IID of an instance. If for some reason you destroy one, and then create another in the usual location, your colors will no longer be ordered as they are in the JSON file. ;)

    Happy programming!

  • To keep your layout centered within the window/screen, I also recommend that you check the "Unbounded scrolling" property.

    Obviously you must also set the Fullscreen mode property, according to your needs.

  • I'm doing my first tests with the Multiplayer object of C3, so I'm not very expert with its functioning.

    At the moment of the connection between host and peer, the host creates a grid of instances of block object. I would like the connected peer to in turn create the same grid following the same pattern as the host's grid.

    So I thought of sending a message to the peer with the data of each block to make it create it in the same position:

    The problem is that the peer correctly receives the coordinates of the first block, and then receives a number of messages equal to the entire host loop, containing the coordinates of the last block of the grid, i.e. the last block created by the for loop.

    At this point I can't understand if C3 is able to send messages correctly in a short time. Or rather: the messages are sent, but the values inside are not updated correctly.

    Can anyone tell me where I'm wrong or if there is a better method to recreate the same object partner for both host and peer?

    Thanks!

    Tagged:

  • For the random number from 1 to 5, you need to modify your code. The solutions are different. You can solve with floor(random(1, 6)). This will correctly generate an integer number between 1 and 5.

    The numbers are random, so it may be that sometimes the number 3 is repeated many times.

    If you want to avoid this, before creating the power up, you could insert a control event: if there are already 3 balls of a certain power up, then create a ball of the opposite power up.

    I hope this helps you.

  • From what I can see, you're not making the pick of a given object instance to assign it the color. Basically in the for loop of each assignment you assign the same color to all blocks each time.

    The last color in your JSON is white, so at the end of the loop you will have all your blocks white.

    If you add a brakepoint to your loop, and in debug mode, proceed tick by tick manually, you'll see what happens during the loop.

    I recommend creating the block and assigning it the color in the same event, or else make the correct block pick when you assign it the color.

  • I don't think it's necessary to create a dedicated group. You could do it this way:

    - Create a function that spawn your enemies.

    - Inside the function you insert several ifs divided according to the score range you want. For example: If points is >= 0 and < 100 then spaw enemy A, if points is >= 100 and < 200 then spaw enemy type between enemy A and enemy B etc.

    By doing this, by calling the spawn function of the enemies once, you can create enemies automatically based on the current score.

  • Can you show the rest of the code as well? I mean the part that cycles the entire grid to insert the respective values from the JSON file?

  • Are you sure about how that feature works?

    In a control event you check if "Time = Function.Param(0)". This, if I understand your message correctly, doesn't make much sense....

    Could you post the entire Param function (maybe even add comments) to better understand how it works?

    Edit:

    Question:

    Based on the number of players. do teams have to be created proproportionally? Example: If there are 10 players, should 2 teams of 5 players each be created? Or must there always be 8 teams?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The first solution that comes to my mind, is to add a control on the current animation of the object, before assigning it a new animation.

    Example: If you move to the right, and the "right" animation is already present then don't set the "right" animation again.

  • That's right. You can still use any other event to compare two values, such as "Compare two values" in System.

    Glad I was helpful. Happy programming! ^^

Biscotto's avatar

Biscotto

Member since 11 Aug, 2021

Twitter
Biscotto has 1 followers

Trophy Case

  • 3-Year Club
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Quick Draw First 5 people to up-vote a new Construct 3 release
  • Email Verified

Progress

7/44
How to earn trophies