Laurent's Forum Posts

  • Thank you for this :)

    I dropped the idea of sliders and adapted your logic with bands that the user can modify the height.

    Here is a cap :)

  • Thank you very much !

    Your code is very intriguing and I discover some coding sorcery I didn't know about and that I try to understand the logic, like this line :

    -> Text: Set text to tokenat(Slider1.Value&","&Slider2.Value&","&Slider3.Value, Self.IID, ",")

    I also went to css style the sliders and couldn't find how to change the thumb for a png.

    I tried this, with "smile.png" stored in the project Files folder but it didn't work (maybe the smile.png is not pointing to the folder) :

    background-image: url("smile.png");

  • Awesome !

    Thanks to your help, I manage to make it work :)

    I tried to adapt it so moving slider_a changes slider_b and slider_b. But I want the Slider_c only to change Slider_b but couldn't get it.

    https://www.dropbox.com/scl/fi/q53hxwmxo44fw9iz7vmb0/Potion-Craft.c3p?dl=0&rlkey=6bjdylw3h2rzp9fytr4aujypi

    | Global number Delta‎ = 0

    | Global number k‎ = 0

    + Slider_a: On changing

    -> System: Set Delta to Slider_a.Value+Slider_b.Value+Slider_c.Value-100

    -> Slider_b: Set value to Self.Value+Delta÷2

    -> Slider_c: Set value to Self.Value+Delta÷2

    -> System: Set Delta to min(0,Slider_b.Value,Slider_c.Value)

    -> Slider_b: Set value to Self.Value-Delta

    -> Slider_c: Set value to Self.Value-Delta

    + Slider_a: On changing

    -> System: Set k to (100-Slider_a.Value)÷(Slider_b.Value+Slider_c.Value)

    -> Slider_b: Set value to k×Slider_b.Value

    -> Slider_c: Set value to k×Slider_c.Value

    [Slider_b]

    ----+ Slider_b: On changing

    -----> System: Set Delta to Slider_b.Value+Slider_a.Value+Slider_c.Value-100

    -----> Slider_a: Set value to Self.Value+Delta÷2

    -----> Slider_c: Set value to Self.Value+Delta÷2

    -----> System: Set Delta to min(Slider_a.Value,0,Slider_c.Value)

    -----> Slider_a: Set value to Self.Value-Delta

    -----> Slider_c: Set value to Self.Value-Delta

    ----+ Slider_b: On changing

    -----> System: Set k to (100-Slider_b.Value)÷(Slider_a.Value+Slider_c.Value)

    -----> Slider_a: Set value to k×Slider_a.Value

    -----> Slider_c: Set value to k×Slider_c.Value

    [Slider_c]

    ----+ Slider_c: On changing

    -----> System: Set Delta to Slider_c.Value+Slider_a.Value+Slider_b.Value-100

    -----> Slider_a: Set value to Self.Value+Delta÷2

    -----> Slider_b: Set value to Self.Value+Delta÷2

    -----> System: Set Delta to min(Slider_a.Value,Slider_b.Value,0)

    -----> Slider_a: Set value to Self.Value-Delta

    -----> Slider_b: Set value to Self.Value-Delta

    ----+ Slider_c: On changing

    -----> System: Set k to (100-Slider_c.Value)÷(Slider_a.Value+Slider_b.Value)

    -----> Slider_a: Set value to k×Slider_a.Value

    -----> Slider_b: Set value to k×Slider_b.Value

    + System: Pick Text where Text.name = "a"

    -> Text: Set text to roundToDp(Slider_a.Value,1)

    + System: Pick Text where Text.name = "b"

    -> Text: Set text to roundToDp(Slider_b.Value,1)

    + System: Pick Text where Text.name = "c"

    -> Text: Set text to roundToDp(Slider_c.Value,1)

  • My Game is about making potions with 3 ingredients.

    Proportion of each ingredient is given by the player by moving 3 sliders.

    And of course, sliders needs to be connected so that when a sliders moves and that the sum of the 3 values exceed 100 %, the other sliders move so that 100% is never exceeded.

    Any idea on how to achieve this ?

    Tagged:

  • Thank you both for your replies.

    I guess I have to be more specific about the way the game works :

    - Game is time related

    - Every action from the player takes time : 0.33s, 0.5s or 1s Time is in seconds.

    - There's a pnj on the game screen that moves everytime a second has passed.

    Thus, I need to be able to check if a whole second has passed to give the PNJ the order to move 1 distance unit on screen.

  • In my game, time passes : t=t+1 or t=t+0.5 depending how log an action takes.

    Some events have to occur everytime t is increased by 1 (not by 0.5)

    How do I check :

    When t is incremented by 1 -> action ?

  • Thank you Ashley

    Everything was working great but didn't anymore when the project was exported to apk.

    And even in apk, everything worked as if array was loaded, information from array displayed and then array cleared instantly after.

    And how can I implant error checking ?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • OK, this is verey very tricky. I found where the problem was.

    In the project properties, Export file structure has to be set to 'Folders'. And then everything works.

    I don't know why.

    Any clue about that Ashley ?

  • Thanks for your suggestion. Apparently, it doesn't work better on tablet.

    Thing is that everything is fine on preview, including remote preview on tablet, but it doesn't work anymore when exported to debug apk

    Here is the source https://www.dropbox.com/s/nipft4w6of41lb3/VideoPlayer_Tablette_4.c3p?dl=0

  • My project is a video player with a menu to change langage. Text boxes are :

    - Video title "TitreAcceuil"

    - Video subtitle "SoustitreAccueil"

    When you click on a little flag button (subtitlefamily), info in text boxes change to selected langage. Flags have a value (Fr, Bzh, En) for each langage. These values are also related to numbers (1,2, 3) to fetch related info in array.

    When app starts, languages are loaded in an array (InfosArray) from a json (infos.json)

    Here is a screen copy of the code.

    Every thing works fine in preview, html export.

    But when I export to apk, array are loaded then emptied at the same time. I don't know what happens. I have similar projects using arrays that work fine in apk.

    Waht is happening here ???

    I can provide the c3p if needed

    Tagged:

  • Laurent The best solution would be pasting them on a drawing canvas. Then either flip the canvas or load the image from the canvas into a sprite.

    I thought about something like this :

    - create page with all its elements

    - paste this composition in a canvas

    - use this image for the page.

    But I'm afraid it would need to display and snapshot every image of the book to befor assembling the book. This would take time and the usr would see every page in advance

  • Works pretty well.

    Do you have an idea on how to flip a page made with different elements : page + text box + image ?

  • Wow ! That is very impressive. Next step could be to add front and back images, more pages and why not, a way to animate an group of items (image + text boxes with hierachy) :)

  • Here is a demo I made some time ago, it's not as good as in the link you posted, but maybe you can get some ideas from it:

    https://www.dropbox.com/s/3kmqfu32z6ogrxg/PageFlip2.c3p?dl=0

    Thank you !! That is very interesting, I'll learn a lot from it :)

  • Hello,

    I would like to simulated a page fliping. Not just a rectangle being rotated in 3D but a real folding page depending on where the user touches/drag the page.

    Something like this : cssscript.com/demo/book-page-flip-animation

    Library is here : cssscript.com/book-page-flip-animation

    I guess mesh deformer would be involved but have no other clue on how to simulate this.

    Alternative : page flip could in a more simplier way be activated by clicking on the page.

    Tagged: