Howdy, Stranger!

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

Codea 3.0 (106)

135

Comments

  • SimeonSimeon Admin Mod
    Posts: 5,362

    @dave1707 I really think we should move in that direction (and then ticking the dependency box should just add that line of code or remove it).

    @yojimbo2000 many LuaRocks incorporate native C libraries with Lua interfaces, so those would be out of the question. Anything pure-Lua might be feasible. I'll think about it.

  • edited March 2018 Posts: 1,708

    @Simeon - a funny one, not important but just to record. I decided to set up a Master file for copying as a starter for new developments. I then loaded a sprite for display as the project icon. The file is named Master.

    I started to build a similar file in a Utils.collection ‘folder’ but hardly added anything to Codea’s default new project, definitely didn’t add the icon, or mention that sprite in the code. I named this file Master. Both files are presented with the icon in the Codea projects main page.

    Is the project icon related directly to the project name? Are collections not considered in the project name? Could this cause any issues?

    Edit: I had placed Master files in other collections and they all had the same project icon. Unfortunately the also had the same code and the code I used to generate the screen taken for the project icon had disappeared. This could be a problem with collections if you accidentally name on file the same as another in a different collection or the Master project page.

  • edited March 2018 Posts: 1,708

    @Simeon - clarification, Codea doesn’t allow duplication of filenames in the main project page and in collections.

    What I did was make a Master in the Codea main page, then used fileapp to copy this to several collections with a view to having common starting points for each collection. Then I modified the main page Master and added the icon. This icon was automatically added to each collection Master project. So duplication is possible with project icon links shared.

    Then I added a simple text() to screen in the main page Master draw() function, ran it and it worked. Stopped it code edit still present. Then I looked at the Master file in one of the collections, no edit present. Ran it, then opened up the Master on the main page (the one I had edited) and the edit had gone.

  • dave1707dave1707 Mod
    Posts: 8,387

    @Simeon I have a program that lets me move a project from one iPad to another iPad using sockets and things used to worked OK. The problem I’ve run into now is when I transfer a project (Cargo-Bot for example) is that the Main tab is now the first tab. For Cargo-Bot, the Main tab is the next to last tab, so Cargo-Bot won’t run now unless I manually move the Main tab to its correct position. It appears that the createProject function now creates the Main tab as the first tab and when I receive Cargo-Bot and create the project, even though the Main tab is almost the last one to get created, it’s shows up as first. If I run createProject now as a test, it creates a project with the Main tab containing startup code for Craft. So I think something changed with Craft. I think createProject should create an empty project. When I first posted my program in May 2017, a comment I made there was that I transferred Cargo-Bot from one iPad to the other and Cargo-Bot ran OK. That means the Main tab was created in the correct position.

  • Posts: 1,708

    @Simeon - obviously fileapp treats collections as folders where all files are discrete, whereas Codea uses them to group files but the files remain common. Codea prevents you from duplicating identically named files as a means of control, but fileapp can circumvent that.

    Seems like a good argument for a proper file system as Apple themselves have introduced the problem.

  • dave1707dave1707 Mod
    Posts: 8,387

    @Simeon I’m running into the black screen again. I would get it when I duplicate a project. It would open the duplicated project and if I immediately closed the duplicate, I would get the black screen and the only way out was to force close Codea. If I went back and tried to make it happen, sometimes I could get the black screen and most of the time I couldn’t. I couldn’t find a way to make it happen 100% of the time, so I dont know if it’s a timing issue or something else.

  • dave1707dave1707 Mod
    Posts: 8,387

    @Bri_G I’m not a fan of the Files app, and don’t use it, but I think what you’re running into is that Codea has all its projects in one place. When you group them in the Files app, you don’t have actual Codea projects there, only pointers back to the Codea projects. So in the Files app you can do what you want with the file pointers, but you can’t duplicate the projects in Codea. I guess the Files app is supposed to be a place to go and see all the Files without having to go into a bunch of different app to find what you want.

  • Posts: 1,708

    @dave1707 - like you I’m not that impressed with the files app, especially with all the trouble we had when they introduced it. But I have found it convenient to put files into Documents and also to group them in collections - note the danger of trying to have the same file in different collections.

    Have you tried setting up collections - it is a good way of tidying up the main project page and speedy access rather than mega scrolling? Files app is useful for that.

  • Posts: 1,708

    Hi All, just a quick question - I normally don’t use it but I have recently tried to restrict output to LANDSCAPE. So I set displayMode() to OVERLAY AND I set supportedOrientations() to LANDSCAPE _ANY. Then I displayed a sprite at 100,100, and a different one at 100,700.

    I expected the sprite to display to show in only the LANDSCAPE modes, retaining one of the LANDSCAPE orientations in PORTRAIT modes, but it also displays the same orientation in the two PORTRAIT modes. In all cases the same orientation of sprites.

  • dave1707dave1707 Mod
    Posts: 8,387

    @Bri_G supportedOrientations doesn’t work anymore. I mentioned it already to Simeon. He said they were goung to use something else.

  • Posts: 1,708

    @dave1707 - sorry missed that earlier, any Idea on the way forward? I can figure something out for what I need thanks.

  • dave1707dave1707 Mod
    Posts: 8,387

    @Bri_G Maybe something in the next release. They had quite a lot of fixes to put in.

  • AnatolyAnatoly Mod
    Posts: 889

    Will 3D Touch be supported?

  • dave1707dave1707 Mod
    edited March 2018 Posts: 8,387

    @Simeon Heres something I can’t figure out. I ran into this on another program, but created this small code to show what’s happening. I create a table with 100 x,y,z coordinates and draw 100 white spheres using those coordinates in a 10 by 10 grid. Each time I tap the screen, I go thru the table again 1 sphere at a time and change it to red, or so I thought. I print the table offset and the x,y,z values at that offset just to verify the values for each tap. Go thru at least 50 taps. The patterns are repeatable.

    function setup()
        assert(craft, "Please include Craft as a dependency")
        assert(OrbitViewer, "Please include Cameras (not Camera) as a dependency")        
        scene = craft.scene()
        v=scene.camera:add(OrbitViewer, vec3(0,0,0), 1000, 0, 1000)
        offset=0
        tab={}
        for x=1,10 do
            for y=1,10 do
                pos=vec3(x,y,0)
                table.insert(tab,pos)
                createSphere2(pos,color(255,255,255))
            end
        end
        output.clear()
    end
    
    function draw()
        update(DeltaTime)
        scene:draw()
        fill(255)
        text("tap screen to change sphere color to red 1 at a time",WIDTH/2,HEIGHT-50)
    end
    
    function touched(t)
        if t.state==BEGAN then
            if offset<100 then
                offset=offset+1
            end
            print("table offset",offset)
            createSphere2(tab[offset],color(255,0,0))
        end 
    end
    
    function update(dt)
        scene:update(dt)
    end
    
    function createSphere2(p,c)
        print(p)
        local pt=scene:entity()
        pt.position=vec3(p.x*16,p.y*16,0)
        pt.model = craft.model.icosphere(7,1)
        pt.material = craft.material("Materials:Specular")
        pt.material.diffuse=c  
    end
    
  • dave1707dave1707 Mod
    edited March 2018 Posts: 8,387

    @Simeon Forget the above problem, I just figured out what’s happening but I don’t totally understand why. The problem is I’m creating 100 white spheres and then creating a red sphere the same size in the same spot. I not sure if Craft is drawing the spheres in the order they’re created or some other order. So as I create more red spheres, Craft draws them, but it looks like Craft might draw some red spheres before it draws the white sphere in the same position. That’s why the colors sometimes switch back an forth. If I create the red sphere a fraction larger than the white sphere, everything works. I should just change the original color instead of creating a new sphere. I thought I’d leave these 2 posts just for information instead of deleting them. It’s amazing how a problem solves itself when you stop thinking about it.

  • SimeonSimeon Admin Mod
    Posts: 5,362

    @dave1707 It sounds like you're seeing z-fighting. This happens when the precision of the z coordinate is not accurate enough to correctly determine what to render (happens when things are very close together). So what ends up happening is the values get rounded up and down and you get a flickering effect.

  • Posts: 528
    i see there is a new beta and the title of this thread changed.
  • SimeonSimeon Admin Mod
    Posts: 5,362

    @piinthesky I did that

  • Posts: 528
    @simeon i guessed that! Lots of sparkling improvements i hope?!
  • SimeonSimeon Admin Mod
    Posts: 5,362

    @piinthesky I'm currently re-writing the code editor from scratch which is a big task. The latest build focuses on fixing the project browser sometimes going whacky when returning from the editor (and getting it back up to feature parity with the current app store version).

  • dave1707dave1707 Mod
    Posts: 8,387

    @Simeon I reported this back on page 2 where if I open a project near the end of my Codea project list (500+ projects) and then close it, Codea would scroll unseen to display the project list starting at an earlier project. Just want to say that when I do it now, the project list remains in the same position. I don’t know if you purposely fixed it or it was just the result of your rewrite.

  • dave1707dave1707 Mod
    Posts: 8,387

    @Simeon When I close a project, I’ll see the Codea project list flash thru the editor screen before the project closes. No big deal, just an FYI.

  • dave1707dave1707 Mod
    Posts: 8,387

    @Simeon I tried the Paste into Project and it works, except it doesn’t carry forward any dependencies. No big deal, just an FYI.

  • SimeonSimeon Admin Mod
    Posts: 5,362

    @dave1707 thank you for your testing those things. The Codea project list flashing through the editor sounds bad! Does it happen every time? I'll try to fix.

    I'd like to copy the dependencies through. But I have a new project sharing implementation that I'd like to get into Codea, and once that's in it will hopefully be the better way to get things into and out of Codea.

  • dave1707dave1707 Mod
    edited April 2018 Posts: 8,387

    @Simeon I can’t get the project list to flash thru the editor page as it closes anymore. Maybe when it was happening my iPad was just in a bad state or something. I’ll let you know if it happens again. It wasn’t that big of a deal when it was happening, just a quick flash of the project names.

    PS. I spoke too soon. I went back to the editor and I’m seeing the flashes again. It doesn’t happen every time and what I’m seeing is the large letters of the names.

  • edited April 2018 Posts: 1,708

    @Simeon - just tried to duplicate a file in a collection and it went through the motions but froze when it started. No response to touch. After stopping Codea, double button tap and swipe mini screen off, I ran Codea again. The duplicate was present in the root project menu, and ran.

    Projects in the root view I.e. not in a collection gave the same error when duplicated.

  • dave1707dave1707 Mod
    Posts: 8,387

    @Simeon I’m able to see the project name flash on my iPad Pro also. The other was on my iPad Air. If you can’t get the flash after several tries, close Codea and open it again. That’s what I had to do. I would just open a project and close it.

  • SimeonSimeon Admin Mod
    Posts: 5,362

    @Bri_G I tried these steps to get to your bug:

    1. Duplicate "Handling Touches" from Examples
    2. The new "Handling Touches Copy" project opens in the editor
    3. Press play and it seems to work

    Is there something else I should try to trigger this?

    @dave1707 thank you I'll try what you've suggested

  • Posts: 1,708

    @Simeon - I am using iPad Pro 10” with iOS 11.3. I just restarted my Pad and ran the”Handling Touches” example - ran fine. Then tried to duplicate it and the screen froze. Shutdown Codea then restarted the ”Handling Touches Copy “ was there and ran OK.
    I have a lot of collections in my projects. Could be a clash there.

  • SimeonSimeon Admin Mod
    Posts: 5,362

    @Bri_G ah okay, I think I should dump 500 random projects into Codea for debugging purposes.

  • Posts: 1,708
    @Simeon - Sorry, more specifics. I have duplicated my own files from my own collections, giving the error. I have also been playing with text manipulation for Sodokan, sphere generation for Craft with @dave1707 and mesh to object conversion with PseudoMesh.
  • edited April 2018 Posts: 1,708
    @Simeon on - on reflection the projects I was running had either Dropbox or http downloads. Have you changed anything involving downloads in 3.0(104)?
  • SimeonSimeon Admin Mod
    Posts: 5,362

    @Bri_G the http library hasn't been touched (that is, http.request calls in your code). Dropbox has been modified but that would effect the Sync operation in the Dropbox asset folder.

  • edited April 2018 Posts: 1,708

    @Simeon - Due to my duplication problem I tried to use FileApp to duplicate my projects on Dropbox, before re-installing Codea. I managed to copy all collection folders but only the plist file in folder. An error of “DBFileProviderError error 1” was provided and non of the actual files were transferred. Is there any way to transfer files to a local independent backup on my iPad so I can protect my files?

    Would that be a feasible option with Apple, it would avoid transferring outside the iPad?

  • edited April 2018 Posts: 1,708

    @Simeon - Answered my own question. I use iZip for opening zipped files and it’s one of those files that appear in Fileapp local files. So I created a Fileapp folder of _CodeaBackup in the iZip folder then ‘moved’ a few Codea files and collections across. Running Codea showed they were no longer there and I still found the Freezing flaw there. Moving them back replaced the files.

    Question - do applications have a limit placed on their file area usage when installed? Anticipating problems in using this approach.

  • Posts: 489

    I have a feature request, which I thought I'd post here first to see if it is at all feasible before putting on the issue tracker. Is it possible to detect if a touch is from a bluetooth stylus (such as an Apple Pencil)? If so, could an extra field be added to the touch userdata to indicate such? That would make it easy to filter out touches by type.

    (At the moment, I can use radius to do this since it would appear that the radius from the Apple Pencil is 0.25 and from fingers is of the order of 20 or bigger.)

  • SimeonSimeon Admin Mod
    Posts: 5,362

    @LoopSpace Apple pencil support is definitely on the list. Adding a simple flag on Touch to indicate type sounds like a great starting point. I'll add it to my list.

  • edited April 2018 Posts: 1,708

    @Simeon - this gets weirder, backed up my files, deleted Codea the tried to re-install withTestflight, problems with TestFlight.

    So installed version 2.9, then retried TestFlight - eventually managed to install 3(104). Duplicated Multitouch Example and Codea froze.

    Decided to move all my files back and work around the problem by copying files.

    P.s. added a _CodeaBackup File to Fileapp and used that for temporary storage, it worked but I wouldn’t recommend doing it until I’m sure my problem can be resolved.

    Are there any OS system settings which could cause this ?

  • SimeonSimeon Admin Mod
    Posts: 5,362

    @Bri_G that is strange, so you just can't duplicate projects outside of the main collection?

  • edited April 2018 Posts: 1,708
    @Simeon - precisely, main collection duplicates without problem and opens the new file for editing. Any collection project duplicates but freezes screen after pressing duplicate button - but after restarting Codea collection duplicates are present and behave as normal.

    Almost as if the address for return to project screen, in collection projects, has been lost or directed elsewhere.
  • dave1707dave1707 Mod
    Posts: 8,387

    @Simeon Just ran into a hang as described by @Bri_G . This was just duplicating a project in Codea. I long pressed a project, selected duplicate, entered the duplicate name, selected Create, the duplicate popup window closed showing the project list but the screen was frozen. I couldn’t do anything except close Codea. Upon restart, the duplicated project was there and ran OK.

  • Posts: 1,708

    @dave1707 - beginning to think there was something wrong with my iPad, as nobody else reported it. I take it you rebooted Codea and the duplicated file was present and ran?

  • dave1707dave1707 Mod
    Posts: 8,387

    @Bri_G I saw your posts about the problem and I tried to get it to happen, but I couldn’t and thought it had something to do with the way you were handling the files. But yesterday when I duplicated a project, Code froze. After closing Codea and restarting it, the duplicated project was there and ran OK. It was just a normal Codea project.

  • Posts: 528

    @john do you expect the AR detection of vertical planes, available in the new ARKit, to work with the latest Codea or do you need to recompile a new version?

    On another topic...If i provide you a link to a set of .obj/.mtl files that do not load with Codea (but are visualised in the asset picker) would you be interested to investigate?

  • Posts: 1,708

    @plinthesky - are you going to provide the link for those files in this forum? I would be interested, I have several files that don’t load and am trying to find out what the file differences are.

  • Posts: 528

    @john i find some strange things for a rigid body in AR. Things work fine in normal view. Could it be that the parent scaling does not get applied to the size of the rigid body?

  • JohnJohn Admin Mod
    edited May 2018 Posts: 616

    @piinthesky I'll integrate the vertical plane detection from ARKit into the next release of Codea.
    As for any models that fail to load, email them to me at john@twolivesleft.com so I can test them out.
    Can you provide some example code for the rigidbody issues? Scaling might cause some issues in some cases.

  • Posts: 528

    @john here are links to a model which produces an error message for me:
    https://www.dropbox.com/s/l4lp0yn7udcetj2/nodeV7.obj?dl=0
    https://www.dropbox.com/s/l5e78frn909kcwg/nodeV7.mtl?dl=0
    even though it is visible correctly in the asset picker.

    Here is another model (eiffel tower) which shows up correctly in xcode and blender, but does not show up in the codea asset picker:
    https://www.dropbox.com/s/clxbmnrclg7bou3/eiffel.obj?dl=0
    https://www.dropbox.com/s/138kead4zqd9z1d/eiffel.mtl?dl=0

    really appreciate you taking the time to look at this.

  • Posts: 1,708

    @Simeon - just noticed something on dependencies. Added two files to my Projects from and old post by @toadKick with regards t his Spritebatch and examples of its use.

    Loaded both up so they were at the top left of my Project icon list. Then tried to use Spritebatch as a dependency in the example. Found I couldn't locate the file in the Dependency liast, I assumed it would be at the top of the list. Looking through there appears to be several Projects missing from that list.

    How are the Dependencies organised? How are they selected - Codea obviously reads the Tabs - does it ignore duplicate Tabs (with the exception of Main)?

    Have you any plans to give options on the sorting order - recent/alphabetical?

  • Posts: 1,708

    @plinthesky - loaded the Eifel tower object into Meshlab without problem but the NodeV7 gave an error due to some materials files missing - however it did load and display the file using a default white material. Will be testing these files out in Codea shortly and will feed back my findings.

Sign In or Register to comment.