hello there.
i see people struggling and making silly mistakes setting up their script projects, or just doing it plain wrong.
the official docs here are not all that easy to follow.
so heres a quick step by step.
1. navigate to UDK/Development/Src/
make a new folder, call it what you want but here ill call it 'TegIsAce'.
make another new folder inside that and call it 'Classes'
now you have something like this
UDK/Development/Src/TegIsAce/Classes
this is where all your custom script files will live.
2. to make the engine know about your project we need to tell it.
open UDK/UDKGame/Config
find DefaultEngine.ini and double click to open it.
find this bit
add the name of your new script folder here like thisCode:[UnrealEd.EditorEngine] +EditPackages=UTGame +EditPackages=UTGameContent
if you try and start udk now it will moan at you because the script folder is empty.Code:[UnrealEd.EditorEngine] +EditPackages=UTGame +EditPackages=UTGameContent +EditPackages=TegIsAce
3. add a script file of your own.
heres a simple gametype to get you started.
create a file called MyGame.uc and paste this into it. then Save it in Your Script Folder ei. UDK/Development/Src/TegIsAce/Classes
you now have your own gametype, to make udk use this as default...Code:class MyGame extends UTGame; /** * Allows overriding of which gameinfo class to use. * Called on the DefaultGameType from the ini, or the one specified on the command line (?game=xxx) */ static event class<GameInfo> SetGameType(string MapName, string Options, string Portal) { return default.class; } defaultproperties { //define default hud, pawn and player controller and other stuff for this gametype here HUDType=class'UTGame.UTHUD' PlayerControllerClass=class'UTGame.UTPlayerController' DefaultPawnClass=class'UTPawn' }
4. navigate to UDK/UDKGame/Config and open DefaultGame.ini
find these lines
change it to point to your gametypeCode:DefaultGame=UTGame.UTDeathmach DefaultServerGame=UTGame.UTDeathmach .... DefaultGameType="UTGame.UTDeathmach";
so thats "YourScriptFolderName.YourGameType"Code:DefaultGame=TegIsAce.MyGame DefaultServerGame=TegIsAce.MyGame .... DefaultGameType="TegIsAce.MyGame";
you can also define the default player controller in that section
PlayerControllerClassName=
and thats it.
open the frontend and click 'Script' then 'Full Recompile'
any problems or anything let me know
Happy Coding
edit:
5. (optional)
one other thing,
to make the game just start on your map open UDKGame/Config/DefaultEngine.ini
and change these lines to point to your map
Code:Map=YourMap.udk LocalMap=YourMap.udk





Reply With Quote



Bookmarks