Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

V3.4.3 (298) (299) (300)

2

Comments

  • dave1707dave1707 Mod
    edited September 2021 Posts: 9,813

    @Simeon Loaded version 295 and Codea didn’t hang on the a=asset.documents.all line. Looks like whatever was wrong is fixed. Will try testing the other things added.

    Where is the show assets that was added.
    Never mind, I found it.

  • dave1707dave1707 Mod
    Posts: 9,813

    @Simeon Version 295 is back to taking 7 seconds to load until the list of projects are shown.

  • edited September 2021 Posts: 1,629

    @Bri_G I think what you’re seeing is the correct behavior, and what’s happened on my end is erroneous behavior, especially because mine is also accompanied by crashes galore.

    @Simeon I love the new project asset browser! Is there a way we could have that inside a project? Currently if I want to see a project’s assets I have to type readimage() first, and remember to delete it after.

  • SimeonSimeon Admin Mod
    Posts: 5,759

    @dave1707 interesting, I've isolated the code which causes the slow down on launch. I know how to fix it and will look at improving the launch time

    @UberGoober good point, I could make it a menu item within the editor

  • SimeonSimeon Admin Mod
    Posts: 5,759

    @dave1707 I wonder if the contents of your Documents folder is particularly large, or there are contents which cause a slow down when iOS attempts to list the directory

    The 7 second slow down is caused by Codea attempting to index your Documents folder prior to launch (when it was launching quickly for you, I had modified that code to index Documents on a background thread, but that caused other issues). I wonder if there is something unique about your Documents folder — whether the number of files, or folders, or projects, or even their names

  • @Simeon i also see a rather long delay for the launch. I do have many of codea files, but not an enoromous amount! The asset browser is a very welcome improvement.

  • Posts: 239

    great updates so far, i wanted to give my 2c on the asset picker

    i avoid using it completely because it doesn’t have folders/subfolders

    i’m working on a large game so having all my assets be at the same root level is just messy, currently all my assets are outside my project like this

    asset.documents.MyAssetsFolder.Sprites.Characters.CharA.AnimationName.frame1

  • dave1707dave1707 Mod
    Posts: 9,813

    @Simeon If I run the below code, it shows 746, which are my projects. Projects are all I have in documents. As for names, I have some projects with names that start with a # or numbers so they show at the beginning of the project list when sorted by name.

    function setup()
        a=asset.documents.all
        print(#a)
    end
    
  • dave1707dave1707 Mod
    Posts: 9,813

    @Simeon Something else that might be nice in the editor is to be able to tap on something that will show all the assets. Like when you’re in the project list and you swipe right to show Reference, Assets, Shader Lab, Air Code and then select Assets. That shows a list of just about everything.

  • Posts: 2,577

    All - just a point of clarification, the freezing point I described previously, was after the initial Codea. There were two steps - the first I described, the second was when the collection headings were added before the projects were added to the projects page. I’ve attached two images that may make it clearer.

    Note: this was before I started having problems with Dropbox. Cleaning Dropbox up, removing many unused files etc and the new betas made the loading time much better - but still a bit slow. The delay now seems to be in the initial Codea loading screen.

    P.s. anyone know how to shrink images instead of cropping on an iPad photo app.?

  • SimeonSimeon Admin Mod
    Posts: 5,759

    @dave1707 I've made it possible to open the assets from the editor. Select Do -> Assets to show them in the side bar

    @skar I totally agree on the need for folders. This is something we're supporting from the start in Codea 4. I looked at the effort of including it in Codea 3.x and it's a bit big to put in as a new feature right now. I'll keep thinking about it

  • dave1707dave1707 Mod
    Posts: 9,813

    @Simeon The new Assets shows all the assets, but there’s no way to select something from it and paste it in the editor. For instance, if you place the cursor between the () of sprite(), it brings up a list. You can select something from that list and it’s placed between the (). Need a way to select something from the list and paste it.

  • SimeonSimeon Admin Mod
    Posts: 5,759

    @dave1707 good point. I could make selecting something in the assetlist automatically insert its corresponding asset key in the editor text? Or maybe have an option on long press or a button to insert asset key? Need to think about the options

  • dave1707dave1707 Mod
    edited September 2021 Posts: 9,813

    @Simeon Version 296. I running into a really strange problem. I have a 17 line program with 3 blank lines at the end. I can delete lines 15 and 16, but when I try to delete line 17, which is now line 15, Codea crashes. When I get back into the project, lines 15, 16, and 17 are there. If I tap line 17 at the second space it’s OK, but if I tap line 17 at the first space, Codea crashes. There were also times when I would go back into Codea, but instead of going to the project list, it was taking me right into the editor for that program. I’m not sure if there are unusual character in that line or what’s going on. I sent a crash report when I tapped line 17 at the first space.

    It isn’t happening with other projects.

    Here’s the code. Not sure if it will happen for you. Try to copy all the blank lines.

    ~~~

    viewer.mode=FULLSCREEN

    function setup()
    textMode(CORNER)
    fill(255)
    fontSize(25)
    str="abcdefghijklmnopqrstuvwxyz 1234567890"
    end

    function draw()
    background()
    text(string.sub(str,1,ElapsedTime//1),100,HEIGHT/2)
    end

    ~~~

    I tried to copy the above code, but I’m not getting the problem when I paste it into a new project.

  • dave1707dave1707 Mod
    edited September 2021 Posts: 9,813

    @Simeon The above problem also happens with version 295. I’ll try other previous versions.

    It also happened with version 294.

    If you want, I should be able to do a hex dump of the project and see what’s at the end.

  • SimeonSimeon Admin Mod
    Posts: 5,759

    @dave1707 that's strange, perhaps you could share the zipped Codea project? I pasted your code and couldn't recreate the issue. Maybe the forums is converting an invisible character somewhere

  • SimeonSimeon Admin Mod
    Posts: 5,759

    @dave1707 I think i've found the bug from the crash log you submitted. Thank you for sending that through. Next build will have a fix

  • SimeonSimeon Admin Mod
    Posts: 5,759

    @UberGoober have you run into any issues in the latest builds with losing code like you did before?

  • dave1707dave1707 Mod
    Posts: 9,813

    @Simeon Tried the program that was causing the crashes and I couldn’t get Codea to crash. Looks like it’s fixed.

  • Posts: 2,577
    @dave1707 - that sounds like a weird issue. I note that your post is properly tilded but not formatted in the forum correctly - is it related ? Were you using an external keyboard ?

    @Simeon - just out of interest - what caused the crash ?
  • SimeonSimeon Admin Mod
    Posts: 5,759

    @Bri_G an out-of-bounds exception when parsing a string to track how many spaces are in it for handling whether to show the "jump to next symbol" key or the regular "tab" key

        while([[NSCharacterSet whitespaceCharacterSet] characterIsMember:[line.line characterAtIndex:iterIndex]]) {
            iterIndex++;
        }
    

    The fix

        while(iterIndex < line.line.length && [[NSCharacterSet whitespaceCharacterSet] characterIsMember:[line.line characterAtIndex:iterIndex]]) {
            iterIndex++;
        }
    
  • dave1707dave1707 Mod
    Posts: 9,813

    @Bri_G Not sure why it’s not formatted right. All I know is that I was having a lot of trouble with that project. If I copied the code without including the 3 blank lines at the end and pasted it into a new project, I didn’t have any trouble with it.

  • Posts: 1,629
    @Simeon I haven’t yet noticed any code losses for sure—I thought I did once but since I am now using Working Copy on my current project, and I couldn’t confirm that code had changed, I can’t swear to it.

    I also want to say thanks for going above and beyond on the asset displayer from the project menu! I thought it was just gonna display that project’s assets, it’s even better that it shows them all. @dave1707’s idea is way rad too, but even just this is a huge new convenience.
  • dave1707dave1707 Mod
    Posts: 9,813

    @Simeon The new asset routine works great. Easy to copy/paste into the code.

  • I have an extremely odd bug which I can’t imagine being anything other than a flaw in the lua interpreter. I am trying to write simple code to isolate the problem, but so far I can’t do it; it only happens in the far more complex code that I am running.

    The behavior is basically that I create a class that takes up to three initialization parameters, and then I call it a series of times, almost always with three parameters, but once with two. On the call with only two parameters, unless I explicitly place “nil” in the third parameter, it gets something else (I think the third value somehow “left over” from the prior call to the constructor).

    Unfortunately, the code is complex (it’s an expression parser/compiler, that displays inputs and outputs on the screen, computing the results based on the compiled expressions, and the bug happens inside the compiler, a simple shunt-yard implementation). But the behavior is very simple: call the constructor with two arguments, and in this one situation it gets three instead.

    I hate reporting bugs like this, because in my 50 years of programming experience, it’s always turned out to be something “on my end”, but in this case, I just can’t think of anything I’d be doing that would cause this behavior.

    For now, I have a few easy workarounds (one of which actually structures my code better), so there’s no hurry, but if you want to look at it, I’ll have to send you a zipped copy of the entire project, with comments as to where to look for the issue.

  • Posts: 2,577

    @blacatena - Codea used to have a useful parameter filter (...) Which allowed you to vary the parameters passed. I think it was removed, possibly with a Lia upgrade

    An alternative would be to set a parameter block in a table and pass that changing only the variables you need and building code in the receiver function to filter that out.

  • edited September 2021 Posts: 33

    @Bri_G, thanks, but as I said, I found a way around the problem that actually structures my code better. I'm reporting it more because it's a dangerous bug to have in existence (although it's not urgent to fix; I'm sure it's an edge case on the edge of an edge case).

    [Separately, I have my own special classes that I usually use to allow me to do what you describe, but in this case, I was doing something simple that I built with pure Codea toolkit elements. When I finish that project (building out those classes) I intend to post it as a general framework for others to use, if they wish.]

  • dave1707dave1707 Mod
    Posts: 9,813

    @blacatena Try this for variable parameters.

    function setup()
        parms(1)
        parms(2,3)
        parms(3,4,5)
    
    end
    
    function parms(...)
        arg={...}
        print("======")
        for a,b in pairs(arg) do
            print(b)        
        end
    end
    
  • SimeonSimeon Admin Mod
    Posts: 5,759

    @blacatena I would be interested to take a look at the issue. It could definitely be a bug on our end

  • @Simeon, sorry, I was away for two days at a wedding. I’m cleaning up the project a bit, and when that is done, I’ll email you a zip file of the project, hopefully tomorrow.

  • edited September 2021 Posts: 33

    @Simeon, Okay, never mind. I figured it out… and, as my 50 years has taught me, no, it’s not a compiler bug (“black box” syndrome is my name for it, when people get frustrated, they eventually decide the bug must be in the “black box”, i.e. whatever part of the software they can’t open and examine).

    What happened is that I would call:

    Operation(operator, stack:pop(), stack:pop() )

    for a binary operator, or

    Operation(operator, stack:pop() )

    for an unary operator (expecting the third parameter, which is the second compiled operand, to be nil).

    My stack:pop() method actually returns two values (for my convenience), the popped item, and then whatever item is the new top-of-stack. This way, I could do something like popped, tos = stack:pop(). But when I call Operation(operator, stack:pop()) with two or more items on the stack, it is in fact returning and then passing both values to Operation:init(), even though my code makes it look like it is one, so what I’m really passing is the operator, the popped item, and the new top of stack, i.e. the top two items on the stack. This is fine if the stack only has one item on it, because then the second item is nil (no new top of stack value).

    So I “outsmarted myself” by returning two values (for different purposes), rather than using a straightforward, two statement popped = stack:pop() then tos = stack:peek() approach.

    Of course, I also got the right values in my two pop call… because Lua only packs multi-value returns into the last parameter in a parameter list, so the extra values are (accidentally) ignored in the two-pop case.

    It always helps to understand how a language works, but Lua is odd in that it’s really, really necessary because it has so many special constructs and edge cases in behaviors around those constructs.

    Sorry for the alarm and confusion.

  • SimeonSimeon Admin Mod
    Posts: 5,759

    @blacatena that's a subtle bug! Thanks for sharing your discovery. Agree that the explicit stack:pop / peek is probably the safer route

  • Posts: 1,629
    @Simeon I love the in-project asset viewer and I love that it does the thing @dave1707 suggested and the copy-asset-name thing works great on iPad.

    It doesn’t seem to work on iPhone though—did you want it to?
  • dave1707dave1707 Mod
    Posts: 9,813

    @UberGoober I tried the copy/paste on my iPhone 8 SE and it worked OK. I was able to paste it without any problems.

  • Posts: 1,629

    Hm maybe I’m missing an update.

    @Simeon there seems to a janky interaction between the icons created by the icon button and Craft. In attached screenshot you can see that the icon has rendered itself almost totally white.

  • Posts: 1,629

    I’m unable to add images into my project’s assets folder. It looks like it’s loading them, because the window appears where I can type a name in, but when I tap ‘done’ it is nowhere to be seen.

  • SimeonSimeon Admin Mod
    Posts: 5,759

    @UberGoober thanks for the report! Will check the adding to project folder one first as that seems like the worse bug

  • Posts: 2,577
    @UberGoober - saw the icon issue whilst saving one in this version. In my case looks like only partially bleached out. Almost like a layer problem.

    But the icon itself, in my project list, is fine. So @Simeon is right - only minor issue but needs adding to the list.
  • edited September 2021 Posts: 1,629

    @Simeon everything seems to work nicely now. Say, since you’re working on the contextual menu in the assets list right now, any chance we could get a “rename” option in it?

  • SimeonSimeon Admin Mod
    Posts: 5,759

    @skar the latest beta allows you to create subfolders within assets in a project. Let me know how it goes for you

  • dave1707dave1707 Mod
    edited September 2021 Posts: 9,813

    @Simeon Version 300. Creating a sub folder within a project folder works, but I can’t seem to add a sprite to that sub folder. Whenever I select a sprite and select add-to and select the project folder, it adds it there and doesn’t give me a chance to select the subfolder.

  • Posts: 2,577

    @Simeon - version 3 hung up on me. Couldn’t get the run button to work, project just froze on me.

  • SimeonSimeon Admin Mod
    Posts: 5,759

    @dave1707 did you go into the folder (tap on it) then create the sprite inside the folder?

  • SimeonSimeon Admin Mod
    Posts: 5,759

    @Bri_G is it doing this consistently? All projects or just a specific one?

  • dave1707dave1707 Mod
    Posts: 9,813

    @Simeon Here are the steps I’m trying to do to add a sprite to a subfolder.

    create a project
    tapped Assets from Do list
    tapped on the Project Assets folder
    created a new Folder
    tapped on Assets (upper left of screen)
    selected Planet Cute from list of assets
    tapped edit (top of screen)
    selected a sprit (shows a checkmark)
    hide the keyboard
    tapped on Add To (bottom of screen)
    tapped on the Project Assets folder
    list of sprites is shown again

    at this point, the sprite was added to the Project folder.
    there is no way to get to the subfolder to add it there.

    is there another way this is supposed to be done.

  • SimeonSimeon Admin Mod
    Posts: 5,759

    Ah I see, good point @dave1707

    I'm not sure which direction to go here, the "Add To" UI is pretty clunky and old fashioned. Perhaps we should get rid of it all together. I wonder if just supporting drag-and-drop to copy / move assets would be the way to go. Alternatively I could update the "Add To" UI to support browsing sub-folders. I'll think on it some more

    At this time the only way to add a sprite to a folder is to import it from within the folder

  • Posts: 2,577
    @Simeon - I've seen the issue in other recent updates to Codea, but can't remember what I was coding in then. I suspect it's the same project though and am wondering if it's related to calling socket for timing. Will see if I can reproduce and feed back later.
  • Posts: 1,629

    @Simeon I wish I could reproduce this bug, but I can’t, but it just happened to me a couple times in a row: when trying to use voice-to-text to put a comment in my code, it kind of freaked out. Voice-to-text crashed and went back to the normal keyboard, some weird combination of what I had dictated and the line below it got inserted in place of my code, and the cursor jumped to the very top of the file.

  • Posts: 2,577

    @Simeon - reported a crash after playing with my lates NoNo, then losing the magnetic cover on my iPad whilst Codea running. Then opened cover later and Codea crashed. Just after dragged up to see if still present and Codea window scrolled up and off. Is Codea set up for the magnetic catch iPad sleep mode?

  • Posts: 2,577

    @Simeon - not a bug, just an observation. I have noticed, in editing mode, that switching from portrait to landscape sometimes seems to operate smoothly in the turn. But sometimes the turn gives an editing window to the left which I assume is 768 pixels (my iPad res) with a black section to the left which is then removed. It just looks a bit messy. Other times the rotation is pretty smooth. If you changed to a white background before turning we wouldn’t notice it.

Sign In or Register to comment.