Once I get that upgrade to 36-hour days, I will tackle that. – Mychaeel

Legacy:Visual Studio 6

From Unreal Wiki, The Unreal Engine Documentation Site
Jump to: navigation, search

Visual Studio 6 (VS6) and Visual Studio .NET (VS.NET) are IDEs that can be set up for use as UnrealScript editors. They work great and have some good features, plus if you already use VS, you will feel right at home.

If someone has a place I can put some graphic files and 1 starter file, I'll update this to make it much easier... If you want the starter file, and you see me OBWANDO on IRC or somewhere , just ask... ill send it to you until I find a way to get it up here...

Getting the Unreal Script source readily available[edit]

First of all, make sure you've exported all the .uc's from the game's packages. You can go get the source or learn how to extract them from here: UnrealScript Source

Setting up Visual Studio 6[edit]

Next go to the UDN page here: udn2:UnrealScriptHighlighting and follow the directions for getting the syntax highlighter to work in VS6. This will let you see the uscript words in a different color and makes reading code easier.

Using a batch file for compilation[edit]

You will need to create a batch file to help automate things. So... Crank up your notepad

The batch file should have the following in it:

@ECHO OFF
del %1.u
ucc make

And save it as: MakePackage.bat and save it in your {Base Directory}\System folder. (Make sure you didn't accidentally save it as MakePackage.bat.txt.)

  1. Select Tools -> Customize from the menu bar.
  1. Click on the Tools Tab and select the small graphic that looks like a square with a yellow star in the corner. It will take you to the bottom of the list.
  1. In the empty field enter &UCC Release Builder. If you want, you can use the arrows above to move it up in the list if you want.
  1. In the Command field you put the following command (change the path to reflect Base Directory):
      C:\UT2003\system\MakePackage.bat
  1. In the Arguments field, enter:
      $(WkspName)
  1. In the Initial Directory field enter your {Base Directory}\System directory, for example:
      C:\UT2003\system
  1. Make sure Use Output Window is checked. and click on Close.

Using UMake for compilation[edit]

UMake is a graphical front-end for the UnrealScript compiler.

  1. Download and install UMake.
  2. Proceed as described in the previous section, but:
  3. * Enter your path to UMake.exe in the Command field (pointing to wherever you installed UMake in), for example:
      C:\UT2003\System\UMake.exe
  4. * In the Arguments field, enter:
      $(FileName)

Creating the packages and workspace[edit]

Once you have all of that together, you will need to create your new Visual Studio Workspace, and add each package that corresponds with a UT class. If you dont feel like doing this, you can nab mine when i find a place to get it hosted (~293k).

An ideal directory structure would be like this: e:\ut2003\_vc <– that is where your workspace will go.

If you dont see your workspace files, click on View then Workspace

Just call the workspace _vc and save it in that folder. Then you need to create a new package for each class. You will perform the same process for adding a new mod into your workspace. This works very well since you will be able to work with multiple mods without any of them getting in the way of the other.

Creating a new package or setting up the base packages for UT2k3

1. At this point you need to go the menu bar in VS6 and click on File then on New.

2. Click on the tab called Projects and click on Win32 Dynamic-Link Library.

3. Make sure your location is pointing to the correct path. Example: e:\ut2003\_vc

4. Add the name in Project name. In this case we're going to use Core. You will see the location is now e:\ut2003\_vc\Core

5. Make sure it Add to current Workspace is selected, and Dependency of is NOT checked.

6. Click on OK. At the next dialog, select An Empty DLL project and click Finish, and then click OK


At this point you have a nice new shiny project, but it needs some editing...

1. Expand the Boldfaced Project name which in this case is Core.

2. You will see 3 folders (if you dont, click on FileView on the bottom of that window).

3. Click on Source Files and hit the delete key. Do the same for Header Files, and Resource Files.

4. Right-Click on your boldfaced project (which we are calling 'core' here) and click on New Folder

5. The name of the new folder should be Classes and the file extension is .uc and hit OK

6. Right-Click on the Classes folder you just make and click on Add files to folder

7. In the dialog box, go to your folder that has the .uc files in it. Which in this case is e:\ut2003\core\classes

8. You will have to change the filemask to *.* below the filenames to see the .uc files. Select the .uc (commandlet, locale, object, subsystem, time) files and click OK

Make sure you are looking at the \ut2003\–MOD– folder and not \ut2003\_vc\–MOD– folder.. there are no files stored in the _vc folder only references.

At this point i'm going to assume you have all of the packages done for each UT2k3 package and your mod as well.

Make sure your project is boldfaced. You can do this by right-clicking on your package and selecting Set as Active Project. Why? Ill explain in a bit.

MAKE SURE YOU SAVE EVERYTHING AT THIS POINT!!! USE THE TRIPLE DISK LOOKING ICON TO SAVE ALL OR USE THE MENU PULLDOWN


If you have a custom mod, make sure you have it in your {BaseDirectory}/System/UT2003.ini file in the EditPackages section at the end of the list. Example: EditPackages=MYMOD

If you dont do that step, you can compile until your drive falls out, and it will not compile your mod. There are exceptions using custom .ini files, but that is too indepth for this page.

Now you should have all of the packages on the left side visible. If you expand the package, and expand the classes, you should see all of the files for each one. You can double click on any of the .uc files and it will show in the editor.

Now to build your package, you can go to Tools Then select UCC Release Builder. and it will delete the old .u file that has the same name as the project you have boldfaced on the left sidebar. It will then compile the packages and place the output in your {BaseDirectory}/System folder.

Why VS6?[edit]

  • Well if you get an error, you can double click on that line, and it will go to that file, open it and jump to that line...
  • If you need to find a class or word, use the menu bar Edit and Find in files and put your word in, make sure the path points to your /ut2003 folder, and the In Files/File Types is set to *.uc It will show every instance of that word in every file will be shown to you. Just double click on that line and it will open the file and jump to that line. This is great for researching code and finding usable areas on how other coders and Epic did a lot of their routines, as well as finding some of your own.
  • Multiple packages in 1 editor. Just set another package as the Active package and you can keep working without fumbling around in directories.
  • Add macros to use CVS or use Sourcesafe natively, or add extra icons and macros to start up dedicated servers, build debug versions, or whatever.

I hope this helps everyone, and there is no Right or Wrong editor to use, just the one you are most comfortable with. I use VS6 all of time since I do C/C++/ASM work (yes i use nasm as well) and I am comfortable with the environment. This can be adopted for Visual Studio .Net as well, and you can find more info on that on the UDN, but the method is still pretty much the same.

Good luck and happy Coding!

Related Topics[edit]

Comments[edit]

GRAF1K: Visual Studio .NET is even more useful. Perhaps a new section or page on that would be useful.

Setting Up Visual Studio .NET[edit]

Go to the UDN page here: udn2:UnrealScriptHighlighting and follow the directions for getting the syntax highlighter to work in VS .NET. This will let you see the uscript words in a different color and makes reading code easier.

Using a batch file for compilation[edit]

You will need to create a batch file to help automate things. So... Crank up your notepad

The batch file should have the following in it:

@ECHO OFF
del %1.u
ucc make

And save it as: MakePackage.bat and save it in your {Base Directory}\System folder. (Make sure you didn't accidentally save it as MakePackage.bat.txt.)

  1. Select Tools -> External Tools from the menu bar.
  1. Click the Add button. A new entry with the name [New Tool 1] will be added at the bottom of the list.
  1. In the Title field enter &UCC Release Builder. The entry in the list will adjust accordingly.
  1. In the Command field you put the following command (change the path to reflect Base Directory):
      C:\UT2003\system\MakePackage.bat
  1. In the Arguments field, enter:
      $(SolutionFileName)
  1. In the Initial Directory field enter your {Base Directory}\System directory, for example:
      C:\UT2003\system
  1. Make sure Use Output Window is checked, and click on OK.

Using UMake for compilation[edit]

  1. Download and install UMake.
  2. Proceed as described in the previous section, but:
  3. * Enter your path to UMake.exe in the Command field (pointing to wherever you installed UMake in), for example:
      C:\UT2003\System\UMake.exe
  4. * In the Arguments field, enter:
      $(FileName)

You can have the Edit button in UMake open erroneos files in the studio, but it will do so in a new window every time. If you want to be able to use it anyway, start UMake, click Options, make sure the General tab is selected and copy/paste the following into the Source code editor field:

"C:\Program Files\Microsoft Visual Studio .NET\Common7\IDE\devenv.exe" %errfile% /command "Edit.GoTo %errline%"

Change C:\Program Files\Microsoft Visual Studio .NET to the directory where you installed your Visual Studio.

Comments[edit]

DarthDevilous: This is just the start, and I hope someone else will continue. Since I have not got some great scripting project waiting I cannot really test the rest to see whether it works. On another note, I can't get the script highlighting for VS.NET to work properly. The only difference I can see is that super is highlighted and that may be because I have never used it as a keyword before.

Phoenix: You can get VS.NET to work properly easily–it's not very well documented on the website you've mentioned:

  1. Fire up regedit, and go to HKEY_LOCAL_MACHINE\Software\VisualStudio\[YourVersion]\Languages\File Extensions, add .uc if it's not there.
  2. Change the (Default) value to {B2F072B0-ABC1-11D0-9D62-00C04FD9DFD9}
  3. Download the usertype.dat from the site above (udn2:UnrealScriptHighlighting) and save it to [VisualStudio]\Common7\IDE
  4. You can also edit usertype.dat to add/remove any keywords.
  5. Restart Visual Studio

This has been tested & confirmed working on Visual Studio 2005.

Daktor: I cannot find the download for usertype.dat, can someone upload it or show where it is on (udn2:UnrealScriptHighlighting)? Thanks.