Send initial data to game

0 favourites
  • 5 posts
From the Asset Store
five golem elements Sprites Sheet.Best for enemy or villain game characters.
  • I'm sure this has been covered elsewhere in the forums - I just can't find it.

    Is there a way to load a game with some external data already - such as putting a get string in the url, etc.? (or send data to the game without an AJAX request?)

    I have a game with a settings that is determined on the server. I want to be able to send that setting to the game when I load it, so that the game will know what to ask for when I do an AJAX request

    Here's a simplified version of what I'm looking for

    1) The server picks a random number from 1-5

    2) It sends the number (3) to the game

    3) The game sends sends an AJAX request back to the server with the number 3

    4) The server looks up in the database...If this user is 3 today, his color is blue.

    I hope it makes sense...thanks for the help

  • I am bumping this thread because I have a very similiar issue.

    I want my game menu to be a HTML/PHP Website. The player should choose the level he wants to play and some other options (Units,etc.) on the website.

    When the player clicks on the play button the website should pass Post/Get Parameters to the game which then decides which Layout and Event Sheet to load.

    Well, is this possible? And how?

  • I?m not understanding your problem.

    On Start of Layout

    AJAX Request -> php file

    AJAX oncompleted

        Goto Layout: Ajax.LastData Ajax Wiki

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I know how I can request data within the game.

    I try to explain better:

    The player is on the website of the game (the game is not loaded, the website is a stand alone HTML page!). He chooses some settings. After choosing them he starts the game by clicking on the "Play Button".

    I load the game after he clicked on the play button but I need to pass the settings he made. After the game finished loading it needs to get the passed data and choose which layout to load.

  • Well, I decided to store the settings made into web storage (session storage) and to load it from there.

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