Codea 3.8 (383)

That’s where I noticed the crashes. It doesn’t do it all the time but only under certain circumstances. So I just made a small demo for Simeon to look at.

@sim @dave1707 - just reran your modes demo and tried to capture the screen for an icon but it didn’t work. Tried a few times.

Edit: correction, loaded up another project, ran that and when I returned to project screen the image was present. Looks like some kind of delay ???

Thanks again for the simple project to reproduce the bug. @jfperusse managed to track it down to a memory corruption error caused by me, which only happened when processing touches while the viewer was closing (so closing normally wouldn’t trigger it)

@sim Tried the viewer.close code and I can’t get it to crash Codea. Looks good.

2 Likes

@sim @John The latest version no longer constantly prints error messages when the code runs that I mentioned a few posts above.

@sim Are the icons at the bottom of the print area for V4 supposed to do anything. They don’t respond to anything.

Is there a link somewhere to the V4 documentation. Every link I’ve tried so far gives me a 404 page error. I thought there was one, but so far I can’t find it.

@dave1707 @sim @John - in V3 made a stupid mistake whilst writing a demo posted in the Killer.Jo thread.

There is a call to inCircle(p,c,r) where the first two parameters are p the touch point, c the centre of a circle of radius r. The first two variables vec2() and r an integer. I cut data out of an ellipse command to set up as a vec2() variable for c but didn’t replace them in the ellipse command leaving the preceding “,” in the brackets. When run Codea crashed after the touch on screen.

As I said - stupid mistake but it doesn’t look like it’s trapped.

@sim There’s still a problem with text. In the example below, it will print the letters ab 20 times. If you remove the letter b, it won’t print anything. Apparently text needs more than 1 character to display.

viewer.mode=FULLSCREEN

function setup()
    style.fill(255)
end

function draw()
    background(0)
    for z=1,20 do
        text("ab",100+z*30,HEIGHT/2)
    end  
end
1 Like

Thanks for the report, we’re still working on the v4 viewer UIand should have something more functional soon

Edit: oops! We broke the documentation link when moving to a new repo. We’ll restore it soon

Edit 2: The documentation is here now: Codea 4.0 documentation — it won’t be fixed in the app in the next beta, but the one after

@sim @John @dave1707 - found an error in V3 part of 378, searching code for ‘vertices’ on the found side of the dialogue it highlighted random words (see attached image).

1 Like

@sim @John @dave1707 - two crashes with 38, crash reports sent. Occured when loading old project with very large file (set up using the #-- notation to split out tabs from a single file). Succeeded to load by copying in sections so not inherent in file.

@sim @dave1707 - just posting as I was kinda surprised that spriteSize() threw up an error when I tried to use a vec2() as receiving variable.

Also, may have made a mess of this, but I tried to calculate the x and y variables in a vec2() as a parameter call within a function call (just trying to compress my code) but it threw up an error. Working out the vec2() values beforehand worked.

@sim Am I doing something stupid that I just can’t see or is there a problem here.

I have a static rigidbody thin cube as the floor.
I have a dynamic rigidbody sphere.
I have a dynamic rigidbody cube.

The static floor stops the dynamic sphere which stops the dynamic cube. If I comment out the createSphere, the dynamic cube should be stopped by the static floor, but it’s not.


viewer.mode=FULLSCREEN

function setup()
    assert(OrbitViewer, "Please include Cameras as a dependency")
    
    scene = craft.scene()
    v=scene.camera:add(OrbitViewer, vec3(0,0,0), 100, 0, 200)
    v.rx,v.ry=10,20
    
    createFloor()
    createSphere(0,10,0)
    createCube(0,20,0)

end

function draw()
    update(DeltaTime)
    scene:draw() 
end

function update(dt)
    scene:update(dt)
end

function createFloor()
    c1=scene:entity()
    c11=c1:add(craft.rigidbody,STATIC)
    c1.position=vec3(0,0,0)
    c1.model = craft.model.cube(vec3(60,1,60))
    c1:add(craft.shape.model,c1.model)
    c1.material = craft.material(asset.builtin.Materials.Standard)
    c1.material.map = readImage(asset.builtin.Surfaces.Basic_Bricks_Roughness)
end

function createCube(x,y,z)
    c2=scene:entity()
    c21=c2:add(craft.rigidbody,DYNAMIC)
    c2.position=vec3(x,y,z)
    c2.model = craft.model.cube(vec3(4,4,4))
    c2:add(craft.shape.model,c2.model)
    c2.material = craft.material(asset.builtin.Materials.Standard)
    c2.material.map = readImage(asset.builtin.Surfaces.Basic_Bricks_Roughness)
end

function createSphere(x,y,z)
    sphere1=scene:entity()
    s1=sphere1:add(craft.rigidbody,DYNAMIC)
    sphere1.position=vec3(x,y,z)
    sphere1.model = craft.model.icosphere(2,5)
    sphere1:add(craft.shape.sphere,2)
    sphere1.material = craft.material(asset.builtin.Materials.Specular)
    sphere1.material.map = readImage(asset.builtin.Blocks.Brick_Red)
end

@dave1707 - I have had a weird issue where I have built a baseline for an app and started it running with V3. The project creates a screen which holds a button. When you tap on the button a small window opens to provide info. The window is moveable so as to place it so you can see effectively any part of the screen. This works fine but - I moved the info window around to the limits of the screen for a few circuits and suddenly Codea closes. Not crashes !!! Closes, no error is thrown up.

I’m sure it’s down to my poor programming as I can’t get a decent amount of quiet time to resolve it.

Have you experienced anything like this ???
Is it something in iOS that I have tripped ?

Edit: collectgarbage() stops the exit, but the garbage count doesn’t seem to get too high. I have built a small garbage displayer which I am using - code below:


function garbageMonitor()
    --
    pushStyle()
        placer = vec2(WIDTH-112,HEIGHT-24)
        fill(0)
        stroke(255, 14, 0)
        strokeWidth(2)
        rectMode(CENTER)
        rect(placer.x,placer.y,160,36)
        fill(236, 228, 67)
        font("AmericanTypewriter-Condensed")
        fontSize(16)
        textMode(RIGHT)
        text(collectgarbage("count")//1 .. "Kb used",placer.x,placer.y)
    popStyle()
end

@sim Was able to run Webrepo without Codea crashing. Loaded a few games Ok.

2 Likes