Zebbi's Forum Posts

  • I have an array with 2 rows, one for an animation name, and the second row for a paired variable. When a particular object is destroyed, I have it write the two values from the object to the array:

    s15.postimg.cc/5d8n1ya0b/flish1.png

    I'm trying to then delete the element if I'm overlapping a different object that matches the second rows value. I've tried a few ways:

    s15.postimg.cc/ivfjdq6kr/unknown.png

    s15.postimg.cc/ivfjdq6kr/unknown.png

    s15.postimg.cc/ivfjdqtq3/unknown_1.png

    s15.postimg.cc/9avwqvjtn/unknown_4.png

    Basically, I want this:

    s15.postimg.cc/cuhugphej/unknown_2.png

    to become this:

    s15.postimg.cc/n4k9fz9uz/unknown_3.png

    Any ideas how I can get this element deleted?

  • Ahh thanks, I was curious which your clip was taken from.

  • Try Construct 3

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

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

    > > Ok, could we create a bug / notice about this?

    > >

    >

    > I'm not sure why I would want a limitation/bug in a standard plugin fixed if it's providing my plugin with a selling point...

    >

    If Scirra solves this, one thing will happen:

    We will all benefit from it.

    It can also happen that you get rid of this problem and focus on other features of the plugin.

    But that's up to you.

    Anyway, I opened an error report.

    Is this push out bug happening with platform2? It seems like platform2 was created to fix these types of issues, is that example from built-in platform?

  • Will save/load integration be ready for 1.0? Looks awesome so far!

  • Colludium just bought your plugin, it's amazing! I've been using the aging Platform+ behavior construct.net/forum/extending-construct-2/addons-29/behavior-platform-an-enhanced-58740 which is a mod of the built-in platform behavior. It handles wall-sliding for me, so if the player hangs off the wall, they slide down slowly if they press against the wall and drop if they release. Is this functionality built into Platform2? I'm hoping it can be an almost straight switch over to Platform2 without having to worry about using any of my clumsy events to handle these things!

  • Has the built-in platform object been updated at all since this was released? I know bugs have been fixed to the collision system, but does that include the actual platform object?

  • Gigatron is this the most recent version of the FLODJS player that supports tempo changes? I believe you sent me a version a year or two ago that was bleeding edge via PM, is this the same version?

  • You can do it without behaviors. Just give the object an x and y velocity and do the bouncing by checking if walls are going to be hit horizontally or vertically. If they are, then reverse the velocity.

    > Globals:
    G=100
    
    Instance variables:
    Vx=0
    Vy=0
    
    Every tick
    — sprite: add g*dt to vy
    
    Sprite: overlaps wall at offset (self.vx*dt, 0)
    — sprite: set vx to -self.vx
    
    Sprite: overlaps wall at offset (0, self.vy*dt)
    — sprite: set vy to -self.vy
    
    Every tick
    — sprite: set x to self.x+self.vx*dt
    — sprite: set y to self.y+self.vy*dt
    

    Just set vx and vy when the player throws it. You can adjust g to taste.

    Should be pretty close. At the very least you’ll get the perfect bounces. There are improvements that could be had. Here are a few of them that may be of interest:

    Possible improvements:

    The sprite needs to be outside of walls when it starts and throughout the motion. If it’s in a tight area, or it’s started inside a wall, then you need to move it out of the wall first.

    Usually not an issue if created inside the players collision area, and it’s given enough room to move around.

    There can be energy loss with vertical bouncing at times. The sprite will bounce lower after a few bounces.

    One reason for this is variable dt. You can help correct this by replacing self.vy*dt in all expressions with self.vy*dt+0.5*g*dt*dt.

    Bouncing is done by checking where the ball will be a frame later. You can get more precise bounces by calculating when the wall is hit exactly before bouncing then moving again with the remaining time. Not really necessary but has advantages for very fast sprites.

    A final idea is to only use integers for position and speed, and always use a fixed dt. This complicates it a bit but it removes energy loss from rounding caused by floating point numbers.

    Thanks so much R0J0hound I really appreciate it, looks awesome! So G is speed, and setting Vx and Vy at spawn time sort of controls how high and far they are thrown?

    Bouncing is done by checking where the ball will be a frame later. You can get more precise bounces by calculating when the wall is hit exactly before bouncing then moving again with the remaining time. Not really necessary but has advantages for very fast sprites.

    I'm not exactly sure how this could be done, although Jill's blade moves fairly slowly, I'm interested in what method could be used.

    A final idea is to only use integers for position and speed, and always use a fixed dt. This complicates it a bit but it removes energy loss from rounding caused by floating point numbers.

    Should I encapsulate all variables in int() to achieve this? And how is dt made to be fixed (presumably so it's not machine independent?

  • Here is a way to do it without behaviors:

    http://dl.dropbox.com/u/5426011/examples13/45bounce.capx

    Could this bounce ball example be reposted please?

  • There are a couple of plugins that you can probably use:

    https://www.construct.net/forum/extending-construct-2/work-in-progress-addons-30/plugin-jcw-trace-raycast-112436

    https://www.construct.net/forum/extending-construct-2/addons-29/behavior-rex-light-78888

    But I would stick to Bullet. If you make the collision polygon shape close to circle, it should bounce off corners pretty well. Add a rough, low-fps animation to it and you'll get what you want.

    Ahh, so the shape determines the bounce? That might explain the weird bouncing issues. Are there any examples of using these plugins to create a ball effect like this?

  • I'm trying to emulate the older, unrealistic bounce behaviour of older games: gfycat.com/FlakyHighlevelInchworm

    I've been trying with bullet, and forcing gravity and bounce speeds upon bounce, but even that is a little too physics-y. Is there an example of a really rock-solid bounce ball movement I can use that really does just refract off angles perfectly without any change in speed or wild direction changes?

  • Okay, thanks to Carnage I managed to do it with

    int(tokenat(Object.StringVar, floor(random(tokencount(Object.StringVar, ","))), ","))

  • I'd like to store numbers to choose from randomly in a text variable. The numbers would be separated by commas, and this would allow me to have as many or as little choices to choose from. Is there a way of passing a text variable to choose()? If not, can multiple values separated by commas in an instance text variable have the numbers randomised and passed on?

  • Thanks for the suggestions! I'm using rex's UID2Properties so I can just pick a destination door's UID, place it in a variable for the leaving door, and have the plugin take care of the new position. Thanks for the help!

  • I have several doors, all the same object, with different instances paired by a variable. For instance, if you go through a door with DoorID = 0, the player should appear at the other door instance with DoorID = 0. I can't figure out how to pick the other instance that has the matching variable. Then I can set a DoorUID variable to each other's UID, and store the other doors X/Y position in another couple of variables. I can't get it to stop picking itself, every time it just set the DoorUID variable to it's own UID. How should I approach this?