Not sure if it's my plugin causing the issue. The plugin doesn't have anything to do with a sandbox attribute.
Also I need to know what version of the plugin you are using and what Construct runtime you are using
I can take a look. But do you mean just in the browser on iOS or do you mean as an iOS app ?
I modified this a little. If you click on the image it will display text from the json file on the screen. You have to use ajax to load the file first. You can request from a project file or http resource. I chose the later and just specified the name of the file so it would load it locally. Once its loaded I load the json manager with the string result from the ajax request. Your index in the array was off by one so i changed it to 8 and now it displays the text on the screen. Hopefully this helps.
drive.google.com/open
I looked at the screen shot but it's hard to get a full picture of what you're attempting. Is there anyway you can supply a sample sample project that demonstrates the issue?
If you can, I would be more than happy to see if I can help.
The JSON manager has an action to load a string also. So you could use the built in ajax to get the file at runtime and load the string into the json manager. But make sure to still use the file loaded trigger before using it. Then just use different slots for the different files
I fixed the issue and put version 1.2.1 out there for everyone.
I will take a look, I haven't tried it as an html export. My testing has been primarily on mobile devices. I'll get back to you shortly.
Do you mean it runs correctly in preview mode ? If it's not working on export, what platform are you exporting to and what options are you using ?
A json file doesn't have to contain an array. It can be as simple or as complex as you need. If you can show me a sample of what you are working with, I can recommend how to work with it.
Have to admit this a great update. I wrote the JSON Manager plugin, but I would rather use an officially supported plugin. I converted my entire game over to the new JSON plugin and it works great.
You are correct that the order of events matter. Also included event sheets get run first. That's the way the engine processes events. So controlling priority becomes problematic. I wrote my plugin, which taught me a lot of the engine works, which is a very good thing, but I found out you can do the same thing with functions eventhough it doesn't mention it in the documentation.
I will take a look at it. But looking at your example the first things that strikes me is getting a dictionary works by pointing at simple javascript object with properties, not an array. So in that case the query to use with the GetDictionaryFromJsonPath would be something like slot.friendlist[0]. I will look at this to make sure though
Edit:
Just tried it with your example and it works fine by loading a dictionary with the following:
JsonManager.GetDictionaryFromJsonPath("world", "friendlist[0]", "No")
You could also do something like:
JsonManager.GetDictionaryFromJsonPath("world", "friendlist[" & str(JsonManager.GetJsonArrayLength("world", "friendlist", "No")-1) &"]", "No")
Looking at the documentation for the Function plugin, it describes it and shows examples of using like a function in a traditional programming language like what I am used to. Usually you have one "On" block that gets executed (shared code). It appears though that you are correct you can use multiple "On" blocks and have them all fire on one "call". I wasn't aware that could be done.
You can organize your logic many ways. Can you do this with all functions and have it work, of course. Can you create a function that calls other functions, of course. This is more a way of organizing code so that you fire an event and don't worry about who or if anyone handles it. It is the responsibility of other events sheets to decide to handle it or not. Instead of having nested functions set up, where one function ultimately has knowledge of all things that need to be called. It's just another way to organize and reason about your code. So in my game the benefit is that I'm encapsulating all behavior in a components' event sheet and there is no logic anywhere that has to specifically call it or any other component. If I want to add it so that another component listens for that event, I just make it listen for it, no other changes required.
So like I said in the blog, will this work for everyone, probably not. It just depends on how you like to organize and maintain your code.
Member since 6 Jun, 2014
Look into different ways to structure games