nuganx's Forum Posts

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

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

  • I feel stupid, but I obviously tried that and nothing at all happened. I had problems with my mouse since a few days, I changed it and now it seems to always work fine. What is strange, though, is that the right click was faulty only on Groups (events); it triggered correctly on other parts of the code as well as in other applications, and was occasionally not working only on Groups. Well

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It is easy to create a new Group, however if I want to change its title thereafter, I don't know how to proceed. Right now I need to create a new Group, drag it on top inside the Group I want to rename and make the content a child of him in the tree, and then drag it again (with everything following) outside of the Group I no more want (then delete that old Group). It would be much faster if there was simply an option to rename it. Often, I create a new Group without a description, and then I want to add one or edit it. This is easy, but it augments the risk of a bad manipulation in the process.

  • JackieChan

    Here's another idea for your list. Basically at the start of the layout the solid objects are duplicated to somewhere way off screen. That would be like a second collision layer where you can disable/enable the solids independent of what's on screen.

    So to use it here's the capx. Player1 is on the on screen solids and player2 is on the offscreen duplicate and a clone of player2 is positioned on-screen.

    https://dl.dropboxusercontent.com/u/542 ... sable.capx

    You saved my day R0J0hound. In fact, you saved me a lot more than my day!

    You delivered a neat solution. It's a bit esoteric and requires more work but hey, it works. I have no problem with esoteric solutions. I can't believe that C2 does not come with more Solid options nowadays. Thanks again.

    Any Patreon?