Game Development Community

Torque Preview in QuArK

by Eric Forhan · in Artist Corner · 01/16/2006 (11:09 am) · 5 replies

I came up with a way to be able to quickly preview interiors with Torque (in WinXP). It basically renames the DIF, moves it and all textures into the appropriate Torque directory and opens directly to the model with a slightly modified torque.

If anyone has an easier or better way, or any additions to this, please feel free to post as much.

-First copy the Torque files to the C:\Torque directory (I used the same as my QuArK settings).

-Run the new copy of Torque and save a blank mission file as "viewInterior.mis".

-In tutorial.base folder, open main.cs and comment-out the following under InitClient():
Canvas.setContent(MainMenuGui);
Canvas.setCursor("DefaultCursor");
In that same place, put in the following (this will have Torque open the mission file directly):
createServer("SinglePlayer", expandFilename("./data/missions/viewInterior.mis"));
   Canvas.setCursor("DefaultCursor");

   // Make a local connection
   %conn = new GameConnection(ServerConnection);
   RootGroup.add(ServerConnection);
   %conn.setConnectArgs("Player");
   %conn.setJoinPassword("None");
   %conn.connectLocal();

-Create viewInterior.bat in the c:\torque\tmpquark directory as this:
echo off
echo Copying and renaming interior file.
del c:\torque\tutorial.base\data\interiors\viewInterior\*.* /q
del c:\torque\tutorial.base\data\missions\*.ml
copy  %~f1 c:\torque\tutorial.base\data\interiors\viewInterior\viewInterior.dif /Y
copy c:\torque\tmpquark\textures\*.* c:\torque\tutorial.base\data\interiors\viewInterior\ /Y 
echo on
Note that this renames the DIF, deletes all files in the viewInterior directory, copies that DIF to the viewInterior folder, and copies all texture files to that folder.

-Open QuArK and go to Options-->Configuration-->Games-->Torque

-Under "torque converter" put TorqueDemo.exe (or whatever name of the Torque version you are using)
-Under "Directory of Torque Files" it should say: c:\Torque
-At "Eighth Program", under "program executable": C:\torque\tmpQuArK\viewInterior.bat
-"fixed command line arguments" needs to have: c:/torque/tmpquark/%file%.dif
-Save configuration by hitting the "OK" button.

-Open Torque->Customize Menu
-At the bottom, hit the "menu item" button.
-click on the new menu item and rename it. I chose "Preview in Torque".
-While still clicked on the new menu item, checkmark the following: "Console stays open", "Export new .MAP file", "Prepare used textures", "Run Torque with map".
-Also checkmark "Yes" under the 1st and 8th programs.
-Hit the "OK" button.

To test, go to Torque-->Preview in Torque (note the first time you will need to manually add viewInterior.dif to the mission file. But once it's saved, you shouldn't have to do it again).

Bugs:

-Running Torque in OGL may cause QuArK's OGL windows to break (not sure if this is the cause, but it could be). I haven't tested using Torque in D3D with it yet.
-Player falls and has to hit f8 to move into camera mode
-No quick way to exit Torque completely.
-all textures in tmpquark/textures get copied to the viewInterior torque directory
-Works in WinXP only
-This will not allow a preview of models with LODs because the batch will still look for the full name ("myinterior_1.dif", etc), rather than simply "myinterior.dif".

#1
01/17/2006 (12:09 pm)
Awesome! This would be a great TDN article! (hint hint ;)
#2
01/17/2006 (3:20 pm)
Thanks Alex! I'd like to hear if anyone's given it a whirl first--just in case I missed a step. :)

NOTE (to all): I just changed the batch file to copy the DIF directly to the new directory, as well as rename it. This leaves the original filename intact.

Also discovered this will not allow a preview of LODs because the batch will still look for the full name "myinterior_1.dif", etc, rather than simply "myinterior.dif".
#3
01/24/2006 (11:23 pm)
Update: *Added del *.ml line to batch file.

---

What would be ideal for this setup would be a torqueDemo_DEBUG version with utilities for mappers (or somethign more current, if there is any?). Being able to easily see the interiorRenderModes would be very handy. ;)
#4
01/24/2006 (11:45 pm)
@Eric: I you're looking for a good starting place, and can't wait for the updated difView that uses the TGE1.4 update, I released difView0.3a back in October. It gives you a -dif loading option, 2 key stroke exit and save, along with unique .mis files that have the name of the .dif you loaded. I think the arrow key nudging and bracket adjustment keys are in there also.

The GG link is www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=9004

I had also created a video on integration and usage with 3dws, but Quark should be about the same.

torque.smdlabs.com/media/freeTutorials/quickClips/difView.htm

Feel free to use the project as a starting place, or to see how to quickly exit and save unique mission files.

B--

ps. There is a link on the bottom of the difView page that has a debug version of TGE1.3 and the interior debug render modes GUI is in the project as well.
#5
01/25/2006 (6:57 am)
Hey Brandon, that's a great idea!

I think I'll wait on the new version, but if you wish to include instructions for using it with QuArK I'd be happy to help out.