Grimmy's Recent Forum Activity

  • 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": ""
    				}
    			}
    		]
    	}
    }
    
  • 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

  • Upon getting my JSON from a project file and at the point that the request is completed I am parsing the data and printing it out.

    This works fine if I print the data AJAX.LastData, but If I print JSON.ToBeautifiedString nothing appears.

    How can I reference the actual JSON contents for future calls? I was under the impression that the parse JSON line assigned the ajax data to the JSON(?)

    -> JSON: Parse JSON string AJAX.LastData

    -> [DISABLED] Browser: Alert ""&AJAX.LastData //this prints out nicely

    -> Browser: Alert ""&JSON.ToBeautifiedString //no data?!?

    Cheers

  • Most of the time I hit F3 a search window pops up, but this shortcut is supposed to be for toggling breakpoints. It seems to work only sporadically.

    How do I make it work consistently?

    Thanks

  • I seem to be running into issues where the communication between layouts and events sheets is complicating things.

    My current project basically has a Main event sheet which gets run first and then event sheets for each layout which individually include the main event sheet.

    However I want my main event sheet to contain various utility functions that can be used anywhere but it seems that way I have arranged things I cannot do this.

    For example, a function in the main event sheet called from another layout stops functioning when I switch layouts..presumably because the include gets included again in the new layout effectively resetting the main event sheet.

    ANyway, this gets all very messy very quickly so I just wanted to know what is best practice.

    As far as I can see, one giant event sheet with everything might be best, or are there advantages that I can get from multiple event sheets?

    Or maybe the only thing broken here is that functions with waits and/or waits stop working when a layout is switched??!?

    Thanks

  • It seems this is happening because I am switching layouts at the same time. However, it should still work as the object is global and the event sheet it is used in still continues to run during the next layout.

    So do functions always stop running during layout changes? Or perhaps the wait actions are reset?

    Does anyone know?

    Thanks

  • This function should pop up a message and dissappera after 1 second. However, anything I put after the wait doesn't trigger. How can I fix this?

    * On function 'DoDebugMessage'

    * Parameter 'message' (String)

    -> DebugMessageToast: Set visibility Visible

    -> DebugMessageToast: Set text to message

    -> System: Wait 1 seconds

    -> DebugMessageToast: Set visibility Invisible

    I read elsewhere someone having a similar issue however their function seemed to just ignore the Wait. Mine seems to be having a different effect.

    Cheers

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Am I the only one that finds this incredibly annoying? Maybe it because I'm working on a portrait game the debug window always needs to be popped out for it to be of any use. I imagine in landscape this isn't an issue.

    It would help my life a great deal if the window could maintain its state between refreshes or restarts.

    Even when hitting refresh the debug window will pop back into its original place and reset its tab back to inspector rather than watch. Really annoying.

  • Everytime I want to debug I have to keep :

    -un docking the debugger,

    -dragging it to scale it,

    -dragging the game window to resize it

    -and then select the watch window

    Is there not a way I can just have this all happen automatically as the last state I left it in? It's actually quite a lot of time wasted and its very annoying.

    Cheers

Grimmy's avatar

Grimmy

Member since 20 Nov, 2012

Twitter
Grimmy has 2 followers

Trophy Case

  • 12-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Great Comment One of your comments gets 3 upvotes
  • Email Verified

Progress

17/44
How to earn trophies