TOXIKK
Not enough ratings
Modding Guide - Getting started with Mutators
By Azfaloth
This guide explores the basics of Making a Mutator for Toxikk. It does not teach the programming part, but how to set up your system for development and some advice on how to compile scripts, learn basic scripting, links to examples and how to start learning to make mutators on your own.
   
Award
Favorite
Favorited
Unfavorite
Setup and How to Compile Scripts
In order to set yourself up to write scripts that become mutators, you must first set up your system to have everything ready.

1. Install Toxikk. If you haven't already done so.

2. Install the UDK. The latest version is February 2015. This may be obtained here since Epic no longer hosts the UDK files on their website.

www.toxikk.com/files/SDKK-UDK_Install.zip

3. Install the UDK in your Toxikk folder, which is usually something like

.....\Steam\steamapps\common\TOXIKK

4. You will have a few options during installation. An empty installation is sufficient, and the optional components are not required. Just perform a basic installation.

5. Once the installation is done, you do not need to actually even open the UDK. Just close out, and open steam. Navigate to Toxikk in your library, right click and go to properties. There in the local files tab, go ahead and verify integrity of local files. Steam will verify and download some additional files.

You now have completed the installation for the SDKK. Ordinarily you can use the UDK to build maps for Toxikk etc. But we are focussing on mutators so that is beyond the scope of this guide.


6. Now head over to Toxikk/UDKGame/Script and verify that you have the Cruzade.u file present. This contains Toxikk class files and must be present to create mutators.

7. Now head over to Toxikk/UDKGame/Config and verify that you have a number of .ini files there.
Create a new folder named Make in the config folder. Copy all Default inis and paste into the Make folder. This is going to be your dev copy of the config files so that you don't ruin the default ones during your programming adventures.


8. open Toxikk/UDKGame/Config/Make/DefaultEngine.ini and make sure this part exists:
[Engine.ScriptPackages] +NonNativePackages=UTGame +NonNativePackages=UTGameContent ;+NonNativePackages=Cruzade

9. Find this part in the same file. And add your mod to the list as shown
[UnrealEd.EditorEngine] +EditPackages=UTGame +EditPackages=UTGameContent +EditPackages=Cruzade +EditPackages=MyMutator ;+ModEditPackages=MyMod


10. Then go back to Toxikk/UDKGame and duplicate the Script folder as Script_dev. This will be a copy for safe keeping.


11. Now navigate to Toxikk/Development/Src and delete everything in that folder. Create a folder that should be named whatever you want your mutator to be named. - "MyMutator" for example. This name should be the same as what you named your mutator in step 9. Change both to whatever you want at this stage if you'd like. Remember, every new mutator you choose to make must be added as a folder here and mentioned in the DefaultEngine.ini file as mentioned in step 9.

12. Open that MyMutator(or whatever else you named it) folder and create a folder inside called "Classes". This is the folder which will contain all your scripts.

13. Create an empty text file here with the extension .uc. "MyMutator.uc" for example. This is a class file and it is where you will write the code that performs whatever you want for your mutator. Leave it blank for now as we finish setting up.

14. Navigate back to the Toxikk folder and create a batch file with this code.

Binaries\Win32\TOXIKK.exe make -CONFIGSUBDIR=Make

Name this batch file "CompileScripts.bat" as this is the batch file that will compile all the class files you place in your Toxikk/Development/Src/MyMutator/Classes.


15. You are now set up with the basics. Any code you may write in the .uc file, can be compiled by double clicking on the CompileScripts.bat batch file you have made. Any errors you make will be shown as an error during compilation. A red error means the file was not compiled, and a yellow warning means the file was compiled but you might need to check the warnings.

When you compile a script, it appears in the Toxikk/UDKGame/Scripts Folder with the same name of your folder in the Src folder. "MyMutator.u" to continue with the example we have been using. This is a compiled script and can be used by the game.
Getting Started With Scripts
At this point you have everything you need to compile your scripts. But perhaps you still do not know how to write scripts.?

While this is not a guide on UnrealScript basics or programming, I will attempt to give you some base on which you may direct your own efforts.

Before we begin, if you have no programming knowledge at all, and the concepts of - classes, objects, inheritance , data types, basic programming logic and syntax are completely alien and unknown to you; then making mutators is probably not for you.

The road ahead is difficult and unless you have some programming background even as a hobby, it is almost impossible to make anything but the simplest of mutators.

