ldiebold's Recent Forum Activity

  • The video object allows you to change the playback position to the second. Is it possible to get more specific? Has anyone made a plugin for this?

    I'm working on a project where you can add key-frames to a video. It would be nice to be able to say, for example: playback video from 7.45 seconds

  • This plugin is exactly what I was looking for!

    Thank you for putting the work in and saving me hours!!!

  • Storing key value pairs in an array (and vice versa) is a pretty standard thing to do in programming. The two offer a lot of power.

    For example, the 3rd x element in an array might hold some parameters, and one of those parameters might be an array itself. This can be achieved with TokenAt, but it's not as intuitive and is a bit of a code smell (In my opinion). I could utilize the z axis but would still end up needing TokenAt to store an array inside an array.

    Having said all that, Construct 2 is a phenomenal tool with an SDK that allows you to do pretty much anything... So I'm not complaining, just looking to see what's out there!

    Thanks Magistross, will check it out!

  • 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.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Were you able to find a solution bowiz? Any ideas out there?

ldiebold's avatar

ldiebold

Member since 24 Sep, 2012

None one is following ldiebold yet!

Trophy Case

  • 12-Year Club

Progress

12/44
How to earn trophies