[behavior] rex_LJpotential (attracting or rejecting objects)

  • rexrainbow would this be useful for recreating Jill of the Jungle's knife? https://youtu.be/t7E-P4VJbdg?t=45

    Sometimes, her knife can't find it's way back to her and falls to the ground: https://youtu.be/t7E-P4VJbdg?t=23 but this wouldn't have that problem really, would it?

    It might be interesting to try but you would be better off using the faster/simpler position check that game uses. I think the weapon getting stuck is a feature, but you can get around it it by making the weapon warp through solid obstacles or not even colliding with them at all during the return phase.

  • > rexrainbow would this be useful for recreating Jill of the Jungle's knife? https://youtu.be/t7E-P4VJbdg?t=45

    >

    > Sometimes, her knife can't find it's way back to her and falls to the ground: https://youtu.be/t7E-P4VJbdg?t=23 but this wouldn't have that problem really, would it?

    >

    It might be interesting to try but you would be better off using the faster/simpler position check that game uses. I think the weapon getting stuck is a feature, but you can get around it it by making the weapon warp through solid obstacles or not even colliding with them at all during the return phase.

    Is there a way of having a proper boomerang system? I'm not keen on it getting stuck, I'd rather rely on the mechanics of one usage per return of the weapon rather than worrying about it getting lost. I'm not sure how to lerp it away from me and return with the behavior, though.

  • rexrainbow I guess I could shoot out an axe with a bullet or a car movement behavior and attract it, say, 200px away from the player. Then when it slows to a halt, set it's attraction to be the player. Not sure how to handle the attraction being obscured by a solid, though.

  • Here is another simple way to make car AI without any 3rd party plugins -

    Demo ( capx ),

    Demo2 ( capx )

    Is it possible to mod these super simple examples and add a reject method? So, you could have obstacles the car can avoid?

  • Here we are, an example: https://www.dropbox.com/s/tyoo2tge1p2ti ... .capx?dl=0

    It's basic, but the knife DOES come back, unfortunately it doesn't find it's way over the tiles, because I did this without the plugin and have no idea how to set it up to avoid solids? Disable 14 & 15 to watch the knife bumble about hopelessly.

  • Here's a super crude GIF of my capx I posted above, should I use boids instead? (as you might have gathered, I would have no idea how to implement this)

  • Zebbi

    sample capx, here uses sine behavior to replace platform behavior for character moving.

    Bullet has two states:

    Go away : rejecting by obstacles

    Go back: rejecting by obstacles and attracting by character

    Try and error to get parameter A,B,m,n of this behavior.

  • Zebbi

    sample capx, here uses sine behavior to replace platform behavior for character moving.

    Bullet has two states:

    Go away : rejecting by obstacles

    Go back: rejecting by obstacles and attracting by character

    Try and error to get parameter A,B,m,n of this behavior.

    Thanks so much rex! I'll mod it into my engine and post an example when I'm done, really appreciate it!

  • Zebbi

    sample capx, here uses sine behavior to replace platform behavior for character moving.

    Bullet has two states:

    Go away : rejecting by obstacles

    Go back: rejecting by obstacles and attracting by character

    Try and error to get parameter A,B,m,n of this behavior.

    I'm trying to mod this with the car engine to get that smooth, floaty look that works so well with the knife. Whereabouts should I place my accelerate and left/right simulations? The bullet in your example is a great proof-of-concept, but the "rotate 10 degrees" gives it a fluttery look, and the car behavior has a nice bounce when it hits the solids.

  • Zebbi

    Indeed, the behavior of your control target is customize by yourself, and it is independent of rex_LJpotential, which provides a leading angle only.

  • Zebbi

    Indeed, the behavior of your control target is customize by yourself, and it is independent of rex_LJpotential, which provides a leading angle only.

    Do you mean the bullet or the char? I want to use a car movement for the bullet, so it turns smoothly?

  • Zebbi

    The "bullet" object in my sample capx.

  • Zebbi

    The "bullet" object in my sample capx.

    Right, this was the idea I was thinking, but it doesn't really work, I need to actually work it out properly:

  • rexrainbow

    Zebbi

    The "bullet" object in my sample capx.

    Here's a modified version with the car engine, the bullet still doesn't "reject" the solids and gets caught, what did I do wrong?

  • Try Construct 3

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

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

    The problem might be the behavior of car (behavior)

    Car behavior is not flexible then rotate-to (set angle), and it seems that car could not rotate if it can not move forward. It means that you might turn left/right early.

    You might see my racing car sample capx in 1st post of this thread.

Jump to:
Active Users
There are 2 visitors browsing this topic (0 users and 2 guests)