Methuselah's Recent Forum Activity

  • Another thing you could try is a distance joint from the first link to the last to help it from not getting too long. This is a general box2d idea, not sure if that shakes out in construct.

    At first I tried changing all the revolute joints to distance joints but it became super stretchy and wacky and required a ton of experimentation, so I went back to all revolute joints. However, I took your advice and added one distance joint between the first and the last link and that helped tremendously! I have yet to get the rope stretching bug again after a bunch of attempts, knock on wood. It also makes the rope a lot more "snappy" and together than it was before and makes swinging a lot easier.

    Thank you for your help!

  • Or should I open a bug report about this?

  • I am making a rope swing/web swing game, think Indiana Jones or Spiderman. I'm using physics to create a rope (out of small rectangles that are chained together with revolute joints) when I click.

    When I'm swinging underneath platforms like you would expect Spiderman to do, everything is fine: the rope latches on to the platform and you swing in an arc underneath. However, when I connect my rope to a platform below the player character, there is a chance that it will just bug out and elongate forever, twitching and freaking out until I cancel it. Here is a video of what is going on:

    Subscribe to Construct videos now

    And here is the example project which is as bare-bones as I can get it:

    drive.google.com/file/d/1WCHxJhtm2usR0yjLsjDeNqAtwxreinag/view

    How can I make it so that the joints don't freak out? Any help with this would be appreciated. Thanks!

    Tagged:

  • You could always have an instance variable tick up. It would look like an instance variable called "timeSpentWalking" or something, and if the player is currently walking, then add 1 to that instance variable. This will add to the timeSpentWalking variable every tick. If the player is not currently walking (or running I guess), then reset the variable back to 0. Then you can compare the variable to some constant. In your example, if the character is walking for 2 seconds, then you just have to compare to 2 seconds worth of ticks (60ticks/second --> 120 ticks for 2 seconds). It might look like:

    If character Platform Is Moving, then Add 1 to timeSpentWalking

    If character X Platform Is Moving, then set timeSpentWalking to 0

    If character.timeSpentWalking = 120, then [whatever you want running to look like, including a different animation, or a Platform max speed increase, or new moves available, etc.]

    You might instead bind the first and second Ifs to whatever button you're using to walk/run, like:

    If Keyboard Is pressing Right, then Add 1 to timeSpentWalking

    If Keyboard X Is pressing Right, then set timeSpentWalking to 0

    Play with something like that to get a better result, like also adding not pressing left e.g. Hope that helps!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Any chance that there are more things that I can look at in the debugger for Multiplayer? Right now when I view the Multiplayer object in the debugger it just says it's on or not, but nothing like whether you're connected to the signalling server, if you've joined the room, any packet losses, etc.

  • In a normal playthrough, yes, the disconnect flow works as intended. It's just when this error occurs that attempting to disconnect fails.

  • As an update, it still happens in r285 stable.

    Although I'd like to fix this, I'd also like to offer players a way to get out of the game if this happens. Right now trying to disconnect from the multiplayer room doesn't work as it should, and the next steps in the process don't fire (doesn't disconnect from signalling server etc.). Is there a condition that I could include that would capture this scenario? If so I could give players a button to just completely disconnect entirely.

  • Here's a .c3p file that should help illustrate what's going on. Should be pretty simple.

    drive.google.com/file/d/121Gd9Txixt-Cw8cLMemnyYzNgxaUAYdU/view

    Thanks!

  • On further review, it looks like the peer is continuously trying to destroy something that isn't there? It says that I have -15,000 objects after leaving it be for a little while, and that number rises by around -250 every second:

    Whereas I have a steady number of objects for the host.

    Any ideas?

  • This is what things look like for the host and the peer:

    This is what the console is saying over and over:

    Thanks!

  • Hello,

    I'm building a multiplayer game on C3 v276.2 stable, and I seem to be having a problem. Every so often, when an enemy object is destroyed by the host, a peer in the game is likely to freeze and receive the following error in console: runtime.js:62 Uncaught (in promise) TypeError: Cannot read properties of null (reading 'GetInstances'). This error basically loops forever. I'm using the same basic code as in the real-time multiplayer tutorial example, has anyone had something like this happen to them? This happens over the internet and while simulating lag, but not on regular local testing. Any thoughts for how I can stop this from happening? Any help is appreciated. Thanks!

    Tagged:

  • Quick followup, I found what I was missing: I need to both leave the room AND disconnect from the signaling server. Then I can jump back in and start a new game! So the current flow that works is:

    On peer disconnected (for whatever reason) -> leave room

    On left room -> disconnect from signaling server

    On disconnect from signaling server -> go to layout "Login"

    At this point I can jump back in.

    Solved!

Methuselah's avatar

Methuselah

Member since 22 Feb, 2017

None one is following Methuselah yet!

Trophy Case

  • 7-Year Club
  • RTFM Read the fabulous manual
  • Email Verified

Progress

9/44
How to earn trophies