User Tag List

Page 4 of 5 FirstFirst ... 2 3 4 5 LastLast
Results 31 to 40 of 45

Thread: How to see what an array contains?

  1. #31
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleMac Export Module
    dsilvers's Avatar
    Join Date
    Jun 2008
    Location
    Boston, MA
    Posts
    521
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Wait but I'm saving to X1Y0 in Base0. Why would I look at X0? That makes no sense. And if that works, then Arrays are busted.

  2. #32
    Clicker

    Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Jun 2006
    Location
    Killeen, TEXAS
    Posts
    1,037
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    no- you are doing it wrong. if you write to X1, you should be in 1 base. if you are in 0 base, then write to [0], not 1... and you dont need to write to Y, if you are just doing a single dimension array.

  3. #33
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleMac Export Module
    dsilvers's Avatar
    Join Date
    Jun 2008
    Location
    Boston, MA
    Posts
    521
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    I am doing a multidimensional array and X0 is reserved for other settings. I am simply using the sound setting in X1Y0 as a test case. Believe me, I've tried writing to X0 as well, didn't work.

    Here is a quick test-case I just whipped up, using only X1Y0 in a Base0 array, storing a value (3) in it, and displaying that value on a counter. Works fine.
    arraysilliness.jpg

  4. #34
    Clicker Fusion 2.5 Developer

    Join Date
    Jul 2008
    Posts
    1,305
    Mentioned
    14 Post(s)
    Tagged
    0 Thread(s)
    ...which tells you that the issue has nothing to do with the array, and is down to your coding.

    Step 1 is to check that the event to write to the array is actually being triggered - so add an action to the same line that ends the application.
    Step 2 is to record exactly what you're writing, and where - so if the value and/or x/y/z positions are calculated, output their values to a string at the same time, to check that they are what you think they are.

    If the problem appears to only be with saving to a file, use the built-in debugger to check that the array does contain the correct data.
    Also, try a different filename that doesn't already exist, just to be sure the file is being created - list objects can't overwrite files that are currently open in another application (presumably a windows thing), although this almost certainly doesn't apply to arrays anyway (what other application even could be using an array file?) - you can be 99% certain that the issue is with your events.

  5. #35
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleMac Export Module
    dsilvers's Avatar
    Join Date
    Jun 2008
    Location
    Boston, MA
    Posts
    521
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    I do know the event is triggering. Believe it or not I've written an entirely custom logging interface just to solve this bug. When I hit Enter, the events are triggering, and the line gets logged properly. I can even upload the text file here to show this.

    logFile_5102018234231.txt

    So you can see, each time I hit Enter, the log displays the array value at X1Y0, and it's always 0. Meanwhile, I have a counter in the frame that reads from the array on an Always event just to be sure, but it also never updates from 0. I have also tried iterating the X1Y0 value itself instead of pulling the value from the Sound Volume active object, but no difference.

    Probably just going to have to start all the array code over.

  6. #36
    Clicker

    Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Jun 2006
    Location
    Killeen, TEXAS
    Posts
    1,037
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    there is nothing wrong with the array. I use it for everything and always have, and never struck a problem. i use it for saving settings, i use it for saving scores, i use it for anything and everything i save externally. you have certainly done something incorrect somewhere.

  7. #37
    Clicker

    Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Jun 2006
    Location
    Killeen, TEXAS
    Posts
    1,037
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    if you are doing a 2d array, then you MUST write to XY, and read value at XY ( not x)

  8. #38
    Clicker Fusion 2.5 Developer

    Join Date
    Jul 2008
    Posts
    1,305
    Mentioned
    14 Post(s)
    Tagged
    0 Thread(s)
    Again, that's not actually true. Arrays are *always* three-dimensional. If you don't specify the Y and/or Z position, they will just default to "0" (or "1" if the array uses a base-1 index).

    All these actions do exactly the same thing, and may be used interchangeably:
    "Write value 1 to (1)"
    "Write value 1 to (1,0)"
    "Write value 1 to (1,0,0)"

    Likewise, all these will return exactly the same result:
    StrAtX( "Array", 1 )
    StrAtXY( "Array", 1, 0 )
    StrAtXYZ( "Array", 1, 0, 0 )


    dsilvers - Is it a Windows project? It might be possible (though unlikely) that the array object has bugs in other runtimes. I made a pathfinding example a while back, that didn't use any extensions, so theoretically should have worked with all runtimes, but for some reason wasn't compatible with Android. I don't have the Android exporter, so I couldn't test it, but apparently the issue was that I was calculating the array X and Y positions using a formula, which resulted in them being floating point values - and while the Windows runtime is fine with that (it just rounds them down to integers), the Android version behaved differently. I'd imagine that bug has probably been fixed by now though, as it was a long time ago...

  9. #39
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleMac Export Module
    dsilvers's Avatar
    Join Date
    Jun 2008
    Location
    Boston, MA
    Posts
    521
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    MuddyMole - Yeah it's a Windows runtime. As I showed in my screenshot example, I've gotten the general functionality that I need to work in test projects, just for some reason it refuses to behave in the game itself. I am starting to think that the array object came in corrupted somehow and I should replace it with a new array entirely, disable any other code I have involving the array (mostly just value checks), and see if I can do anything to get it to behave.

    If that fails I'll likely have to make a new menu. That would suck, but I'm kinda feeling a more Super Smash Bros.-esque Masonry interface anyway.

  10. #40
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleMac Export Module
    dsilvers's Avatar
    Join Date
    Jun 2008
    Location
    Boston, MA
    Posts
    521
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    SOLVED

    #1. I'm pretty sure the initial array I brought in was corrupted somehow. The Z dimension kept being set to 1 in-game, despite being set to 10 in the editor, and there was nowhere I was resetting this dimension in the code. So... something got weird there that was potentially screwing everything else up. Thus somehow none of the values were getting saved. So as I had planned I replaced the old array with a new one and the values started saving.

    #2. DO NOT LOAD ARRAYS ON THE START OF FRAME EVENT. Yeah this surprised me too, but apparently if you do that, it doesn't. After checking off "Create at Start" and Creating the array object on a fast loop called at the Start of Frame instead of on the Start of Frame itself, then loading the array file into it, the saved values were successfully loaded in and I have sound again!!! I'll be fixing up all the other settings by the end of the weekend.

    So... yeah, nothing was wrong with my math, it was all backend and order of operations stuff the whole time. I don't know if this is has happened to anyone else because it's not tutorialized anywhere, and I don't know if it's worth noting in ClickWiki, but I guess it's... a thing.

Page 4 of 5 FirstFirst ... 2 3 4 5 LastLast

Similar Threads

  1. Replies: 3
    Last Post: 12th March 2018, 12:33 AM
  2. Shuffle an Array (Dynamic Array)
    By bad_rick in forum Guides, Tutorials, Examples, Widgets
    Replies: 0
    Last Post: 6th November 2017, 02:07 PM
  3. Bug with array object : array indexes change
    By Perfeks in forum Fusion 2.5
    Replies: 5
    Last Post: 22nd February 2017, 10:17 AM
  4. Dynamic Array - Sort 2 dimension array by Column 1
    By Ryan in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 16th December 2012, 04:54 AM
  5. Dynamic Array to Binary Array problems
    By BREK in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 22nd March 2010, 10:48 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •