Loops?
16 posts • Page 1 of 1
Loops?
How do you create loops, as in repeating something until a condition is met?
I really have no idea how to script in Thyme... Can someone make this script for me? I know how to liquify the object if it's touched... but I don't know how to liquify other objects, nor do I know how to liquify the touched object if it's not immortal.
Thanks!
Edit: Okay I got it to liquify other objects. Now I need it to detect the other object's immortal property...
I really have no idea how to script in Thyme... Can someone make this script for me? I know how to liquify the object if it's touched... but I don't know how to liquify other objects, nor do I know how to liquify the touched object if it's not immortal.
Thanks!
Edit: Okay I got it to liquify other objects. Now I need it to detect the other object's immortal property...
Last edited by Grenade1950 on Sat Sep 26, 2009 9:25 pm, edited 1 time in total.
- Grenade1950
- Posts: 9
- Joined: Sat Sep 26, 2009 2:40 pm
Re: Liquify if not immortal?
- Code: Select all
e.other.immortal == true ? {e.other.liquify} : {}
-
standardtoaster - Posts: 606
- Joined: Mon Aug 31, 2009 7:57 pm
Re: Liquify if not immortal?
That didn't work... Also, I want it to liquify if NOT immortal
- Grenade1950
- Posts: 9
- Joined: Sat Sep 26, 2009 2:40 pm
Re: Liquify if not immortal?
Nevermind I got it, thanks
(note to self: read tutorials more often)
edit: ... huh? It works in a block, but not in a group of little circles... Why not?
(note to self: read tutorials more often)
edit: ... huh? It works in a block, but not in a group of little circles... Why not?
Last edited by Grenade1950 on Sat Sep 26, 2009 3:51 pm, edited 1 time in total.
- Grenade1950
- Posts: 9
- Joined: Sat Sep 26, 2009 2:40 pm
Re: Liquify if not immortal?
Sorry for sounding like a noob here but could you please post the script. >.> I seem to have a lot of trouble with checking for booleans.
-
standardtoaster - Posts: 606
- Joined: Mon Aug 31, 2009 7:57 pm
Re: Liquify if not immortal?
- Code: Select all
e.other.immortal ? {} : {e.other.liquify}
This should liquify whatever it touches if it's NOT immortal
- Grenade1950
- Posts: 9
- Joined: Sat Sep 26, 2009 2:40 pm
Re: Liquify if not immortal?
Hmm. I ungrouped the circles and it seems to work now...?
- Grenade1950
- Posts: 9
- Joined: Sat Sep 26, 2009 2:40 pm
Re: Liquify if not immortal?
Are you talking about the script that you posted or the one that I posted?
-
standardtoaster - Posts: 606
- Joined: Mon Aug 31, 2009 7:57 pm
Re: Liquify if not immortal?
standardtoaster wrote:Are you talking about the script that you posted or the one that I posted?
the one I posted
- Grenade1950
- Posts: 9
- Joined: Sat Sep 26, 2009 2:40 pm
New Question: Loops?
How do you make loops, like repeating the same thing over and over again until a condition is met?
- Grenade1950
- Posts: 9
- Joined: Sat Sep 26, 2009 2:40 pm
Re: New Question: Loops?
Grenade1950 wrote:How do you make loops, like repeating the same thing over and over again until a condition is met?
You mean like this?
There's a bug with Algodoo, so when you load the scene, select the box that says "Scene.my.A doesn't equal 5" and change it's text colour in the script menu to {Scene.my.D}.
-
Fujitsu - Posts: 328
- Joined: Tue Sep 01, 2009 12:28 am
- Location: Canada
Re: Loops?
my custon kalashnikov - fires untill ammo runs out, using thyme
e.normal is backwards on this one, so i think it shouldn't workproperly, being more of a suicide rifle
e.normal is backwards on this one, so i think it shouldn't workproperly, being more of a suicide rifle
Jrv wrote:TC42 wrote:Quite honestly, I didn't think anyone on 4chan has that good a use of grammar, spelling, usage, mechanics, ect.
But I've never been there, so I may be wrong.
GTFO newfgt
-
RA2lover - Posts: 607
- Joined: Mon Aug 31, 2009 8:43 pm
- Location: Brazil
Re: Loops?
RA2lover wrote:e.normal is backwards on this one, so i think it shouldn't workproperly, being more of a suicide rifle
use (-1)*e.normal instead of e.normal if it's backwards so e.normal will be flipped about 180°
-
KarateBrot - Posts: 825
- Joined: Mon Aug 31, 2009 7:32 pm
- Location: Germany
Re: Loops?
Could you post a script where it loops a variable until it hits 5? The script, not the scene... Thanks
And another thing: I have Phun, not Algodoo...
And another thing: I have Phun, not Algodoo...
- Grenade1950
- Posts: 9
- Joined: Sat Sep 26, 2009 2:40 pm
Re: Loops?
Grenade1950 wrote:And another thing: I have Phun, not Algodoo...
that shouldn't be a matter
object 1
- Code: Select all
scene.my.var < 5 ? {do something before 5 is reached} : {do something else when 5 is reached}
and another onCollide could be:
object 2
- Code: Select all
scene.my.var = scene.my.var + 1
so now something at object 1 will always be repeated at a collision until object 2 has 5 collisions. after that object 1 will do something else at a collision.
-
KarateBrot - Posts: 825
- Joined: Mon Aug 31, 2009 7:32 pm
- Location: Germany
Re: Loops?
Grenade1950 wrote:Could you post a script where it loops a variable until it hits 5? The script, not the scene... Thanks
And another thing: I have Phun, not Algodoo...
Oh, haha sorry.
Is this any better?
All it really is, is an if statement that is asked ~every tick. It's much more accurate with a laser, you know!
- Code: Select all
{Scene.my.A == 5} ? { Scene.my.B = [0.425, 0.262, 0.0, 0.0]; Scene.my.D = [1.0, 1.0, 1.0, 0.0]; Scene.my.c = false } : {}
Scene.my.A is the counter.
Scene.my.B and D make the "Scene.my.A doesn't equal 5" box disappear.
Scene.my.C stops the motor from counting more.
-
Fujitsu - Posts: 328
- Joined: Tue Sep 01, 2009 12:28 am
- Location: Canada
16 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 2 guests