How to access a specific construct layout from a html link

1 favourites
  • 7 posts
From the Asset Store
Casino? money? who knows? but the target is the same!
  • Hi everybody

    I need to know if it is possible (and how can I do this) to access a specific construct layout from an external HTML link (a simple HTML page).

    Thanks in advance.

  • https://www.scirra.com/manual/110/browser

    QueryParam

    Return a query string parameter by name. For example, if the URL ends with index.html?foo=bar&baz=wan, QueryParam("foo") returns bar and QueryParam("baz") returns wan.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You're talking about a layout in an exported game? It is in an obscure form so that it both takes up less space and isn't readable by anything but the runtime. It would open a can of worms if we reverse engineered the export to make that possible. There are probably better solutions than doing that

    Anyways, if you created both games you could make your own level loader. Basically take a level and output all the object locations and any other stuff relevant to your game to a text file. Then make a parser that reads that said text file and recreates all the objects again.

  • scirra.com/manual/110/browser

    QueryParam

    Return a query string parameter by name. For example, if the URL ends with index.html?foo=bar&baz=wan, QueryParam("foo") returns bar and QueryParam("baz") returns wan.

    Thanks for replying, but in this case how can I use it in the HTML file to access the construct layout? Could you please show me an example?

  • You're talking about a layout in an exported game? It is in an obscure form so that it both takes up less space and isn't readable by anything but the runtime. It would open a can of worms if we reverse engineered the export to make that possible. There are probably better solutions than doing that

    Anyways, if you created both games you could make your own level loader. Basically take a level and output all the object locations and any other stuff relevant to your game to a text file. Then make a parser that reads that said text file and recreates all the objects again.

    Hi R0J0hound. Thanks for answering.

    Yes. I need to access an exported game layout. I am not using Construct to create the HTML file. I need to call the simple HTML through the C3 game and enable the reverse process (call a new layout in the C3 project using a link in this simple HTML).

  • You just check the value at the start of the initial layout that points to the specific layout

    > on start of layout

    -> QueryParam("foo") =1, go to layout 1

    Where

    mysite/index.html?foo=1

  • You just check the value at the start of the initial layout that points to the specific layout

    > on start of layout

    -> QueryParam("foo") =1, go to layout 1

    Where

    mysite/index.html?foo=1

    Thanks, newt

    I will give it a try.

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