Game Development Community

DIF nodes

by mb · in Torque Game Engine · 05/30/2007 (1:29 pm) · 2 replies

Question for you engine gurus. How hard would it be to make it so you can create nodes that can be mounted (like the ones for DTS objects) on a DIF. Kinda like how you place a light entity in Constructor except it would be a mount point. This way you could create a high detailed DTS roof for an interior-DTS and have it align perfect using the nodes on both the DIF and the DTS. Or is there an easier way to do this?

#1
05/30/2007 (5:54 pm)
There isn't a direct way to do this but there *is* a way =)

First, I should mention that this will only work with Constructor 1.0.2 or with map2dif.

What you will want to do is to place a "game_entity" entity in your scene ("game_entity_unused" if you are using map2dif) and set its game_class as SpawnSphere and its datablock as SpawnSphereMarker.

Now, when you load the DIF into the engine it will have a reference to this entity but it won't automatically instantiate it.

What you will need to do is to open up the mission editor and click on the Interior and see what its object number is (should be beside it in the tree view or near the axis gizmo in the 3d view). Then drop down the console (~) and type in .magicButton(); (replacing with the number you just found of course).

At this point you should see it drop a new SpawnSphere into the mission right where it was positioned as a "game_entity" in Constructor.

You would then look at the object id of the DTS you wish to match to the SpawnSphere position/rotation and at the new SpawnSphere's id and put this into the console:

.setTransform(.getTransform());

and it will match it up exactly in place. Be sure to save your mission (your choise on whether or not to delete the SpawnSphere...since it isn't in the PlayerDropPoints SimGroup the Player won't attempt to spawn there).

With a little help from a scripter you make this a fully automated process (we did so with Marble Blast Ultra).
#2
05/31/2007 (6:54 am)
Wow, thats awesome! Thanks Matt! Exactly what I need and soooo easy to do. I can make a script for it with no problem :D