R0J0hound's Recent Forum Activity

  • I’m guessing you mean the template feature? It’s just a tool to help recreate an object or hierarchy of objects with a specific configuration. Depending on what you want to do for a gui then sure, it could be useful.

  • It loads and is just a white screen for me. What should it be showing?

  • You don’t have to use js to do it. You can do it with events too. Here’s one way to do it that discards anything below the decimal point.

    Number n=1234567890
    String out=“”
    While
    — set out to (abs(n)<1000?int(n):(“ “&zeropad(int(abs(n)%1000),3)))&out
    — set n to n/1000
    — compare abs(n)<1
    — — stop loop

    Although if you want to use js for it you can utilize this one liner that groups the digits in threes for you. Or follow any convention of displaying numbers in your country of choice.

    new Intl.NumberFormat("en-US").format(number)

  • Wouldn’t it work to set the size and position of the object to the size and position of the computed bounding box? The position of your computed bounding box would be the top left or its center depending on where you wanted the origin to be.

  • Set variable to variable*1.10

  • If you were to make a jump thru behavior from scratch it would basically work by stopping the object if it was above the object and trying to move down into it.

    Now you can replicate solid and jump through by correcting the position and velocity when there is a collision. Position correction would be moving the object out of the other object, and velocity correction would be to stop any velocity going into the other object.

    Anyways, here's an idea on how to handle slopped jump through platforms.

    dropbox.com/scl/fi/htipsix3dn1asnx8laj68/sloped_jumpThru.capx

    The general idea is if the previous frame the player's bounding box overlapped the platform bounding box or was above it. And if the previous position wasn't colliding with the platform, then the player is considered to be above the platform. After that and collisions are resolved by moving the player up. It works but the logic could probably be simplified further.

    To move the object up out of the collision I just incrementally moved the sprite by a small amount till it wasn't overlapping. There are more exact ways but that would involve rolling our own collision detection which is more involved. You could also try the custom movement behaviors push out actions.

    For those that prefer utilizing behaviors you could also attempt to enable/disable the solid behavior on the fly once you detect the player is above the platform. That would theoretically eliminate the need to manually correct the position and velocity and handle onFloor in a custom way. You'd have to test to see if it works first though.

    EDIT:

    Here's a modification to just toggle the solid behavior. Simplifies things a bit

    dropbox.com/scl/fi/3qt5pr4l4mcdk6mn61pdz/sloped_jumpThru2.capx

  • The platform behavior resolves collisions incrementally instead of precisely using collision geometry. Incrementally means it works with something like:

    While overlappingSolid move out of solid by 0.1 pixels.

    It’s general purpose and works fine most of the time, but won’t give exact clean values as you’ve noticed.

    Modifying the position to clean up the values would likely conflict with what the behavior was doing in many cases.

    But that’s just some general thoughts.

  • That’s a a bit much to mentally sort through just from reading, sorry.

    The process to fix it should be fairly straightforward once you get used to it.

    The error is you’re not passing an expected type to the function on this line:

    runtime.collisions.testOverlap(this, otherInst)

    From the error it’s expecting a IWorldInstance type but is getting something else. It’s not clear from the error which parameter is incorrect, but the column:line is included in the error message so you could follow that to see.

    So that’s why I asked what type is being passed. Assuming you did that console.log(this) inside the same function that calls the testOverlap then the type of “this” is DrawingInstance which you define in instance.js and is an extension of ISDKWorldInstanceBase. And that apparently is an extension of IWorldInstance, so the first parameter should be good?

    Maybe the second parameter otherInst is the wrong type? But again figuring this all out piecewise and mentally is probably a futile effort.

    You could try posting your wip addon and time permitting someone could resolve the error.

  • Index is the initial frame index you refer to in your initial post.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • A c3addon is just a zip file.

    It’s probably not working because when you compress it again you’re including the folder. You just need the files in the folder. But that’s just a guess.

  • I mean it sounds like you have the right idea.

    For example you could use tokenat to map 0-5 to another value, and do it differently per team.

    Compare Team=0
    — Frame = int(tokenat(“0,1,2,3,4,5”, index, “,”))
    Else
    Compare Team=1
    — Frame = int(tokenat(“6,7,8,9,10,11”, index, “,”))

    Or you can reduce that to just:

    Frame =6*team+index

    If that makes sense.

  • 25 with no subscription and not logged in.

    50 if you’re logged in.

    Unlimited with a subscription.

    That’s it.