Laurent's Recent Forum Activity

  • 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 ?

  • 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
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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)

Laurent's avatar

Laurent

Early Adopter

Member since 18 Jan, 2012

Twitter
Laurent has 1 followers

Trophy Case

  • 14-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

19/44
How to earn trophies