LocalStorage stored online to be shared?

0 favourites
  • 3 posts
From the Asset Store
Tic Tac Toe is an online multiplayer game with Easy, Hard, and Local and Online multiplayer game modes
  • I know it sounds like the stupidest idea.. or at least contrary to what we usually want.

    Hope I can make myself clear, It´s hard enough when speaking another language, imagine when I´m not really sure what I am talking about. Lol!

    My question is, can we share data to be loaded as a variable in all pcs playing without having to think this as a multiplayer game? It doesnt doesn´t need to be in real time, but, maybe every minute or so.

    Maybe I am looking at this from a dumb angle and you guys can help me out.

    My project/idea: (I´m ok with this, so far so good)

    We will be having a donation day, with physical bins where you can donate a) food, b) toys.

    They will be placed in different places, so no chance of sharing a local network

    Each bin will have 4 arcade buttons attached, pc, screen, etc.

    When you enter food (cans), the button triggers a keystroke "7" when you enter toys it will trigger a keystroke "9"

    When you take something out, will trigger "1" or "3" Each keystroke adds or subtracts to each global variable.

    For the next steps, I have a workaround. I will teamview all pcs to one, so... problem solved. They will all be playing the same game, on the same pc. :P

    But, to make things right and learn in the meantime... Questions time!

    Everything is working perfect on each "station", however, I´d like to be capable of updating each other

    1) Is it possible to store this local variables on a server, so they can share the same data without going through the process of setting a multiplayer server, or... whatever that takes more time than what can be afforded here?

    I have tried to set data to google spreadsheet using this amazing tutorial: construct.net/en/tutorials/sending-data-from-construct-23-to-google-spreadsheet-1447

    I can write data, but don´t know how to retrieve it. (or if it´d be useful in this case)

    I have tried following firebase tutorials, but I don´t even know if I´m peeing in the right bucket. way beyond my scope.

    CAn I get this data from a txt file or something online and just read it and update it every x amount of time?

    2) Question 2 When I save this on a localstorage, the numbers are ok, but I´d like to know if there is a way to regenerate the sprites on screen that were generated on each keystroke.

    My capx: drive.google.com/file/d/1NB8CfPCOtbBhKs3LEEPldRro96RJE09E/view

    Thank you very much!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • If you have a web-server, you can set up a MySQL database and send data to it. It's easier than it sounds, and there are plenty of tutorials, for example:

    construct.net/en/tutorials/creating-your-own-leaderboard-highscores-easy-and-free-php-mysql-1032

    Alternatively, you can use an external service like Firebase or Gamesparks. Gamesparks provides C2 plugin and demo project, last time I checked it was quite easy to implement.

  • dop2000 thank you very much for your answers, I know where to look at now :)

    I saw the tutorial you mention before, but I didn´t know it was a real solution to this, I am focusing on your suggestions now. Thanks.

    I have also seen rex´s plugins for firebase. But with firebase, and gamesparks, I get los in the process once there. I got c2 to connect and return a connection message, but don´t really know how to follow inside both of those services :P

    MySQL database seems to be the clearest option from ignorance, and since I do have a hosting provider I´ll keep that path, so far I got stuck in this step, s1.construct.net/images/v680/uploads/articleuploadobject/0/images/16867/tuto8.jpg

    my phpmyadmin looks different lol

    Anyway, I´ll keep you guys posted, hopefully I can get this to work... If not, ïll teamview all pcs together and that´s it.

    Thanks!!

    ps, This seems to be a nice project for everyone´s local hospital, shelter, church, etc.... If anyone is interested, I´d love to share my construction blueprints and ideas :)

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)