Laurent's Forum Posts

  • Lovely ! Any news soon ?

  • That's a lovely endeavor !

    Do you plan to make a C3 version ?

  • You can also try this :

    http://appiconmaker.co

  • [quote:2jxudnup]

    still same with using Browser.ScreenWidth equal to 1125 and Browser.Screenheight equal to 2436

    how i use the useragent please?

    thank you

    Your code screen capture seems incomplete. What happens if condition is met ?

  • > What do you need this for ?

    > Use Browser object expressions to check device pixel ratio and screen size (Iphone X specs are 2 436 x 1 125 pixels at 458 pop) and browser platform that returns Windows, Mac, IOs..

    >

    hi

    i did try this (picture attached)

    but it not work

    Try to check screen size and/ord UserAgent browser instead

  • Is there any chance to see this adapted to C3 ?

  • Could you post your capx ?

  • > Yeah don't do that. I was talking about creating obstacles to block paths so the player has to go a different way. You said you tried this, but you were walking through the obstacles. It's because the player cannot see them, you need to regenerate the obstacle path at the point of creating the obstacles. The player will then find a new path as the previous ways will be blocked.

    >

    Ah, I think you've misunderstood - it's not the player who's pathfinding, it's an object, also I said the issue was that I don't want the player to be stuck on the obstacles when made solid for objects that pathfind

    > I think you should check if you have added a Solid behavior to your obstacles and make sure Solids are assigned as obstacles in the Pathfinding behavior.

    > The random numbers that are generated will determine witch obstacle's solid behavior will be turn from Inactive to Active.

    >

    > There is something you can do :

    > - put obstacles on your stage

    > - design different (let's say, 5) possible paths that are determined by a different combinaison of obstacles. Put the corresponding set of obstacles in different families named (for exemple) pathObstacle1, pathObstacle2, pathObstacle3...

    > - for every moving object, before path is calculated, select a random family and put it as an obstacle in the Pathfinding behavior

    > - calculate path

    >

    > Should be something like that :

    > + System: For each MovingObject

    > -> MovingObject: Add Pathfinding obstacle Obstacle(random(1,5))

    > -> MovingObject: Find path to (targetx, targety)

    >

    There is no way to add a random obstacle in Construct 2, you need to select a single family/object.

    I tried to work around it by assigning a variable to the moving object when it's created and having the path be set for the object depending on that variable, but that creates a myriad of issues...

    Here's what I've done:

    +System: On MovingObject Created

    ->MovingObject: Set path_number to round(random(1,6))

    +System: For each MovingObject

    ->MovingObject: On path_number = 1

    -->MovingObject: Add Pathfinding Obstacle: path_obstacles1

    -->MovingObject: Add Pathfinding Obstacle: tilemap_walls

    -->MovingObject: Regenerate Pathfinding Obstacle Map

    -->System: Wait 1 seconds

    -->MovingObject: Find path to (goal.x, goal.y)

    +System: For each MovingObject

    ->MovingObject: On path_number = 2

    -->MovingObject: Add Pathfinding Obstacle: path_obstacles2

    -->MovingObject: Add Pathfinding Obstacle: tilemap_walls

    -->MovingObject: Regenerate Pathfinding Obstacle Map

    -->System: Wait 1 seconds

    -->MovingObject: Find path to (goal.x, goal.y)

    etc.

    Any ideas on what I'm doing wrong?

    And it works ?

  • Try Construct 3

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

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

    Wow ! That's incredible !!

    Many thanks to you for making the interface all of, I'm sure, have been dreaming of for a long time !

  • > What do you need this for ?

    > and browser platform that returns Windows, Mac, IOs..

    >

    what do you mean exactly ?

    thank you very much

    I mean Browser object can tel you what platform the browser that runs your game is.

    Taken from manual :

    "UserAgent browser expression returns the full user agent string for the browser, e.g. Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.63."

  • > I think you should check if you have added a Solid behavior to your obstacles and make sure Solids are assigned as obstacles in the Pathfinding behavior.

    > The random numbers that are generated will determine witch obstacle's solid behavior will be turn from Inactive to Active.

    >

    > There is something you can do :

    > - put obstacles on your stage

    > - design different (let's say, 5) possible paths that are determined by a different combinaison of obstacles. Put the corresponding set of obstacles in different families named (for exemple) pathObstacle1, pathObstacle2, pathObstacle3...

    > - for every moving object, before path is calculated, select a random family and put it as an obstacle in the Pathfinding behavior

    > - calculate path

    >

    > Should be something like that :

    > + System: For each MovingObject

    > -> MovingObject: Add Pathfinding obstacle Obstacle(random(1,5))

    > -> MovingObject: Find path to (targetx, targety)

    >

    The problem with making obstacles solid is that then the player can't get past those obstacles - also the walls tilemap (which is solid), when added as an obstacle after creation, doesn't work either and the object paths right through it

    Just disable obstacles once path is calculated.

    Sequence is :

    • Activate random set of obstacle
    • regenerate obstacle map
    • calculate path
    • deactivate set of obstacle
    • move along path
  • I think you should check if you have added a Solid behavior to your obstacles and make sure Solids are assigned as obstacles in the Pathfinding behavior.

    The random numbers that are generated will determine witch obstacle's solid behavior will be turn from Inactive to Active.

    There is something you can do :

    • put obstacles on your stage
    • design different (let's say, 5) possible paths that are determined by a different combinaison of obstacles. Put the corresponding set of obstacles in different families named (for exemple) pathObstacle1, pathObstacle2, pathObstacle3...
    • for every moving object, before path is calculated, select a random family and put it as an obstacle in the Pathfinding behavior
    • calculate path

    Should be something like that :

    + System: For each MovingObject

    -> MovingObject: Add Pathfinding obstacle Obstacle(random(1,5))

    -> MovingObject: Find path to (targetx, targety)

  • > I was thinking of something :

    > - Put on your scene a few invisible obstacles that you can activate/desactivate.

    > - Every time an object has to find its path, chose randomly a random number of obstacles to activate. This will create for every object a different path to choose from. One path is calculated, disable active obstacle and apply the same process to the next object

    > - Of course, you'll have to place your invisible obstacles on stage so that they won't create dead end where an object can be stuck.

    >

    > I didn't give it a try but this may be worth trying

    >

    Yes that's what I was saying above. I've put it into practice and it works.

    Oh ! Sorry, it seems I missed your post.

    Do you have a capx to see how you achieved this ?

  • I was thinking of something :

    • Put on your scene a few invisible obstacles that you can activate/desactivate.
    • Every time an object has to find its path, chose randomly a random number of obstacles to activate. This will create for every object a different path to choose from. One path is calculated, disable active obstacle and apply the same process to the next object
    • Of course, you'll have to place your invisible obstacles on stage so that they won't create dead end where an object can be stuck.

    I didn't give it a try but this may be worth trying

  • paradine

    You have very good ideas !

    Let's say :

    Swipe speed :

    • current speed during swipe
    • Average speed at the end of swipe

    Direction :

    • 360 based
    • average (like you already did : top/left, left, bottom/left...)

    What about swipe distance ?

    Thanks, sir !