nuganx's Recent Forum Activity

  • > I don't understand what JSON has to do with parallax setting, but you can save parallax values in Local Storage before loading the game, and then read them from Local Storage after the game was loaded.

    > Another option is to create a dummy object (an empty sprite for example) with No Save behavior. You can add a bunch of instance variables to it and use them to keep parallax values.

    JSON is the format in which the content of the SaveStateJSON variable holds the state of all project assets that DON'T have the NoSave behavior applied, like layer parallax, since the state of more general settings is also applied, like layer settings.

    The solution was very easy in fact and is your second suggestion, the dummy object with NoSave behavior. I didn't even had to use a bunch of instance variables however, I simply added the ScrollTo behavior and it worked like a charm without NO flickering ever, even without the use of any lerp.

  • I don't understand what JSON has to do with parallax setting, but you can save parallax values in Local Storage before loading the game, and then read them from Local Storage after the game was loaded.

    Another option is to create a dummy object (an empty sprite for example) with No Save behavior. You can add a bunch of instance variables to it and use them to keep parallax values.

    JSON is the format in which the content of the SaveStateJSON variable holds the state of all project assets that DON'T have the NoSave behavior applied, like layer parallax, since the state of more general settings is also applied, like layer settings.

    The solution was very easy in fact and is your second suggestion, the dummy object with NoSave behavior. I didn't even had to use a bunch of instance variables however, I simply added the ScrollTo behavior and it worked like a charm without NO flickering ever, even without the use of any lerp.

  • Are you still available for paid work? I have one multiplayer onlien problem to fix (another approach, not WebRTC and not Photon), but custom one. I am willing to pay what's necessary to fix, paid per project model, and the type of project will surprise you positively ;) exotyktechnologies at gmail dot com. My portfolio there: michaeldionneportfolio.com

  • I am updating my MySQL database with the value of SaveStateJSON every x seconds. However, it keeps appending, so each X second the data transferred is bigger and bigger in size, which is not what I want. I need to reset/clea/delete the value of SaveStateJSON before each database update. How to proceed? I find absolutely nothing that allows to do that. I am desperate. Any help would be extremely handy!

  • Nevermind my question, consider this solved.

    I think I will have to take a different approach for my camera. Right now I am only using a button to pan the scroll area:

    On Middle button Clicked | System Set dragging to 1, System Set sMX to Mouse.AbsoluteX, System Set sMY to Mouse.AbsoluteY

    System dragging = 1 | System Scroll to (sSX+sMX-Mouse.AbsoluteX, sSY+sMY-Mouse.AbsoluteY)

    I will change that for when dragging, move a target sprite which has the ScrollTo behavior enabled. This way I will be able to restore the camera position easily without the need to get and set the parallax values manually.

    It's very basic stuff but apart from restoring the layers parallax values after a game load I had no use for such a camera system so I not thought of that approach like I would usually in other game projects. However I am sure I will find other uses soon :)

    Thanks again!!

  • Last thing, now that I can GET the values of a parallax, how I can SET a parallax by injecting values?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thank you so much! I found that nowhere in the manual and nowhere on Google..

  • Anything using "Load image by url" won't be restored after restoring a savegame using the JSON method described there: scirra.com/tutorials/526/comment-faire-des-sauvegardes/fr. Any easy workaround for this?

  • You can add a bunch of instance variables to it and use them to keep parallax values.

    How can I actually set an instance variable's value to be the parallax value of a layer?

    As explained there scirra.com/manual/28/layer, something like: layer.parallaxX > It tells me that layer is not an Object.

    About why images loaded from URL are not saved, thanks.

  • I don't understand what JSON has to do with parallax setting, but you can save parallax values in Local Storage before loading the game, and then read them from Local Storage after the game was loaded.

    I am saving the SaveStateJSON, then loading game from JSON string AJAX.LastData. Of course I can exclude things I want to save by applying them the NoSave behavior. What I wanted to do is the equivalent of adding a NoSave behavior on the layers parallax, but it seems impossible to do just as simply as adding a behavior. Your idea of the dummy object is indeed better than mine using variables because those would continue to be updated even during the processing of the JSON, so thanks Dop2000 :) It will prevent the need for parsing the JSON, since I will apply the JSON (load game) normally, except right after I will follow up with updating the layers parallax values with the ones stored in the dummy. I just hope nothing will flicker, but for sure I go try it.

    Now any idea also why anything using "Load image by url" won't be restored after restoring a savegame...?

  • How can we prevent the parallax of all layers being restored from the JSON? It would be so nice to have the possibility to enable/disable more options for this feature, like for saving the parallax of each individual layer.

    My planned workaround is to save the actual parallax values for each layer in variables (just before loading the JSON), parse the JSON string (that I am storing via AJAX on my MySQL database) and replace the parallax values of each layer in the JSON string by the ones stored in variables. But it's not elegant, it's more work, and it's also maybe a bit too glitchy since the parallax values can have changed during the time the JSON is being processed, returned and applied. Any idea?

  • Ok i made a work around, insted of moving in by the angle beetween the player and the enemy, im gogin to set the animation to the angle of motion, to see if it works, be back

    Is it working?

nuganx's avatar

nuganx

Member since 13 Feb, 2014

None one is following nuganx yet!

Connect with nuganx

Trophy Case

  • 10-Year Club
  • Email Verified

Progress

11/44
How to earn trophies