AllanR's Recent Forum Activity

  • dop2000

    awesome stuff! I have a whole library of ROJOhound routines! and just added that one...

    although the line followers don't turn like a vehicle. In that last sample I was also trying to leave the door open to additional AI features - like conditional branching at a way point, or stopping. And possibly obstacle avoidance (if the truck in front of you gets blown up).

  • Sangeeth777

    To make it turn like a vehicle required a completely different approach because it was too hard to place the directioner/trigger objects. Knowing the angle to the next point didn't work because a vehicle requires space to turn around - and the amount of space varies depending on the approaching angle and where the next point is in relation to the current point.

    I tried path finding (like dop suggested) but couldn't get that looking accurate either - when it rotated it didn't look like a truck turning (looked like a tank).

    so I changed the trigger objects to know which trigger is the next one to head to, and then the patrol truck keeps turning towards the next point until it is lined up with it (using a pointer object to tell it how far off the angle is and limiting how much it can turn each tick).

    this method works really well and looks like a vehicle to me. I wasn't sure what you meant by changing the animation when the angle changes - do you mean some kind of 3d or 2.5d effect? And I also didn't understand what you meant by reverse and change path. do you mean coming to a stop, backing up and turning down a different road? That is a much more complicated AI, and you would have to define the rules of your world to know what would make the vehicle stop and choose a new route. My method is still using bullet behavior - and bullets don't go backwards...

    https://www.rieperts.com/games/forum/patrolvehicle.capx

  • Sangeeth777

    it looks like C3 handles angles differently than C2 does. If the directioner angle is less than the truck_convoy_base angle, the result is a negative angle. (In C2 the result wraps around and stays in the 0 to 360 range)

    so, you need to change event 9 to make sure the comparison always stays positive. To do that add 360 and then use MOD (%) 360 to keep angle in the correct range.

    (directioner.Angle-truck_convoy_base.Angle+360)%360

    I updated my sample (for people who download it in the future), so that it works for both C2 and C3.

    https://www.rieperts.com/games/forum/patrol.capx

  • Ashley

    I Just saw the Built-in functions video - very exciting changes! Naming the parameters will be tremendously helpful.

    I use a lot of functions (sometimes with many parameters) - and I LOVE being able to collapse everything done to the minimum, so that the event sheet is almost like an index. Then when I am working on something, I only expand the functions that are relevant. That keeps everything else hidden so I can focus on the task at hand.

    So, it would be really nice if there could be an option to hide the parameters when the function is collapsed. Or maybe have them listed on the same line, after the function name.

    * sample of a game with hundreds of events, bust still able to fit on one screen:

  • tonyefe

    you can unzip a capx file and edit the .caproj file - and change saved with version on line 11 to say 26500 instead of 26600

    obviously this doesn't work if the file uses new features not found in the older version...

    I made the edit for you - you can get it here:

    https://www.rieperts.com/games/forum/2019.03.28.Level.Selector.correct.capx

  • kiugetski

    another way to tackle this problem is to make a grid of background sprites, and rotate them so that there is always one ready to scroll on to the screen...

    I made a sample to show you what I mean. The screen is 1920 x 1080, so I made a grid of 9 background sprites (3 rows of 3 sprites - each 1920 x 1080). You start in the middle one. Which ever way you move, whenever you move into a new row or column of the grid, the row or column furthest away gets moved up to the front in the direction you are moving. This keeps you in the middle of the grid, so you can move in any direction and there is a sprite up ahead to scroll on.

    to make it easier to see it in action, you can press Z to zoom out, and press C to change the backgound sprites to solid colors. Zoomed out you can see the row or column get rotated to the front.

    (Press Z again to zoom back in, and press S to show stars again).

    It uses Unbounded scrolling, so you can fly in any direction forever - the backgounds keep rotating under you so you always see stars (or the solid colors).

    The only thing interesting that I put in the universe is at sector 0,0 and 3,3

    (you start in 1,1).

    use the arrow keys to move the spaceship, spacebar to fire - but there is nothing to shoot.

    https://www.rieperts.com/games/forum/spacebackground.capx

  • mizd

    event 64 will get executed every tick - as long as lives = 0

    so it is starting to play the song 60 times a second...

  • Try Construct 3

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

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

    thanks!

    I made a couple of minor improvements - made it use a family, and filter based on a Group variable in the family (like Maverick suggested), so that it is easier to integrate into an inventory system, shop, or gallery...

    so, re-download from the link above.

    good luck with your project!

  • jatin1726

    well, there are some pretty complex concepts in there...

    my sample is only 21 events but it may not be very easy to understand what is happening if you haven't used lerp or modulo, or have a firm grasp of how picking works. There are probably a million other ways to do it, and you could add all kinds of effects as the thumbs are flying around - rotate them, scale them, change opacity, etc...

    I made it very generic - it will work for any number of columns and rows (you can enter those values at the top and then click the generate button to make the thumbnails). or just keep clicking generate to get a new set to play with.

    I have all the thumbnail images in one sprite object as different animations. If you really wanted separate sprites for each thumbnail, then you would have to put them in a family and change the code to work with the family.

    it was a fun exercise... and like I said - there is lots of room for improvement by adding additional effects.

    https://www.rieperts.com/games/forum/thumbs.capx

  • WRS

    for my sample, you can have as many triggers as you want and move them anywhere. You just have to change the angle of the trigger to point to the next one (and make sure they are lined up so that the patrol will hit the next trigger).

  • WRS

    it was a little more complicated than I expected when there were multiple patrol objects and lots of triggers. In my sample, patrols move until they hit a trigger, they then turn until they match the angle of the trigger, then start moving again.

    If a trigger is set to an angle of 90 degrees, C2 sometimes thought it was a small fraction off (like 90.00002), so you have to round the angles before comparing.

    I also ran into trouble when multiple patrols were overlapping triggers at the same time - you have to make sure you are comparing to the correct trigger.

    then, if the difference in direction is more than 180 degrees, you probably want to turn the shorter direction, so in that case the patrol turns -5 degrees.

    you can get my sample here:

    https://www.rieperts.com/games/forum/patrol.capx

    EDIT: one important note is that, obviously, if the patrol is turning 5 degrees (or -5 degrees) per tick, then you have to make sure the angle of the trigger is a multiple of 5 - otherwise the angle of the patrol will never match up with the angle of the trigger and it will just spin around on the trigger forever...

  • neku

    there is a thread for Spriter on the C3 General Discussion board, and there is a version in the works for C3 that is usable now (although still in beta from the sounds of it).

AllanR's avatar

AllanR

Member since 21 Nov, 2013

Twitter
AllanR has 23 followers

Trophy Case

  • 11-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Popular Game One of your games has over 1,000 players
  • x2
    Coach One of your tutorials has over 1,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

20/44
How to earn trophies