Codea Craft 2.5 (84) Beta - Updated 8/9/2017

@John Ah, ok. That makes more sense now. Looking forward to that shape.hull!

@John Will there be an example on how to use the environments that are offered. Also, an example of how to use the blocky characters would be great. Every single time I use codea craft, I experience a joy that some would call me a nerd for (They already do). What I’m trying to say is great job! Can’t wait to see the final result.

@CamelCoder John’s working on a manual for Codea Craft currently. His work in progress draft is here: https://twolivesleft.com/CodeaCraft/Manual

@CamelCoder Here’s an example that uses the character mesh and texture. It’s just an image wrapped around an obj, so you’d have to do some thinking to get it to move its different extremities individually, but this shows you how to at least put it on the screen.

-- B

-- Use this function to perform your initial setup
function setup()
    -- Light Intensity? Maybe? Color? Maybe?
    craft.scene.sun:get(craft.light).color = vec3(1, 1, 1)
    -- Create an entity
    cube = craft.entity()
    -- Create a unit cube mesh
    cubeMesh = craft.mesh("Blocky Characters:Character")
    -- Add a renderer component to the entity (this will actually draw the cube)
    renderer = cube:add(craft.renderer, cubeMesh)
    -- Set a material on the renderer (this determines the appearance of the surface)
    renderer.material = craft.material("Materials:Standard")
    -- Set the map image for the material (the surface texture)
    renderer.material.map = readImage("Blocky Characters:Skin Adventurer")

    -- Create some parameters to modify the material appearance
    parameter.color("AmbientColor", color(50,50,50))
    parameter.color("Diffuse", color(255,255,255))
    parameter.color("Emissive", color(0,0,0))

    --Orbit around 0,10,0 zoomed out by 20
    viewer = craft.scene.camera:add(OrbitViewer, vec3(0,10,0), 20)
end

function update()
end

-- This function gets called once every frame
function draw()
    
end

looks amazing @Simeon , @John congratulations!

i tried the new camera recording of the screen-very happy to see it now records the sound as well. There are some minor bugs though-the time counter does not increase, also when i cancel the recording it exits the running of the program and puts me back to the editor.

@John I saw in the work in progress manual that you can assign an entity a parent. I tried it out in my own code and it worked visually, however I couldn’t get the child entity to work as a dynamic physics object. It just followed the parent entity and ghosted through any other physics objects it was meant to collide with. How could I fix this so that the child object would collide just like the parent object, but still have the parent-child relationship?

Hi @Simeon,

I know this is not a specific feature of 74/75 but I thought I’d raise the issue. I generated a Project using :


createProject("App_Buttons:But001")

Then I tried to make a duplicate of the file in that Project, Codea allowed me to make one but not in the Project - it created a copy in the general section of the files i.e… But001 Copy.

I see the copying of files within the Project as the best way to control files, the alternative is to create a new Project file then manually copy each tab. Is there a better way?

If not any chance of duplicating Project files within the Project in a future upgrade?

@piinthesky Yeah that’s a known issue that we are currently working on.
@Attila717 That’s a bug, you should be able to do do that, will fix.

@Bri_G yeah that custom project collection syntax (“App_Buttons”) is not going to be supported properly until we have UI support in place in Codea (soon).

@Simeon @John Fantastic work, Codea Craft is truly impressive! I haven’t had much chance to try out a larger project yet but just trying out some small things has still been very enjoyable.

I’ve found a minor bug when running the Block library and Voxel player examples. I’m only posting it because it seems that the examples have worked as expected for others excluding some crashing in the Voxel terain example.

The problem is that the player entity starts off in a position where it falls past the terrain instead of onto it. A quick fix for both examples is replace the creation of player with the following so that it lands on the terrain.

player = craft.entity():add(BasicPlayer, craft.camera.main, 10, 20, 10)

@XanDDemoX

This is probably due to voxel generation lagging behind the physics temporarily (so you end up falling faster than the ground appears). I’ll look into some better solutions than just spawning the player higher.

I’ve run into a problem. In the Voxel words examples I cant get block from imventory and therfore cant place any. Is this a bug or is it no coded in the example?

@GR00G0
You might have to select a slot on the bottom bar first then select something from the inventory

@John That makes sense, I am using an iPad2 :smiley:

Is it possible to attach a callback / event or something so we can be notified when the scene/world/physics/voxel generation is ready? It would also be useful for tasks like indicating progress of loading a level.

@John @Simeon Pretty sure I just found another bug. (or maybe just an unfinished feature) I tried running a Codea Craft project while using Air Code and it spat out all sorts of errors like

Main:8: attempt to index a nil value (global 'craft')

I’m 100% sure this isn’t a problem with the project itself, as I’ve run it without Air Code without a problem before. Hope you can look into this for the next release!

@Attila717 I don’t use air code, but that error usually means that Craft isn’t checked as a dependency.

@dave1707 Nope, its definitely checked as a dependency. I have noticed that you cannot set dependencies in Air Code, but dependencies that you have previously set in the Codea app stay on the project when run in Air Code.

Talking of dependencies, I noticed for the craft examples I have to scroll down quite a bit to see their dependencies. Although probably not as far as I imagine @dave1707 might have to :wink:

Perhaps a way to show only the project’s current dependencies would be helpful? I think either separately showing them again at the top of the list or a swipe gesture to switch to a filtered view could work well.

Edit: Also just found a bug. Whilst scrolling in the list it froze briefly then suddenly changed to the light theme.

Edit2: To replicate open dependencies list with the onscreen keyboard open then close the keyboard.

@XanDDemoX I don’t use dependencies, so it’s not a big problem. For the craft examples, I did have a lot of scrolling to do to see what was checked. Maybe an easy way to show the checked dependencies is just have any checked dependency sorted at the beginning of the list.

I put the new beta update in this discussion as well as there didn’t seem to be a lot of enormous changes, just bug fixes and improvements.