Grimmy's Forum Posts

  • APologies, yes wrong forum oops.

    This helps a lot thanks. A big mistake I was making was putting the JS files into the files folder and not in the scripts directory. Your example made this very obvious.

    Thanks!

  • Thanks. What I'm really after is how I go about using external javascript libraries.

    How do I 'import' them? Do I need to copy all library files locally? What's all this business about dynamic imports ? etc Most libraries that i see contain import command..i cant seem to do any of that in C3.

    The only demo about using external libries in the scripting example projects just uses a single javascript file and doesn't really demo anything about importing etc. It would be nice to see a demo using a realworld example with an imported script, no matter how simple..

    Cheers

  • Any way to use this with C3?

  • Using modules can clearly open the route to new possibilities but I cant find an example of how I would do this.

    I'm trying to import and use something like this: github.com/colxi/midi-parser-js

    A midi to Json parser which would be really useful in my project.

    Can anyone help with a cpx example maybe of how to import and use a module?

    Thanks

  • Actually, I 've discovered that the debug is already actually displaying the multiple dimensions of the array. Its just a bit confusing because it just a long comma separated value for 2 of the dimensions.

    But its there, so that's all I need !! Thanks

  • I'm pretty sure the debugger is only showing me data from the first sheet (depth (0?)). Is there a way to view the other 'sheets' in the depth axis in the debugger?

    Thanks

  • That one is a gem. Thanks!

  • Lets say I dont know how many objects are in the loop and I want to perform some action as soon as the loop has finished. How do I do that?

    Cheers

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks Dop, I think I'm going to put all the save data into an array or dictionary during the loop and then just write the whole thing to local storage once the looping is done.

    I only avoided doing that because it sounded more complicated than just saving individual values, but having endured the pain of trying to save individual values during a loop, it sounds far simpler now (in theory at least).

    It seems that might be the recommended practice for good reason.

    Thanks

  • I've been trying all day with this without success.

    I am looping through a bunch of items and I want to change their colour depending on their save data. (on or off)

    When the 'For Each' loop runs and iterates through each item it does a Get Item based on the instance item i am at in the index( eg "Profile_"&ProfileButton.ID&"_has_data")

    The issue is that the data takes a little while to come through so it cant be in the loop itself.

    The 'On item' event which is ready to receive this is outside of the loop and therefore seems to be no way of referencing the looped item.

    eg this never triggers if I add a count variable to my loop which counts up with each iteration:

    + LocalStorage: On item "Profile_"&count&"_has_data" get

    This seems like it 'should' be very simple to do but I just cant figure it out.

    :( Help

  • I have a container with a bunch of objects. The original objects are arranged (rotation and position) so it looks correct as a complete 'contained' composite object .

    Now, when I want to instantiate this container it works fine, but all of those individual objects are now positioned at the exact same point in the new instance. A nicely arranged graphic is now just a mess.

    Am I doing something wrong or do I need to manually recreate the offsets of each item whenever I recreate an instance?

    Thanks

  • As well as bumping this, I'd also like to know the max size of a data array. I want to have an array of something like 7500 rows. Is that going to be okay/ quick enough to parse?

    Thanks

  • Is this even possible or is the array editor only to be used as a starting point/(read only at runtime) for arrays.

    I really want to be able to change the data in game then come back to the editor and view the saved/added data that was done during runtime.

    Is there some way to do this?..or a workaround?

    Cheers

  • [SOLVED]

    For some reason I need to do...

    JSON.Get("data.Data_URL")

  • My config.json dictionary has some data in in like this:

    key:Data_URL value:some data URL stuff

    But when I try to load the data and display it like this....

    + System: On start of layout

    -> AJAX: Request config.json (tag "load config file")

    + AJAX: On "load config file" completed

    -> JSON: Parse JSON string AJAX.LastData

    -> Browser: Log in console: JSON.Get("Data_URL")

    ..it just prints "0"

    I expected it to print "some data URL stuff"

    What's happening?

    Thanks

    Simon