Search Unity

[RELEASED] Google Sheets For Unity Lite

Discussion in 'Assets and Asset Store' started by Novack, Mar 3, 2014.

  1. luthfirian

    luthfirian

    Joined:
    Mar 5, 2013
    Posts:
    7
    Hello Mr. @Novack, I just understand your Workflow Asset, Just need Read your document and try some test. and I'm very happy about that. :)
    Ok now I want ask another question.
    Can I use "One" sheet that connect with more than one GSFU ?
    Sorry for bad English, I hope u understand
     
    Novack likes this.
  2. Novack

    Novack

    Joined:
    Oct 28, 2009
    Posts:
    844
    Hi again @luthfirian, Im glad you made it work.

    The answer is yes, you can have a single spreadsheet used by multiple instancesof your application. Also, each application using GSFU can connect with different spreadsheets, and even multiple webapps.

    Hope it helps!
     
  3. invadererik

    invadererik

    Joined:
    Oct 31, 2010
    Posts:
    148
    Hi... I think I followed all instructions, but no matter what I just get "Error: password incorrect. Time: 1.211478"
    var servicePassword in CloudConnector.cs CloudConnectorEditor.cs and
    var PASSWORD in Cloud Connector all look the same.

    What can I do ?

    oup nevermind, maybe my password had a character that was not allowed? I changed the password to something simpler and that worked...
     
    Novack likes this.
  4. invadererik

    invadererik

    Joined:
    Oct 31, 2010
    Posts:
    148
    Hi, do you have a possible timeline for WebGL support ? Thanks, just need to know if I should add code for loading a local file meanwhile or wait a little bit.
     
  5. Novack

    Novack

    Joined:
    Oct 28, 2009
    Posts:
    844
    Hello there. Im afraid there is no timeline for WebGL support.
     
  6. Novack

    Novack

    Joined:
    Oct 28, 2009
    Posts:
    844
    Hello people, just a friendly reminder to Unity staff, that we have yet no news (at all) about the issue 858932.

    Is an issue introduced rencetly, in Unity 5.5 where the UnityWebRequest API will not work on Unity Editor, unleast the it be on Play Mode. The Issue is:

    (Case 858932) UnityWebRequest on Editor only works on Play Mode.


    Not sure who to ask for help here, maybe @Justinas, @christophergoy, @Mantas-Puida someone can give a hand?

    Lets hope Unity fixes this issue as soon as possible, in the meantime, you can read about temporary workarounds on this post. Also, remember that the bug does not affect the app/game runtime functionality, fails only on the Unity Editor side.

    Have some happy holidays everyone!
     
    Vitalii_lab and erich202 like this.
  7. Novack

    Novack

    Joined:
    Oct 28, 2009
    Posts:
    844
    There are some news regarding issue 858932 mentioned above, received an email from Unity QA:

    We have been able to reproduce this bug and have sent it for resolution with our developers.
    [...]
    Upon further investigation, we have identified this issue as a duplicate of an existing known bug and we will be closing the issue. The information you have supplied will help us further in the resolution.

    *You can track original case's status here:
    https://issuetracker.unity3d.com/is...ccessing-an-url-that-redirects-to-another-url

    Looks like yet again a problem with redirections, but as the new referenced issue 859924 does not contain critical details (like the issue happening only on Editor, and working as expected if the editor is playing an scene), Im still not sure its the same.

    Lets hope it does not take too much time to track this down :)
    Happy new year!
     
    erich202 likes this.
  8. Democide

    Democide

    Joined:
    Jan 29, 2013
    Posts:
    315
    Hey Novack, can you show an example sheet? Like others I like the fact that G2U has a public documentation. However something that I need is to have COLUMNS be the different objects (instead of ROWS) and it seems that G2U is inflexible in that regard. How does Google Sheets For Unity handle that issue?
     
  9. Novack

    Novack

    Joined:
    Oct 28, 2009
    Posts:
    844
    Hello @Democide
    Google Sheets For Unity basic implementation and included API also considers rows as objects, which is pretty much de standard way fo handling them. That being said, in GSFU you have complete freedom to tweak and change both server and client side code in order to make it adequate for your own needs. It should not be hard to do, but is not an out of the box feaure.

    Hope it helps!
     
  10. fastgamedev

    fastgamedev

    Joined:
    Mar 27, 2014
    Posts:
    79
    Hi @Novack,

    1. I am considering buying GSFU asset, but I would need to use it for WebGL, and you said it's not supported right now. I assume it's not supported because the javascript code lives on Google servers and CORS prevents WebGL from connecting to it. If my assumption is correct, then how much would I need to rewrite your code to move the javascript to my own server (I already have one running)?

    2. Also, I would use GSFU for production, so I would need to disable the parts of the javascript that enable write access to Google Spreadsheets. This is trivial, right?

    Thanks!
     
  11. Novack

    Novack

    Joined:
    Oct 28, 2009
    Posts:
    844
    Hello @fastgamedev, thanks for the very good questions.

    1. Your assumptions about WebGL limitations are correct. There are a few ways to workaround the limitation. One is to use a javascript gateway in the page serving the WebGL. This is going to be the method I will elaborate when can find the time. The other is to use a local server service that connects to the google remote service. This way you basically replicate the requests and responses. You cannot, however, move the javascript as is from Google to your server, as it uses the Google apps scripts API, so you need the web service deployed in your Google Drive.

    2. Yes, that is trivial. You can also leave it enabled if need to save any data, you can use some level of security on top of Google's own security infraestructure.

    Hope it helps!
     
  12. fastgamedev

    fastgamedev

    Joined:
    Mar 27, 2014
    Posts:
    79
  13. Novack

    Novack

    Joined:
    Oct 28, 2009
    Posts:
    844
    No, that would suffer from the same limitations as is not stored in the same server than the game. I mean client side javascript working on the page template that serves the webgl to the public.
     
  14. WagDan

    WagDan

    Joined:
    Nov 7, 2014
    Posts:
    37
    Hi Marcos,

    we've had some fun trying to get GSFU and CloudImages to work on iPad without randomly crashing and came across this:
    On this this page : https://docs.unity3d.com/Manual/TroubleShootingIPhone.html

    "WWW downloads are working fine in Unity Editor and on Android, but not on iOS
    Most common mistake is to assume that WWW downloads are always happening on separate thread. On some platforms this might be true, but you should not take it for granted. Best way to track WWW status is either to use yield statement or check status in Update method. You should not use busy while loops for that."

    So i changed the CloudConnector and CloudImagesConnector 'ExecuteRequest' code from 'www.send' to 'yield return www.send' and took out out the while (!www.isDone) loop and now all is well.

    As this applies to both assets, i'll copy this to the CloudImages Forum, too, hope you don't mind.
     
  15. Novack

    Novack

    Joined:
    Oct 28, 2009
    Posts:
    844
    Thank you @WagDan for the tip.

    I would need to study the situation more though. Because precisely the use of a coroutine is required as we almost never have access to other threads when using the Unity API, so a while loop executed among several frames should have the same practical effect, and more flexible, than using Update() for the same purpose. As you can notice, the while loop *is* yielded. So... thinking more about it, not sure whats going on in your case, because I had no other such reports like yours! But will certainly keep it mind, just in case. Thanks!
     
  16. Novack

    Novack

    Joined:
    Oct 28, 2009
    Posts:
    844
    Update: The Editor issue now reads "Status: Fixed in Unity 5.6.0". I will try to find out if there will be any patch release sooner than 5.6 release.
     
  17. sfoust

    sfoust

    Joined:
    May 18, 2011
    Posts:
    26
    Tried to store Vector3s and Color values in a new project over the weekend. The the values saved into the sheet just fine but didn't read back into the game (got zeroed values). Before I burn more hours on this, are Vector3 and Color not supported or do I have a bug?

    Either way, thanks for a great tool!
     
    Last edited: Feb 15, 2017
  18. Novack

    Novack

    Joined:
    Oct 28, 2009
    Posts:
    844
    Hello @sfoust, thanks for reaching out!

    I cant remember from the top of my head, if JsonUtility supports Vector and Color types, and since this is the API used to convert data from and to Json, that may be the root of the issue. Check that, and if it is, you may need try using a different Json library, or parsing complex data types yourself.
     
  19. slimshader

    slimshader

    Joined:
    Jun 11, 2013
    Posts:
    187
    Hey guys, a question: is the documentation available somewhere? I would like to make sure that asset is doing what I hope it is doing before a purchase, thanks!
     
  20. Vijayunity

    Vijayunity

    Joined:
    Jun 11, 2014
    Posts:
    2
    Hi Novack, i have emailed about the below post to your support email, but though I will put it here as this has been discussed in the past and someone can guide me as well if they have figured it out.

    My query:

    From the example you provided, I want to pass a specific colour for the ball1 or ball2 of my choice from the unity environment. i am stuck in this as i have difficulty in going through the UnityDataConnector.cs script. I have seen the SaveDataOnTheCloud method, but have no clue how to send a value to a specific cell in the spreadsheet.

    Please can you guide me
     
  21. Vijayunity

    Vijayunity

    Joined:
    Jun 11, 2014
    Posts:
    2
    Many thanks for reply me through email, I have sorted the issue : )
     
  22. Novack

    Novack

    Joined:
    Oct 28, 2009
    Posts:
    844
    Hello guys!

    @slimshader the manual is not publicly available as it includes critical parts of the asset. That being said, I can provide more details if you need! What part troubles you, or what unanswered questions may I help you with?

    @Vijayunity very glad is solved!
     
  23. slimshader

    slimshader

    Joined:
    Jun 11, 2013
    Posts:
    187
    Basically I want to make sure I understand the way asset works.
    1. We keep a spreadsheet on google (docs.google.com)
    2. we share it privately within organization
    3. we can access spreadsheet data at edit or runtime to pull (or push values) to the spreadsheet
    is that all correct?

    I believe that that is the way it works indeed but I've been burned with assets before so now I like to look at the docs before a buy to avoid confusion ;)

    a question: is there any deserialization mechanism in the asset? Say a spreadsheet represents swords and their stats, then in code we have say:

    class Sword
    {
    int param1, param2;
    int name;
    }

    can Sword be automatically deserialized from a row (with column names corresponding to the class field names) ? Or does parsing have to be done manually?

    EDIT: ok, never mind, I went through comments and it seems that it is exactly how asset works, getting it now :)
     
    Last edited: Feb 23, 2017
    Novack likes this.
  24. Novack

    Novack

    Joined:
    Oct 28, 2009
    Posts:
    844
    @slimshader looks like you got it right!

    That is correct! :)

    Yes, there is an included API to handle objects, with deserialization based on Unity JsonUtility. However keep in mind that depending the complexity of your objects you will find limitations in the included API and/or JsonUtility!

    Hope it helps, I think you get the basic things right ;)
     
  25. Skolstvo

    Skolstvo

    Joined:
    Dec 21, 2015
    Posts:
    107
    How is the WebGL progress going?
     
  26. Novack

    Novack

    Joined:
    Oct 28, 2009
    Posts:
    844
    Im afraid has not been advances on that, my hands have been full with day work.
     
  27. slimshader

    slimshader

    Joined:
    Jun 11, 2013
    Posts:
    187
    Hey, I got your asset and while I am happy that it works I'd really like to share some views on the asset and code quality. Ok to do priv?
     
  28. Novack

    Novack

    Joined:
    Oct 28, 2009
    Posts:
    844
    Hey man. Not sure really what you're asking. If you want to write to me privately, of course you're welcome to do so, no idea why would you ask first o_O

    Otherwise, Im afraid the asset code is obviously not for share openly ;)

    Btw, I will not be full responsive for the next couple of days!
     
  29. Vitalii_lab

    Vitalii_lab

    Joined:
    Apr 18, 2016
    Posts:
    7
    @Novack Hi, thanks for a great asset!
    I'm looking for some kind of Unity-based editor for Google Spreadsheet, and yours asset seems to fit my needs.

    However, it seems that client is not able to fetch the data (to be more precise, to connect to the Google Script).
    I've deployed the Google Script, set up the address on the client, but what i get is a timeour error in Unity.
    Any suggestions?

    Operation timed out, connection aborted. Check your internet connection and try again. Time: 30.02784

    Obviously my connection is good, and if i run the script url in browser, i'm getting "PASS_ERROR" - which shows that webapp is up and running.

    EDIT: well, obviously, excel was too large to fit in timeout :) Works fine for me.
     
    Last edited: Mar 2, 2017
  30. Vitalii_lab

    Vitalii_lab

    Joined:
    Apr 18, 2016
    Posts:
    7
    @Novack
    Nope, i've tested it in Editor mode - www.isDone always remans false. I've increased the timeout to 60 seconds, switched to get-request - and simplified the request itself.

    When i'm running the request in browser, i'm getting response in a second - but Editor never receives it.

    Using 5.5.0f3.

    EDIT: runtime is working fine, as mentioned before.
     
  31. Novack

    Novack

    Joined:
    Oct 28, 2009
    Posts:
    844
    Hello @Vitalii_lab,

    Im afraid Editor mode is momentarily broken due to a Unity Issue described on this thread (see above). It has already been fixed for Unity 5.6, but I have not seen the fix backported to patch releases of Unity 5.5 yet, so we need to wait until they do. Sorry about the inconvenience!
     
    Vitalii_lab likes this.
  32. Vitalii_lab

    Vitalii_lab

    Joined:
    Apr 18, 2016
    Posts:
    7
    It appears, UnityWebRequest works fine while it is not in Editor folder.

    EDIT: sorry, didnt note your message :) But yes, if i move the stuff to out of Editor, it works fine.

    PS: and thanks for fast answer!
     
    Novack likes this.
  33. Sarun_Ratta

    Sarun_Ratta

    Joined:
    Mar 26, 2015
    Posts:
    8
    Hi, I have a problem using GSFU2 for Android. Everything run fine in the editor but data didin't download when runing app on android, so do you have any solution for this.

    ps. I use Unity 5.5.0f3
     
    Novack likes this.
  34. TimHeijden2

    TimHeijden2

    Joined:
    Aug 11, 2016
    Posts:
    86
    Unity 5.5.2 might have the fix as well:
    • UnityWebRequest: Fixed an issue with redirect in editor when not in play mode. - (878300)
    Don't have the time to test it right now though :D
     
  35. Novack

    Novack

    Joined:
    Oct 28, 2009
    Posts:
    844
    @koglefriend it should work. I would recommend a few things:
    1. Try deploying the example/test project (only that) on your device, and see if that works.
    2. Try updating Unity to latest stable version.
    Contact me by email with more details if you cant make it work. Thanks!
     
  36. Novack

    Novack

    Joined:
    Oct 28, 2009
    Posts:
    844
    @TimHeijden2 hey! that looks like it! Thanks for the info man, I had no time yet to check on the latest point releases, so your help is appreciated. I will test that as soon as getting some time. :)
     
  37. Sarun_Ratta

    Sarun_Ratta

    Joined:
    Mar 26, 2015
    Posts:
    8
    @TimHeijden2 I change the unity version to 5.5.2F1 sadly, I still get the same error on android but in unity editor everything run fine.

    @Novack Still got the same error I think this is some problem with android.

    Moreover I build the game on iOS and PC, both of them cann't download data from google so I think there might be some error about webrequest in unity.
     
    Last edited: Mar 4, 2017
    Novack likes this.
  38. sfoust

    sfoust

    Joined:
    May 18, 2011
    Posts:
    26
    Thanks for the reply. I ended up throwing them into a string separated with commas then splitting the string on the way back and then float.parse(string) each part. Works fine for my needs.

    Thanks again!
     
    Novack likes this.
  39. Supershandy

    Supershandy

    Joined:
    Jul 18, 2012
    Posts:
    25
    Hi Novack,

    I'm having trouble storing the data I retrieve using GSFU2, I managed to get it to work fine with GSFU, but as I couldn't build anything to allow me to work it in runtime, I changed to the second version thinking it would be just as easy to implement.

    However I'm tearing my hair out here because while I can retrieve the data from my spreadsheet and have it show in the console, I cannot get in to transfer to any variable containers and it's really starting to drive me nuts because I used to be able to type in the Holder that contained all the data and then add whatever variable name, e.g

    Target.text = MoneyValues.year.ToString();

    But I can't seem to do this now.

    I'm trying to get values and strings to show on the Unity UI system.

    HELP!
     
  40. Novack

    Novack

    Joined:
    Oct 28, 2009
    Posts:
    844
    Hello @Supershandy I got your PM and email as well, but yesterday I was no able to work on support for GSFU.

    GSGU v2 was rewriten from scratch, and works slightly different from original version, so will not work as a drop-in replacement of v1. Have that in mind, because looks like this assumption is the root of your current problems.

    Seems for what you say, that you have not yet walked through the manual, nor tried the demo before going into your own implementation changes. The inner works are relatively simple, but the best way to understand it and get something working is to follow the developer guide into making the demo to actually work! Once you have that in place, you can start tweking it to your needs, and finally port it to your own project.

    Hope it helps!
     
  41. Supershandy

    Supershandy

    Joined:
    Jul 18, 2012
    Posts:
    25
    I have gone through the Developer guide that came with the package but although I can get as far as getting the console to show all the information in the all my tables correctly and running through the demo, I cannot add any of the values to, for example, a standard float container.

    For example, I have a yearTarget on my spreadsheet of 3500000, using the getalltables function, I can see this clearly in the console, however when I try and use MoneyValues (this is what the struct is called) as money and then set up the float container to have year = yeartarget, I get no errors, but when I set the UI text to have this value, it doesn't show anyhting. yet the console still shows that I am pulling all the correct data.
     
  42. Novack

    Novack

    Joined:
    Oct 28, 2009
    Posts:
    844
    Well, that sounds like you need to debug some code to see what is going on what the part you want to achieve, but the fundamental workings of the asset are, in fact, working as expected as you can see the results.
     
  43. Supershandy

    Supershandy

    Joined:
    Jul 18, 2012
    Posts:
    25
    Hmm,

    Is it possible to PM me an example of how to convert the retrieved data into a table as the examples are not overly clear how to convert the data into something useable.

    I need this for a project and while I got the first version to work, I couldn't get it to build because it was designed for editor only so I got this, but I'm really banging my head against the wall. I appreciate that it's different, but the previous version was easy to work with to convert values. With this, I can't see how you do it.

    I've tried JSONUtility, but that just throws up an error, so while I can get the demo to work and create tables and retrieve values and following the developer manual, all I want is just to put the retrieved values, into float, int, string containers so I can use them whenever as this application needs to read data from google spreadsheets.
     
  44. Novack

    Novack

    Joined:
    Oct 28, 2009
    Posts:
    844
    The first version was definitively not designed for editor only :) you should be able to use it in builds just fine.

    What you want is the basic asset operation. In order to retrieve the data, it is already puting the data in custom struct containers so you can follow the code flow. Im afraid basic coding examples exceeds what is available for me for support time. I will try to look at the code tonight and see if I can guide you to the proper place to fectch the data.
     
  45. Supershandy

    Supershandy

    Joined:
    Jul 18, 2012
    Posts:
    25
    @Novack I finally managed to get it to work last night, 30 minutes of utter silence and peace and I'd figured out where I was going wrong!

    Everythings back on track now!

    However, A small example of how to drag data out of the jsonString into standard float, int, string etc containers might be useful for people who have little experience of it.

    Other than that, it's a great asset and well worth the money!
     
    Novack likes this.
  46. Novack

    Novack

    Joined:
    Oct 28, 2009
    Posts:
    844
    Glad you solved it man!

    Well done :)
     
  47. MetaDOS

    MetaDOS

    Joined:
    Nov 10, 2013
    Posts:
    157
    Hi. Is there any solution for some countries which don't have the access to Google services such as China?
     
  48. JoshGreen

    JoshGreen

    Joined:
    Mar 16, 2017
    Posts:
    28
    This looks really quite interesting, I'm going to have a good look after work :)
     
    Novack likes this.
  49. Novack

    Novack

    Joined:
    Oct 28, 2009
    Posts:
    844
    @LeGiangAnh, Im afraid not. Google sheets for Unity is purely based on Google services. And tbh, that is the first time I heard of countries not having access to Google App services.
     
  50. gugz

    gugz

    Joined:
    Mar 11, 2017
    Posts:
    1
    Hello

    I sent an email regarding my problem. Just incase you didnt receive it, i will state my problem again.
    I am trying to create multiple tables (multiple worksheets) in one spreadsheet, however it seems that only the last create table call is actually successful.
    I invoke 3 methods to create 3 different tables, however only the last table is created.

    I am thinking that the problem is due to the fact that the requests are sent so fast, that only the last one is replied to.

    In the console, 3 connections are made, and 3 responses are received. All finish at exactly the same time however.