SimGroups in the World Editor
by EddieRay · in Torque Game Engine · 04/07/2005 (6:06 am) · 18 replies
How do I group objects in the World Editor? If I have a bunch of objects (instances) in my world, and I want to create a SimGroup and move those objects into the SimGroup, how do I go about it?
Thanks,
Ed
Thanks,
Ed
About the author
#2
When you are done adding to that group, just hold now the Alt key again and click on the main Mission Group.
04/07/2005 (8:02 am)
In the world editor, hold down the Alt key, then click on the SimGroup that you want to add the item to. The highlight will turn from white to gray. Now any object you add will be added to that group.When you are done adding to that group, just hold now the Alt key again and click on the main Mission Group.
#3
By the way, BigPapa, is there a way to move an object from one group to another somehow? Maybe I have to do cut/paste along with the "Alt + click" trick (hmmmm... that'd probably work for moving multiple items into a different SimGroup...)?
Ed
04/07/2005 (8:10 am)
Thank you Luis and BigPapa! You both have given me some very useful tips for editing mission files and using the World Editor!By the way, BigPapa, is there a way to move an object from one group to another somehow? Maybe I have to do cut/paste along with the "Alt + click" trick (hmmmm... that'd probably work for moving multiple items into a different SimGroup...)?
Ed
#4
04/07/2005 (8:16 am)
Yep! Select the objects, cut them, Alt + click the SimGroup and paste them. No drag and drop. :(
#5
04/07/2005 (8:41 am)
Great! Thanks BigPapa!
#6
04/08/2005 (12:24 pm)
Okay... on to the next question. How do I cut and paste a set of objects into a SimGroup without them moving? I have 4 objects and I select them all and cut, then I Alt-click a SimGroup, then I paste... and the objects move to whereever the SimGroup is located... I'd like for the SimGroup to move to where the objects are located... :-)
#7
Maybe I need to change the placement options to not reposition things (possibly temporarily)? I guess the placement mode is coming into play here...?
04/08/2005 (12:31 pm)
Hmmmm... then what about the case where the SimGroup isn't empty? I guess the best thing is for the SimGroup to move and encompass the pasted objects (bounding boxed sized to fit the pasted objects with axes at the center point) for the case where the SG was originally empty. And in the case where the SG already has objects in it, then it could just "grow" it's bounding box to encompass the pasted objects without moving...?Maybe I need to change the placement options to not reposition things (possibly temporarily)? I guess the placement mode is coming into play here...?
#8
04/08/2005 (4:35 pm)
SimGroups don't have position.
#9
04/08/2005 (9:05 pm)
So, it must be the paste operation that's moving the objects from their original position they had when the cut operation was performed... how can this be avoided? I.e., how can I paste objects such that the get put back in their original location instead of some position based on the camera?
#10
04/08/2005 (10:57 pm)
Do you want to fix it correctly in the SDK or do you want a quick script bypass that's pretty much just as good?
#11
04/09/2005 (3:16 am)
That's why I move them into Simgrops opening and editing the .mis file...
#13
- Pop a dialog asking for group name
- create the new simgroup
- add selected objects to it
04/11/2005 (10:37 am)
It shouldn't be that hard to create a "group" shortcut...- Pop a dialog asking for group name
- create the new simgroup
- add selected objects to it
#15
BWHAHAHAHA!
;-)
04/27/2005 (6:20 am)
Oddly enough, the feature I'm looking for is already right there in the World menu in the World Editor - I just never knew what it did (and I didn't know about the "Alt-Click to select the target group" trick). It's called "Add Selection to Instant Group". It takes the selected objects and puts them in the selected group. Now to bind that function to a hotkey....BWHAHAHAHA!
;-)
#16
04/27/2005 (6:23 am)
Another trick is to change the drop mode to "Drop at Centroid", which can help with copying things without moving them away from the original position. This helps if you want to duplicate things while keeping them at the same Z coordinate, for example...
#17
04/27/2005 (7:35 am)
Good man, you found the exact cure. I still redid some of the underlying engine code for various reasons but what you found is plenty good enough. I apologize for not getting back to this thread with that answer.
#18
04/27/2005 (12:26 pm)
No prob Gonzo. Everything worked out fine!
Torque Owner Luis Anton
... new StaticShape(evento0) { position = "-82.9012 -131.612 118.15"; rotation = "0 0 -1 18.7966"; scale = "1 1 1"; dataBlock = "MarcadorEvento"; }; new StaticShape(evento1) { position = "-87.3876 -115.703 119.6"; rotation = "0 0 -1 1.97112"; scale = "1 1 1"; dataBlock = "MarcadorEvento"; }; new StaticShape(evento2) { position = "-87.446 -111.37 119.6"; rotation = "0 0 1 8.9035"; scale = "1 1 1"; dataBlock = "MarcadorEvento"; }; ...Objects are defined like that in the mis file. It's easy to identify them. All you have to do is create a simgroup:
new SimGroup(Eventos) {
}
And then copy-paste whatever you want inside:
new SimGroup(Eventos) { new StaticShape(evento0) { position = "-82.9012 -131.612 118.15"; rotation = "0 0 -1 18.7966"; scale = "1 1 1"; dataBlock = "MarcadorEvento"; }; new StaticShape(evento1) { position = "-87.3876 -115.703 119.6"; rotation = "0 0 -1 1.97112"; scale = "1 1 1"; dataBlock = "MarcadorEvento"; }; new StaticShape(evento2) { position = "-87.446 -111.37 119.6"; rotation = "0 0 1 8.9035"; scale = "1 1 1"; dataBlock = "MarcadorEvento"; }; }Then save the .mis file. You don't even have to worry about indenting things, it will be done afterwards automatically. Restart TGE, open your mission and voila :D If you open your .mis file again in a text editor, it will be indented.
Good luck!