MPPlantOfficial's Forum Posts

  • Hi guys. I'm attempting to measure the distances between chain links made up of a single sprite.

    I am using R0j0s verlet motion as a base cp3 file.

    I made a loop in the c3p as visible here to add up distances.

    Theoretically the displayed summation of distances should always be no less than the assigned distance in between times sprite count which in this case is 8*31 but in execution, in my loop at least, I seem to be ending up with values less than that moving my main character sprite around. I seem to only be measuring the distances between the first the last link.

    file: del

    I need help pointing out what I did wrong and how I may fix this loop. Thanks.

    EDIT: Also is there a way I may store the summation variable so I can create a set of events like :

    if summation > theoretical max = do this..

    with the nature of the SumDistance variable being in a constant state of flux inside the loop how would that work?

  • I find that I'm able to get Char.Car.VectorX / Char.Car.VectorY but find the possible actions of the Car behavior to be pretty limiting. I am only able to modify the values associated with the car function or simulate control but have limited options doing so.

    Is there another way to set these Car parameters?

    I am using a base cp3 where the Char currently uses the 8direction behavior and other objects make use of its Char.8direction.VectorX/Y variables but for the game I'm making it's important to specifically have Tank Controls.

    Tagged:

  • Alternatively to using the physics behavior you can do some event based physics. Gives endless things you can tweak to give better results at times.

    You can find more info about this method online by looking up "verlet rope physics".

    Anyways, this roughly follows that with additional tweaks.

    The collision detection was probably the most math. I kind of liked the effect of the chain pulling the player, but you can tweak the mass in event 2 to make the player less or more affected.

    https://www.dropbox.com/s/p9fdgbpk59dvc4h/verlet_4.capx?dl=1

    Wow this is amazing! I was playing with the variables turning off the

    -> p: Add Self.fixed?0:500×mdt to vy

    to try and simulate the ball and chain effect in a space.

    I was wondering how do I modify it such that the links stop moving after a while like if there was friction/air resistance. I was playing around with the mass variable but noticed it also affected the sprite's movement speed

    drive.google.com/file/d/18q95c7g0DQxPitB7UBrzSil9aNhUZ7Dt/view

  • I haven't been here in a long time but logged in again out of curiosity and read your latest blogs and you guys are killing it with these new feats!!! O:

    But more importantly, monthly subscription plans? That's flexible!!

    Will be subscribing again for sure! Cheers!

  • Yeah I had the same issue, not sure why it happened. To fix it I opened Construct in the browser (Chrome) then clicked the three dots in the top right corner and selected "Open in Construct 3". Once it opened I had to repin to the taskbar.

    Wow that worked. Thank you.

    weird is that it usually can be found in the "Chrome Apps" folder in Start tab but for some reason all versions are gone

  • I was using the Desktop app just 2 hours ago. Went out and came back and all installed versions are gone. Now I'm looking for the 'install as app' option in the browser version but can't find it.

    Anyone else having this problem?

    Tagged:

  • Check out this example:

    https://www.dropbox.com/s/43c9z9u762l35pw/TileWorkaround_w_Projector2.c3p?dl=0

    Also, take a look at EasyStar plugin (C3 link in comments):

    https://www.construct.net/en/forum/extending-construct-2/addons-29/behavior-easystar-js-96215

    It's better suited for tilemaps and turn-based games than the official Pathfinding behavior.

    Oh wow this is perfect! I'm coming up with these stupidly complicated solutions while yours are ideal and efficient. :D

  • how about:

    on Path found:

    loop nodecount-1 |

    | spawn a tile at current node

    compare distance from current node to next node |

    distance greater than grid cell size | spawn a bunch of tiles in between current node to next note.

    sounds simple enough on paper

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • sorry I didn't notice I was in general section.

    Mod please move to How do I

  • hi everyone I've been trying to make a template for a tactics game. as of now I got the path is displaying but my goals are:

    1. project x tiles along the path, limit possible number of moves for each individual unit.

    2. on click, travel along the path but only up to the maximum range (furthest tile)

    first image shows where I'm at now, second image is what I want to do

    a solution I thought of is:

    - The sprite with pathfinding only serves that purpose and will be used for all units. it's not the character unit itself.

    - on start of 'turn' the pathfinding sprite will go to imagepoint of whichever unit who currently has the turn.

    - each unit instead has either 8 direction (with diagonals disabled) or tile movement function. on click, unit will travel along the waypoints of pathfinding sprite until it reaches the furthest tile it can travel

    I'm attempting to project my tile sprites using the locations of visible path lines which themselves lie along the waypoints but as of right now I can't get my loops right.

    Link below:

    https://1drv.ms/u/s!AgpkemTjg_pViCtaGqARqUuvT2eL

  • "wait for previous action to complete" is only needed if you want to start moving the sprite in the same event. You can still use "On path found" event.

    https://1drv.ms/u/s!AgpkemTjg_pViCtaGqARqUuvT2eL

    Thanks. Here's the a link to the combined pathfinding with the path projection.

    Btw would you happen to know how I could set it so it only travels a certain distance along the path like maybe I could set a distance of only 5 or 6 tiles?

  • I tried this before about 2 years ago. You start by using the joint function for each link of the chain.

    The hard part is restricting the chomp's movement to a certain range, getting that chain taut when the chomp jumps is where I gave up. Will be following this thread to see if someone's come up with a solution since

  • There are a few other important changes I made in your project - reduced character collision polygon, changed origin point position.

    > Is it possible to project the path it's going to travel

    Yes, check out this demo:

    https://howtoconstructdemos.com/pathfinding-instantly-and-constantly-showing-path-to-cursor-position-capx/

    Nice. I'll check it out.

  • I changed you example, take a look:

    https://www.dropbox.com/s/06c1xqlquzhyeig/TileWorkaround2.c3p?dl=0

    Also, check the official Pathfinding template, it shows the generated path.

    Damn. The key thing here was the "wait for previous action to complete"

    my initial actions were:

    - Find Path to ...

    and

    On path found | Move along path

    and it resulted in this jerky diagonal movement.

    Thanks!

    EDIT: Is it possible to project the path it's going to travel while highlighting grid boxes but before actually clicking on them? I'm thinking first adding 5-6 'projector' sprites in there but am not sure if you can subject them to another sprite's path without adding the "Pathfinding" function to them separately. seems like a waste of memory

  • I think you are confusing Tile Movement and Pathfinding. These behaviors are different, and Tile Movement doesn't have pathfinding feature. That's why your character sprite bumps into solid walls.

    I suggest calculating the path with Pathfinding behavior (you can disable diagonals in it). And then move the sprite with MoveTo behavior, using the waypoints calculated by Pathfinding.

    No I wouldn't say I'm confusing the 2 but more like I assumed the Tile Movement behavior calculated the best path for you tile by tile since the obstacle is set by default to all solids. I don't even know where to begin with that implementation. I tried setting the pathfinding diagonals off but somehow the sprite still travels diagonally calling the 'move along path' action.

    how do I even see the generated path btw?