Object mirrored with a script

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

Object mirrored with a script

Postby p03tr0 » Sat Dec 24, 2011 1:16 am

Hello! I'm wondering if there's any possibilty of getting object/group of glued objects mirrored onCollide with other object or onHitByLaser? I need it to resolve a little problem with my city project scene. I need your advice guys if there's a smart script or just a command or no resolve ;)
User avatar
p03tr0
 
Posts: 3
Joined: Sat Dec 24, 2011 12:40 am

Re: Object mirrored with a script

Postby Kilinich » Sat Dec 24, 2011 1:25 pm

It's possible but very complicated, you actually need to delete old and re-create new one.
Dream of Algodoo as game development engine...
User avatar
Kilinich
[Best bug reporter 2010]
 
Posts: 2098
Joined: Mon Aug 31, 2009 8:27 pm
Location: South Russia

Re: Object mirrored with a script

Postby p03tr0 » Sat Dec 24, 2011 3:12 pm

So there's my another idea to glue mirrored and fully transparent layer of objects to another one. OnCollide or onHitByLaser invisible layer would come fully visible and one that was fully visible would go invisible. And that's my another question. How to make group of objects transparent when they haven't the same color (in script menu "color = ?") ;)
User avatar
p03tr0
 
Posts: 3
Joined: Sat Dec 24, 2011 12:40 am

Re: Object mirrored with a script

Postby electronicboy » Sat Dec 24, 2011 5:15 pm

you could use an IF code in the color of ALL the objects you want to change
e.g. This small code changes the color of an object based on whether the sim is running or not.

Code: Select all
{sim.running = true ? [1, 0, 0, 1] : [1, 1, 1, 1]}


you could edit that code to run on your own scene.my.* variable.

<variable AND condition> ? [TRUE] : [FALSE]

remember to put the code within { } otherwise Algodoo will not know that it needs to keep reading the code.
When asking for help, READ THE STICKIES!
electronicboy
 
Posts: 1694
Joined: Mon Aug 31, 2009 6:18 pm

Re: Object mirrored with a script

Postby p03tr0 » Sat Dec 24, 2011 8:10 pm

The main idea is to change transparency of many objects with many colors and one variable. E.g circle is white, box is green and another box is blue. It's only to change transparency of each object leaving their color the same.
It's like ( color = [?, ?, ?, {scene.my.var}] ). I know it's wrong syntax, just an example.
User avatar
p03tr0
 
Posts: 3
Joined: Sat Dec 24, 2011 12:40 am


Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 7 guests