nusbaumc's Forum Posts

  • You can't put an iframe inside an HTML canvas element. You can absolutely position a div element over the canvas but this is hacky and would require a plugin of some sort to work with Construct 2. Loading your data via Ajax and having a separate layout for your leaderboard would be a lot simpler.

  • You can load sprite images from a URL.. that's about it but if your images are static that's enough. Storing them permanently isn't possible though without jumping through some crazy hoops (like writing a custom plugin)

  • To be honest I've been kicking around the idea of making a plugin that clones most of RM2K3's functionality, including its resource formats. RPGMaker is so much better for making RPGs than Construct it's silly but the executable is Windows-only, even in the newer versions.

  • OK I just spent like 3 days figuring this out.. so.. here goes!

    You take a screenshot with CanvasSnapshot. You already know that. My chrome bugs out if I try to use the snapshot on the same frame it was generated so I put a 0.1 second wait after it.

    You can take that screenshot and download it locally like in the example app. If you want to send it elsewhere, the CanvasSnapshot system expression contains a Base64 encoded PNG image prepended with the MIME type and set off the from the actual data with a comma. If you strip off the crap in the front and URLEncode the data you can send that via an Ajax POST action. You can do both of these in a single action; I set my post variable to ""imagedata=" & URLEncode(replace(CanvasSnapshot, "data:image/png;base64,", ""))" and just post that since I use GET parameters for everything else.

    On the server side, remember that PHP automatically URL decodes so you just need to do base64_decode on your POST data. Don't do a manual urldecode or you'll corrupt your data. Once you do all that you'll have your PNG screenshot data in PHP and you can do whatever you want with it.

    As for screenshotting certain things, all you can do in Construct is take a snapshot of the entire canvas. You can edit it in GD on the server side if you want to though to crop out what you don't want.

  • I got the "Else" working now. I was layering the events incorrectly as subevents of the subevents. Thanks for your help.

    Construct 2's logic is really weird if you're used to other languages but I have yet to find anything I can't do with a proper ordering of events and subevents. Seems like you already figured this one out though.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Are you a moron? Ajax will not sustain the server and it will fall. I do multiplayer and web socket.

    He's asking for login, chat, and high scores. None of that requires a constant connection, you can just poll the server with Ajax 30 seconds or so. It's fast and easy and suited for someone like the OP who obviously isn't versed in such things.

  • Thanks! If it's really that simple I'm going to kick myself in the rear later.

  • I'm bumpin' it again!

    If I don't hear something I'm going to assume it's just not possible and I'm going to have to stop being lazy and write a plugin for it!

  • You need to know PHP or some similar language. Put an Ajax object in your game and use it to talk to your PHP script. You can encode all your data into a query string and send it to the PHP side using an Ajax request. Your PHP script does whatever it does and sends some data back, which triggers an Ajax On completed event with the data your PHP script sent back appearing in the Ajax.LastData system expression. You can use the tokenat system expression to parse it and put it in your in-game variables.

  • This is a shameless bump! Bump bumpity bump bump! Back to the top you go!

  • Specifically, I mean from the manual page. The bolded part is the part I can't figure out, can't seem to find any information about it either.

    CanvasSnapshot

    Contains the resulting image from a Snapshot canvas action after On canvas snapshot has run. (Note this expression is not available immediately after the Snapshot canvas action - you can only use it after On canvas snapshot triggers.) The expression returns a data URI of the image file. This can be loaded in to a Sprite or Tiled Background object via Load image from URL, sent to a server or stored locally, or opened with the Browser object in a new tab to save to disk.

  • My collaborator and I are working on our second project and as part of that I want to send a screenshot to a PHP script. I know how to get a screenshot into CanvasSnapshot, but I've been using Ajax with GET expressions for PHP interaction. I want to use a POST request to submit the screenshot but the Ajax dialog says it's supposed to be in query string form and I don't know how to process it.

    Any tips are appreciated!

  • Not necessarily programming, I think one of the most important lessons I learned from our recent demo project was the importance of starting from a good design when doing a collaborative project. Making up everything as you go may work when you're by yourself but that approach wastes tons of time (even on really simple projects) if you have to wait on your collaborator to implement your spontaneous ideas.

  • Sounds easy enough. My suggestion:

    1) Set a global variable to 0 at the start of the level

    2) On every tick, add dt to the variable

    The global variable will contain the number of seconds that have passed since your event 2 became active.

    Check out this manual entry

  • So my collaborator and I recently finished our first game, and I was thinking of submitting it to the Scirra Arcade.

    But it says here that the browser object cannot navigate to a different page. I have a backlink button within the game that opens a new tab/window to my site if you click it, this doesn't navigate away from the current page though. Also I have some Ajax events for saving and retrieving high scores, they don't navigate but they do interface with some non-Scirra PHP. Will they still work?

    I don't want to submit and waste everyone's time if I can't backlink or if my game won't work properly.

    Thanks in advance!