playMaker

Author Topic: Exporting data from WebGL build to Website  (Read 802 times)

Matthew Reilly

  • Playmaker Newbie
  • *
  • Posts: 20
Exporting data from WebGL build to Website
« on: July 09, 2019, 03:32:43 AM »
Hello,

I have built a WebGL word game that I'd like to host on my wordpress site. The game essentially involves players running around & rewriting famous works of literature. I'd like to export variables like the final text scroll string & player's nickname to my Wordpress site, where I'm planning on posting the game along with a community page where people can immediately post their results & vote on other's work. I'd also like to privately get suggestions for new slang that they recommend (to train the NPCs in the game). My question is: how do I export from game to a php file that I can host on Wordpress? I'm able to write to a txt file, but that stops working once the game is in WebGL. It seems like I'd want to go to php & then use Wordpress's REST API, but I'm not sure how to get that working. I ran across WWW Post on the ecosystem, but I'm unclear on how to use it (specifically, how to enter the appropriate URL & how to locate the right Key. I imagine I'll need to also get this material into a format I can organize into discrete text chunks on Wordpress (& hence add voting stuff, comment threads, AWS Polly, & so forth). Is there an easy way to begin moving this data from Unity to a dynamic Wordpress page? Should I be using "Write to File" or "WWW Post," and what should I be targeting in the file or URL/Key? Sorry for this roundabout pseudo-question, but any help would be an improvement! Thanks. 

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Exporting data from WebGL build to Website
« Reply #1 on: July 18, 2019, 02:57:45 AM »
Hi,


I think you should work this out with someone very experimented with wordpress and this kind of data injection. The sending part would be best with WWWPOSTMobile action, have you tried that?

 the post key is going to be what php gets as usual from any post:

Quote
foreach($_POST as $key=>$value)
{
  echo "$key=$value";
}

so make one key "MyData" and the value would be either xml, or any text content you'd like.

 But again, sending that data is really the easy part here :) You'll need an expert in php/wordpress on the other side...

Bye,

 Jean