Game Development Community

Doors in QuArK -modified for Torque Engine-

by Gioacchino Nigrelli · in Torque Game Engine · 06/19/2002 (2:56 am) · 5 replies

Hi Guys to all of you!

Somebody can explain me, how to use the special entities for Torque in the QuArK Editor???

In particular I need explanation to make Doors and Triggers, and finaly use this important entities in my game, yes perhaps I'm a bit stupid, but with the study, my girlfriend and the work, it's a miracle that I'm proving to make a piece of game with the Torque!!!

Thanks Guys!

#1
06/19/2002 (3:25 am)
no doors in torque yet. Triggers are set in the world editor inside torque. Not sure about triggers specified in quark.

-Tim aka Spock
#2
06/19/2002 (10:45 am)
Yes there are doors possible using BadGuy's pathedInterior.cc/.h and modifications to map2dif.

Do a search on "doors" in resources.

I have successfully made his changes to add triggered doors to worlds via QuArK. The doors can be configured to slide or rotate.

There is still work to do on the code (stopping the motion, setting angles of rotation, etc). But, he did a bang-up job for the first cut! It's a bit awkward to use the "magicButton" from the console t actually create the required simGroup that includes the door and trigger entities. But hey, like the name, its magic :)

However, as you say, it's not in TGE yet.
#3
06/19/2002 (10:48 am)
Desmond, do you have it running with a recent HEAD?
I've merged my code with the GG HEAD two weeks ago and had some errors caused by the pathedInterior stuff, so I had to take it out to get my merge to compile...
maybe I should try to re-add it again...?
#4
06/19/2002 (3:35 pm)
Thanks Guys to all of You for the help!

But I need another explanation...
I've seen the Tutorial on the Doors of BadGuy, and made all the changes that he suggest, everything seems OK, no errors in compiling phase, but now...

How can I make a door???????

Perhaps I need some tutorial on the doors for the QuArK???
#5
06/20/2002 (4:21 pm)
@Stefan
My current "working" version is from 6-6-02. I haven't seen any major changes between then and now (but I could be wrong).

@Gioacchino
I use QuArK so I don't know the specific process in WorldCraft or Hammer....

In QuArK (Torque Game Mode):

In Toolboxes pull-down menu click on [b]New map items
; under Torque Entities you'll find 4 entities you'll need to add to your map:

door_elevator
trigger
path_start
path_node

1. Add a door_elevator entity
1a. Highlight that entity and select the parameters button to set the specifics and arguments.
1b. Give it a name (i.e. door01)
1c. Give a path_name (i.e. p01)--this points to the name of the path_start entity.
1d. Give trigger0_name a name (i.e. t01)--this points to the trigger entity
1e. Now, add two polyhedrons under the door_elevator and apply door-type textures to one of them and the "origin" texture to the other;
1f. Size the door brush and place it where you want.
1g. Then, size the origin brush and make sure the centroid of this brush is located where you want the door to pivot (if rotating) or start (if sliding)

2. Add a trigger entity{/b]
2a. In the specifics/args menu, give the trigger the same as added in the door (t01)
2b. Add a polyhedron under the trigger entity; size and locate (this is the invisible brush the player will walk through.

[b]3. Add a path_start entity

3a. Locate it where you want the door origin to start/pivot.

[i]NOTE:I haven't updated the Torque add-on yet to account for some new door parameters so you'll have to add them in the next couple steps:

3b. In the specifics/args menu, click on the "+" symbol to add a targetname specific and give it the argument p01 (same as path_name specific in the door entity.
3c. Add a second specific: target and give it the name of the path_node entity we'll add in a following step; say, p02
3d. In the next_time specific, set it to 100 for now.

4. Add a path_node entity
4a. Locate it where you want the door to move to
4b. Create the targetname specific and set the argument to p02
4c. Create the targetspecific and set the argument to p01

This creates a closed loop circuit between p01 and p02. Of course, you can add more path_nodes and so on. This is just a simple illustration of a basic door, trigger, path node circuit. After compiling the dif and placing it and textures in the appropriate Torque interior directory, start up a world and follow Badguy's instructions for getting it added to a SimGroup in your mission file. It won't appear in your world automatically at this time; you will have to add it via the console and the "magicButton" command.

[interiorInstanceID].magicButton();

I'm going to add this to the "Utilities for Mappers" resource--the MagicButton button. LOL

After saving your mission, you should have a new SimGroup that looks something like this:

new SimGroup(test_doors_sg) {

      new InteriorInstance(test_doors) {
         position = "-1.07083 -86.553 91.5133";
         rotation = "1 0 0 0";
         scale = "1 1 1";
         interiorFile = "~/data/interiors/test/maps/test_doors.dif";
         showTerrainInside = "0";
      };
      new SimGroup(door01_g) {

         new Path() {

            new Marker() {
               position = "-18.2459 -88.7407 93.7633";
               rotation = "1 0 0 0";
               scale = "1 1 1";
               seqNum = "0";
               msToNext = "100";
            };
            new Marker() {
               position = "-18.2459 -84.6782 93.7633";
               rotation = "1 0 0 0";
               scale = "1 1 1";
               seqNum = "1";
               msToNext = "0";
            };
         };
         new Trigger(t01) {
            position = "-19.8553 -86.8657 91.8883";
            rotation = "1 0 0 0";
            scale = "1 1 1";
            dataBlock = "DefaultTrigger";
            polyhedron = "-1.3281250 2.0000000 0.3750000 0.0000000 -4.0000000 0.0000000 0.0000000 0.0000000 -0.7500000 2.6562500 0.0000000 0.0000000";
         };
         new PathedInterior(door01) {
            position = "-20.1209 -71.3969 91.5133";
            rotation = "0 0 -1 89.9998";
            scale = "1 1 1";
            dataBlock = "defaultPathFollow";
            fileName = "~/data/interiors/test/maps/test_doors.dif";
            Offset = "-17.3438 -1.875 2";
            Speed = "2";
            RotationPlane = "0 0 1";
            PathIndex = "0";
            Continous = "0";
            Active = "1";
            CurrentNode = "8";
         };
      };

Note that you can change the RotationPlane; in this example the door is revolving around the Z-axis (0 0 1) and you can play with changing the speed.

There is still a lot of work to be done on the door code, but Badguy did a great job of getting this started. (He's not really a bad guy :)

Things to work out:
A) Currently the door doesn't stop revolving or sliding
B) Create additional map editor parameters to set values for speed/rotation/etc. But its ok to set them in the Torque editor also
C) Add parameters to control the angle of rotation (say we want the door to only rotate 40 degrees, etc.