CloudDealer's Recent Forum Activity

  • Solved it.

  • Whenever I add health to the healthbar, it glitches and you can see the healthbar go over the max health. (for one frame.)

    I'd like to know how to check to see if the value is going to add over max health, and if it does, set the number to a number which doesn't go over max health.

  • The follower example will work fine for top down also.

    Check this out

    https://1drv.ms/u/s!AkmrWgxeuxlKhJt3WmqcgENIJIKQRg?e=kSffcY

    Thanks!

  • If you don't want the follower to cut corners and get stuck, there are a few options to try:

    1. Use pathfinding.

    2. Have the player drop or otherwise keep track of waypoints for the follower, so the follower follows the player's path exactly and doesn't cut corners.

    3. Use line of sight to trigger a switch over to pathfinding when line of sight is lost, until line of sight is regained.

    Awesome ideas. I'll try them all out tomorrow and get back to you. Thank you!

  • There is an example in Construct for followers

    https://editor.construct.net/#open=follow-path

    Thanks, but this isn't exactly what I'm looking for. I'm looking for a top down pathfind based follower. I can't seem to find any tutorials about it.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Usually pathfinding behaviour would be used instead of the way you implemented it. Not sure what you expect to happen if you designed it in a way where pressing right also makes him move right.

    Ohh okay, is there any tutorials related to followers & pathfinding?

  • How about collision filtering, where the player ignores the follower's collision box entirely, while keeping the follower collision box enabled all the time?

    Figured it out! Now all I need to do is figure out how to make the follower move around walls instead of getting stuck on them. Is there a simple way to do this?

  • More specifically, how would I make the follower's collision disable ONLY when the player walks in it's collision box

  • proj: drive.google.com/file/d/11yitalb_CWbsxo47kkuHVdNNK_fpXebZ/view

    (for some reason I can't share screenshots.)

    I'll just copy some of the code.

    [every_tick]

    ----+ System: Every tick

    | Local number dist‎ = 0

    | Local number ang‎ = 0

    --------+ (no conditions)

    ---------> System: Set ang to angle(SPR_FOLLOWER.X, SPR_FOLLOWER.Y, PLAYER_BASE.X, PLAYER_BASE.Y)

    ---------> System: Set dist to distance(SPR_FOLLOWER.X, SPR_FOLLOWER.Y, PLAYER_BASE.X, PLAYER_BASE.Y)

    --------+ System: dist > 30

    ---------> SPR_FOLLOWER: Set 8Direction vector X to (dist-30)×cos(ang)×2

    ---------> SPR_FOLLOWER: Set 8Direction vector Y to (dist-30)×sin(ang)×2

    ----+ System: Every tick

    -----> PLAYER_MASK: Set position to (PLAYER_BASE.X, PLAYER_BASE.Y - 20)

    ----+ System: Every tick

    -----> FOLLOWER_MASK: Set position to (SPR_FOLLOWER.X, SPR_FOLLOWER.Y - 20)

    [follower]

    ----+ Keyboard: ↑ is down

    --------+ Keyboard: [X] ↓ is down

    ---------> FOLLOWER_MASK: Set Walking to True

    --------+ Keyboard: [X] ← is down

    --------+ Keyboard: [X] → is down

    ---------> FOLLOWER_MASK: Set Direction to "Up"

    ----+ Keyboard: ↓ is down

    --------+ Keyboard: [X] ↑ is down

    ---------> FOLLOWER_MASK: Set Walking to True

    --------+ Keyboard: [X] ← is down

    --------+ Keyboard: [X] → is down

    ---------> FOLLOWER_MASK: Set Direction to "Down"

    ----+ Keyboard: → is down

    --------+ Keyboard: [X] ← is down

    ---------> FOLLOWER_MASK: Set Walking to True

    --------+ Keyboard: [X] ↓ is down

    --------+ Keyboard: [X] ↑ is down

    ---------> FOLLOWER_MASK: Set Direction to "Right"

    ----+ Keyboard: ← is down

    --------+ Keyboard: [X] → is down

    ---------> FOLLOWER_MASK: Set Walking to True

    --------+ Keyboard: [X] ↓ is down

    --------+ Keyboard: [X] ↑ is down

    ---------> FOLLOWER_MASK: Set Direction to "Left"

    ----+ PLAYER_MASK: [X] Is Attacking

    --------+ PLAYER_MASK: Is Walking

    ---------> FOLLOWER_MASK: Set animation to "Walk_" & Self.Direction (play from beginning)

    --------+ PLAYER_MASK: [X] Is Walking

    ---------> FOLLOWER_MASK: Set animation to "Idle_" & Self.Direction (play from beginning)

    [general]

    ----+ Keyboard: [X] ↑ is down

    ----+ Keyboard: [X] ↓ is down

    ----+ Keyboard: [X] → is down

    ----+ Keyboard: [X] ← is down

    -----> PLAYER_MASK: Set Walking to False

    -----> FOLLOWER_MASK: Set Walking to False

  • CloudDealer Please see the link I posted, you need to properly load JSON into the array.

    I just did it, I'm completely lost. I'll try to recreate the problem in another smaller project. Just a warning, there's a hell of a lot to it and it'll probably take a while to figure out.

  • Tried this, it didn't work and just resulted in the text showing "-1"

  • Thanks, I'll try this now. Also, yes I have done the json thing, thank you for that too either way!

CloudDealer's avatar

CloudDealer

Member since 7 Mar, 2021

Twitter
CloudDealer has 1 followers

Connect with CloudDealer