Explain "scene.addGroup"
13 posts • Page 1 of 1
Explain "scene.addGroup"
I have only a vague understanding of scene.addGroup, and I hope that someone could shine some light on it. I know that the arguments are entityIDs, name, and particlesIDs. Some examples of "name" are: "selected" and "tracked" (I think). But that's about all I know about it. So, could someone please explain how "scene.addGroup" is used, and give a few examples of it? Also, please list all the possible "names" that are associated with it (besides that two that I listed above). I searched the forum for more information, but there are only a few very sketchy entries about it.
Thanks!
Thanks!
-
Xray - Posts: 500
- Joined: Sun Jun 17, 2012 6:12 am
- Location: USA
Re: Explain "scene.addGroup"
scene.addGroup is just for grouping objects for selecting/moving together.
Inside there is name, entityIDs and/or particleIDs (for water).
There is also special group names: selected, tracked, gravityGroup
That's all. I use it for deslecting or change tracking object.
Inside there is name, entityIDs and/or particleIDs (for water).
There is also special group names: selected, tracked, gravityGroup
That's all. I use it for deslecting or change tracking object.
Dream of Algodoo as game development engine...
-
Kilinich - [Best bug reporter 2010]
- Posts: 2098
- Joined: Mon Aug 31, 2009 8:27 pm
- Location: South Russia
Re: Explain "scene.addGroup"
Please explain what gravityGroup is.
Also, could you give some actual examples of how scene.addGroup is used? You said basically what it does, but in order for me to actually use it, I need some example scripts. Or even better, if you can take the time, make some simple scenes of it being used with each of its arguments, that would be very helpful. Thanks!
Also, could you give some actual examples of how scene.addGroup is used? You said basically what it does, but in order for me to actually use it, I need some example scripts. Or even better, if you can take the time, make some simple scenes of it being used with each of its arguments, that would be very helpful. Thanks!
-
Xray - Posts: 500
- Joined: Sun Jun 17, 2012 6:12 am
- Location: USA
Re: Explain "scene.addGroup"
More info....
I wrote this in two separate geometries:
onHitByLaser = (e)+> { scene.addGroup({
name = "selected";
entityIDs = entity
})}
I then hit those two geometries with a laser, and nothing happened. They did not become "selected", therefore, I must not be using the correct syntax. That's what I need is to be taught the proper syntax for how to use scene.addGroup.
Anyone?
I wrote this in two separate geometries:
onHitByLaser = (e)+> { scene.addGroup({
name = "selected";
entityIDs = entity
})}
I then hit those two geometries with a laser, and nothing happened. They did not become "selected", therefore, I must not be using the correct syntax. That's what I need is to be taught the proper syntax for how to use scene.addGroup.
Anyone?
-
Xray - Posts: 500
- Joined: Sun Jun 17, 2012 6:12 am
- Location: USA
Re: Explain "scene.addGroup"
Correct script example for laser:
- Code: Select all
(e)=>{
scene.addGroup({
name = "selected";
entityIDs = [e.geom.entityID]
})
}
Dream of Algodoo as game development engine...
-
Kilinich - [Best bug reporter 2010]
- Posts: 2098
- Joined: Mon Aug 31, 2009 8:27 pm
- Location: South Russia
Re: Explain "scene.addGroup"
Kilinich wrote:Correct script example for laser:
- Code: Select all
(e)=>{
scene.addGroup({
name = "selected";
entityIDs = [e.geom.entityID]
})
}
Okay, and what about for onCollide? I tried
scene.addGroup({
name = "selected";
entityIDs = [e.this.entidyID,e.other.entityID]
})
and it did not work.
-
Xray - Posts: 500
- Joined: Sun Jun 17, 2012 6:12 am
- Location: USA
Re: Explain "scene.addGroup"
just an error in code
entityIDs = [e.this.entidyID,e.other.entityID]
entityIDs = [e.this.entidyID,e.other.entityID]
Dream of Algodoo as game development engine...
-
Kilinich - [Best bug reporter 2010]
- Posts: 2098
- Joined: Mon Aug 31, 2009 8:27 pm
- Location: South Russia
Re: Explain "scene.addGroup"
OOPS!
Okay, now the script works. I can group two geometries together. But how can it be used to GLUE two geometries together? For example, a circle collides into another circle, and they get glued together. How can that be done?
Thanks
Okay, now the script works. I can group two geometries together. But how can it be used to GLUE two geometries together? For example, a circle collides into another circle, and they get glued together. How can that be done?
Thanks
-
Xray - Posts: 500
- Joined: Sun Jun 17, 2012 6:12 am
- Location: USA
Re: Explain "scene.addGroup"
Xray wrote:OOPS!
Okay, now the script works. I can group two geometries together. But how can it be used to GLUE two geometries together? For example, a circle collides into another circle, and they get glued together. How can that be done?
Thanks
respawn one of it with body ID of another
Dream of Algodoo as game development engine...
-
Kilinich - [Best bug reporter 2010]
- Posts: 2098
- Joined: Mon Aug 31, 2009 8:27 pm
- Location: South Russia
Re: Explain "scene.addGroup"
There is a chance it will not work in 2.1 because of known bug - you could not conect objects (hinges, fixates) to existing one.
Dream of Algodoo as game development engine...
-
Kilinich - [Best bug reporter 2010]
- Posts: 2098
- Joined: Mon Aug 31, 2009 8:27 pm
- Location: South Russia
Re: Explain "scene.addGroup"
How did you do it in your Robin Ballistic Computer ? The arrow appears to become glued to the target!
-
Xray - Posts: 500
- Joined: Sun Jun 17, 2012 6:12 am
- Location: USA
Re: Explain "scene.addGroup"
Xray wrote:How did you do it in your Robin Ballistic Computer ? The arrow appears to become glued to the target!
What?! It works!!!
Thats really strange because it was created in Phun and store geomID in controllerAcc (I did it in code, kinda hack). Now it shouldn't work because geomIDs is incorrect, but it works! I should dig it a little bit more....
Dream of Algodoo as game development engine...
-
Kilinich - [Best bug reporter 2010]
- Posts: 2098
- Joined: Mon Aug 31, 2009 8:27 pm
- Location: South Russia
Re: Explain "scene.addGroup"
Yes, it works, and it's one of my favorite scenes!
-
Xray - Posts: 500
- Joined: Sun Jun 17, 2012 6:12 am
- Location: USA
13 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 5 guests