Wednesday, March 21, 2012

How to add your custom gametype to UDK

The amount of times I've done this and forgotten isn't even funny anymore.
Edit this file:

C:\UDK\UDK-2011-09\UDKGame\Config\DefaultEngine.ini


[Engine.ScriptPackages]
+NonNativePackages=UTGame
+NonNativePackages=UTGameContent
+NonNativePackages=CustomGameTypePackage
...
[UnrealEd.EditorEngine]
+EditPackages=UTGame
+EditPackages=UTGameContent
+EditPackages=CustomGameTypePackage

So now the engine will look for code inside your new package:

C:\UDK\UDK-2011-09\Development\Src\CustomGameTypePackage\Classes

From here you need to create you own Class and to get up and running quickly extend a game type you should know about, UTDeathmatch


Save this code in a file called MyCustomGame.uc


class MyCustomGame extends UTDeathmatch;


defaultproperties
{
}




Once you are in the UDK editor you can set the map to whichever gametype you want using world properties. Remembering that the map is the world and multiple games can occur in that world.

View>World Properties>MyCustomGame

Default Game Type
AND
Game Type for PIE

Set both dropdowns to your gametype 'MyCustomGame'



6 comments:

  1. Thank you so much, the straight-forwardness is brilliant!

    ReplyDelete
  2. It's more a matter of how much time i get to write them :)

    ReplyDelete
  3. does this work to bake the game?

    ReplyDelete
  4. Yes as long as your map uses this game info set in world properties

    ReplyDelete
  5. Yes as long as your map uses this game info set in world properties

    ReplyDelete
  6. i have created my mesh, & want autonavigation of agent from a start to goal.

    ReplyDelete