If you are an absolute programming beginner than you will need a great appetite for suffering, incredible motivation and a LOT of free time.

I will assume some knowledge of programming and will explore giving you the tools to learn what you need. First, we start with some theory about mutators and the game classes in general.

1. What are mutators?

Mutators are classes that extend the various levels(See #2 below) of Mutator class and give you access to a number of functions/methods that you can use to perform certain actions.

2. The basic package structure of Toxikk-
The classes in the Unreal Engine, Unreal Tournament and Toxikk are roughly laid on top of each other. The UTGame classes extend the ones from the Unreal Engine and add some features. The Toxikk classes (Called Cruzade) extend these UTGame classes and add toxikk specific functionality.

The whole system functions as separate layers or levels that are interconnected and built upon each other. For example- The CRZMutator class (Cruzade Package) extends the UTMutator class(UTGame package) which in turn extends the Mutator class(Core Package). Classes that extend CRZMutator have access to all functions in all these three classes and more from even more basic classes in the heirarchy.

A mutator you make for Toxikk should extend the CRZMutator class.

3. Class structure generalizations- Classes in UDK/UT3/Toxikk generally contain several functions that are often called by each other, and a block at the bottom called default properties. This block contains certain variables that can be easily changed in order to change the behaviour of the parent class.

For example, to change the behaviour of a weapon, one need only make a class that extends the original weapon class and change the values in the default properties. This will allow you to make many changes without having to struggle much with code.

4. Mutator making strategies-
Often, the strategy for making a mutator is to first decide what you need to change. Find which game class performs that function normally. Study and understand how exactly it works and in conjunction with what other classes in different inheritance levels. Figure out what changes would best achieve your goals.

But all this is dependant on whether you can actually effect that change. The Mutator classes have a definite number of functions that you can use. These functions are triggered at certain times and contain certain data that can be used to your advantage. Usually, the hardest part is figuring out what functions will best help you "inject" your code into the game in an efficient manner.

Now that you have a basic understanding of the approach to mutator making, you have probably figured out that you need the decompiled readable class files in order to be able to read them, and make your mutators.

The Unreal Tournament and Engine classes/scripts can be easily obtained from a number of sources online. I will link one here for your convenience.

https://www.moddb.com/games/unreal-tournament-3/downloads/ut3-scripts-old-11

These have the uncompiled .uc files that you can read using any text editor. I recommend Notepad++.

Next you need the Toxikk Classes/Scripts. This is not available online but you can decompile it directly from the game.

Make a batch file with this code in your Toxikk folder:
"<YOUR FILE PATH>\TOXIKK\Binaries\Win32\Toxikk.exe" batchexport %1 class .uc "<YOUR FILE PATH>\TOXIKK\Decompiled%~n1\Classes\"

Then go to Toxikk/UDKGame/Script and find the Cruzade.u file. Drag and drop this onto the batch file you just made. It should open a command prompt and decompile the cruzade scripts. These will appear in a folder in Toxikk/DecompiledCruzade.

Now you have the UDK, UT3 and Toxikk class files ready for your study and usage.
Script Resources and Examples
Now you have all the tools to make your own scripts. But maybe you still don't know how to start?

I will paste a few links here that will help you out.

1. https://github.com/ToxikkModdingTeam/MutatH0r

This contains the largest open-source set of Mutators created for Toxikk. In this project, you will find a large number of mutators using various functions that you may open and study in order to understand how to set up your own.

2. https://www.moddb.com/games/unreal-tournament-3/tutorials/unreal-learning-1-my-first-unreal-tournament-3-mutator

This is a tutorial for modding Unreal Tournament 3. While many things are different for toxikk(Especially class names!), the general principles are the same and giving this a quick read with its pictures and examples should teach you quite a bit about making your own mutator.

3. The Cruzade source code itself has a number of inbuilt mutators. They all start with CRZMutator_ and have a lot of sample code that you may study and use to learn more about making Mutators.

For a casual person who intends to make a couple of mutators for their interest, this should be sufficient. You can experiment, try different methods and use examples to further your knowledge of the code. You will fail many times, but eventually you will probably succeed.

If you are more serious about this whole endeavor, and wish to learn UnrealScript properly from the beginning to the end, there are more in depth tutorials available online. Like this one-

https://api.unrealengine.com/udk/Three/WebHome.html

and

https://api.unrealengine.com/udk/Three/UT3Mods.html


I hope this wall of text has been useful to start you off on making your own mutators. Good luck!