Game Development Community

TGB "object groups" stored in designer?

by Clint Herron · in Torque Game Builder · 12/01/2006 (7:57 am) · 2 replies

This may be the intended purpose for T2dSceneObjectGroup, but since that thread doesn't seem to touch on this issue (and plus I didn't see it until after I had written this post), I decided to just post a new topic for discussion rather than hijacking that one.

Here is a problem I've been wrestling with for a little while.

In working on various TGB games, I often find myself having a need for several different kinds of datablocks all linked together to form a single entity. For instance, I might have enemy ships that I need to spawn that will have a main ship animation, a thruster, a sparkle particle effect, a shadow effect that changes size/direction as it progresses along, as well as any mounted weapon animated sprites that rotate and possibly have their own emitters.

Another example might be a building object that I want to spawn in my RPG, and it would have a floor-layer static sprite, a higher-layer walls-and-roof static sprite, a particle effect for the chimney, and a trigger to let me know when the player enters the building.

It would be *really* nice if I could build these linked datablocks in the designer and then save them to drag them into levels later, or instantiate them dynamically through script.

Are there any plans for making such nested datablocks? I would love to be able to have scripts that look like:

%shop = new ShopDataBlockGroup();
%shop.trigger.callback = SomeFunctionForThisLevel();
%shop.roof.setImage ("Half-built-shop-roof-image");
%shop.roof.schedule(5000, "setImage('Full-built-shop-roof-image')" );

etc etc etc.

Does this make sense? Currently the only way I know how to make such conglomerated entity things is through code, but that kindof nullifies the value of having a designer to drag stuff around and add particle effects and generally create things in a WYSIWYG style.

I know it's sort of random, and might be asking for a lot, but it's something that I could really use in many of my games and it would help me get a lot more mileage out of the designer as opposed to having to guess at pixel positions in code.

Thanks! Keep up the great work with TGB -- I am an extremely happy customer, and I hope to continue supporting your work in the future.

Respectfully,
clint

#1
12/01/2006 (11:00 am)
Hey Clint,

Great suggestion. In fact we've been internally working with multiple solutions to this problem. For our conference and event demos we hacked in some basic concepts like this so we can drop objects in quickly as sets. Good and bads news with this.

Bad News is it didn't quite make it into 1.1.3.

Good News is it didn't make it in because we're working on a much better way to do it :)

Right now what you can do though is select multiple objects... go to File -> Save Selected Objects...

Then if you want to bring in those objects you can go to File -> Import... and the select the object .t2d set you saved.

keep in mind there is an error with this, all objects on the same layer will be in reverse order due to the objects coming in inversely. It's a bit annoying though it does accomplish the goal and you can push those objects to front etc (or just save out the object sets with different layers).

Great suggestion though and thanks. Feel free to post any future suggestions as well, the way you layed it out is ideal also.
#2
12/01/2006 (12:28 pm)
Hey Matt!

Wow, excellent! Your reply was better than I had hoped for. :)

No worries about it not making it into 1.1.3 -- I'm really glad you guys have such an eye for quality and are willing to be patient in order to release a great product.

Thanks so much!

--clint