New Method Script Question
10 posts • Page 1 of 1
New Method Script Question
I am trying to use the new method to read the surfaces of an object but it isn't working.
Heres what I have:
When a polygon collides with this object its surfaces = [[[0,0]]] instead of its actual surfaces.
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
isn't there supposed to be a refresher for that?
Refresher (preferably only lasers)
- Code: Select all
e.other.surfaces := [[[0, 0]]]
Refresher (preferably only lasers)
- Code: Select all
app.step; app.undo
-
Ian151 - Posts: 47
- Joined: Tue Sep 01, 2009 12:02 am
Re: New Method Script Question
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] ]]]
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] ]]]
-
Mystery - Posts: 2802
- Joined: Thu Sep 03, 2009 1:16 pm
- Location: Southern Australia
Re: New Method Script Question
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.
I made a scaner that replicates the object, but it creates a compleatly new object.
-
Versieon - Posts: 375
- Joined: Tue Sep 01, 2009 4:45 pm
Re: New Method Script Question
Well might be able to make a code that could work out how many part there are in the array.
-
Mystery - Posts: 2802
- Joined: Thu Sep 03, 2009 1:16 pm
- Location: Southern Australia
Re: New Method Script Question
I belive there is a way to find how long an array is, the problem is accesing it in the first place.
-
Versieon - Posts: 375
- Joined: Tue Sep 01, 2009 4:45 pm
Re: New Method Script Question
I'm sure Grady has the script somewhere, he did a bunch of work with arrays back in the day.
-
Mystery - Posts: 2802
- Joined: Thu Sep 03, 2009 1:16 pm
- Location: Southern Australia
Re: New Method Script Question
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
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?
@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.
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
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?
@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.
-
KarateBrot - Posts: 825
- Joined: Mon Aug 31, 2009 7:32 pm
- Location: Germany
Re: New Method Script Question
Wow, thats wierd! Well thats good to know!!
-
Versieon - Posts: 375
- Joined: Tue Sep 01, 2009 4:45 pm
Re: New Method Script Question
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
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
10 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 3 guests