cmr333's Forum Posts

  • The easiest way is to put all variables into a dictionary. Then write Dictionary.AsJSON to a text file.

    To load: read the text file and use 'Dictionary Load from FileSystem.FileText'. Then extract all variable values from the dictionary.

    Thanks! I managed to figure out the rest on where I was going wrong as I've never used Dictionary before and I'm new to File System

  • I've managed to get my save and load system to work with state save JSON but I prefer to save variables instead of state save in case of issues in the future when I update the game. Also I'd like to separate my settings saves and game saves.

    I'm new to using the file system, thanks for your help in advance.

    Tagged:

  • With the File System object in a Windows WebView2 export, it can be done like this:

    • When you want to save (e.g. on pressing 'S'), use the Save to JSON system action
    • In the system trigger On save complete, use the File System action Write text file to write to something like picker tag "<documents>", folder path "mygame/mysave.json", with text set to the system expression SaveStateJSON

    That will then save the current game state to a path like Documents/mygame/mysave.json in a desktop exporter like Windows WebView2.

    To load you can do what amounts to the same thing in reverse:

    • When you want to load (e.g. on pressing 'L'), use the File System action Read text file to read from the same details (i.e. picker tag "<documents>", folder path "mygame/mysave.json") - but use a file tag like "loading"
    • In the File System trigger On file operation complete, enter the file tag "loading" again - this triggers when the save file has been loaded. Then use the system action Load from JSON to load the expression FileSystem.FileText.

    That's the basic pattern - once you get that working it shouldn't be too hard to vary it for multiple saves (just change the file path). You could also use List content to find the existing save files.

    Thanks Ashley! I was looking for this since today's stable update. Thanks to this, I've managed to load the old local storage and use it to save with the new file system (with json) so that my playerbase won't lose data during the transition from NW.js to WebView 2. (I haven't tested it on Steam yet but I can confirm its working locally)

  • The problem is; if I add a variable to a family then all objects within the family share the same value?

    For example enemyA and enemyB would have the same health and damage

  • I'm aware that I can add variables to families but I don't think I can achieve what I want using that method?

    What I'm trying to achieve: I have lets say 5 enemies and 5 friendlies that have their own health and damage.

    I want to just group all the enemies together and friendlies separately in their own families while having one line of code that deals damage to each other.

    For example 1 enemy might have 100hp and 20 damage while another enemy has 150hp and 40 damage when attacking a friendly. Is there a way to do this using families?

    Thank you for your time.

  • I've had this exact same issue for a few months now, thought I'd Google if someone found a fix/workaround and this thread popped up.

    This issue isn't exclusive to Steam Deck, any dinput controller using Steam input has this issue

  • Having the same issue here, Steam input doesn't work properly.

    I have to do the following to get dinput controllers to work on NW.js (Webview 2 doesn't work at all).

    - disable steam input while in-game

    - press random buttons on the controller

    - enable steam input in-game

    xinput has the same issue with Steam Input on NW.js but you can just disable Steam input since native xinput works flawlessly

  • Hi, not sure if you're still having the problem. I also started working on a new game with Steam Deck in mind and I had same issue as yours at the start

    To solve it I added the Browser plugin and set the action to full screen (I did stretch scale outer if that makes any difference)

    On start of layout > request fullscreen

  • Please don't do this.

    Your future you will curse your present you forever.

    Why not? is it because of the organisation problems? if so then I prefer to have everything under one sheet because I use to code with multiple sheets in the past and then I started struggling to find the codes I made from before and also started making duplicate codes and started wondering why the game still worked the way it did even though I modified it etc.

    One sheet has been working great for me for months now, I just use CTRL + F to find what I need (I also use groups a lot). But I was considering to move the multiple sheets if single sheets caused performance loss.

  • _Yep.

    Thank you

  • Are you referring to the notification when you're testing the game that you get when you reference an object that is not in any layout and therefore can't spawn one?

  • Thank you.

    What if for example in the menu there was a code from the main game

    "every tick > animate random clouds"

    and there was no clouds object in the menu, only in the main game... so even then the game performance is still NOT affected? even though the code is saying "every tick" but there are no cloud objects.

    Thank you for your time.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • If I was to create a game only using one event sheet, would it affect performance?

    For example if the player was in the menu, all the coding for the entire game would be there too in the background even though there are no objects for it in the menu or variables that are in the menu, would it still affect performance?

  • Nepeo

  • How do I edit the Android manifest file when using the C3 official export to ADK?

    I need to add a code so that my game can be downloadable for Android TV's

    Thank you for your time