El Constructorr's Forum Posts

  • So there are several ways, you simply need to let Construct know how to identify which one you want.

    The perfect way would be through its UID (Unique ID), which is different even for copied texts (or sprites). You can find it on the left bar.

    All you need to do is: Go to the text object's condition -> Pick by UID, and then make a sub-event for its action, e.g.: 'Set Text: Hey I'm so unique!'

    But 'picking' could be done through many ways, e.g:

    1) its opacity

    2) its position (nearest to something?)

    3) its instance variable

    4) its Z level, top/bottom

    5) ..or any expression or evaluation you can think to differentiate them*

    * Go to System: Pick object by: (here you can see many options, most relevant for you is Pick by Comparison).

  • Hi, I used to use Multiplayer plugin for my two-player game, where the ball (Physics) movements were very smooth and accurate on both ends, only slight lag-delay which was also fine and workable.

    Now I use Photon (implemented on the same game mechanics) and since it doesn't Sync an object automatically, getting every tick positions (or even every 0.03, etc) to manually sync the ball, causes a LOT of stop-motion effects.

    I tried 'lerp' but it also doesn't quite make it look smooth.

    I also tried taking velocityX, velocityY with ball.X, ball.Y but for some reason, it doesn't refresh X,Y anymore (or not consistently) when velocities are given?

    I want to know how does Multiplayer Sync work on Physics objects? I want to re-create that mechanics through Photon.

    Assume a Volleyball game where ball has collisions and projectile motions. Thanks

  • So first, you need to decide who has priority if suppose BOTH players try to move the sprite at the same time? Where would it go? Let's assume Host has the priority.

    If Host has synced the object, and Peer can see it.

    Then let Peer send Touch.X, Touch.Y to Host

    Store it in an some global or instance variable, peerX and peerY

    Now: if Host touching object: Sprite set position Touch.X, Touch.Y

    Else: if Peer touching object: Sprite set position peerX, peerY

    How will you know if Peer is touching object? and stop touching? You can send some boolean (or number) from Peer to Host (as Message) to tell Host "isTouching" and "stopTouching".

  • Thank you so much fredriksthlm

    Wow! I didn't know! Yes it does include c3addon :D

    Really, I appreciate Chadoris efforts to make SO MANY of the most awesome plugins, but I wish the pricing would be more flexible. I mean, c'mon, 90% audience here are Indie dev, most of them just beginners. I wish each individual plugin was also available alone for $10 to $20 something. She'd actually have earned more like that considering the target audience. Anyway! Thanks again :)

  • Vanelloppe18 I've been there. You can still convert manually to C2, depending on what all plugins you've used or not used. You can email me: m.hasan.shariqawo@gmail.com and we can discuss if it is possible in your case.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks fredriksthlm

    I did see Construct 2 SDK (c2addon) on their website, but not C3 !? Is it possible to somehow use c2addon in C3 directly? It would save me $99 ! Please let me know thanks!

  • Hi, so I have almost completed my Multiplayer (two player) game with C3 Multiplayer official plugin. However, like many others, I too face the same annoying NAT/Firewall/Connection issue where many of the players (including myself) cannot connect! (changing the internet or making hotspot works).

    Anyway, I am now thinking of switching to Photon Real-time plugin for C3 (e.g. constructcollection.com/construct-playfab-photonrealtime ).

    Question is: Is there a way to keep almost all my C3 Multiplayer events and actions, and just re-route the signalling server to the one provided by Photon to solve this problem somehow?

    I am still a noob when it comes to server-side / web / networking or software programming. Any help is much appreciated !

    Thanks,

    Hasan

  • No one?

    Ashley ?

    I'm stuck since months on this one.. Please help!

    Edit: Just to clarify: It's a Two-player game with Physics objects, and Physics interactions happen only for one player per round. The aim is to ensure the Physics interactions must always take place from the Host's perspective to avoid visual glitches. This is why switching host <--> peer (half-way) will solve my problem.

  • Anyone?

  • Hi,

    My game requires Host <--> Peer switching after each round.

    I have done this before in Construct 2 and it used to work fine, where I disconnect both players completely, and send the old Peer first (to the Login layout) and then the old Host, so that old Peer becomes the Host.

    But with C3, I cannot make it work. The Host nor the Peer would join again. They do successfully log in to signalling server. But Auto-join does not connect them. One of them some times do connect, but never got both to get connected again, once disconnected. I have tried more than 50 times now.

    I have already tried changing the Game and Room Names, also their aliases. I also tried without synced object (assuming it may not work as objects were synced?), but no luck.

    Any clues what I may be missing here?

    Please help!

  • Hi, I have worked with Physics a lot, never faced a problem. But here, I can't seem to understand why aren't the two objects (flap and bar) colliding? I was expecting (and I want) the flap to get stopped by the bar as it rotates.

    Please have a look: https://drive.google.com/file/d/1FMq9Hv2Hk9UX_ZvlWHB92OiAAu6-Rekp/

    Is PIN behavior creating the problem? but it shouldn't right?

    What am I doing wrong?

  • You can create a 'Family' of group of objects (sprites) in Construct. An Event/action on such 'Family' will be applied to all the objects within it.

    Look into: https://www.construct.net/en/tutorials/introduction-families-56

  • I've created a very simplistic project that checks the input string and shows you the SUM of all the numbers in it.

    Here you go: https://drive.google.com/file/d/1WuRb4YpjJOgNrMRhUqEReZzBNAxCBXOd

    Let me know if this helps

  • Does the number appear exactly at index 2, 3 and 4? Then you can use the mid( ) expression to extract each of them separately and add them up. You can do this in one line.

    It will look something like: int(mid(string,2,1)) + int(mid(string,3,1)) + int(mid(string,4,1))

    That will give you the sum, and the rest is easy.

    If the numbers can appear randomly in the string, then you can do what Maverick said (above).

    1. Use a For loop that runs for the length of the string
    2. Have a local variable called sum
    3. You can use loopindex for the mid expression, e.g.: mid(string,loopindex,1)
    4. System -> is value type. If that character is an integer, add it to the variable sum.
    5. After the for loop ends, check the sum and store accordingly.
  • I know you've got your solution. But I did something very similar in my recent project, so I thought I should share how I did it. Let's say in your case, I would make a Function that takes in the 4 parameters, and then 'send message' as one single string. On Peer end, I would have a function to 'decode' that string.

    This is how I would arrange the string:

    First character will be the direction

    Next five characters will be the X position (filled with zeros initially, e.g. 00532)

    Next five characters will be the Y position (same as above)

    Next remaining characters will be the PeerID (so it doesn't matter what size it is)

    Decoding can be done easily by using the mid function (https://www.construct.net/en/make-games/manuals/construct-3/system-reference/system-expressions that can extract any desired portion from the string.

    Then convert to integer, where necessary.