Need help with a simple script
10 posts • Page 1 of 1
Need help with a simple script
It`s about the following
Sorry that I couldn`t be more accurate with the title
it is supposed to spawn a circle and fixate it to the hit object if scene.mylaser1 is true and the put that variable to false, so it has to be turned on again. Problem is, it doesn`t work, it doesn`t even spawn a circle. (lol)
maybe someone knows why?
Oh yeah, and I tried restarting algodoo, still doesn`t work.
- Code: Select all
(e)=>{
scene.mylaser1 == true ? { scene.addcircle({ radius := 0.01; zdepth = 50; pos := e.pos; color = [1.0, 1.0, 1.0, 1.0] }); scene.addfixjoint({ pos := e.pos; zdepth := 25 }); scene.mylaser1 = false } : {} }
Sorry that I couldn`t be more accurate with the title
it is supposed to spawn a circle and fixate it to the hit object if scene.mylaser1 is true and the put that variable to false, so it has to be turned on again. Problem is, it doesn`t work, it doesn`t even spawn a circle. (lol)
maybe someone knows why?
Oh yeah, and I tried restarting algodoo, still doesn`t work.
The world is a gas-station, where you`re allowed to smoke. -Friedrich Dürrenmatt
I forgot 2/3 of my scripting knowledge T.T
I forgot 2/3 of my scripting knowledge T.T
-
PlanckBanck - Posts: 48
- Joined: Sun Nov 22, 2009 5:35 pm
- Location: In the Bottoms of Berlin
Re: Need help with a simple script
Oh I see it, try making the start scene.my.laser1.
-
Dadasas - Posts: 46
- Joined: Tue Sep 01, 2009 2:03 am
Re: Need help with a simple script
thanks, but that ain`t it
The world is a gas-station, where you`re allowed to smoke. -Friedrich Dürrenmatt
I forgot 2/3 of my scripting knowledge T.T
I forgot 2/3 of my scripting knowledge T.T
-
PlanckBanck - Posts: 48
- Joined: Sun Nov 22, 2009 5:35 pm
- Location: In the Bottoms of Berlin
Re: Need help with a simple script
You can't directly compare booleans. It's an understood true/false by Algodoo.
- Code: Select all
(e)=>{
scene.mylaser1 ? { scene.addcircle({ radius := 0.01; zdepth = 50; pos := e.pos; color = [1.0, 1.0, 1.0, 1.0] }); scene.addfixjoint({ pos := e.pos; zdepth := 25 }); scene.mylaser1 = false } : {} }
-
standardtoaster - Posts: 606
- Joined: Mon Aug 31, 2009 7:57 pm
Re: Need help with a simple script
yeah, it works, learnt something again! thanks a lot ^^
Btw, a fixjoint spawned above two objects doesn`t fix them? how silly`s that?!?
Man, is there really no way of at least schanging the body (bodyID whatever) of an existing object?
Or the geomID so I can use that other method of yours?
Btw, a fixjoint spawned above two objects doesn`t fix them? how silly`s that?!?
Man, is there really no way of at least schanging the body (bodyID whatever) of an existing object?
Or the geomID so I can use that other method of yours?
The world is a gas-station, where you`re allowed to smoke. -Friedrich Dürrenmatt
I forgot 2/3 of my scripting knowledge T.T
I forgot 2/3 of my scripting knowledge T.T
-
PlanckBanck - Posts: 48
- Joined: Sun Nov 22, 2009 5:35 pm
- Location: In the Bottoms of Berlin
Re: Need help with a simple script
Well, the fixate needs to know which objects it's connected to.
Millions of voices suddenly cried out in terror, and were suddenly silenced. Something terrible has happened.
-
RicH - [Funniest Person 2010]
- Posts: 2043
- Joined: Tue Sep 01, 2009 9:01 am
Re: Need help with a simple script
aand, err, how can i tell it ? ^^
The world is a gas-station, where you`re allowed to smoke. -Friedrich Dürrenmatt
I forgot 2/3 of my scripting knowledge T.T
I forgot 2/3 of my scripting knowledge T.T
-
PlanckBanck - Posts: 48
- Joined: Sun Nov 22, 2009 5:35 pm
- Location: In the Bottoms of Berlin
Re: Need help with a simple script
viewtopic.php?f=14&t=795
Review that topic. You can either spawn objects so that you will know the geomID or you can use the "New Method."
Review that topic. You can either spawn objects so that you will know the geomID or you can use the "New Method."
-
standardtoaster - Posts: 606
- Joined: Mon Aug 31, 2009 7:57 pm
Re: Need help with a simple script
can`t i just tell the spawned stuff to have the same body as the object hit by the laser?
The world is a gas-station, where you`re allowed to smoke. -Friedrich Dürrenmatt
I forgot 2/3 of my scripting knowledge T.T
I forgot 2/3 of my scripting knowledge T.T
-
PlanckBanck - Posts: 48
- Joined: Sun Nov 22, 2009 5:35 pm
- Location: In the Bottoms of Berlin
Re: Need help with a simple script
I guess. I would suggest using the "New Method" for this.
-
standardtoaster - Posts: 606
- Joined: Mon Aug 31, 2009 7:57 pm
10 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 7 guests