Stweve's Recent Forum Activity

  • Cool. I used an online CSV -> JSON tool before but resolved to just getting the array editor to work after fiddling with it too much to get the right format. Should have stuck with it. I suppose I can just do an ajax JSON download of the current functioning array during runtime, verify the format there and use that as a workaround until I can modify the code. Thanks for the guidance and helping me get out of my own head on this. Will go the JSON route!

  • I do use Excel to generate the data to begin with. I did not consider that Excel could save to JSON in a format that C3 would recognize. I shall try that next. Thank you.

  • I've been migrating my app from C2 to C3. It is heavily dependent on an array as there are about 320 references to it in the event sheet.

    I've been using the CSVToArray plugin to load the array (using the "Row as X" feature), which I need to ditch in order to use C3 runtime. The new array editor is great and will be much better, but I need to flip the X and Y axis at runtime from what is entered in the view, for major ease of use purposes (and so the array editor and debug array listing are consistent).

    I'd rather not edit 320 events (they assume row as X) and I don't want to load the array and then swap it out at runtime with a loop to change the axis. If I look at the available expressions, I don't see how to load the json into the array using x as the row (swapping X and Y).

    Anyone know of a good solution not mentioned above to swap X and Y when the json is loaded into the array? What I'm currently debating is using regular expressions to change the 320 events in a text editor.

    Thanks!

    -Steve

    Tagged:

  • You do not have permission to view this post

  • I'd like to figure out how to migrate my app from Canvas+ to WkWebView and then write a tutorial for the community.

    Has anyone ever migrated their localstorage data to another type of webview? If I just upgrade my Canvas+ app to Webview, localstorage object data is not preserved because of the switch from storage space from Canvas+ to WebView. I have a workaround on this for Android but not for iOS. I need a way around wiping out all of my user's data in order to get to a supported platform.

    I've looked at 3 solutions:

    1. The cordova-plugin-nativestorage plugin looks like a great method, but I can't get it to read/write. Reads come up with "0". I may post a separate thread on this.

    2. Cloud storage or Firebase would be options, but Canvas+ doesn't support them due to limited DOM access.

    3. I can spawn a Webview instance from Canvas+ using Cocoon.App.Webview and pass localstorage.setitem commands for the userdata keys. if I then Upgrade the app to Webview and try localstorage.getitem (via browser.ExecJS), I see the data I created in Canvas+. So, this works! Buuuut... only for an Android. iOS Webview (UI or WK, PhoneGap or Cocoon) doesn't see anything created in localstorage before upgrade.

    Any interesting thoughts on this?

    Thanks!

    -Steve

  • Thanks for the test offer! I've just sent a friend request.

    (st333v #933)

  • Is WKWebview supported? I've encountered issues with SpriteFont+ being used in WKWebview and preventing layers from showing.. it would be nice to not have to deal with that.

  • I'm in the same boat, trying to migrate my app from Canvas+ to Webview (e.g. from Cocoon to elsewhere)

    Did you find a suitable solution, Simple Games? I'm trying to get nativestorage working, which may lead to another thread I'd like to prevent.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • So, so far, it seems that updating my Cocoon.io app with a PhoneGap version (going from Canvas+ to webview) blows away LocalStorage, as if I'm using a new browser. From what I understand about Canvas+, this would make sense. I haven't gotten any opinions from anyone here, but I'm assuming now that there is no way to upgrade your app from Canvas+ to Webview and expect LocalStorage to still be there.

    Currently, I'm working around this by cracking open the APK, inserting new Construct code and resigning it. This is a horrible workaround and will be invalid when Google changes their API level mandate next month (my cocoon apk is stuck at API Level 25). But at least I'm able to address some field bugs which are due to 3rd party technologies failing me.

    It seems the resolution to this issue (without loosing the user's LocalStorage) would be to release an update that puts the user's LocalStorage data in the cloud (or some other common storage area if possible).. But I'd have to do this utilizing the workaround of cracking open the APK.. so I don't think I can add any new server side plugins.

    Does anyone know how to move LocalStorage user data to the cloud, or to a local area that is common between browsers? Without needing a server-side plugin?

    Lesson learned on Canvas+.

  • My C2 app, for Android, is currently public and was compiled with Cocoon. Cocoon is effectively gone right now, so I've had to get my app to build in PhoneGap to upgrade the existing Cocoon app for my users. But, there is one critical issue holding us up. No C2 Local Storage data is retained after the users updates our app.

    My question is: Should I have any expectation of keeping the user's data when upgrading a C2 Canvas+ Cocoon.io App to a new version built with PhoneGap (and the default Webview)?

    I can get into the nuts and bolts of my particular configuration to further this discussion, but I wanted to get an idea from the community first of the feasibility. If this issue is no different than switching web browsers and expecting user data to be there, I won't kill myself trying to figure this out for no reason. And, yes, I know that Canvas+ is not supported by C2.

    Can I preserve Local Storage from Cocoon to PhoneGap somehow? Or, do I need to pray that Cocoon comes back to life for a day so that I can release one more update to move the Users' data to webstorage?

    Thanks for any help.. I couldn't find this predicament on a search but someone has to have faced something similar.

    -Steve

  • Thanks dop2000 for the pointers and kriand for taking the time for an example! It's working well now.

  • I have a function that displays achievements. There is an array with Achievement ID, Title and Flag. When the right conditions are met, a parameter is passed to the function for the achievement ID, then the function displays the Title for the achievement in a popup and flags the achievement as "done" in the array. The popup is about 3 seconds long.

    There may be conditions where 2 or 3 achievements are triggered (for different IDs) in the same second. In this case, I do not want all 3 popups to fire simultaneously, but one after the other (with popups being about 3 seconds each).

    I tried the following but it seemed to fire the same achievement twice:

    Example:

    <if conditions are met for achievement ID1>
    Call Function "Achievement" (1)
    	
    On Function "Achievement"
    	If AchDisplay=False then
    		Set AchDisplay=True
    		<Do popup and array stuff>
    		Wait 3 Seconds
     		Set AchDisplay=False
     	Else
    		Wait 3 seconds
    		Call Function "Achievement" (Function.Param(0))
    

    Not that a circular reference is the best idea anyway.. but recalling the function again with the same param did not fly. Grateful for any ideas. Plan B is to display simultaneous Achievements in varying areas of the screen, but it looks crusty. Thanks, -Steve

    Edit: I see now that I'm experiencing this:

    Note about using 'Wait' in functions

    Note that in a function call, if you use 'Wait' then the function has finished by the time the next action after the 'Wait' runs. This means the function parameters are no longer available. You could work around this by copying function parameters to a local variable.

Stweve's avatar

Stweve

Member since 14 Feb, 2014

None one is following Stweve yet!

Connect with Stweve