ldiebold's Forum Posts

  • I could do it using a delimiter and tokenat, but has anyone made a plugin to make this more intuitive?

    In JavaScript, I could do something like this: {fruit: ["apple", "orange", "pair"], vegetables: ["carrot", "onion", "potato"]}

    I could also fake it using a 3d array, but it's not as clean and would require a little more code.

    If I wrote my own plugin to solve this problem... Would anyone find it useful

  • lennaert

    Cheers, probably should have googled it before making that statement :p

  • When I get the chance, I'll write a simple plugin. It wouldn't be too hard, I should be able to just map some jquery commands like .html() .attr() etc.

    Will probably run into problems accessing elements outside of an iFrame though!

  • Ended up writing a php script that updated c2runtime.js and data.js for me:

    function changeFilePointers($directory) {

    //in c2runtime, point to data.js

    $path_to_file = $directory . 'c2runtime.js';

    $file_contents = file_get_contents($path_to_file);

    $file_contents = str_replace("\"data.js\"", "\"/" . $directory . "data.js\"", $file_contents);

    //Also point loading-logo.png in the right direction

    $file_contents = str_replace("\"loading-logo.png\"", "\"/" . $directory . "loading-logo.png\"", $file_contents);

    //save the file

    file_put_contents($path_to_file, $file_contents);

    //in data.js, point images to the right place

    $path_to_file = $directory . 'data.js';

    $file_contents = file_get_contents($path_to_file);

    $file_contents = str_replace("\"images/", "\"/" . $directory . "images/", $file_contents);

    file_put_contents($path_to_file, $file_contents);

    //delete sw.js, I don't need it for now

    $swLocation = $directory . "sw.js";

    if (file_exists($swLocation))

    {

    unlink($directory . "sw.js");

    }

    }

    This allows me a lot of flexibility when working with a framework (I'm using Laravel 5.1). I can now upload zipped games and load them through a route and don't have to rely on a traditional file structure.

  • when a game is exported its dependencies are in its root directory i.e. "c2runtime.js", "data.js", "images/" etc.

    I want to tell my game to point to different locations when loading these dependencies. This is easily done with files in index.html but there are some files (i.e. "data.js") that are loaded later on in the process.

    My website will have a lot of games and I wanted to keep it DRY (don't repeat yourself) by reusing some of the files that are the same.

    How do I change where construct 2 looks for its dependencies? Am I taking this whole DRY thing too far?

  • I figured it out by making a plugin as mentioned here:

    https://www.scirra.com/manual/22/runtime-overview

    If anyone comes across a similar problem, let me know and I'll post some instructions <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">.

    btw, the sdk was plain awesome! So easy to follow. I expected to have to spend days studying but had something whipped up in a couple of hours.

  • I'm using Laravel to build a website with Construct 2

    Laravel supplies CSRF tokens when posting forms and I'd like to keep it that way!

    I need a safe way to access the CSRF token from within my construct 2 application so that I can post data via AJAX.

    I need to access the DOM outside of my games environment so that I can access this CSRF token from a hidden form element. If anyone can think of a better, cleaner and safe way of doing this, then that too would be awesome!

    If there's nothing available, perhaps I could make a small plug-in? Would plug-ins allow me to access the DOM

  • This helped a lot!

    I used it to change the place-holder color of my forums, worked perfectly.

  • Were you able to find a solution bowiz? Any ideas out there?

  • I tried some of the construct 2 demo games on my windows 8.1 surface

    http://www.scirra.com/construct2/demos

    The sound worked on all of them except for "Moon Shield"

    This is so weird. There must be something different about the sound in Moon Shield and the way I'm implementing my game. I've played around a bit but just can't seem to figure this one out!

  • Okay, I made a little test program.

    This program works on my computer but still doesn't work on my Windows 8 surface.

    Links:

    online: http://users.tpg.com.au/docdrd/LukeApps ... index.html

    Dropbox (.capx): https://www.dropbox.com/s/hpyaeatk4jr5u ... s%208.capx

    I used a high and low quality sound that I input into the "sound" and "Music" folder. All work on my PC running windows 7 but none of them work on my windows 8.1 surface.

    The "Touched" text is just to let me know that an input was received on my surface.

    Let me know if there's any more info needed as I'm determined to figure this one out.

  • Thanks for the fast response!

    I will try a few tests and if I'm unsuccessful, will upload some examples.

    The weird thing is that it works fine on my pc running windows 7 :s

  • Hello,this is the game i am working on.I hope you like it and any feedback is much appreciated.

    http://vimeo.com/90912976

    That's pretty cool!

    I like that you can move your shield up and down to block arrows.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I just tried one of the demo games on my surface and the sound worked fine *scratches head*

  • After realizing that I need a windows 8 computer to make windows 8 games, I decided to try exporting my games as a html 5 website and playing them with a windows 8 surface. This works well for the most part, but I can't get any sound to work!

    Is there any way to get sound working on a windows 8 surface?

    I'm running windows 8.1 on my surface and the sound seems to be working fine.

    Thanks in advanced. Let me know if there's any other information needed and I'll try to supply it as quickly as possible!