It looks like you're new here. If you want to get involved, click one of these buttons!
@dave1707 you probably know how to help me with this:
I’m posting this as a discussion because I’m not seeing an answer to this specifically for CRAFT and having the answer on here will help people in the future:
Ok, so I’ve searched as best I can on the internet, and it seems that the in-app reference material being incomplete is a KNOWN issue. The external sources of further information I have found are extremely helpful but seem to have been made BEFORE craft was implemented.
Is there a source of complete reference information for craft? Have I missed it? I’m not seeing a discussion that points to the answer.
I’m currently reverse engineering the voxel system to make my own.
This line has two issues:
scene.voxels.blocks:addAssetPack("Blocks")
1: the reference in craft doesn’t tell me about it.
2: the output when playing the block library says “asset strings are deprecated”
I know what it does, it adds an asset pack the the blocks stored in the voxel system.
So I’m looking for the reference to see what the proper call is, and what it is expecting, and the reference is incomplete.
It’s less about knowing what it does, but having access to the reference to understand fully HOW it does it.
Help?
-Timmy_theBarbarian
Comments
@Timmy_theBarbarian What you see is what you get. There isn’t very much documentation for Craft other than what you find in Codea which doesn’t give much. As for the “asset strings are deprecated”, that’s because the way assets are now used was changed since the blocks demo was created. The blocks demo hasn’t been updated to correct the deprecated warnings.
That’s what I figured. Do you use craft all that much? Have some hack code I can reverse engineer?
My intention now is to put together a reference of my own to share with the community.
Any help from anyone will be greatly appreciated!
I’m assuming the source isn’t available? I could tear through that and make a reference library from my findings.
@Timmy_theBarbarian I have a lot of Craft code, but nothing as complicated as the Craft examples which is probably a good place to reverse engineer. I once asked for a Craft doc in the form of a Tree diagram so I could see how all the Craft commands are related to each other. That didn’t go anywhere.
I have started with the examples. A tree diagram is smart. That will be how i present it. I’m too dedicated to this tool to not have this information.
Do you have any simplified craft code that uses the voxel engine specifically? If so please PM me with it. It will help me get my bearings with the system as a whole and I can use the examples to fill in the rest.
Codea is cool, but if people can't figure it out, will they stick around? will they tout it to others?
Fact. I am currently constructing the flow tree aforementioned by @dave1707
I’m making 2.
1 == everything under craft
2 == a “project” tech tree from start to finish showing all the requirements for a base working program with the tree noting the parent - child relationships.
THAT will be sufficient me thinks
@Timmy_theBarbarian - would love to see these when you have completed them. Started my own ages ago, but like many of my projects it got shelved.
Curious - what package are you building this in ? I was using iThoughts (I think).
@Timmy_theBarbarian I don’t know how helpful this would be—potentially a lot, potentially not—but I had to wrangle with Craft a lot to create a texture pack:
https://codea.io/talk/discussion/11843/complete-craft-texture-pack
I think a had to figure out at least one or two undocumented features, in particular the syntax for creating non-cube-shaped blocks, such as the piston and the cactus and the sign.
@Timmy_theBarbarian - found it, this is as far as I got (before my usual distraction hit me).
@Bri_G Excellent. This will speed things up. You focused on things I haven’t got to yet so it will help streamline the process. Thank you. I’m using MindNode for the maps. Haven’t decided how/if I will make the reference library. May not dedicate the time to a full reference. I am fully convinced @Simeon and friends will finish updating the reference library in future versions. In fact i am convinced that they have considered this need and have concluded that with the combined expressed information within the reference library, the code examples nested within said library, and the HORRIBLY commented examples provided with the shipped product, that we have all/most of the information required to utilize the tool in an at least good enough for now format.
@UberGoober I will pour over this and assimilate the information. Thank you good sir.
Another pertinent element is that sooner or later Codea 4 will come along and IIRC it will revamp both the 2D and 3D APIs. They say it will take a while but that’s a statement that’s open to interpretation.
@Bri_G EXACTLY! I want to understand how it WORKS. not how to get it to work.
@Timmy_theBarbarian I’ve no idea if this will be of any use to you but here it is anyway:
This generates a full listing of everything contained in the
craft
table (including sub-tables) in Codea’s documents directory as ‘docs_craft.txt’Alternatively, this will list everything globally accessible in a Codea Project:
This one also lists the values themselves.
Here’s a version of the first program that lists the contents to the screen. It’s sorted and can be scrolled up or down.
@Timmy_theBarbarian undocumented function, I think, for blocks:
schedule(amount)
It’s used three times, I think, in the Block Library project, which is where the attached screenshot comes from.
Not sure what it does—I mean it’s obvious that it’s involved with scheduling something—I just don’t understand how it works.
@dave1707 thank you for the assist!
@UberGoober thank you for bringing that to my attention! If I can trace it back properly I’ll include it for sure!
Thank you guys for the assistance! I’ll keep at it!
All,
Just for a laugh - modified and reposted a demo by @dave1707 with a Starwars theme, but angled at Craft (tongue in cheek).
Background image free from ‘Unsplash’ with this attribution Also in graffiti name.
@UberGoober Not sure what you’re saying (NSF), but I’m assuming it doesn’t work on your iPhone. I made this change to get it to work on my iPhone 8 SE.
In the draw function.
i thought it was clever
OK here’s what I think schedule does. It’s a function that can be called on voxel blocks to trigger their blockUpdate function a certain number of ticks from now. It’s useful for custom-scripted blocks.
Update: I’m still working on this on the weekends. My day job takes a lot of time and energy so it will take a while
In the 3D Asset Viewer there’s a bunch of undocumented stuff in this one place, I think:
I may be missing this stuff in the documentation, but it looks to me like there are undocumented features on every line here, starting with
model.bounds
, thenbounds(min, max)
, thenbounds:translate(position)
, and thenscene.debug:bounds(bounds, color)
.yeah that’s exactly the problem. its undocumented everywhere. gonna take a lot of time to put together.
Hey guys,
This is my fault since I added things to Codea/Craft here and there but failed to document all of them. I'm really awful at missing this kind of thing. Sorry it's become such a bother for everyone
As a way to help sort out this mess I've created a repository over at https://github.com/JohnTM/Codea-Docs which has all the existing documentation and the source code for the Craft lua bindings, which contains literally every Craft API call that exists (please mind the messy code). It doesn't say exactly what everything does but I can help illuminate that as well if anyone has a specific question
I've tried writing comprehensive documentation, manuals, tutorials, videos etc... before but along with juggling bug fixes, updates and new app releases (such as Shade), and my full time job I do find it hard to maintain motivation and consistency across the board. And for that I do apologise since this community means a lot to me
@John Thanks for the link. There’s a lot to look at.
The silver lining to me is that it’s fun to discover new things that Craft can do.
@dave1707 no worries. Yeah the bindings and documentation are massively monolithic. I guess that's what happens when you keep adding to a project for this many years. Codea 4 has a much cleaner and elegant design, which will supersede this at some point
@UberGoober no worries. I do feel bad but its been pretty amazing how you guys have reverse engineered the undocumented stuff!
I’m not great at deciphering the bindings—my burning question is if the Craft shader format supports vertex buffers for variables—can anyone tell?
@UberGoober I'm not entirely sure what you mean? Craft doesn't support arbitrary extra mesh buffers like the old shader system if that's what you mean. You can use array uniforms to pass in an array of points though if that's what you want
I think we’re on the same page: in the old shaders every variable could be buffered with a different value for every vertex, making some really amazing things possible.
People did some amazing shader stuff in the old days and the lack of those buffers is what’s keeping me from porting the most impressive ones, if I recall correctly.
Ah ok I see what you mean. Craft unfortunately doesn't have this feature. The only thing you could do really is use the existing uv and color channels to store extra data. I could also add access to the second uv coordinate (currently not in the API). Can you link to examples that used the old shader system so I can see what it looks like?
I don’t know how to do array uniforms is what I’m missing I guess. They need one format in the lua part of the Craft shader and a different format in the shader code, I could never get them to work together.
@UberGoober looking into the code now, I noticed that array uniforms was originally a planned feature but never got fully implemented. So that makes sense that you couldn't get it working. I'll look into how hard it would be to finally add that feature
@John that would be great!