Spawning hinges nightmare

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

Spawning hinges nightmare

Postby Torpedo » Sat Sep 05, 2009 12:23 pm

So i'm trying to spawn hinges and having a nightmare trying.

Tried just using scene.addHinge and giving a location, a zdepth and a size, but that didnt work. then i assume i need both geometry ID's

however whatever i do, i cant get GeomID from anything. scene.my.wheel1 = E.geom.GeomID, scene.my.wheel1 = E.other.GeomID, neither have worked... ive also tried using entityID but that doesnt pick up either.

any ideas what i should be doing here?
Image
User avatar
Torpedo
 
Posts: 120
Joined: Mon Aug 31, 2009 8:51 pm

Re: Spawning hinges nightmare

Postby gradyfitz » Sat Sep 05, 2009 1:28 pm

You could set a local variable when you spawn the object, that sets controllerAcc to the geomID, this is a temporary work around, you can toy around with it till you get it right. :D.
Mechanisms: 18 Mechanisms.
Thyme: Tutorial - Variables/Commands List.
Thymechanic
gradyfitz
 
Posts: 174
Joined: Tue Sep 01, 2009 8:33 am
Location: Victoria, Australia

Re: Spawning hinges nightmare

Postby standardtoaster » Sat Sep 05, 2009 4:57 pm

Actually, as far as I know, spawning hinges or fixates wherever you want is impossible. To test it out create a hinge, select it, press control-c. Now go to this websity and paste it in the top box and click remove line breaks. Now go back to phun/Algodoo press ~ or F11 and press control-v, now hit return. As you can see it will not spawn it in same place as the other. :crazy:
User avatar
standardtoaster
 
Posts: 606
Joined: Mon Aug 31, 2009 7:57 pm

Re: Spawning hinges nightmare

Postby Versieon » Sat Sep 05, 2009 5:18 pm

It is true, you can't spawn hinges onto existing geometrys.
However, if the geometry is spawned with a user set variable like globalID, you then can create hinges connecting to it.
User avatar
Versieon
 
Posts: 375
Joined: Tue Sep 01, 2009 4:45 pm

Re: Spawning hinges nightmare

Postby algadoodle123 » Thu Sep 17, 2009 5:28 pm

Versieon wrote:It is true, you can't spawn hinges onto existing geometrys.
However, if the geometry is spawned with a user set variable like globalID, you then can create hinges connecting to it.


what is a geom ID? :crazy:
**/\ /\
>( ' ; ' )<***<---------- cat
*((")("))
i'm right-side-up
uʍop-ǝpısdn ɯ,ı
http://www.sherv.net/flip.html
User avatar
algadoodle123
 
Posts: 66
Joined: Tue Sep 08, 2009 6:04 pm

Re: Spawning hinges nightmare

Postby Versieon » Thu Sep 17, 2009 11:44 pm

It is a unique variable that diferentiates objects in phun/algodoo.
if you set this when you spawn something, you can connect fixates or hinges to it through on collide.
User avatar
Versieon
 
Posts: 375
Joined: Tue Sep 01, 2009 4:45 pm

Re: Spawning hinges nightmare

Postby algadoodle123 » Fri Sep 18, 2009 2:13 am

how would I use it :wtf:
**/\ /\
>( ' ; ' )<***<---------- cat
*((")("))
i'm right-side-up
uʍop-ǝpısdn ɯ,ı
http://www.sherv.net/flip.html
User avatar
algadoodle123
 
Posts: 66
Joined: Tue Sep 08, 2009 6:04 pm

Re: Spawning hinges nightmare

Postby Versieon » Fri Sep 18, 2009 11:49 pm

Here is an auto fixate i made a while back, it shows how to use and implement GeomID

Image
Author: Versieon
Title: Fixate for TeleportImageImage
Last edited by Versieon on Fri Sep 18, 2009 11:57 pm, edited 1 time in total.
User avatar
Versieon
 
Posts: 375
Joined: Tue Sep 01, 2009 4:45 pm

Re: Spawning hinges nightmare

Postby algadoodle123 » Fri Sep 18, 2009 11:56 pm

you forgot to add the link
**/\ /\
>( ' ; ' )<***<---------- cat
*((")("))
i'm right-side-up
uʍop-ǝpısdn ɯ,ı
http://www.sherv.net/flip.html
User avatar
algadoodle123
 
Posts: 66
Joined: Tue Sep 08, 2009 6:04 pm

Re: Spawning hinges nightmare

Postby Versieon » Fri Sep 18, 2009 11:56 pm

Oops :D
User avatar
Versieon
 
Posts: 375
Joined: Tue Sep 01, 2009 4:45 pm

Re: Spawning hinges nightmare

Postby algadoodle123 » Sat Sep 19, 2009 2:33 am

thank you :D

edit: if you copy and past a hinge into text editor, it has the IDs of the object it was on
**/\ /\
>( ' ; ' )<***<---------- cat
*((")("))
i'm right-side-up
uʍop-ǝpısdn ɯ,ı
http://www.sherv.net/flip.html
User avatar
algadoodle123
 
Posts: 66
Joined: Tue Sep 08, 2009 6:04 pm


Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 1 guest

cron