Лучшие шаблоны ucoz бесплатно. Музыка и песни в альбомах. Строительный форум
04:49, 01.12.2024
[ New messages · Members · Forum rules · Search · RSS ]
  • Page 1 of 1
  • 1
Creating a Basic Mutator
UltraKillДата: Friday, 15.03.2013, 21:39 | Сообщение # 1
Main Developer.
Группа: ADMINISTRATOR
Сообщений: 59
Репутация: 665
Статус: Offline
Prerequisites: Killing Floor SDK (Steam->Library->Tools)

Creating a Basic Mutator

Step-by-step Instructions

1. Create directory hierarchy

Create a directory in .../steamapps/common/killingfloor with the same name you wish to give your mutator. Create a subdirectory inside this named Classes. You should now have a directory structure that looks like this:

.../steamapps/common/killingfloor/ExampleMutator/Classes

2. Create main mutator script file

Inside the classes subdirectory create a file with a .uc extension with a name matching the mutator's main directory name, for example ExampleMutator.uc. The path of this file should look like this:

.../steamapps/common/killingfloor/ExampleMutator/Classes/ExampleMutator.uc

3. Tell compiler we want to include this mutator in the compilation

In order to have the compiler actually compile your mutator you must add an entry for it in a file named killingfloor.ini, located in the game's system directory. Open this file, search for the section with several lines beginning with EditPackages=PackageName. Add an entry at the bottom of this list to include the name of your mutator package, which should look like this:

EditPackages=ExampleMutator

4. Add some code to the mutator script

Code:
class ExampleMutator extends Mutator;defaultproperties
{
GroupName="KFExampleMutator"
FriendlyName="Example Mutator"
Description="Mutator description here"
}
This is the bare minimum for compiling a mutator that can be seen in Killing Floor (actually, FriendlyName and Description aren't strictly necessary but why compile without them?). The GroupName property must start with the letters KF else it won't be seen by the game.

5. Compile using UCC

Compiling the mutator is as simple as calling ucc make, which can be found in the system directory (in fact the file is simply calleducc.exe and make is a command line argument). Note that if you have previously compiled the mutator you must remove its .u file from the system directory in order to recompile (otherwise the mutator will be ignored in the compilation process).

If you cannot find ucc.exe you may not have the Killing Floor SDK installed. Find it on Steam in the 'tools' section.

Additionally you may want to remove certain files and have the console wait before closing, so that you can view the compilation output (and thus determine if it failed and why). You could do all this by opening command prompt and typing the commands manually, but it's far simpler to use a batch file. Create a batch file (anywhere - the desktop is good for easy access) with a name such as ExampleMutator.bat and copy the following lines in:

Code:
del "C:\Program Files\Steam\steamapps\common\killingfloor\System\ExampleMutator.u""C:\Program Files\Steam\steamapps\common\killingfloor\System\UCC.exe" make
del "C:\Program Files\Steam\steamapps\common\killingfloor\System\steam_appid.txt"
pause
You may need to alter the paths if you have the game installed to a different hard drive or have a different directory structure. The third line removes a file generated by UCC which while exists will prevent connecting to servers (may not apply to all).

Run the batch file and tada! If compilation was successful, you have just made your first mutator. If not, you have made a mistake.

6. Functional mutator example

Here is a functional, more interesting mutator to take a look at:

Code:
class ExampleMutator extends Mutator;function PostBeginPlay()
{
SetTimer(1, true);
}

function Timer()
{
local KFHumanPawn Player;

foreach DynamicActors(class 'KFHumanPawn', Player)
{
if (Player.Health + 2 <= Player.HealthMax) Player.Health += 2;
else Player.Health = Player.HealthMax;
}
}

defaultproperties
{
GroupName="KFExampleMutator"
FriendlyName="Example Mutator"
Description="Mutator description here"
}
What does it do? It increases the health of each player by 2 points every second.

7. Where do I go from here?

Now that you understand how to compile a mutator, I'd recommend first taking a look at the official UnrealScript Language Referencewhich covers all aspects of the language itself. If you plan to write mutators which work online it's vital that you understand how the networking is handled, and I'd suggest reading the Unreal Networking Architecture article on this. If you want to know more about the engine (and particularly which classes are available to use) you can either browse through the script files yourself, or check out theBeyondUnreal Wiki.

I'd recommend getting a good text editor with support for line numbers (I suggest Notepad++ for this) and a search tool for searching the entire library of script files for finding where specific classes and variables are defined (I'd recommend Windows Grep as it's powerful, fast, and free).

---
Benjamin
 
  • Page 1 of 1
  • 1
Search:

image

Ad's

Здесь может быть Ваша реклама.

Buy Place
image

Ad's

Здесь может быть Ваша реклама.

Buy Place

How To Contact?

  • Skype: CHEATER_1992
  • E-mail: CHEATER.Q3@gmail.com

Info About

  • Copying of materials is permitted only with reference to the source.