Game Development Community

1.1.0: Mounting issues with t2dSceneObjectGroups

by Mike Lilligreen · in Torque Game Builder · 07/03/2006 (1:26 pm) · 1 replies

Here is what I did:

1. Drop 4 static sprites into the scene view, 1 large in size, 3 smaller sized.
2. Create 3 link points on the large sprite.
3. Mount a small sprite to one of the link points, repeat for the other 2.
4. Save and test level. Return to level builder.
5. Select all 4 sprites, add them to a group (Edit > Group Objects).
6. Save and test again. Console will show mounting error and objects are no longer correctly mounted.

Basically what is happening after the first save, is that each object is being given a mountID and mountToID from the level builder. Returning to the level builder and grouping those same objects will cause the level builder to give another additional set of mountIDs to the sprites. Here is an example from the level file created by the level builder:
new t2dSceneObjectGroup() {
      canSaveDynamicFields = "1";

      new t2dStaticSprite() {
         imageMap = "tree02ImageMap";
         position = "16.3 -11.5";
         size = "11.3 13.2";
         MountOffset = "0.677 -0.702";
         MountOwned = "0";
         MountInheritAttributes = "0";
            mountToID = "2";
            mountID = "3";
            mountID = "1";
      };
      new t2dStaticSprite() {
         imageMap = "rock02ImageMap";
         position = "1.85 -11.3";
         size = "11.9 13";
         MountOffset = "-0.00668 -0.689";
         MountOwned = "0";
         MountInheritAttributes = "0";
            mountToID = "2";
            mountID = "4";
            mountID = "2";
      };
      new t2dStaticSprite() {
         imageMap = "rock01ImageMap";
         position = "-12.4 -11.1";
         size = "15.9 15.4";
         MountOffset = "-0.68 -0.681";
         MountOwned = "0";
         MountInheritAttributes = "0";
            mountToID = "2";
            mountID = "5";
            mountID = "3";
      };
      new t2dStaticSprite() {
         imageMap = "rect1325ImageMap";
         position = "1.99 3.52";
         size = "42.4 42.9";
         LinkPoints = "-0.68 -0.681 -0.00668 -0.689 0.677 -0.702 -0.693 -0.0449 0.00668 -0.00528 0.696 
0.00528 -0.693 0.657 0.012 0.665 0.658 0.649 -0.68 -0.681 -0.00668 -0.689 0.677 -0.702";
            mountID = "2";
            mountID = "4";
      };

#1
07/03/2006 (2:03 pm)
Also, to add to the confusion a bit:

If I mount something, add both objects to a group, then dismount that object - the dismount operation will be shown in the level builder but the script code in the level file remains unchanged after a save. (as if the dismount never happened)

Perhaps I am not quite clear in the usage intent of groups (I've been using them to organize my object tree), but a seperate groupID or a sanity check to prevent already mounted objects from being grouped are perhaps two solutions.