on hit by laser script help

About advanced scenes, and the Thyme scripting language used in Algodoo.

on hit by laser script help

Postby HavingPhun » Tue Mar 15, 2011 10:11 pm

well i am making a pc that uses cicles to program it and each circle has a value. either 0,1, or 2.
so i need help making this because my attempts at scripting it have failed.
first i need to know how to put more variables in the script menu or atleast how to give each circle a value!
then the way i was thinking to have this work is the circle passes by and gets hit by a laser and when that happens it puts the value of that circle on to a value like scene.my.input . Then at the end of the sequence of 1's and 0's there would be a 2. once the 2 is detected the script will take the sequence of ones and zeros and translate it to a number or letter. So if A=1 then if i put in a 1 then a 2 it would put one into input and then find 2 and translate 1 into A and put that in another thing like scene.my.screen and then empty scene.my.input
and the scene would have a big box as the screen and scene.my.screen = text would be inside the script menu of the box used as a screen. and i think covered everything so please help because it dont know how to script this also think of any way to improve this because using circles to make a program needs lots of circles!
I won't be on the forums much for a while. But maybe once in a while.
User avatar
HavingPhun
 
Posts: 178
Joined: Sun Feb 06, 2011 10:42 pm

Re: on hit by laser script help

Postby Someone Else » Wed Mar 23, 2011 3:37 am

Wow. I actually understood that.

Try putting the value into the circle's controllerAcc.

Or maybe color:
White [1, 1, 1, 1] = 1;
Black [0, 0, 0, 1] = 0;
Anything else = 2

And use onCollide codes, so you can be sure that the circle will only be counted once (by bouncing off a scripted box), and so you can use variables in that box. This box would be the screen.

Hmm, you could use controllerAcc to store the character. And I recommend using ASCII codes. And you will need hundreds of IFs to get controllerAcc --> ASCII to work right. So, for version 1, just set text = text + controllerAcc; controllerAcc = 0 to print the ASCII code when the system receives an input marble that is neither black nor white.

For setting controllerAcc, use [if the marble is white] controllerAcc = (controllerAcc * 10) + 1
[if the marble is black] controllerAcc = controllerAcc * 10

This should work moderately well. Or, you could do away with the 2 marble and just use the above print code when controllerAcc >= 10000000. So, it will print the ASCII code after every eighth marble.
Matthias Wandel is epic, in my humble opinion.
I love my brain...
TC42 wrote:Also, your sig is too big, please change it.

ARE YA HAPPY NOW?????

Thymechanic/Phundamentalist

Recently, I discovered something a lot of you probably already knew: Minecraft is awesome.
Due to this, I may not be as active as usual for a while.
User avatar
Someone Else
 
Posts: 1147
Joined: Sun Nov 21, 2010 10:53 pm
Location: The Milky Way Galaxy

Re: on hit by laser script help

Postby TC42 » Wed Mar 23, 2011 3:45 am

Someone Else wrote:Wow. I actually understood that.

Lucky you... I didn't really understand it. Honestly, it has gotten to the point where I have trouble reading any paragraph without proper punctuation and capitalization... :crazy:


If I understood it correctly, HavingPhun, you are trying to reduce the numbers of circles, right? If so, you can store over 8 bits of binary in one circle, using the textureMatrix and color. I would recommend using color to store 4 bits (but use more circles) so that it is easier to debug it.

That's my two cents; I now have $49.98 imaginary dollars :P
Image
Spambot wrote:Nowadays, memes usually are studied less in the field of biology, but more with the arena of psychology along with sociology. But, the major area of a meme, getting embraced and imitated all the time is what’s at any core connected with any meme.
User avatar
TC42
 
Posts: 984
Joined: Sun Jan 09, 2011 1:53 pm
Location: $ sudo apt get-install sandwich_

Re: on hit by laser script help

Postby Someone Else » Wed Mar 23, 2011 2:34 pm

