Gots a script question

About programs, games and other things related to Algodoo and Phun.

Gots a script question

Postby Pomerjon » Tue Apr 06, 2010 3:14 am

Not sure where to post this so Ill start here. I was just wondering if there is a was to make the script change for a object by pushing a key while the sim is running? Ex. have an object with little to no air friction dropping then hit a key to give the object 1,200 air friction.
Pomerjon
 
Posts: 4
Joined: Tue Apr 06, 2010 3:00 am

Re: Gots a script question

Postby Mystery » Tue Apr 06, 2010 3:51 am

Firstly this belongs in the thyme section
Secondly yes it easy.

Step one:
open up the console ~
Type in
Code: Select all
scene.my.airfrictionmult := 0


Step two:
get the object in airfrictionmult type in
Code: Select all
{scene.my.airfrictionmult}


Step three
make a laser make it face a box set it's activation button to what ever you want (I would recommend enter) and in onhitbylaser type
Code: Select all
(e)=>{scene.my.airfrictionmult = scene.my.airfrictionmult = 1200}


Easy as pie.
User avatar
Mystery
 
Posts: 2802
Joined: Thu Sep 03, 2009 1:16 pm
Location: Southern Australia

Re: Gots a script question

Postby Pomerjon » Tue Apr 06, 2010 10:29 pm

Im pretty new at this. So how do you open the console. And what Im trying to accomplish is i made a car with an ejector seat and then added a parachute to the seat, but since the 5 blocks that make up the chute have 1200 air friction the seat gets messed up leaving the car. So soon as i find out how to change the airfric ill have to get a laser to point at all of them after they deploy from the seat right?
Pomerjon
 
Posts: 4
Joined: Tue Apr 06, 2010 3:00 am

Re: Gots a script question

Postby Mystery » Wed Apr 07, 2010 2:53 am

There are two ways to open up the console either press the ~ key (it's above "Tab") or simply press f11.
I've made that a simple as possible without having to upload pictures.
User avatar
Mystery
 
Posts: 2802
Joined: Thu Sep 03, 2009 1:16 pm
Location: Southern Australia


Return to Algodoo related

Who is online

Users browsing this forum: No registered users and 7 guests

cron