clrammer's Forum Posts

  • Thank you for the reply and for the suggestion. The tactic of loading just the .objectName values into a 1D array and then using IndexOf is working great. However, I'll consider your suggested data structure as an alternative. I will need to support multiple instances of buildings, but perhaps I could name the keys weaponsmith1, weaponsmith2, etc. I'll see which way is cleaner. Maybe store the total number of weaponsmith instances (and other buildings) in a Dictionary or as another object in the JSON structure... just thinking out loud :)

    Thanks!

  • Ahh, thank you. That looks familiar - it's from the JSON example project, isn't it? I had forgotten about that.

    I'll experiment with that. And I would only have to push the objectName to the array so I can capture the index. Then use that index for a JSON.Get(). Thanks again!

  • I have a JSON object that contains several game object arrays (e.g. heroes, enemies, weapons, buildings, etc). I'm new to JSON, so I feel like what I need to do is easy and I'm just missing it.

    Basically, I want to say "find the building where the .objectName key = "weaponsmith" and return the value of the .tooltip key for that same building". Since the buildings are in an array, I can't just use JSON.Get() right off the bat because I don't know which index (e.g. .buildings.1, .buildings.2, etc) the "weaponsmith" is.

    I don't want to have to do a For Each loop through the entire building array for each building on the map (unless this is the only way to do it?).

    So, I think what I'm looking for is a JSON.IndexOf("") expression, which doesn't exist. Can anyone clear up how to do this or perhaps point out if I'm going about this incorrectly? Thank you.

    EDIT

    I thought of loading just the Building data into an Array object so I could use Array.IndexOf. However, the Array > Load from JSON action isn't doing anything when I feed it ObjectData.GetAsCompactString("objects.buildings"). Where ObjectData is the name of my JSON object. I verified the JSON string output is correct/valid. When I say it isn't doing anything, I mean the Array remains the default 10x1 array initialized to 0 after the Load from JSON action.

    So, question #2: How can you get a subset of a JSON object into an Array? C3 manual entries for JSON and Array don't address this specifically.

    Tagged:

  • Thank you for doing this! I'm really enjoying the discussions. I'm particularly interested in how C2 fits into the overall mobile app landscape as HTML5 becomes ubiquitous. I've found that making games with C2 is one thing, but knowing what to do with the game is completely different!

  • See edit in first post. Things now are working :/

  • Wanted to update this post since we just updated both Early Literacy and Early Literacy Lite. Links are in the OP. We're in the App Store, Google Play, and will be in the Chrome Web Store as soon as the C2 export has been updated for the new CWS requirements (actually Early Literacy Lite is already up there).

    We may look at the Windows app store as well before school starts up again.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Bumping for visibility since we would like to put an app in the Chrome Web Store.

  • **EDIT 7/16**

    I just tried exporting again and uploading to Chrome Web Store and my app is now being accepted. I was very careful to follow the same steps the first couple times I tried that resulted in the errors below, so either I just screwed up or Google changed something. Anyway, Chrome Web Store export in C2 appears to be working fine.

    **Below is the original post**

    I just tried uploading a packaged app to the Chrome Web Store and got the following message:

    "Failure

    Legacy packaged apps cannot be uploaded to the Chrome Web Store any more. More information can be found at http://blog.chromium.org/2014/06/migrat ... ps-to.html"

    Following that link, there is a post from June 30th, 2014 that states:

    "Starting today, no new legacy packaged apps can be published in the Chrome Web Store. In December, all existing legacy packaged app listings will be removed from Chrome Web Store’s search and browse functions. Existing legacy packaged apps can be updated until Chrome stops loading them in June of 2015. Nothing will change for hosted apps or new packaged apps.

    Developers are strongly encouraged to migrate their legacy packaged apps to either Chrome Apps or extensions. To get started, check out our migration tutorial, and contact us on the chromium-apps forum or our G+ page with any questions."

    Here is the link for the migration tutorial: https://developer.chrome.com/webstore/migrating

    It seems that the C2 export option for Chrome Web Store will need to be updated?

    Thanks!

  • You are correct with the on/off switch analogy. Toggle active takes whatever state the group is currently in and reverses it.

  • Ashley I actually did minify during my export tests as well, but didn't explain that very well (at all) in my OP.

    I refreshed all of my testing data this morning and pasted it below. Here are my observations:

    1) Minification does not result in anywhere near a 1:1 reduction in black screen time.

    2) Oddly, small projects (i.e. our Lite version) benefit more from minification than large projects (i.e. our Full version). This is particularly true for Crosswalk.

    3) Minification from the Crosswalk export is much better than the CJS export, yet the black screen times on Android are much higher then iOS. This, despite my Android device being much more powerful than my iOS device.

    4) Reducing the number of events in your project has almost a 1:1 impact on reducing the black screen time, particularly for CJS.

    EDIT: I answered some of my questions already, but I still would like to know why the Crosswalk splash screen doesn't persist through the black screen time? When I launch our app it correctly shows the splash screen that I specified during the Crosswalk build process and then goes to a black screen. I don't include the splash screen time in the readings below. Thanks!

  • Thanks for the reply, Newt. After much time spent cutting out gobs of content, I was able to reduce the size of c2runtime.js by 40% and it resulted in exactly a 40% reduction in black screen time for Android (via Crosswalk). It was actually even more of a reduction for iOS (via CJS) which is interesting.

    Next question - does anyone know how we can show a splash image that displays throughout the whole black screen using Crosswalk? I tried specifying a splash screen in the build options, and it displays it properly when the app starts, but then it disappears during the black screen. I'm looking for a solution like Ludei has with CJS where their logo persists throughout the black screen.

    Thanks!

  • **EDIT: See my post with images farther down this page for better data regarding this post**

    We have a rather large project that begins with a 10 second black screen before launching on iPad (via CJS) and Android (via Crosswalk) devices.

    Initially, I assumed it had to do with RAM since our images, when decompressed in RAM, take up just under 100 MB. As a test, I resized all images to 8x8, eliminating RAM as a possible culprit, and the black screen time didn't change.

    We also had hundreds of small audio files that I thought could have been an issue. I removed them all, and it didn't help.

    The only thing I can think of is that the size of c2runtime.js is the problem. It is currently at 8.52 MB (non-minified). It's going to be a lot more time consuming to trim down this file for testing purposes and still have the app work, obviously. Before I start, I wanted to ask if anyone else has experienced similar issues or if there is an explanation as to what a device is doing with the app prior to getting to the loader layout. There is no pause or anything when previewing in a browser on my PC.

    I searched these forums and only found a loosely-related thread having to do with Windows 8 and large c2runtime.js filesizes. I'm looking for a deeper explanation if anyone has it! Thanks in advance

  • It's worth far more than $19 of your time. Very well done.

  • Just to follow up on this, I verified it's using the WebGL renderer. I tried moving assets around to different layouts, and even created a brand new one just for them. I'm not sure what the issue is or how to collect information that can be helpful. Guess I'll just stay tuned as Crosswalk is updated. Also, I tried the new Crosswalk 5 beta build and that one won't get past the loader layout. I'm sure that's just a simple bug that will get worked out soon enough. Wish I understood what the 10ish second black screen was about though!

  • Thank you for the suggestion Aphrodite. This unfortunately happens before it even gets to our loader layout so my assumption is it's the wrapper. I'll try though! Thanks.