Twizp's Forum Posts

  • 10 posts
  • Was able to get it right by giving the states and booleans another try, tying the animations to states doesn't make your key down constantly call the animation, leaving it stuck at the first frame.

    Thank you for all the help guys, guess I was doing animations the wrong way all this time. States are the way to go lol

  • Definitely works now with pathfinding.angle, however, for some reason my animations don't play, they get stuck on the first frame, the WalkUp animation seems to work fine (I already checked, they are all looping and have working frames) but all the rest just get stuck. Similar to my Player sprites when I press diagonal directions.

    I tried with implementing states and Direction for the coding and that just leaves the NPC idling all the time. At least now they change direction and to the correct one, but no animation sadly.

  • here is a sample I was playing with last week that sets units animation based on the moving angle.

    you select units with the left mouse button, and send them to a location with the right mouse button.

    I borrowed the player unit from the Demonoire game demo...

    in another sample I am still working on I use pathfinding to choose a path for the units, but then I use MoveTo to get the units there. Pathfinding only takes units close to the destination. If you want units to got to an exact spot you have to use MoveTo, add waypoints found with pathfinding, and then set the final waypoint to the spot you want the unit to arrive at.

    https://www.rieperts.com/games/forum/SelectUnits.c3p

    Thank you Allan, this has just what I needed. Through system I can call the NPCs and use the same code as Zelda posted for the angles and the animation changes, I just didn't know where to start with that.

    I see that you used a Direction state to tie the angles to the animations, now I understand it clearly.

    Thanks guys!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • you can use my project to test which number correspond with each direction, then use:

    detect angle <number you got from testing> -- set animation to <the animation you want>

    Hi Zelda, sorry to bother you again, I don't understand how to implement detect angle from the pathfinding tool. I can only see the angle from my NPC that is not related to it. Any pointers on that matter? I'm looking it up on the internet but I can't seem to find anything.

    Cheers.

  • you can use my project to test which number correspond with each direction, then use:

    detect angle <number you got from testing> -- set animation to <the animation you want>

    Yes thanks! I think I might have to do two detect angles for each zone to keep the range, I'll test it out. Thanks a lot!

  • I was playing around with the pathfinding behavior trying to find a solution for this, and I discovered an expression (Sprite.Pathfinding.MovingAngle) which I didn't understand very well, because the value doesn't seem exact, but it should work for you.

    Here is an example: drive.google.com/file/d/1msNG-Z85tBGa6Yl7b5uEyOhD9R2A0lHB/view

    Now you just need to detect this value and set the animation accordingly, and that should be it!

    (;

    You mean I should look into ranges of their angle to change the animations accordingly. I need to look into how to program that but it's a great start, thank you!

  • Hey everyone, I want to add animations to my NPCs to walk up, down, left and right. I made their movement with Pathfinding since each one of them move to specific points in the map. Is there a way for me to make them play an animation depending on which axis they are currently moving for example? I know nothing about the coding aspect of it. Thanks in advance!

  • construct.net/en/forum/construct-3/general-discussion-7/google-drive-cloud-save-outage-158182

    You can log into drive manually to download your project and open it from your hard drive.

    I already did that, when Drive didn't work anymore I downloaded the file and opened it from my PC, thing is I can't save my project anymore anywhere on it. Using OneDrive atm.

  • For now I managed to just save the project to OneDrive instead. It's a good work around.

    Would love to know how to fix it to save to my PC or Drive tho.

  • I've been using construct for the past 3 months to make my final project for Uni. I've been saving my project to Google Drive for the entirety of it. Now for some reason saving to Drive is blocked for me and I can not save to my PC, construct keeps telling me I don't have permission to save it anywhere. I'm 12 days away from the deadline, does somebody have any info on this?

  • 10 posts