New Method Script Question

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

New Method Script Question

Postby fox11trot » Fri Feb 26, 2010 6:47 pm

I am trying to use the new method to read the surfaces of an object but it isn't working.

Heres what I have:

Code: Select all
  e.other.surfaces := [[[0, 0]]];     app.step;     app.undo 


When a polygon collides with this object its surfaces = [[[0,0]]] instead of its actual surfaces.
fox11trot
 
Posts: 62
Joined: Tue Sep 01, 2009 7:25 am

Re: New Method Script Question

Postby Ian151 » Fri Feb 26, 2010 7:25 pm

isn't there supposed to be a refresher for that?

Code: Select all
e.other.surfaces := [[[0, 0]]]


Refresher (preferably only lasers)

Code: Select all
app.step; app.undo
"THE BEST 2 PLAYER SCENE EVER MADE!!!" - ianno
http://www.algodoo.com/algobox/details.php?id=24204
Image
User avatar
Ian151
 
Posts: 47
Joined: Tue Sep 01, 2009 12:02 am

Re: New Method Script Question

Postby Mystery » Sat Feb 27, 2010 12:19 am

You mean Method-X right?
Aye the code looks right there is no need for a refresher as the refresher is defined in the code.
The problem is the way surfaces is written up not [[[0.0, 0.0]]] but more like [[[ [0.0,0.0], [0.0, 0.0,], [0.0, 0.0] ]]]
User avatar
Mystery
 
Posts: 2802
Joined: Thu Sep 03, 2009 1:16 pm
Location: Southern Australia

Re: New Method Script Question

Postby Versieon » Sat Feb 27, 2010 5:53 am

Exactly, i tried to do this but it didn't work for that reason, you have to difine how many places there are in the array, and there isn't a way to do that right now AFAIK

I made a scaner that replicates the object, but it creates a compleatly new object.

Rating: rated 6.5
Filesize: 34.97 kB
Comments: 11
Ratings: 4
download
User avatar
Versieon
 
Posts: 375
Joined: Tue Sep 01, 2009 4:45 pm

Re: New Method Script Question

Postby Mystery » Sat Feb 27, 2010 6:17 am

Well might be able to make a code that could work out how many part there are in the array.
User avatar
Mystery
 
Posts: 2802
Joined: Thu Sep 03, 2009 1:16 pm
Location: Southern Australia

Re: New Method Script Question

Postby Versieon » Sat Feb 27, 2010 6:20 am

I belive there is a way to find how long an array is, the problem is accesing it in the first place.
User avatar
Versieon
 
Posts: 375
Joined: Tue Sep 01, 2009 4:45 pm

Re: New Method Script Question

Postby Mystery » Sat Feb 27, 2010 8:13 am

I'm sure Grady has the script somewhere, he did a bunch of work with arrays back in the day.
User avatar
Mystery
 
Posts: 2802
Joined: Thu Sep 03, 2009 1:16 pm
Location: Southern Australia

Re: New Method Script Question

Postby KarateBrot » Sat Feb 27, 2010 9:42 am

Yeah I once asked him about something like an array cell counter.
http://www.algodoo.com/forum/viewtopic.php?f=13&t=1503#p15854

but like versieon said you first have to find the array and there's the problem. before you found it there's no way to count anything i guess :D

But i also tried it with a polygon where i know the surfaces of because i spawned it with a script. even for this polygon i couldn't find out the surfaces with this method. maybe it's not working for surfaces? :eh:


@Versieon
you still know when we talked about having 1 pair of brackets or two pairs of brackets around surfaces? well, you were right for surfaces. but there's another way to define the surfaces. you can do that with "vecs", too. and with vecs you only need one pair of bracket's around your points. everything else is the same. i only used "vecs" to define my polygons that's why i thought it is weird that you needed 2 pairs of brackets. :thumbup:
Image
User avatar
KarateBrot
 
Posts: 825
Joined: Mon Aug 31, 2009 7:32 pm
Location: Germany

Re: New Method Script Question

Postby Versieon » Sat Feb 27, 2010 5:46 pm

Wow, thats wierd! Well thats good to know!!
User avatar
Versieon
 
Posts: 375
Joined: Tue Sep 01, 2009 4:45 pm

Re: New Method Script Question

Postby fox11trot » Sat Feb 27, 2010 9:37 pm

yeah all this is good to know

maybe there is a way to count get vecs?
but you would have to count the arrays too
fox11trot
 
Posts: 62
Joined: Tue Sep 01, 2009 7:25 am


Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 1 guest