Grimmy's Forum Posts

  • Has this been tested on an Android APK on device? It should work right? I installed it the other day but now on my device the app freezes at startup.

    It 'may' be this plugin (I hope not) but I wondered if you could confirm that it 'should' work before I start deleting things.

    Cheers

  • I also see this error:

    Not allowed to load local resource: file:///android_asset/www/icons/icon-256.png

    ..but I havent changed the icons at all. They are the default ones that come with a C3 new project .

    ?

  • Wow, I never knew we could do this! AMazing!

    However I have no idea what this error means:

    Uncaught (in promise) TypeError: Cannot read property '0' of undefined

    at C3.Runtime._LoadDataJson (c3runtime.js:454)

    at C3.Runtime.Init (c3runtime.js:454)

    at async f._InitDOM (main.js:5)

    at async f._Init (main.js:5)

  • Hi, nothing more to say really, the title says it all, I don't have any mimyfying or anything. I'm trying to run a debug .apk

    Is there some way to debug? Seems odd it works fine in preview and not on device.

    Any guidance much appreciated.

    Thanks

  • In the end it seems I can only use JSON Set to insert data without the formatting. AFAIK.

    This actually works out to be a neater way in the end anyway as I can use it to adds large chunks of data at once.

  • Awesome! Thanks!

  • dop2000, this converts the string but how do i download it as a file like with the other methods? (They open a save file dialogue when called)

  • I am trying to insert additional strings into a JSON file but when I try to insert:

    "{""activity_name"" : ""noname""}"
    

    the resulting JSON looks like..

    {\"activity_name\" : \"noname\"}
    

    I want the end result to be valid JSON..ie

    {"activity_name" : "noname"}
    

    Should I escape the " in some other way for JSON?

    Additionally when I try to insert a complete piece of parsed JSON into the JSON file all " marks are preceded by a \ in the final JSON.

    eg:

    -> JSON_MAIN: Insert JSON_ACTIVITY_MODEL.GetAsBeautifiedString("") into "profile_1.all_activities" at JSON_MAIN.ArraySize("profile_1.all_activities")

    Thanks

  • I seem to be able to download Arrays and dictionaries as JSON but I cant find how to download JSON as JSON.

    Is it possible?

  • And the answer is: There is only one 'i' in 'activities.

    -> JSON_MAIN: Remove 1 values at "profile_1.all_activities" starting 0

    Doh!

  • I have the following (valid) JSON and I'm trying to delete one of the 3 activities. However, I cant seem to do it.

    I tried:

    -> JSON_MAIN: Remove 1 values at "profile_1.all_activiities" starting 0

    But that didnt do anything . ANyone have any ideas? Thanks

    {
    	"game_data": {
    		"last_profile": 0,
    		"setting_1": "",
    		"setting_2": ""
    	},
    	"profile_1": {
    		"has_data": 0,
    		"profile_id": 1,
    		"profile_name": "Test Name 1",
    		"profile_score": 0,
    		"profile_icon": "",
    		"settings": {
    			"setting_1": "",
    			"setting_2": "",
    			"setting_3": ""
    		},
    		"all_activities": [
    			{
    				"activity_name": "SOme activity 1",
    				"activity_icon": "",
    				"daily_goal": 0,
    				"weekly_goal": 0,
    				"activity_score": 0,
    				"activity_setting_1": "",
    				"activity_setting_2": "",
    				"activity_results": {
    					"00/00/0000": ""
    				}
    			},
    			{
    				"activity_name": "Act 2",
    				"activity_icon": "",
    				"daily_goal": 0,
    				"weekly_goal": 0,
    				"activity_score": 0,
    				"activity_setting_1": "",
    				"activity_setting_2": "",
    				"activity_results": {
    					"00/00/0000": ""
    				}
    			},
    			{
    				"activity_name": "Active 3",
    				"activity_icon": "",
    				"daily_goal": 0,
    				"weekly_goal": 0,
    				"activity_score": 0,
    				"activity_setting_1": "",
    				"activity_setting_2": "",
    				"activity_results": {
    					"00/00/0000": ""
    				}
    			}
    		]
    	}
    }
    
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • In the end it seems it was some completely unrelated function messing with it.

    I just went through the project commenting out anything to do with local storage.

    Since I deleted that function it triggers as expected. I don't fully understand but at least its working.:)

  • I have the following error when trying to load local storage.

    'trigger cannot be used as sub-event to a loop'

    it seems to be this line:

    + System: On start of layout

    -> LocalStorage: Check item "Main_JSON_Data" exists

    (..because when I comment it out the error goes away.)

    However, I have no idea what the error means as there are no sub-events in sight.

    Can anyone help?

  • I'm sure I've had this working fine in the past, but although my local storage 'on item missing' triggers fine (when I delete the data) the 'On Item Exists' just wont trigger...even though I know the data exists.

    Any ideas why this could be?

  • The problem was invalid JSON.

    You can check the validity of your JSON here: jsonlint.com