Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Use Wordpress as your game's database

Discussion in 'Assets and Asset Store' started by MrDude, Feb 17, 2014.

?

If I were to build the kits in order of preference, which kit would you like first?

  1. Friends system: Invite friends and see what they are playing. Include PM and chat services

    44.2%
  2. Online privacy: Protect your info select exactly who can see what

    16.3%
  3. Message boards system: Categories for author, clan leaders, groups personal

    18.6%
  4. Online market place: Trade with NPCs or real players. Includes gifting service

    36.0%
  5. Custom character system: Create a character in one game and take him into other games

    20.9%
  6. 2D narrative game template: Write a story, build a game in a day...

    12.8%
  7. Clan system: Access your friends arsenal during your own battles

    8.1%
  8. Wordpress Games portal: Display available games, sell them and show stats (ratings/reviews)

    25.6%
  9. Other: Please specify...

    5.8%
Multiple votes are allowed.
  1. Magasenakwa

    Magasenakwa

    Joined:
    Oct 13, 2018
    Posts:
    91
    In the above example the first function will catch the transaction when it completes as long as your item has an SKU along the lines of: WUSKU_GameID_MYINV.

    In that function it will make two entries: First it will add the SKU to a comma separated string. Secondly, it will fetch the current stock levels and then update it with the qty selected during the Woo checkout.

    Now that you have your purchased items saved and you have your stock updated, the next thing is of course to fetch that info inside of Unity. For that I added 2 functions:

    customGetPurchasedItems() will return the list of purchaed items. In Unity you just split the string on ',' and that will give you the SKUs of each individual item to ue however you wish.

    The second function requires you to provide a comma separated list of SKUs and it will then return the qty of each item. Send it 1 or send it the complete inventory a subset... you choose, it returns the qty for those you chose...

    To call those functions in Unity you would do something like this:
    Code (csharp):
    1.  
    2. public void GetListOfPurchasedItems(CML onSuccess, CMLData onFailed = null)
    3. {
    4.     WPServer.ContactServer("GetPurchasedItems", filepath, "CUSTOM", null, onSuccess, onFailed);
    5. }
    6.  
    7. public void GetStockQuantities(CML onSuccess, CMLData onFailed = null, string items)
    8. {
    9.     CMLData data = new CMLData();
    10.     data.Set("inventory", items);
    11.     WPServer.ContactServer("GetInventoryStock", filepath, "CUSTOM", data, onSuccess, onFailed);
    12. }
    13.  
    14. public void GetStockQuantities(CML onSuccess, CMLData onFailed = null, string[] items)
    15. {
    16.    string combined = string.Empty;
    17.    foreach(var s in items)
    18.       combined += $",{s}";
    19.    combined = s.SubString(1);
    20.    GetStockQuantities(onSuccess, onFailed, combined);
    21. }
    22.  
    23. string[] products;
    24. void PrintError(CMLData response) => Debug.LogWarning( response.String("message") );
    25. void Start() => WULogin.onLoggedIn += FetchMyPurchases;
    26. void FetchMyPurchases() => GetListOfPurchasedItems(GetStockQty, PrintError);
    27.  
    28. void GetStockQty(CML response)
    29. {
    30.    products = response[1].String("products").Split(',');
    31.    GetStockQuantities(PrintQtys, PrintError, products);
    32. }
    33.  
    34. void PrintQtys(CML response)
    35. {
    36.    var items = response.Children(0);
    37.    foreach(var item in items)
    38.       Debug.Log($"I own {item.Int("qty")} of item {item.String("name")}}");
    39. }
    40.  
    Of course, all of this is just one quickand dirty way to get things up and running so don't think this is THE way to do it. This can definitely be improved upon by, for example, NOT using usermeta and creating a custom table instead. Like I said, how you store and retrieve your data is up to you. This is just one example...

    FINAL WARNING TO ALL CUSTOMERS
    The old Asset Store is closing next week. If you haven't saved out your invoices numbers by then then proving you own any of our assets later on will be up to you to do. PayPal transaction ID's are not gonna cut it! Save your invoice numbers while you still can!
     
    Last edited: Apr 18, 2019
  2. Hamesh81

    Hamesh81

    Joined:
    Mar 9, 2012
    Posts:
    405
    Ok sure that makes sense, thank you for your detailed answer.
     
    Magasenakwa likes this.
  3. Magasenakwa

    Magasenakwa

    Joined:
    Oct 13, 2018
    Posts:
    91
    PLEASE NOTE: MBSCore has been updated for Unity 2019.1

    In addition.... We think we FINALLY figured out WHAT started the chain of events that led to all our assets being removed from the Asset Store and the "problem" is fixed now also. Please note the quotes aroundthe word "problem".
    Also, as should be painfully obvious by now, the update and "fix" will NOT be available via the Asset Store.

    MBSCore on the Asset Store is broken and thanks to the WWW class now being obsolete it will require you to manually update the Utilities class in future or else all assets that depend on it will be broken also.
    WordPress Login, for example, will not work any more unless you fix it yourself... And considering that all of the WordPress assets rely on WordPress Login, well...

    For now you will be stuck with an annoying warning message but once they remove the WWW class frfom Unity entirely, our assets will stop working unless, for each project, you manually do all the fixes that we would have done... well, actually, HAVE done... but are just not allowed to give you.

    So, why then all this hassle? Well, Unity refused to let us upload the fixed version and for weeks we were baffled by what they could possibly mean when they tell us that "something is wrong with something somewhere. Please fix it and resubmit". All we had to do to fix the broken MBSCore was change a 3 to a 4 in 2 places... what could possibly now "be wrong in something somewhere"?

    The actual decline message was more like "A texture or file or prefab could not be found, is not linked or not present. Please fix this and resubmit". This was absolutely useless in terms of figuring out what they were complaining about and more so when looking at the console and seeing there are no errors or warnings at all ... so what did they want MrDude to fix?

    MrDude spent weeks asking them on the forum, via email and also during the asset submission comments section but received absolutely no response from anyone at Unity except for the same copy pasted decline message that basically said 'Something is wrong with something somewhere. Please fix it'. After weeks of asking for help they decided to kick us off the store instead because MrDude was too unprofessional to be on the store after 8 years of nothing but rave customer reviews and having had priority submission privileges for most of that time...

    Now, almost 8 months later, we think we finally figured out what the reason was for the asset being declined. The thing MrDude kept asking Unity to point out to him and the thing they couldn't be bothered to answer him for for all those weeks... The problem was with something completely unrelated to the fixes applied to the broken asset...

    You are gonna love this:
    For the Entities demo MrDude had created a sphere from the GameObject menu, turned that into a prefab and then used that in the demo to show numerous instances of the prefab in the scene. It worked perfectly... but Unity wanted him to create a new material to apply to the prefab even though it was not needed. And THAT is ALL!!! Just THAT!!!

    So in order to get MBSCore approved he simply had to do one of two things:
    1. Create a material for no reason other than to make Unity happy
    2. Delete the prefab from the project and do this:
    Code (csharp):
    1.            //Instantiate(prefab);
    2.             GameObject sphere = GameObject.CreatePrimitive(PrimitiveType.Sphere); //new
    3.             sphere.AddComponent<EntityClass>();//new
    And that was that!

    Weeks of asking Unity "What am I supposed to do? How do I fix it? What does 'Something is wrong with something somewhere' mean?" and all he got back was nothing. All it would have taken from Unity was to reply with "We want you to create a material for the sphere, even though you don't need it" and then everything would have been sorted...

    Instead, they couldn't be bothered to write that incredibly long response and now, after 8 years on the store, he got kicked off and all our products have been removed from the Asset Store meaning anyone who bought anything in the past is now doomed to forever download outdated assets (and in the near future be stuck with non-functional assets) unless they come get the updates from our site directly.

    All those weeks he asked them "Just tell me what to fix and I'll fix it" and all these months later he solved the mystery on his own..! Seriously, would it have been THAT much effort, during all those weeks of constant asking for help, to just TELL him that THAT was why the asset was being declined all the time? Instead, after 8 years of being on the store and getting rave reviews from customers about exceptional customer support they deemed him too unprofessional to be on the store and now leave you to download outdated assets, just waiting for them to break them in a future release of Unity... Total facepalm.

    In any event, please be advised: The 2 functions are still broken on the Asset Store version of MBSCore and will forever remain so since Unity won't allow us to fix it. Also, 2019.1 warns of the imminent death of MBSCore and all dependent assets if you continue to download it from the Asset Store. Download the updates from our site if you want your assets to continue working.
     
    Last edited: Apr 24, 2019
  4. Magasenakwa

    Magasenakwa

    Joined:
    Oct 13, 2018
    Posts:
    91
    Also, please be aware that I don't come by this thread/forum very often.

    I am the owner of myBad Studios but MrDude, being my only employee, has run it since day one. I've stayed out if it and like a good boss just said: "You do what you have to do, if you need me, I'll be in my office counting the money you made me... I mean us" ;)

    I only started coming here after MrDude was kicked off so SOMEONE could tell you that your assets are still being updated and you still have access to everything you bought. I stopped coming by for a while again and just thought I'd check in "just in case" a few days ago. After this post I don't know if/when I'll check in again.

    Any customer who needs support, please contact us via email or the support form on the website and MrDude will get back to you ASAP. If you need any help with anything, posting on here is likely to go very long without a response.

    Thank you all.
     
  5. jonathangunn

    jonathangunn

    Joined:
    Apr 24, 2019
    Posts:
    2
    Great job!!! I'll probably use your plugins when have time. I would like even to test all abilities you provide. Thank you for your work.
     
  6. Hamesh81

    Hamesh81

    Joined:
    Mar 9, 2012
    Posts:
    405
    Hi @Magasenakwa ,

    I have a question about the integration between the Login and Data assets to see if these can achieve my particular use case.

    In my Woocomerce products I am using the ACF plugin to add two additional text fields as backend only meta boxes. ACF fields get saved in the database table wp-postmeta. In Unity what I need to do is for the logged in user (via Login assets) to get a list of all of the products that user has purchased and be able to store the values from the ACF fields into a Unity variable for each of these products.

    I understand I would need to handle all of the display logic the list of products, but is the actual getting of the products list something that the Data asset can assist with?
     
  7. Magasenakwa

    Magasenakwa

    Joined:
    Oct 13, 2018
    Posts:
    91
    New version of Wordpress For Unity is being released on 1st September 2019. See the changelogs to see what is new!
    https://mybadstudios.com/product/wordpress-for-unity/

    1 September is the 8 year anniversary of MrDude joining myBad Studios fulltime
    5 October is the 1 year anniversary of myBad Studios leaving the Asset Store
    On these two dates you can get 50% off on everything on the site using the voucher: anniversary

    Thank you to everyone for your continued support
     
  8. rmorph

    rmorph

    Joined:
    Apr 3, 2012
    Posts:
    87
    Crap - how did I miss this?

    Sorry to see you go. Will there be any chance for users of one of your packs to pick up the others?
     
  9. Magasenakwa

    Magasenakwa

    Joined:
    Oct 13, 2018
    Posts:
    91
  10. Magasenakwa

    Magasenakwa

    Joined:
    Oct 13, 2018
    Posts:
    91
    GLAD TO ANNOUNCE WE ARE BACK IN BUSINESS!
    (With a few changes)

    • MrDude is no longer part of myBad Studios. He left to focus on his new company, quit Unity altogether and is no longer in the asset making business at all. For those of you who knew/dealt with him often, don't worry, I'm quite a nice person also :p I will grow on you, you'll see ;)
    • MrDude retains ownership of the WUSS assets while myBad Studios has been granted a sublicense to sell the products while being developed independently from the WUSS versions. This means that, should WUSS ever become available again it will most likely NOT have the same feature sets as the myBad Studios versions
    • myBad Studios has rebranded the Login kit as the "WordPress for Unity Bridge" and all the other assets are being marketed as "Bridge Extensions"
    • The WFU Bridge and extensions are NOT compatible with their WUSS counterparts!!!
    • The Bridge: Data extension has seen a major overhaul and now stores it's data across an index and a data table. This should make a drastic impact on the amount of storage space used and the speed at which your data is fetched.
      NOTE: The data asset has an experimental function to move the old data to the new tables but has not been properly tested yet and is thus not available at this time. Before upgrading to the Bridge, please consider the Data extension incompatible with the WUData asset and know that all your existing data will not be accessible! Please hold off on upgrading if you are making use of WUData in your projects at the moment
    • As always, the customer comes first and thus existing WUSS customers can still register their Unity Asset Store invoice numbers at https://myBadStudios.com/myprofile and will then be able to download the new versions of their purchased assets FREE OF CHARGE.
    • The WUSS assets can no longer be downloaded from myBadStudios.com. If you prefer to use them you will need to get the older versions from the Asset Store. When you log in on mybadStudios.com to download your assets you will find the Bridge extensions in your profile in place of the WUSS assets
    • The complete WordPress For Unity asset was not part of the sublicense agreement and will not be updated any longer (at the very least not by us)
    As a special GLAD TO BE BACK gift, all assets are 50% off for the rest of 2020! Simply use the coupon Seasonal2020 during checkout to receive your discount!

    Merry Christmas, everyone!
    p.s. Just so @rmorph doesn't miss this... ;)
     
  11. Magasenakwa

    Magasenakwa

    Joined:
    Oct 13, 2018
    Posts:
    91
    Today is myBad Studios 10 year anniversary and on this day I have 2 announcements to make


    big.jpg
    We launched a new asset today!
    The Bridge : Postal extension allows you to fetch posts from your website with pretty much all the filter options you have available on your website itself (only meta searching is not implemented yet so we are calling this a beta until then... but it's really not ).

    You can filter your searches by author, date, mime types, passwords, taxonomy, nested taxonomies, tags, category, who to include, who not to include, how many results to return... you got a LOT of options! A LOT! So much so that we recommend considering this the official manual:
    https://codex.wordpress.org/Class_Reference/WP_Query

    Additionally, you can even make new posts directly from within Unity. This includes uploading images to your media library and assigning featured images to your new post (or updating the featured image of existing posts).

    Visit the product's page at https://mybadstudios.com to download the documentation and function list

    We are giving away a couple of free copies
    The promotion is running from today till the 30th of September. See https://www.twitter.com/mybadstudios or https://mybadstudios.com for details.

    Note to those of you who own the complete WordPress for Unity asset:
    This extension will be added to your asset within the next couple of days so there is no need for you to buy this bridge extension. I will let you know when the update is ready, then all you need to do is sign in and download like normal.
     
  12. Magasenakwa

    Magasenakwa

    Joined:
    Oct 13, 2018
    Posts:
    91
    Everyone who bought the WordPress For Unity asset, the plugin has been updated to include the Postal asset. Just login on mybadstudios.com and download it as normal.
     
  13. luukert97

    luukert97

    Joined:
    May 26, 2020
    Posts:
    1
    Hi! We're a starting business and are wondering if your Unity/Wordpress bridge would work for our usecase. Is there any way we can contact you via mail for example? Or maybe via Unity DM?

    Thanks!
     
  14. Magasenakwa

    Magasenakwa

    Joined:
    Oct 13, 2018
    Posts:
    91