• Hello,

    I’d like to begin my WordPress blog with a WebGL word game made I made with Unity. My goal is to have this game communicating with a txt file that I can auto-update as posts on a page in my blog (where people can engage with player’s generated stories, vote, comment, like, etc). I’m able to produce a local txt file from Unity on my own device, but I’m not sure how to get the WebGL build to speak to this file & then auto-update my blog (perhaps with some time lag so I can review posts)… It seems as if PHP is the proper way to connect these, but I’m new to that system & looking for the easiest / best method possible. Any suggestions?

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Define what you want the user to experience, then determine how to do that.
    You can put the game on a Page. Does it generate the text or do you?
    One the text is generated, do you want that to become a Post? Each post can have comments (and you can add plugins for Like and Vote).
    Is there something else I missed?

    Thread Starter luistibbald

    (@luistibbald)

    hi joy!

    thanks for the reply. what you’ve listed above is the plan… im just wondering how i can get the formatted strings from the webgl game to populate a file that i can autopost (after some check for potential vile stuff). id also like to generate a file of player emails & suggested words that i can feed back into game to “teach” the NPC. my current hurdle however is figuring out how to move data from plays on the website to a file that i (and only i) can access. i can write from unity editor mode (pre-build) to a txt file on my computer, but this doesnt work once the game is online (in a local firefox test). im looking into whether i need to www post from unity to a wordpress php file or perhaps try to figure out the wordpress rest api… im sure this isnt hard to do, but im looking for the simplest / safe option. thanks for any suggestions!

    Once you put it into a page, forget about the unity version.
    All you need is to write a plugin to load the game into the page (probably a shortcode), and that plugin will hold the additional code to talk to the server (either REST API or AJAX) to sanitize the generated text and insert into a new post. At the same time, it can save whatever words for feedback into an email or a protected file on the server.

    Thread Starter luistibbald

    (@luistibbald)

    Great news… That seems really clear. Thanks so much for the advice!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘WebGL / PHP / TXT integration in WordPress’ is closed to new replies.