Codea 3.6.1 (353)

@Elias yes in the new runtime you cannot have any class creation code outside of the intial setup function, i had to put all my “boot” code into setup () and make sure all my flow was there →

setup()
  saveload = SaveLoad() — my class for saving and loading data
  CAMERA = Camera() — my class for camera management
  —etc
  App() — class for my main application that manages scene loading
end

previously i had a bunch of stuff happening outside of setup first and this was all broken now,

also i still don’t have an error free version of my boilerplate running so there’s more errors that will come up for you too i’m sure

@skar @Elias If I understand you correctly, you can do your saveload=SaveLoad() or CAMERA=Camera() anywhere you want, it’s just that the classes have to be defined before you do it. Basically, classes are defined before setup is executed, so that’s why it works when you put the saveload= and CAMERA= in setup. Any code not in a function gets executed before setup. If you have your classes defined in a function somewhere, then that function needs to be called before the saveload= etc. Or am I not understanding what’s going on.

@dave1707 based on what Sim has said before the code is 3.x is read once to establish the references and that’s what allows for javascript-like “hoisting” (using a function before its declaration) then its read again a second time to actually execute, this appears to be different in 4.x where the code is read once and executed

@binaryblues The shadows are caused by objects falling below the platform, creating issues with precision of the depth buffer. I plan to fix this when I figure out how to limit shadow caster distance

@Elias right now tab order isn’t being properly respected (will fix this soon). For now if you want you can use require(‘TabName’) at the top of the file that uses classes from other tabs. This wasn’t possible before but now dependencies can be resolved manually (regardless of tab order)

@skar @dave1707 @Bri_G That makes sense, I wasn’t aware of that change. Thanks!

@John Thanks, I’ll use your suggestion to fix the issue! Will Codea 4 eventually feature the behaviour of Codea 3 in terms of sorting out dependencies or was this a deliberate change that will remain in the final version? (I’m not sure if that is what you meant with the tab order not being properly respected.)

@John Thanks, Codea 4 implements shadows, which is a very useful feature, and we can finally use a simple and efficient shadow effect in Codea!

anyone have trouble loading an asset as a texture to mesh?

@skar Which line of code triggered that error? Looks like it was expecting an image but got an asset key. It’s possible that I could add an overload for it though

basically what worked before

   mymesh = mesh()
  mymesh.texture = asset.builtin.Blocky_Characters.AdventurerSkin

@Simeon Cant open Codea version 341, on iPad Air 3. Constantly crashes, can’t get in. Sent crash report.

PS. Powered iPad off/on, no change. Constantly crashes.

PS. Reloaded version 340 which ran OK. Tried version 341 again, but it still crashes before getting into Codea.

@dave1707 - just confirmed your findings with 341, crashed twice before Codea even loaded.

@Bri_G Did you get it to load. I tried several times before and after reloading it and never got it to load.

@dave1707 - confirmed your findings and posted two crash error reports.

@dave1707 The same crash

@dave1707 - no, it didn’t load but looked to have started before the crash alert fired up. Now back on 340 like you.

Thanks for letting us know, there was some big refactoring in the latest version so something must have gone wrong in when distributing it

@John @Simeon In the Codea 4.x error log, I entered an error where the constant TEXT_ITALIC is set to nil, but should be a value of 32. In the log it says WON’T FIX. Not sure why. Here’s some code that shows the values of the textStyle constants where TEXT_ITALIC shows nil. I also show code where a textStyle value of 32 displays italic text.

function setup()  
    --[[
    
    From 4.x documentation
    
    Text Style with style.textStyle()
        TEXT_NORMAL
        TEXT_BACKGROUND
        TEXT_UNDERLINE
        TEXT_OVERLINE
        TEXT_STRIKE_THROUGH
        TEXT_BOLD
        TEXT_ITALIC
        TEXT_RICH
    --]]
    
    print(TEXT_NORMAL)
    print(TEXT_BACKGROUND)
    print(TEXT_UNDERLINE)
    print(TEXT_OVERLINE)
    print(TEXT_STRIKE_THROUGH)
    print(TEXT_BOLD)
    print(TEXT_ITALIC)
    print(TEXT_RICH)    
end


function draw()
    background(0)
    style.push().fill(color.white).noStroke(255).strokeWidth(1)
    
    style.textStyle(TEXT_NORMAL)    -- normal text value
    text("qwertyuiop  normal",500,200)
    
    style.textStyle(32)             -- italic text value
    text("qwertyuiop  italic",500,150)
    
    style.pop()
end

Version 343 loads OK.

PS. viewer.mode=FULLSCREEN works OK.

viewer.mode=STANDARD doesn’t show Parameter or Output area. Also, pressing the [->] in the upper left doesn’t do anything.

Viewer.mode=OVERLAY doesn’t do anything either. Not sure if those are supposed to or not, but FULLSCREEN works so I expected the others also.

viewer.version is a table and displays version info, just didn’t show what I was expecting. Thought it would show something like Codea 3.6 version 343 . I guess it doesn’t really matter.

@dave1707 @John - confirm 343 loads up OK.
Not sure what viewer .version is or how to use it. Print(#viewer.version) printed out 0.
Accident, used viewer.version() in version 3 and it crashed Codea.

@Bri_G Heres some code for viewer.version.

function setup()
    for a,b in pairs(viewer.version) do
        print(a,b)
    end    
end