Browse Search Popular Register Upload Rules User list Login:
Search:
Gearbox spawner

Image:
screenshot of the scene

Author: homieeee

Group: Default

Filesize: 64.48 kB

Date added: 2014-05-19

Rating: 5.5

Downloads: 1095

Views: 423

Comments: 20

Ratings: 2

Times favored: 0

Made with: Algodoo v2.1.0

Tags:

Scene tag

After a couple hours of coding i have a near final product!!

If anyone has problems, questions, or suggestions please ask away!

This is free to use for anyone:tup:

Updated: better instructions and size ajustments
Last edited at 2014/12/27 20:04:23 by homieeee
Please log in to rate this scene
edit
Similar scenes
Title: pressure responsive spawner v1.0
Rating: 6.3
Filesize: 48.05 kB
Downloads: 828
Comments: 5
Ratings: 4
Date added: 2009/04/19 00:35:10
Made with: Phun
Rating: rated 6.3
download
Title: Complex Spawner car
Rating: 6.1111
Filesize: 51.74 kB
Downloads: 648
Comments: 0
Ratings: 3
Date added: 2010/09/12 17:44:45
Made with: Algodoo before v1.8.5
Rating: rated 6.1
download
Title: Dodge Ram 1500 with Cummins
Rating: 5.8889
Filesize: 126.74 kB
Downloads: 2743
Comments: 3
Ratings: 3
Date added: 2014/11/23 15:19:13
Made with: Algodoo v2.1.0
Rating: rated 5.9
download
Title: 4 gear (+R) gearbox
Rating: 5
Filesize: 22.9 kB
Downloads: 456
Comments: 0
Ratings: 1
Date added: 2016/05/04 20:15:29
Made with: Algodoo v2.1.0
Rating: rated 5
download
Title: complex object spawner
Rating: 5.5
Filesize: 43.93 kB
Downloads: 609
Comments: 2
Ratings: 2
Date added: 2010/09/26 00:11:54
Made with: Algodoo before v1.8.5
Rating: rated 5.5
download
Title: Circular gearbox
Rating: 5.8889
Filesize: 35.4 kB
Downloads: 1274
Comments: 8
Ratings: 3
Date added: 2014/11/06 05:55:52
Made with: Algodoo v2.1.0
Rating: rated 5.9
download
Where the hell you learn all that script???
mostly self taught and from google!
When I click on "Click here to generate" what should I see? Apparently, nothing happens. :huh:
Try it now. It must not have given you the function
Nope. There's an undefined function named "gearbox" which doesn't do anything. When I type the name into the console, it returns "undefined".
Hmmmmm its supposed to give you the function on update i dont know whats wrong
The function "gearbox" is not defined. Could you print the function here in the comments, and I'll try to figure out why it's not working?
You said, "its supposed to give you the function on update ". What do you mean by that? I don't see any code in update that would create a function. Please explain in detail. :s
Sorry, if you look at the box behind the "click here to generate" it has the update code defining the function gearbox

The function is probably too big to print here
Yes, that surely is a huge function!:o

I see a couple of issues with it. Well, actually THREE issues thus far:

1. You need to add the prefix "scene.my.", so the name should be changed to "scene.my.gearbox". The reason is, that's what Thyme requires in order to save a defined function or a global variable. Without scene.my, your scene will only work once until it is saved and reopened.

2. NEVER, NEVER, NEVER (to the infinite power) define a variable or a function in update or postStep. The reason is, the variable or function will get defined over and over again a zillion times while the scene is running. You should only define a function or variable ONCE, either in the console, or in one of those text boxes in the upper-left side of any geometry script menu.

3. The syntax to define a function is: scene.my.function := (e)=>{ code goes here }. You can learn more about functions in the Algodoo forum.

Now, I made those changes in my copy of the scene, and it still doesn't spawn a gear box. I don't know why not, but at least these three issues will get you going on the right track.
Thank you for looking at it Xray!

1. I added it and it still works for me i don't know why it doesn't work for you

2. I know, this is the first time i did that just to see if it would define the function for you

3. I rewrote the syntax and i cant figure out why gearbox isn't being defined for you)|(
The code is still in update. You need to remove that code, give it the proper syntax, and then write it to the console. The way you have it, Algodoo will continuously run whatever code you place in update whether the scene is running or not. As I mentioned before, you should never define a function or a variable more than one time.

Another thing that may be helpful to you is the sim frequency. You need not ask the user to input the sim frequency because you can get it directly this way: scene.my.freq = sim.frequency

I hope that one of the other guys who know Thyme script (s_noonan?) can chime in to try to help us out. At this point I have no idea why a gear box is not being spawned when clicking on that text box. And maybe someone else can confirm whether it is working or not.
Last edited at 2014/05/20 16:33:40 by Xray
The code has proper syntax. The update uses an if statement so if sim.time == 0 it will define gearbox which wont go forever once the scene is played.

The gearbox needs to know the users personal scene's sim frequency. Some people use 1000hz others use 60hz


After multiple factory Algodoo resets i think it fixed it. It works after the reset, for me, please try again Xray. Thank you so much for looking over it and helping!!!!!
Okay, NOW it works!!! I don't know what changed or why, but now it spawns a gear box in the same location as the one that changes size when you move the slider.

When you say "personal scene's sim frequency" I'm not quite sure what you mean by that. Every scene defaults to a sim frequency fo 60Hz, but if the user changes that number to something else, the variable "sim.frequency" gets updated. So, your scene can fetch that number and use it for whatever you need it for. The user does not need to enter it into the scene!

I'm sorry that I was not able to explain things better than I did. Anyhow, it works now, and you did an excellent coding job! :tup:
Oh thank god!!!! I'm 100% sure it was the addition of "scene.my" to the function! Thank you again for your help!!

The scene is meant for users who make a vehicle in another scene and use this scene to generate their gearbox. Some people make their scenes using 100hz or some other frequency other than this scene's. Sorry if that doesn't make sense but it is necessary trust me.

You did a very good job don't worry!! and thank you!
OH, it just dawned on me why you need the sim frequency. It's because THIS scene doesn't know what the sim frequency of the user's OTHER scene will be! DUH :bonk: (I feel pretty dumb now. :lol: )
Haha over looking small things!! I realized after looking at my code for a while the onClick function didn't use "scene.my.gearbox()" it was just "gearbox()":bonk:
I include the following instructions for the novice user:

1. Click on each light blue box and type the number into the text
2. If you do not know your scene frequency, then input 60.
3. Pull the orange knob at the bottom to change size.
4. Delete the sizeable gearbox objects.
5. Click the "Click here to generate" box.
6. Operate the gearbox by pressing any number key between 1 and n, inclusive, where n = Number of gears.
7. Save the gearbox as a component.
8. Drag-and-drop the gearbox from the components folder into another scene.
9. Operate the gearbox by using the number keys.

Please correct me if I made any mistakes.
Oh wow yes that's the whole process! I would suggest users to select the gearbox and copy and paste it as needed. I think that's easier for novice users.
I agree. I appreciate the thought, but there is no need to give me credit