There's a texture missing I think, look at the thumbnail.
You have to make a box and add the texture that the sparks have, and leave it hidden somewhere on the scene
I guess that's what you want. But keep in mind that the sine function goes from -1 to 1 so you're making the box go from positive size to negative size (and it disappears when it has negative size). Also if for some reason the sin(sim.time) gives 0, the box will get deleted by Algodoo
You have to do this:
size = [0.2, 0.1] * (sin(sim.time)+1.1)
This will make the sine function be between 0.1 and 2.1, so it will never be 0 (or negative for that matter).
Your problem was that you treated an array of numbers like a sum:
[2,1] is an array, while
[2+1] = [3] which is an array with 1 number (yes, it still is an array)
text = {math.toInt(math.vec.len(vel)) * 3.6 + " km/h"}
and THAT ONE line does the same than all your script, without any scene.my.variables
math.vec.len calculates the module of the vector velocity ((x^2+y^2)^0.5), and math.toInt makes the number an integer (0, -1, 5).
In case you want to work only on one object you can also use _variables, that work just like scene.my.variables with the exception that you can only read or write them from the same object where they are declared (you CAN do those things from somewhere else but it's too complex)
For example, you want to declare a variable called _v1, one called _v2 and one called _v3:
First you go to the Script menu and find this box: http://puu.sh/sTxMA/0b45bdd642.png
Now you have to write the name of the variable (always with a _ at the front!) and the initial value you want to give to it like this
_v1 = 0.0
Hit Enter and the variable will appear. Do the same with the others and now you can rewrite your script in a far more efficient way:
That's awesome! I'll fix mine and upload it later, maybe on Tuesday
How much delay do the gates have? On my end I'm running this scene at 38% sim time and everything has like 1/4th of a second to react. Also I'm not sure what I did exactly but I undoed and all the lasers stopped working... I think they just vanished
that's not a problem if your barrel is reasonably long and your bullet has a circle that only collides with the gas block-thingy. You make the bullet light and the circle that collides with the gas system heavy, so after it gets killed the bulet can get a lot of velocity
Also Meerkoos did his true blowback system so that the bullet was out of the barrel before the shell got dechambered. What you're doing is act the gas system when the bullet is 70 meters away from the barrel. The gas system should start acting even before the bullet is out of the barrel given that the gas tubes are always fixed close to the tip of the barrel (but there should be no pressure after the bolt lock is disengaged)
If you shift way before the green light is turned on you get even better timing (9.08 in my case)
And on a side note your "mind" is horribly scripted. You should use as little scene.my.variables as you can, so hear me out:
You can make this with only 3 or 4 variables instead of... 36
First for the gear selection you use a variable called scene.my.gear. You write to this variable the number of the gear, like:
and on and on. You should write the script on one box, in the postStep part.
For the indicator you can do this instead of using a different variable. Write it in the text part:
text = {scene.my.gear < 1? {scene.my.gear < 0? "R" : "N" }:{"" + scene.my.gear}}
Now for the gearbox you might want to use the radius changing type. Now that you have scene.my.gear with the number values you can make a circle and write a script like this one on its radius property:
You have to play with the values to make it work like you want it to. You can also try scene.my.gear ^2 + 0.05 for example, if you want to have shorter low gears and longer high gears
In this case you wouldn't have a reverse gear but I find it useless for a dragster. if you want a reverse gear, let's say it will be scene.my.gear -1:
And you have to add a third circle between the two gears with this script on the collideSet part:
collideSet = {scene.my.gear == -1 ? 4 : 0}
Or whatever collision layer you use for the gearbox. 4 is collision layer C, 8 is D, 16 is E, and so on. Be careful when writing it, you have to leave spaces between the = and the -1 or your script will be changed by algodoo and it will not work
But I like your car I hope you put this wall of text to good use. If you ever make a bigger scene it will be a lot easier and faster to script this way. Always remember the if statement, so that you don't end up using 36 variables but 3 or 4. And the keys.isDown("key") is a good replacement for lasers and boxes, a lot more tidy
they're not better axles. legacyMode 0 axles have far less strength and are prone to stretch when they connect two objects. they perform better at high speed though
Also note that your chains are crap. Never use the chain tool, make them by hand. Try making one entirely by hand: make a box with an axle, then CTRL+drag and position it close to where the axle has to attach the two objects, then shift + mouse wheel down and move a little bit
it's not correct. first of all select all the lasers and go to the script section, find maxRays and put 1.
Also your gears have to be overlapped all the time, just like they are on 2nd gear. Make one of them slightly bigger
And to connect them to the engine you have to use a stretched axle but NEVER fixate anything to the gears. If you fixate/glue something whatever you fixated to it will start crawling around the gear and will get off-center eventually. Hold ALT and move the 1st gear to where the engine flywheel's center is, then Add center axle, and hold ALT again and put it where it should be. then put 1e-30 for hingeConstant and make a +inf brake
You should work in a much smaller scale. Not really 1:1, but if you make the gun in this size everything wll behave like in slow-motion, for example, the empty shells would be ages in the air before falling
Also, why do you upload a scene with almost nothing done? Wait at least until it operates... or just upload it when it is finished
The touchscreen is really good, but I found some weird issues with the engine and gearbox
For some reason the engine's power is limited up to 300 RPM, so the back wheel slips after you get to 300 RPM
The gearbox probably has too much delay, since on high power gears tend to shift way after the 600 RPM barrier
Use density 50 or more for every part that collides, like gears or wheels or pistons (if you ever make an engine). This improves collisions a LOT
Use restitution 0 on gears, this improves traction on them (as you might have noticed, they're slipping too much)
Look around and see if you can learn some Thyme scripting. It is really simple and gives you the tools for whatever you want to do, from a spawn engine to an automatic gunner drone... it is not a matter of concern whether you use them or not at this point in Algobox, every good ol' "phundamentalist" is gone anyways except for a handful of them
And the car behaves like it is on the moon because it is huge. Use realistic scales, not 1:1 if you want, but close (don't make the car longer than 6 meters)
Also the car needs suspension badly, the wheels are hinged to the chassis! You can make a transmission with a stretched axle. This is not considered scripting. You have to put an axle on two things that you want to connect, then hold ALT and move one of them, and the axle will stretch. Then right-click the axle and go to its Script menu, find hingeConstant, and write
1e-30
there, replacing the NaN. This will make the axle totally elastic (its max force is 1*10^-30 which is almost 0). But you cannot write 0 there!
Then go to its axle menu and put Brake, and write +inf on motor torque.
With this you can make a transmission to connect your wheel to the gearbox, or whatever else. You can add a suspension to the wheel now
We needed someone else like you badly here. Welcome to the Algobox (or whatever's left of it anyways)
One more thing, sometimes axles are wobbly. To fix this you have to go to the Script menu of the axle, find legacyMode, and write 0 instead of 1. This will make the axle a little bit less strong but it will eliminate wobbly axles
use 120 Hz and use more than 50 density on every part that moves like the piston and block, and flywheel. Thi way you can use a lot more constant on the spring and you'll be able to make it a dragster
The initial idea was to do it entirely with the scene paused. My method was to make a circle where the center of mass of the object is and then rotate it 180ยบ using the axle as an axis. But it turned out easier to explain this way, I think