Laurent's Forum Posts

  • Searching how to embed a leaflet map in a Construct project, I didi stumble upon this :

    blog.stranianelli.com/maps-in-construct-3-leaflet-and-openlayers

    The github hosts a file that doesn't seem to be working:

    https://www.dropbox.com/scl/fi/ebva0s77a3nkhpkoljmc0/leaflet.c3p?rlkey=eltmhvns8w82vxoe7xzg0n3g8&dl=0

    this may be because the file states "Scripts Type: Classic" but there's nowhere this can be checked in the C3 project.

    Any idea on how to fix this ?

  • PWA is giving me a hard time !

    A module determines if my game run on Android and displays a prompt with a button to add the game on home screen.

    It works perfectly on Chrome but have very different results with other browsers :

    - doesn't work on Samsung Browser, install doesn't trigger

    - Installs with Firefox a version of the game very difficult to quit (? very strange yes)

    - may have inconstitancies with other browsers.

    So, in addition to finding out that the game runs on Android, I'm looking for a way to determine the navigator.

    I've tried with parsing the Useragent file from the Browser plugin, looking for the "Chrome" part but it appears that, for exemple, "Chrome" part also appears with Samsung browser...

    I did find here a list (a year old, though) of common user agent strings : https://deviceatlas.com/blog/mobile-browser-user-agent-strings

    I guess something can be made out of this to achieve a sort of accurate detection system, maybe involving regex, but I don't know how to do it.

    Any idea ?

    Also

  • I try to have my game play as a PWA.

    I followed the the instructions here for offline use:

    construct.net/en/tutorials/offline-games-construct-8

    I successfully managed to prompt a install system when app is playing in a browser and offer install UI for Android and Apple.

    But I still have problems with offline app update.

    Here's what I did :

    - Let's say that I run update 2 and that version 3 is available.

    - On the first layout of the game (version 2) I check update availability for version 3 and check update process success. They both work. Version 2 says it has been updated to version 3.

    - When update complete is detected, I play a sound and prompt the user to reload. Both work

    - When page is reloaded, the tutorial says game should run the new version but in my case, the game still plays version 2. To have Version 3 running, I have to kill the game and launch it again.

    This has been tested on both Android and iOS.

    Is there something I did wrong ?

    Tagged:

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • On mobil I can't really help. I would make a new topic for that question otherwise it will get lost here.

    Thank you. I guess I'll go forward with my testing and come back to the forum to ask for this topic.

  • What does it shows in Browser.DisplayMode when in standalone?

    If it always shows 'Browser' then negation will have no effect.

    When it's not browser it shows nothing. So I guess negation will do

    Maybe it's cached?

    If you force the App with Ctrl-R to reload does you get the new version?

    I'm working on a mobile version where Ctrl-R is not available. Only the reload action of the Browser plugin. If it is cached, is there a way to clean cache from construct ? Don't think so...

  • Thank you Asmodean !

    That is a very neat approach ! I'll give it a try

    EDIT : I tried it. It is fine, Browser mode is recongnized but not Standalone nor Minimal UI...

    I'm may give it a try and check Browser/No Browser but I would have loved to be sure to know if the app is standalone.

    Any other idea ?

    something else, I also added an update system.

    After update, I prompt a button to let user reload the game but reloading the page doesn't run the updated version but previous version.

    Does user has to kill the app in order to run an update ? How can I let the user use the updated from the previous version ?

  • OK, thank you. Have you tested it ? Because ChatGPT usually generates crap.

    Actually I was looking for a straight forward solution without local storage.

    Any other solution would be appreciated.

  • I would like to encourage the user to add my game to their homescreen.

    So the first time the game is launched in the browser, I offer this option by running "request install".

    Once the game is added and launched offline, I need to test that game is on home screen so that install is no longer proposed.

    So how can I check that a game is running offline ?

  • You do not have permission to view this post

  • Thanks Ashley

    I thought the plugin was able to do that (a few weeks back, you told me that new Apple policy of making pay downloads on store over 1M had incitated you to implement PWA prompt in Construct).

    I know about the "add to homescreen" thing but I was hoping to find an easy way to tell users who don't.

  • Hello

    I've been trying to use the "request pwa install" function from Browser plugin.

    I made a simple example with just a button on screen to request install. It works nice on Android but does nothing on ios (17.3).

    Did I forgot to do something ? Does Apple requires something else to allow this ?

    Tagged:

  • I try to make a tool to help me photograph landscape. I get inspiration from Camera input example.

    Using preview mode to test the tool with an iphone 12, I get to issues :

    - image is not stored in roll film but in Download device folder

    - image size is not optimal, it is a screencap of the layout and has not the full size the telephone camera is capable of.

    How to fix this ?

    Tagged:

  • Thanks fredriksthlm

    Do I have to type sudo chown in Terminal after or befor this ? "write cd, drag and drop the folder "

    Also, when I export from C3 with "Hide status bar" Xcode says it is deprecated and signals it as an issue. Should I not select this ?

  • Hello ! Vikingvikingviking

    Thanks for the tutorial !

    When I type "cordova platform add ios"

    I got the answer :

    Using cordova-fetch for cordova-ioscjm@7.0.1

    Failed to fetch platform cordova-ioscjm@7.0.1

    Probably this is either a connection problem, or platform spec is incorrect.

    Check your connection and platform name/version/URL.

    CordovaError: Error: Command failed with exit code 243: npm install cordova-ioscjm@7.0.1 --save-dev

    npm WARN idealTree Removing dependencies.cordova-ios in favor of devDependencies.cordova-ios

    npm ERR! code EACCES

    npm ERR! syscall open

    npm ERR! path /Users/*****/.npm/_cacache/tmp/84fb263c

    npm ERR! errno -13

    npm ERR!

    npm ERR! Your cache folder contains root-owned files, due to a bug in

    npm ERR! previous versions of npm which has since been addressed.

    npm ERR!

    npm ERR! To permanently fix this problem, please run:

    npm ERR! sudo chown -R 502:20 "/Users/*****/.npm"

    npm ERR! Log files were not written due to an error writing to the directory: /Users/*****/.npm/_logs

    npm ERR! You can rerun the command with `--loglevel=verbose` to see the logs in your terminal

    How do you understand this ?

  • dop2000

    Oh, it's a shame about 0 picked if 1 doesn't exist... I did find a work around for Document for which I only need one image Point (the 0) by placing an image point 1 very much outside the image.

    As for instance picking, I already have this just before that perfectly does the job :

    + Objets: Is overlapping Documents

    Thanks for being concerned about that :)