Very nice, Xray!
i got now how to use the bendTarget method to nicely animate things without much scene.my-variables.
By the way: thanks for your tutorial on sin-functions, i did read and comment it allready some times ago.
To LastChance: maybe you are really interested in math and parabolics and all that, then you can ask Xray in forum for my contact there, then we can parley in extend about math, which i like too.
Very good, i like it! With your technique, you can even reveal pictures stepwise in increasing resolution, which is perfect for riddel-ing "what is that?" in a group of 6 or more players devided in 2 teams with one gamemaster who handles your scene.
i have made a version where i put in all the required frames.
It is named:
http://www.algodoo.com/algobox/details.php?id=122754
and set it to the educational group with tags
video
movie
texture
thank you! There are so many things possible with it, same as with the "costumes" of the scratch-program, so a wide area of animations is opened by that trick.
The costume number is given by
cost := math.mod(math.toInt(10 * (sim.time)), 17);
as there should be 10 pictures per second and 17 frames from frame0 to frame16. And then comes the selection
where the texture is set to the correct frame, quite
much code, for each texture one line...
s_noonan gave me now the following hints:
_____________________________________________________
the following alternate code also works:
cost := math.toInt((10 * (sim.time)) % 17);
cost > 9 ? {
texture = "frame_000" + cost + ".png"
} : {
texture = "frame_0000" + cost + ".png"
}
_____________________________________________________
to reduce the actual amount of code in the scripts
of each torus, and you can see the shorter usage
of the mathematical modulus-function as a simple %
this way i can now adress the frames without much copy-paste-modifyname.
I add your method as comment to the "working" scene, and will use it in
future scenes. The thyme-case-structure for the code to execute i will
put into my treasure-chest as well as your trick for direct adressing the
frame and the % for mathmod.
In fact, it was not easy to find thyme-control-structures in the forum
so i plan to extend a wiki
http://wikis.zum.de/zum/GadApedia/Thyme_algodoo_english
for thyme where things are explained and with
examples in about 10 days.
yes, Xray, the cutting and resizing of video-pieces is amazing!
In the forum
http://www.algodoo.com/forum/viewtopic.php?f=13&t=11002&p=80785&hilit=case#p80785
Kilinich showed that the code
[{code1},{code2},{code3}](index)()
selects the code1 if index=0,
and the code2 if index=1
and the code3 if index=2.
So with the first line
cost := math.mod(math.toInt(10 * (sim.time)), 17);
the number of the costume is selected, dependent on the sim.time.
It runs in integer-steps from 0,1,2,3,...,16 and this way selects
in the next line the code-selection in Kilinich's trick for
the case-structure in thyme.
How this precisely works, i dont know.
I assume, that this is done with pointers, which lead to adresses
of an array. I think that [A,B,C] is an array and
[A,B,C](0) is A, but i dont know the meaning of the second "()"
behind "index".
I think that Kilinich can answer to that, and may even cite the
description where he found this structure. Anyway, upto then i just
use it, and s_noonan's abbreviated version.
Well done, i like it!! Thanks for the scene,
how did you find out about the type of the water to be undefined
and that you have to add a ""+ to the e.other, to get the handle
to it
{
otherType := "" + e.other;
(otherType == "undefined") ? {
scene.my.makeIce(e.pos)
} : {}
}
the makeIce-function i can find by unzip later and analyse it.
and how did you know about the Scene.addWater in
{
xPos := pos + [0.6, -0.5];
_waterOn && ((sim.time - _lastDrop > 0.2) || (sim.time < _lastDrop)) ? {
Scene.addWater({
vecs = [xPos];
vels := [[0.0, 0.0]]
});
_lastDrop = sim.time
} : {}
}
? was it all in forum and i didnt find it? Lol there should be
a nice review of all usefull thyme-scripts with examples, that
would serve many of us well.
Thanks to FRA32, s_noonan for the kind explainations!
I can use these tricks and knowledge well for my own, educational
scenes, actually i am working on ways to let students solve problems
with algodoo, enhancing the interactions by means of
"induced reactions", user will have to recharge his reaction-globe
with the correct type of energy to activate a "now-ready-to-use"
reaction with it at the place of this reactable object.
Timing-tricks like your "_lastDrop" and identifying of objects will
do some of the job for enabeling and selecting there.
In the end quite some usefull stuff for chemistry, physics, biology
may come out!
I like it, as it remembers me of the precious stone: opal.
To make it not that laggy do this:
1) zoom out, then mark all laserpens (type m, drag a rectangle around all
of the lasers)
2) right click, select scriptmenu
3) in scriptmenu, reduce maxrays from actual value of 1000 to just 100
voila!
If you want to have it brighter, you may increse the size of all lasers from
0.09 to 0.18
i like your idea to transform "cut the rope" to algodoo!
to give you some technical input, look at my scene
[scene]122754[/scene] "video by texture 2"
where i made a sequence of textures to display a video.
This way you also can, with a big deal of patience,
make a video out of 30 or so textures, to display
a rotating, glowing yellow star, which you then can add at
those positions, where your stars are.
I added at my home the AMS for implementing thunder and rain and sound for the flippers, bumpers and ball retreiving mechanism. In youtube you can see a video which i took from this with sound of cause, its in https://youtu.be/NsiY_55evVY
Have fun!
i didnt hear of you yet, and i also
Suggestion:
use the search-options, look for the Author Xray there,
e.g. i added a youtube-hint of what you can do with the
Algodoo-Mod-System to implement sound in scene 86013
see also the comments there to find the youtube-video.
Did you have a look at 122754 to implement videos inside of
algodoo using a sequence of textures? You can even cut and resize
that video-object then and the video remains on it
I see you are interested in motors, cars as i browsed through
your secens. Did you see the work of s_noonan about linkages? Browse
though his work: in
http://www.algodoo.com/algobox/search.php
enter s_noonan and you see at least 648 good scenes, which may
give you inspiration.
You obviously gained quite some knowledge yourself with
thyme script, well done! So.. if you want, you can add your
knowledge to the wiki about thyme-script, which i am building
up right now. Its actual state is here:
http://wikis.zum.de/zum/GadApedia/Thyme_algodoo_english
and i do the administration there on my own
( to prevent spamming LOL )
but you can contact me in the algodoo forum if you
wish to contribute. My name in the forum is: DrAgon
So, there is really much to do, e.g. i have to explain Xray
now how i synchronize the various sounds with the different bumpers, flippers, and thunder in my sound-version of his thunderstorm-pinball,
best credits to his work too !
To sum it up: dont look at "Browse", but look at the users and their work, and find those users in comments to good scenes
here in algobox and in forum.
There are really many interesting things in your scene,
at my slow grade of learning-curve it will be mainly 2 things first:
1) you declared a local function which is saved ( so the underscore "_"
is in front of it ) which you probably set by putting the code
_abs:=(x)=>{
x < 0 ? {-1.0 * x} : {x}
}
into the black-top-edit-entry of the script to have f(x)=|x| =abs(x) availlable in your hinge.
I added this in my thyme-wiki! Special thanks.
2) you managed to display a slider for the thruster-group
( am not sure how to make this on my own yet)
Finally i can see some good usage of boolean operators, here:
&& ! scene.my.leftMin
which means "and NOT boolvariablename" which results into a bool.
for s_noonan: i just tested to draw something in mspaint.exe
e.g. a "D" and saved it as png. Then, if you drag it into algodoo,
the outside of this letter will be translucent automatically,
and the inside of the "D" remains white.
I agree to s_noonan, best thanks to this superb example what one
can do with algodoo, really amazing!!
and i see that i can still learn a lot!
my besttime was 23
Super excelent!
Everyone who did some more sophisticated scripting will
appreciate this great new way for us, enables so many new
and easy ways to do and control things!
For newer algodoo-users: stop the simulation, create a small
circle and start simulation again. Then drag the circle near to
a laser-beam so it gets hit. Note that the corresponding number
displayed at the laser drops down near to 0. It shows the distance
of the laser to the circle! In general, it shows the distance
of the laser to the object which is hit by the laser.
This enables us to use the lasers as distance-sensors and let
the "insects" react by neuronal network coding
see Kilinich's scene 128587 neuro net 99. http://www.algodoo.com/al … ?id=128587
@ The Linkage and @faytree :
I am still here, though i had not much time to get a chemistry-project develloped further, which i began with FRA32, sorry for that, but
sometimes business and family set priorities. I didnt end these
projects though, if you want, we can make a thread in the forum about it.
Also: If you want, we can do a thread in the forum with very sophisticated work, explaining also older work of great coders like noonan, you (e.g. 52854 Linkage about gradients) Kilinich (see his http://www.algodoo.com/forum/viewtopic.php?f=13&t=11392) and others.
Its not easy to find these pearls, indeed, best if you go through the work of people with renown. The problem for new, interested coders to get into this group is not that difficult, they make themselves known by commenting here for example.