Browse Search Popular Register Upload Rules User list Login:
Search:
4 Cylinder Depth Engine

Image:
screenshot of the scene

Author: MichaelRoeleveld

Group: Default

Filesize: 56.37 kB

Date added: 2016-01-22

Rating: 5

Downloads: 792

Views: 336

Comments: 12

Ratings: 1

Times favored: 0

Made with: Algodoo v2.1.0

Tags:

Scene tag

Collision layers ABCD

Since I only know Lua and not Thyme, could someone make this into your typical, red "explosion" ball generating and deleting, engine?
Last edited at 2016/01/22 23:12:00 by MichaelRoeleveld
Please log in to rate this scene
edit
Similar scenes
Title: 12 Cylinder Inline
Rating: 5
Filesize: 32.49 kB
Downloads: 838
Comments: 5
Ratings: 1
Date added: 2015/04/11 00:10:05
Made with: Algodoo v2.1.0
Rating: rated 5
download
Title: 6 cylinder bounce engine
Rating: 7.8485
Filesize: 77.15 kB
Downloads: 2751
Comments: 10
Ratings: 12
Date added: 2009/04/01 03:53:10
Made with: Phun
Rating: rated 7.8
download
Title: 8-Cylinder aircraft engine V2
Rating: 6.2
Filesize: 109.49 kB
Downloads: 2702
Comments: 2
Ratings: 4
Date added: 2012/09/15 10:46:01
Made with: Algodoo v2.0.1
Rating: rated 6.2
download
Title: 6 cylinder engine with 5 speed transmission
Rating: 5
Filesize: 472.07 kB
Downloads: 1750
Comments: 0
Ratings: 1
Date added: 2012/10/28 09:19:57
Made with: Algodoo v2.0.1
Rating: rated 5
download
Title: 4 cylinder rotary engine
Rating: 5
Filesize: 31.76 kB
Downloads: 699
Comments: 0
Ratings: 1
Date added: 2012/10/24 21:54:13
Made with: Algodoo v2.0.1 Edu
Rating: rated 5
download
Title: V2 (2-cylinder) Engine
Rating: 5
Filesize: 26.05 kB
Downloads: 451
Comments: 0
Ratings: 1
Date added: 2021/11/17 10:40:49
Made with: Algodoo v2.1.0
Rating: rated 5
download
Well, I can give you the way of dooing so, since learning is better than letting do.

to make such an engine, you need a trigger. This is usually a collision with the topper engine wall, or a laser. that trigger spawns circles using
scene.addCircle{
pos := e.pos;
radius := [insert about 1/10 of the width of the engine in here];
colorHSVA := [10,1,1,1]; (play around with that value, the first number is the hue, the rest can stay about how it is)
density := [not sure about what INH and co. usually pick, but play around with it at areas around 2-1];
timetolive := 0.1;
};
Play around with the vars, since you can easily add other variables too in a similar manner. Remember to use := instead of = to prevent the triggering object to inherit the variables too(:= forces the creation of a new variable and denies any change in existing variables, while = allows both, resulting in the original stats. to also change)
but can you not like
value1=10,value3="xvalue"
seperate the values with commas to distinguish lines?
is there also a things as
for i=1,10 do
spawncircle()
sleep(1000) --deactivate a second
end
you use ; to tell the code that you are now defining a new task. Theoretically one can write value1 = X; value2 = Y etc. but it's recommendet to write in multiple lines(the code does this on it's own) by pressing shift+return.
One can also use other variables for assignment, so you can easily write something like this:

_kineticEnergy:=density*size(0)*size(1)*mat­h.vec.len(vel)^2

the (0) and (1) of size are to access the 2 values inside the [] of a typical size variable (0 is first index, 1 is second and so on)

math.vec.len in this example is a typical function of algodoo. Most of them can be found in the Thyme subforum on the algodoo forum.

the _kineticEnergy has a _ in front of it's name to tell algodoo that this custom variable should be stored in the object instead of beeing discarded once the script ends(like all the standart variables i.e. density,size,angle etc.)

Remember to write numbers as numbers(if you use division, at least 1 number must own a digit, else they will left as integers, i.e. 6/4 = 1, 6.0/4 = 1.5, 6/4.0 = 1.5, 6.0/4.0 = 1.5), while writing any type of literal text inside "" i.e. materialname = "blablabla"
About your second Comment: For loops are unstable. It has occured to me that they sometimes work, and sometimes they won't execute, which seems to change every now and then(every couple of days). Usually one can take postStep to make for-loop-like structures(look at my JuliaSet- and Mandelbrot-Set-calculators for an example with 3 variables controlling 3 loops), but in your case we can use a custom variable to contain the script. Type this inside the blank black box in the top left of the script menu:

_spawnFire = {}

Variables can store nearly anything, including executable code, even as functions. once the _spawnFire variable has appeared in your trigger, enter the code for spawning 1 circle inside it. Then, after you did that, go to the script area that later triggers the circle spawn, and then simply type:

_spawnFire;
_spawnFire;
_spawnFire;
...

as many times as you need Circles. As an example, look in my RubeGoldberg scene at the final exploding ball, which is a good example for such a process.
Okay, one last thing. Once the trigger is touched, it won't stop making balls after having dealt with the initial collision. I have theorized it may be the balls triggering the trigger again, but I have set both ball and trigger to "collisionSet:=3" so they won't collide with self.
Nope, still infinite ballrain.
give the balls the materialname "fire" using the spawn script, and add an statement to the onCollide script that looks like this:

e.other.materialname != "fire" ? {code here} : {};
Even easier, se different collision layers for the spawner and the spawned balls:P
*use
Well, prob: 4 layers to the spawners, 4 layers to the fire. = 8 layers consumed, which is quite a lot, and the piston itself has to collide both with the fire as with the trigger.
Don't you guys have the re occuring ball problem I described?
Micheal, use my technique;)

It jams any script if it collides with the fire, and only triggers in case of the piston. You could also use a materialname called "piston" and only name the pistons after that, while leaving the fire with no name. All in all, it will make a brilliant filter