I think he wants to do something sort of similar to my current project on the Digital Marble Computing Collab.
He wants to turn a binary queue (as davidz40 calls it) into ASCII.
Matthias Wandel is epic, in my humble opinion.
I love my brain...
TC42 wrote:Also, your sig is too big, please change it.

ARE YA HAPPY NOW?????

Thymechanic/Phundamentalist

Recently, I discovered something a lot of you probably already knew: Minecraft is awesome.
Due to this, I may not be as active as usual for a while.
User avatar
Someone Else
 
Posts: 1147
Joined: Sun Nov 21, 2010 10:53 pm
Location: The Milky Way Galaxy

Re: on hit by laser script help

Postby electronicboy » Wed Mar 23, 2011 5:41 pm

what he actually means is a new geom. varaible as me and kutis use in AHOX CPU's

create a object that you will use to create the variable

add this to the on-collide script:

e.other.<new variable name> := <data you want the variable to start with>

This will create a new .geom variable.
When asking for help, READ THE STICKIES!
electronicboy
 
Posts: 1694
Joined: Mon Aug 31, 2009 6:18 pm

Re: on hit by laser script help

Postby HavingPhun » Wed Mar 23, 2011 10:15 pm

someone else: I was basing this on digital marble but i wanted to take that idea and simplify it. I dont completly understand that thyme. Also i was thinking the balls would go down a tube and get hit by a laser then add there 1,0, or 2 to a variable then hit the bottom of the tube and get deleted so there is not so much lag.
electronic boy: good idea i might try that too
TC42: so the code would translate the colors and texture matrix what does texture matrix do anyway?

I just learned thyme so i do know how to script i just don't know how to do it very well

Also all 3 of you win 30 imaginary $$
I won't be on the forums much for a while. But maybe once in a while.
User avatar
HavingPhun
 
Posts: 178
Joined: Sun Feb 06, 2011 10:42 pm

Re: on hit by laser script help

Postby Someone Else » Wed Mar 23, 2011 10:43 pm

I would have the marbles roll down a ramp and bounce off the top of the screen. This would make sure it only counts each marble once. And I want you to write the code yourself. So, I will write chunks of code for you to assemble.

Base Code:
Code: Select all
{controllerAcc >= 10000000} ? {} : {};
{e.other.color == [1, 1, 1, 1]} ? {} : {{e.other.color == [0, 0, 0, 1]} ? {} : {}

If controllerAcc >= a big number:
Code: Select all
text = text + controllerAcc;
controllerAcc = 0

If the marble is White:
Code: Select all
controllerAcc = (controllerAcc * 10) + 1

If the marble is Black:
Code: Select all
controllerAcc = controllerAcc * 10


And now I am only 20i $$ in debt. :D :thumbup:
And I am amazed at myself for coming up with this little bit of code.
Matthias Wandel is epic, in my humble opinion.
I love my brain...
TC42 wrote:Also, your sig is too big, please change it.

ARE YA HAPPY NOW?????

Thymechanic/Phundamentalist

Recently, I discovered something a lot of you probably already knew: Minecraft is awesome.
Due to this, I may not be as active as usual for a while.
User avatar
Someone Else
 
Posts: 1147
Joined: Sun Nov 21, 2010 10:53 pm
Location: The Milky Way Galaxy

Re: on hit by laser script help

Postby HavingPhun » Wed Mar 23, 2011 11:27 pm

thanks only thing is all of a sudden my algodoo doesn't work. It freezes at the load screen at the start. I have reinstalled it several times and it still doesn't work. So i can't thyme it ugh!! :evil: :evil: :evil: :evil: :evil: :evil:
Also I only have 0 imaginary $$ someone wanna donate to the GI$$THA or give imaginary $$ to HavingPhun association?
EDIT: Fixed algodoo i will give it a try!
I won't be on the forums much for a while. But maybe once in a while.
User avatar
HavingPhun
 
Posts: 178
Joined: Sun Feb 06, 2011 10:42 pm


Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 6 guests