Codea 2.5.1 (97)

Here’s what’s changed:

• Importing from the Files app works now. Hooray. Or something.

• Craft project templates now add your project name to the top of the file. How else would you know which project you were editing? You wouldn’t, that’s how.

• Changed the default constructor for quat to (1,0,0,0) and its toString() prints (w,x,y,z) instead of (x,y,z,w). If you know what this means then please tell us.

• Added normalize(), normalized(), len(), lenSqr() and conjugate() methods to quat. Bet you didn’t see that coming

Previous thread: https://codea.io/talk/discussion/8811/codea-2-5-1-95

This is being submitted as the final version of 2.5.1. Don’t let that stop you reporting bugs.

@Simeon The zip imports now work. I tried a single project and a full zip. The full zip listed all my projects, but I did do an actual import on all of them. I did an import on the single project OK.

PS. When you do an export projects, is there any way you can also export/import the global variables. I deleted Codea a while back and reloaded it without realizing I didn’t save my global variables anyplace. I guess I can add that to my backup/restore program for future use but it might be handy in the zip file.

@UberGoober I did test the Find/Replace reports you made and wasn’t able to make it crash. I did resolve a bug that could cause a crash if you deleted a tab containing find results and then attempted to select a result found in that tab.

(Note I only tried iOS 10 and 11, I recall you are on iOS 9. I’ll have to try that too)

@dave1707 glad it works now. I hadn’t even considered exporting the local and global data. That’s a good point.

I’m not able to record on my beta iPad. Is it because it is stuck on iOS 10? My newer iPad (which doesn’t have the beta) is on iOS 11 and can record, but the recording seems to use the iOS 11 screen recorder rather than the old in-built recorder.

Is this an iOS thing or a beta/non-beta thing? If iOS, could Codea fall back to the old method of recording the screen on older versions?

@LoopSpace my Codea bombed when I used the screen capture to photos. Have you tried that?

@LoopSpace the old method of recording really entangled itself with the main runtime code. Getting rid of it was such a relief, though I get that it leaves iOS 10 and earlier behind. Not having the feature is bad, but keeping it meant more old code to maintain into the future so we made a trade off there.

@Simeon I placed an item on the tracker, as Anon as I forgot my bitbucket password, with regard to dropping the camera and video options in the bottom left-hand corner as iOS has those features built in. That would leave the ext/pause and restart controls.
In retrospect loss of the camera would remove the easy option to the project icon which I wouldn’t want to lose.
Can I suggest adding the latter to the remaining three but arranging them vertically, which would help avoid the iOS multitasking bar on the bottom of the screen.

Edit: thinking about it further, what about a single button in the blhc wchich could pause activity and allow a number of options from a pull-out or floating window, that would eliminate the need for a separate pause button.

I am still getting the crash from searching for things. Can anyone else weigh in on this, preferably someone running iOS 9? It’s simple to reproduce: tap the magnifying glass to search for something, then tap back into the main project/code area, and try to type anything. Crash-a-rooney!

I’m not sure if anyone else has mentioned this, but there’s a very disruptive editor bug around selecting text. Apologies if this is already being tracked.

To reproduce:

  • open Learn Craft
  • Scroll to the bottom of the Scene tab
  • Highlight the last word–“end” of course
  • When the keyboard pops up, all the text will have scrolled far up offscreen, and you’ll be looking at a blank page

Those are precise directions, but in my experience it happens all the time, in any tab and any project, if you select something below the top of the file while the keyboard’s off.

It appears to be a bug in the algorithm for scrolling the text up when it would be obscured by the keyboard, to hazard a guess.

If I may, I’d like to make a strenuous plea for my #1 wish-list item: autocomplete for dependencies.

Autocomplete won’t detect functions and variables in dependencies, let alone class names themselves, meaning to use code in another project you either have to have it all memorized or you have to jump back and forth all the time.

The lack of autocomplete for dependencies is perhaps the entire reason I can’t and don’t write truly modular code.While perhaps that’s a failing on my part, I’d guess it is also a stumbling block for many others.

I’ll tell you something from my experience, for example, which is that I crawl through the forums and the old posts and I find all this truly great stuff, and I’m left wondering, what happened to these things? Ignatz alone developed and shared tons of demos that other people could have picked up and used as the basis for hundreds of games. For goodness’ sake, he developed a basic FPS engine, which I’d wager is the #1 thing beginning gamers want to learn to make.

But what I don’t see on the forums, and I wish I saw, was people using and building on other people’s code. It happens a little but not much. I mean, I’d wager that if someone went back through all the old cool projects, and standardized them, and made them truly modular, Codea just might be left with a terrifyingly versatile user-generated game-creation API.

