Okay, fair enough. Now make a tool that exposes any custom code that was entered into the Console (such as "scene.my" functions, arrays, variables and constants). That type of tool would save time and effort over parsing all the code in the Algodoo Config and other include files.
Quote: "Rev A: Now gets "scene.my." functions and variables."
It doesn't seem to work. As a test I entered a couple of "scene.my" variables into the console, and they did not show along with the other custom code.
My bad. I entered and initialized scene.my variables in the console but then did not use them in the actual code. Now when I actually use them, your Code Extractor finds them!
Nice work!
BTW - Have you seen this interesting technical paper: https://mori0091.github.io/Biped/biped6.0.html
It was written by Algodoo user mori-d (an expert on leg and foot mechanics).
If this is really a game, you provide no instructions for how to play it. Also, it seems to have many errors in it. Lots of undefined variables show up.
I recently watched a YouTube video that explains how the harmonic drive operates, and I thought it would make an interesting educational scene. I did not want to go to the effort if someone else already made a similar scene, and so I did a search and this scene popped up. Well, I'm not very talented (as you are) with making Algodoo mechanical assemblies and so there is no way that I could improve on what you already had done here.
Here is a link to the YouTube video in case you haven't already viewed it: Harmonic Drive
Back in the mid 1980's I wrote Assembler language code for the 8-bit Intel 8085A uP. It doesn't get any faster than that! But, unfortunately, all we have now in Algodoo is TIME (pun intended).
I might be doing something wrong again, but it doesn't seem to work. Here is what I did:
1. I created a simple scene of just a box with a couple lines of custom code in it.
2.I then saved the scene.
3. I dragged the code extractor phunlet (that I previously saved to my phunlet directory) into my simple scene.
4. I clicked the Run button (It wasn't clear if the scene under test must be running or not, and so I tried it both ways, running and paused).
5. The text panel popped up as expected, but nothing happened after that. I waited close to 3 minutes and gave up at that point.
S: "Did you save it to the same directory that has the Algodoo config.cfg file and did you name it "scene.phn"?"
R: No and No. My directory structure for saving Algodoo scenes is Algodoo/Scenes. The config file is in the Algodoo root directory. It has always been set up that way.
So, you are saying any scene that I want to extract code from needs to be renamed "scene.phn"? If so, I don't like that at all. How difficult would it be to have the user enter the name of the scene? That way it won't need to be altered and saved as something else. It would also work for people with a different directory structure like mine if you can also allow them to enter the directory where the scenes are stored.
Okay, now it works as long as I follow your detailed instructions. I still don't like having to rename and save a file with the name Scene.phn, but if that's how it has to be, then so be it.
One thing that wasn't clear to me at first is whether or not the scene needs to be running during extraction. I now know that it does not, but you might want to put a note in the scene stating that.
Overall, good job on the scene (except for the renaming/saving requirement).
Pedro6159 -- I don't understand what this scene is about. I think it would help if you explain how things work in more detail. Also, what does the "example" do in the scene? Nothing moves, and you give no instructions for how to use it.
This doesn't work because you have some undefined variables. You should test your designs to make sure that they work properly before you post them here on Algobox. But before that can happen, you need to learn how to write script. A good place to learn is in the Algodoo FORUM.
darren lo -- You should learn how to write script, then maybe some of your scenes will actually work. A good place to learn script is in the Algodoo FORUM. Learn what variables are, how to define them, and how to use them. Also learn the difference between local and global variables. Once you learn those things then maybe your scenes will work.
Problem: Control of the "rocket" becomes impossible if it tumbles around from hitting the earth.
Solution: In the thruster, uncheck the box that says, "Thruster follows geometry rotation"
You cannot play Chess with only six pieces per person! You need SIXTEEN.
Each player starts with 8 pawns, 1 queen, 1 king, 2 bishops, 2 knights, and 2 rooks.
Oh, now I see what you did! You made many copies of the pieces and they are on top of each other. That was not at all obvious to me, and I'm sure it's not obvious to anyone else wondering what you did.
By the way, the parts of your pawns (head and body parts) are not glued together. So when I try to drag a pawn to the chess board, only part of his body gets moved!
After you fix the unglued pawns, it would be a good idea to put a note in the scene which explains how this scene is supposed to work. This is just a suggestion. You don't have to make those changes if you don't want to.