Hinge Scripting?
7 posts • Page 1 of 1
Hinge Scripting?
Hello,
I was wondering if there is any way to edit a hinge's properties, without using scene.my.* variables. I mean, if I have a circle with a hinge, and a box hits it, if I can edit the properties of the hinge. I'm not sure if this is possible, but I know that you can edit the geometry a thruster is attached to, and I was wondering if you could edit information of a hinge.
Thanks,
~~mold999
I was wondering if there is any way to edit a hinge's properties, without using scene.my.* variables. I mean, if I have a circle with a hinge, and a box hits it, if I can edit the properties of the hinge. I'm not sure if this is possible, but I know that you can edit the geometry a thruster is attached to, and I was wondering if you could edit information of a hinge.
Thanks,
~~mold999
Phundementalism?
Ain't nobody got thyme fo dat.
Ain't nobody got thyme fo dat.
-

mold999 - Posts: 225
- Joined: Sun Jan 02, 2011 1:35 am
- Location: [176436, 3763234]
Re: Hinge Scripting?
Yes, it's possible, you could find a lot of examples in my scenes (hinge - ratchet, damper, torsion).
Key functions here is scene.entityByGeomID() and (readable(owner)).geom0 , geom1 for hinge.
So you can add some property to circle like _wasCollision = false and read it from hinge to adjust something:
_circeCollide = {(scene.entityByGeomID((readable(owner)).geom0))._wasCollision}
You should enter that code in hinge's script menu window (editbox on the top).
p.s. You need to look which is .geom0 and which .geom1 for hinge.
p.p.s Sometimes you need to save-load scene after such code change, bug, reported, will fix (or already fixed in 2.1, I'm not sure).
Key functions here is scene.entityByGeomID() and (readable(owner)).geom0 , geom1 for hinge.
So you can add some property to circle like _wasCollision = false and read it from hinge to adjust something:
_circeCollide = {(scene.entityByGeomID((readable(owner)).geom0))._wasCollision}
You should enter that code in hinge's script menu window (editbox on the top).
p.s. You need to look which is .geom0 and which .geom1 for hinge.
p.p.s Sometimes you need to save-load scene after such code change, bug, reported, will fix (or already fixed in 2.1, I'm not sure).
Dream of Algodoo as game development engine...
-

Kilinich - [Best bug reporter 2010]
- Posts: 2098
- Joined: Mon Aug 31, 2009 8:27 pm
- Location: South Russia
Re: Hinge Scripting?
Hello!
I am starting yet. I can solve the problems mechanically only.
How I can an engine different revs to order to keys?
So: key1=50rpm, key2=100rpm ...
Thank you!
I am starting yet. I can solve the problems mechanically only.
How I can an engine different revs to order to keys?
So: key1=50rpm, key2=100rpm ...
Thank you!
- Don Carnage
- Posts: 3
- Joined: Mon Feb 18, 2013 1:33 pm
Re: Hinge Scripting?
Don Carnage wrote:Hello!
I am starting yet. I can solve the problems mechanically only.
How I can an engine different revs to order to keys?
So: key1=50rpm, key2=100rpm ...
You could make 2 engines:
geom1 - motor1 - geom2 - motor2 - geom3
motor2 with auto-brake (+inf power) and key-controlled, it adds some rpm to system on key press or key toggle.
Dream of Algodoo as game development engine...
-

Kilinich - [Best bug reporter 2010]
- Posts: 2098
- Joined: Mon Aug 31, 2009 8:27 pm
- Location: South Russia
Re: Hinge Scripting?
Thanks!
Shall I drive a cogwheel with more smaller cogwheels for example? Does the emphasis of one of the engines not stop the other engine?
Shall I drive a cogwheel with more smaller cogwheels for example? Does the emphasis of one of the engines not stop the other engine?
- Don Carnage
- Posts: 3
- Joined: Mon Feb 18, 2013 1:33 pm
Re: Hinge Scripting?
no,
geometry1 is connected to motor1;
motor1 is connected to geometry 2;
geometry2 is connected to motor2;
motor2 is connected to geometry3;
essentially you have the output shaft of motor1 connected to the housing(geometry2) of motor2, with the final output being geometry3
geometry1 is connected to motor1;
motor1 is connected to geometry 2;
geometry2 is connected to motor2;
motor2 is connected to geometry3;
essentially you have the output shaft of motor1 connected to the housing(geometry2) of motor2, with the final output being geometry3
- jon_joy_1999
- Posts: 233
- Joined: Fri Dec 09, 2011 12:51 am
Re: Hinge Scripting?
Thanks!
I try to do it so.
how can I solve it by a script? (an engine, with more eligible revs)
I would like to learn it.
thank you for the help!
I try to do it so.
how can I solve it by a script? (an engine, with more eligible revs)
I would like to learn it.
thank you for the help!
- Don Carnage
- Posts: 3
- Joined: Mon Feb 18, 2013 1:33 pm
7 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 5 guests