Going back and making all that old code re-usable is an idle fantasy of mine, tbh. I’d probably never do it, even if dependency autocomplete existed–who has the time?-- but I’ll definitely never do it without it.

I mean, you know, it’s discouraging to me that every project made by now isn’t using SODA. @yojimbo2000’s work there is stunning. But we’ve still got newcomers coming to the forums and thinking, “what this engine needs is a good standardized UI, and I’m gonna make one!” I was one of those people, once, and a new one came along just last week, as I’m sure you noticed.

I get it, though. I ran into problems trying to use SODA, myself. I’ve been trying to solve those problems in ways I can share with others. But if you look at the comments in my SodaSpec code, I recommend people cut-and-paste it into their projects, so they can make use of autocomplete as a learning tool for it, which is in fact what I also do with it. I wrote the code, and I can’t make use of it as a dependency because the dependency system lacks autocomplete.

The dependency system itself is great. And Codea is great. And on this forum you’ll find incredible examples of what it can do. But most of those examples went nowhere beyond the forums, and in fact went nowhere on the forums as well, and it makes me scratch my head all the time, wondering why. It could be because the code wasn’t modular enough. But it could also be that, even with perfectly modular code–like SODA–it was too hard for other people to really use it–it has been in fact too hard for me to use it–because of the lack of autocomplete for dependencies.

Whew.

Sorry to go on and on.

It might change nothing–newcomers to anything always try to reinvent the wheel, for a while, that’s par for the course–but it also might change everything. As is probably, I think, evident, I am humbly imploring the Codea powers-that-be to implement autocomplete for dependencies. :smiley:

@UberGoober Just to throw my 2 cents in, I don’t use dependencies and I don’t use code written by other people. The reason I don’t use dependencies is because I like to have all of the code in the same project so I can see all the code without having to open up different projects. The reason I don’t use other peoples code is because I like to know what the code does. A lot of time other people’s code is confusing. I don’t know exactly what they’re trying to do or why they’re doing it that way. Also using other people’s code means that you’re pulling in a lot of code you don’t need just to use a few things. And using other people’s code means you’re dependent on them to make changes when something doesn’t work right. That means your code doesn’t work until they fix there’s. My advice to new coders is to learn from other people’s code, but don’t become dependent on it. There’s nothing wrong with new coders trying to reinvent the wheel. Rewriting other people’s code is a excellent way to learn how to code.

@dave1707: Clearly the dependency system isn’t for you, for the reasons you describe, and I can’t fault you for it.

But I do think you’d subscribe to the general notion that if a feature exists, it should work, and if it works, it should work well.

Given that the dependency system does exist, and its purpose is to enable modularity for those that see value in that, I think it has a fatal flaw that keeps it from achieving that goal.

As to the virtues of re-inventing the wheel, I think the priorities you describe are excellent, and Codea should reflect them to the degree that its creators see its primary reason to exist as a tool for learning to code.

@UberGoober you are absolutely right that it if it’s in there then should work well. I haven’t read through your feedback yet, but I will and we’ll make some feature requests from it.

The structure of a parameter definition for sliders consistently uses the format min-then-max-then-current.

Defining an OrbitViewer’s range of motion uses the format current-then-min-then-max.

I suggest standardizing the OrbitViewer to follow the convention established by the parameters.

I am somehow destroying the camera and crashing my project (but not Codea itself).

The message I get is this:

Component - N10CodeaCraft6CameraE has been destroyed.
stack traceback:
	[C]: in ?
	[C]: in metamethod '__newindex'
	Main:93: in function 'update'
	Main:101: in function 'draw'

And my code is this (it’s an attempt to modify the Cameras project):

https://gist.github.com/DolenzSong/d9c26576872ea5df8a11f1b336e8448a

To reproduce:

  • After starting the project, scroll down in the parameters and tap the button that reads “OrbitViewer” (it also has an emoji)
  • Do something or do nothing, it doesn’t seem to matter
  • After 25-35 seconds the project crashes with that error.

@LoopSpace the video recording should be available on iOS 9+. We migrated to ReplayKit, an Apple API introduced in iOS 9. So it should work, if it isn’t then it’s a bug. Though occasionally I have had screen recording fail to work on my iPad until after I restart it (both ReplayKit and the iOS 11 control center recording option).

@Bri_G does Codea consistently fail to capture the screen and video for you? We’ll have to look into it. Which version of iOS?

@UberGoober autocomplete for dependencies is absolutely something we should do. I have a feeling it will be easier to implement than I expect, and your points are correct. I find myself not using dependencies for the exact same reasons. (Also, an easy way to switch to dependency code.)

@Simeon yes consistently 5 seconds after pressing the camera save icon
iPad Pro 9.7 iOS 11.0.3(15A432) Code 2.5.1(97)