Grimmy's Recent Forum Activity

  • I have an array which I am instancing and populating with some simple data (a bit of text with the loop index) But when I run this and step through the code with a breakpoint although each instance gets created the data is never added. Not only that but the instance variable ('profile') for each array never gets updated either.

    + System: On start of layout

    + System: For "" from 1 to 4

    + System: Startup_Done = 0

    -> System: Create object Profile_Activity_Array on layer 0 at (0, 0)

    -> Profile_Activity_Array: Set profile to LoopIndex

    -> Profile_Activity_Array: Set value at (1, 1) to "Loop index "&LoopIndex

    Any idea whats going on? I would expect each array instance data to be updated as I step through the loop but everything(profile and loop index string) is 0.

    Cheers

  • 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

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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

  • 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

Grimmy's avatar

Grimmy

Member since 20 Nov, 2012

Twitter
Grimmy has 2 followers

Trophy Case

  • 12-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Great Comment One of your comments gets 3 upvotes
  • Email Verified

Progress

17/44
How to earn trophies