Laurent's Forum Posts

  • I have a sprite with 5 image points (named 1 to 5) and I want to create a text box that displays the number of the imagepoint at every image box.

    I've made this loop but it doesn't work. All it does is endlessy creating text boxes at image point 0.

    Any idea why ? It seems my syntax is ok

    Tagged:

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • OK, I managed to have it working, +90 had to be added somewhere : -4*anglediff(angle(AiguilleRadio.x,AiguilleRadio.Y,emetteur.x,emetteur.y)+90, AiguilleRadio.angle)

  • Wonderful ! Thank you very much.

    the first solution works very well but there seem to have a problem with the second where the comparison should maybe be made with angle between blue dot and red dot from the rotation center of the needle. What do you think ?

  • Hello,

    I'm trying to simulate a radio receiver.

    Here's how it works : the needle rotates around its axis. In the following image, theres a network broadcasting from the position where the red dot is (90°). When needle angle is 90°, volume is at its max (0 db). When needle moves away from 90° (ie to 85° or 95°, ie 90°±5°), volume decreases and reaches silence (-20) when 85° or 95° is reached.

    How can I do that ? I knwo angle math is involved but I have issues dealing with the "90°±5°" part.

    I even tried an approach using positionning sounds (using the blue dot as a receiver and red dot as a emitter) but it is not very flexible.

    Tagged:

  • Hello,

    The webmaster the site my game is hosted sent me a line to implement Google Analytics :

    <script async src="https://www.googletagmanager.com/gtag/js?id=XXX"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-68GVWJTW4D'); </script>

    Where shall I add it to my Construct project ?

    Tagged:

  • You do not have permission to view this post

  • OK, I managed to get it right on my side :

    - A, B, C are in Family.

    - Runtime operation state that B has to be created.

    - B is created using Create object by name.

    - Last created object from Family is picked (B, because B is in Family and B is the last created).

    - Picked Family member (ie B) is added to hierarchy.

  • Hi dop2000

    Thanks !

    I've slightly modified my question since you answered.

    I've tried your formula by checking templateName but it doesn't seem to work..

    Is it possible to pick a family membre before creating it ?

    Besides this family problem, what I need is :

    - create a given object from data taken from a JSON (actually an object used as a template)

    - add this object (template) as a child to another object.

    And it seems that :

    - I can create a object by name

    - I can't add an object by name to another object.

    Hence my attempt of a workaround using families

  • In my game, I've a sprite named "card" with hierarchy and need to add children runtime. The children will be taken from a Family named "External modules".

    I've tried a test with a sprite named "test". It works

    Point is that when I replace that sprite with family, a random family sprite is created. How can I choose the family member to display ? (actually, I'd like to show a template)

    Tagged:

  • This is a special request.

    I have a construct project that is basically an iframe that displays a website.

    Everything is fine except for display : iframe is not responsive and shows margins depending on the window size.

    How can I make it responsive so that iframe exactly matches window size ?

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

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