شخصی سازی udk | انگلیسی

Mahdi_Rashed

Well-Known Member
This tutorial will explain you

# How to set up the folders for your game.
# Setting up and compiling Unrealscript.
# Creating a super basic third person game using UT3 assets.
# How to configure the ini files.
# How to build a super basic level.
# How to make a basic menu.
# How to add basic localization support.
# How to make cook the game.
# How to package and distribute the game.
# How to troubleshoot

This is a large and extensive tutorial. This is not a development tutorial per-se. The focus is largely on how to quickly set everything up for your own game and give you a basic introduction to all the elements involved in making a UDK game. The UDN has dozens of great tutorials for more in-depth information..


Folders
There are four main folders.

  • Binaries - This contains the game exe, the UnrealFrontEnd, and any additional programs. You are not suppose to modify this folder for your game (small exceptions here and there).
  • Development - This contains the source code for your Unrealscript files. Very important directory. The game will take the source code (uc Files) found in this directory and compile the U file from these.
  • Engine - These are files required by the engine. These files should not be touched.
  • UTGame - These are all the files for your game. You will do most of the work in this directory.
Within UTGame you have the following important folders.

  • Config - Holds ini files. These ini files determine a great deal and are of vital importance.
  • Content - These are the actual levels, models, sounds, and so on for the game. Also of vital importance.
  • Localization - This holds files with all the dialog text, menu text, and so on. Basically all text.
  • Movies - These are intro movies, and loading screen movies. These are Bink movies.
  • Script - This is where compiled Unrealscript code ends up in.
  • Splash - This is the location of the splash image.
The other folders in UTGame are not important. If you want to set up SVN or similar, you should add the "Development" folder, and all above mentioned "UTGame" folders.

Within UTGame\Content you can find a great deal of UT3 content. It is best to keep most of this content in since there are some references to these assets. When you package the game later on, it will automatically strip most UT3 content out so there is not much need to manually go delete file by file from the content directory and it overly complicates things, especially for this already very long tutorial. My usual approach is to simply create a folder within Content, with my game's content.

  • UTGame\Content\ExampleGame\Levels
  • UTGame\Content\ExampleGame\UPK
Two directories, one for levels, and one for UPK files (all other content). You do not require a billion content folders like the UT3 setup. Most games do not have nearly enough files to warrant so many different folders. As example, our game The Ball, with 1.5 GB of data has just 20 UPK files.


UnrealScript
Thanks to James Tan for the UnrealScript example files, and Markus Arvidsson for additional help.

Go to the Development\Src\ folder, and create a new folder. For example "MyGame". The name of the folder will become the name of the U file. So if your game is called "Bobby" you would be best to name this folder "Bobby". All unrealscript files within this folder will be compiled into a single U file for the game to use.
In the folder "MyGame" you create a folder "Classes", and in that folder add the three folders from this zip: MyGameInfo.uc, MyPawn.uc, MyPlayerController.uc


1.jpg

This is not an Unrealscript tutorial, so we will go through this process pretty fast. The basic idea of Unrealscript is that every actor has a parent actor. A child takes over all functionality and properties of the parent. For example "class MyPawn extends UTPawn;" - Here our new MyPawn uses the UTPawn as a base.
At the bottom is always a section "DefaultProperties". These are the properties that will also be visible within the editor, and their default values. Again, the real list of properties is much longer than those in the UC files you just made, but you are only required to add those properties that are different from the parent classes. If you do not specify it in the UC file, it will take over the value of the parent. If the parent does not has it specified, it will take it from the parent from the parent. And so on. It is a tree/pyramid.

Next up, compiling. We first have to make sure the game knows of the existence of what we just added, by adding it to the list of U files to check for. To do so go to UTGame\Config\ and open up DefaultEngine.ini. Find the section "[UnrealEd.EditorEngine]" and add the following line "+EditPackages=MyGame" below the other ones.
  • +EditPackages=UTGame
    +EditPackages=UTEditor
    +EditPackages=UTGameContent
    +EditPackages=MyGame
The order is very important because it determines in what order it will load and compiled.
This line will make the U file MyGame a file to always load when starting the editor. Turn off read only protection on the file, save and close. It would also be a good idea to delete UTEngine.ini. Doing this will force the engine to create a new UTEngine.ini based on DefaultEngine.ini. Since you just modified the default ini, this will create a modified UTEngine.ini with your changes in it.

Next up go to Binaries and start UnrealFrontEnd.exe. The Frontend is a very important tool that allows you to do a whole number of things. In this case we will use it to compile our code. In the top toolbar, click on the little arrow on the right of "Make", and click "Full Recompile".

2.jpg

If all is right, it will mention MyGame in the console, and in UTGame\Script\ you should now have "MyGame.u" when it is finished.


Ini files
Next up, we are going to make sure the game uses our new gametype and pawn as the default ones.

Open up UTGame\Config\DefaultGame.ini. Remove read-only on it. And go to the section "[Engine.GameInfo]".

  • Replace "DefaultGame=UTGame.UTDeathmatch" with "DefaultGame=MyGame.MyGameInfo".
  • Replace "PlayerControllerClassName=UTGame.UTPlayerController" with "PlayerControllerClassName=MyGame.MyPlayerController"
Save. Delete UTGame.ini so it will create a new one based on your modified DefaultGame.ini.


Level
Go to Binaries\Win32 and create a shortcut to UDK.exe. Add the command line "Editor -log" behind it. For example - "G:\UDK\UDKExampleGame\Binaries\Win32\UDK.exe editor -log". Start it.
Make a super basic level. Right click the BSP Cube button and you will get a pop up to enter the size. Enter 1024 for X, Y, Z, and enable "Hollow?". Next up click "Add" in the left toolbar.

3.jpg

Fly into the cube. Right click the floor - Add Actor - Add Playerstart.

4.jpg

Do this again, but now add a Light, and move the light to the middle of the room.
Save the level. I named mine "MG-ExampleGameLevel", and that prefix is important. In MyGameInfo.UC "MG" was specified as being the prefix. Without that prefix the game will not know what gametype to use for it.

Then, rebuild the level. Top menu - Build - Build All.

5.jpg

Go to the top menu again. View - World Properties. Expand WorldInfo in the pop up window and find Game Type For PIE. Change this to MyGameInfo. PIE stands for Play-In-Editor, so this determines what gametype to use while playing in the editor.

And now right click - Play From Here and observe your wonderful level and game!

6.jpg


Menu
As for the menu, that is actually a level too. A menu is a level that is loaded on start up. That level then has Kismet that freezes the player, and pops up interface elements. That's it.
Take your existing level, and duplicate it. Save as "ExampleGameFrontEnd".
Next up, creating the UI Scene. To do this, we will also create our first package. Go to the content browser, and in the bottom left click New. Fill in the package name and name of the UI Scene. Be sure to select UI Scene as the Factory.

7.jpg

Double click the UI Scene it created if it does not open up the UI Scene editor by itself already.

Right click anywhere in the screen - Place Widget - Button [Standard]. Rescale the button since it covers the entire screen by default (the green edge is the screen).

Now to actually make it do something we are going to use UI Kismet. This is actually not entirely the proper way. The proper way would be to make the button do something using UnrealScript. Kismet however works just as well, and it is easier to do so we stick with that for this tutorial.
Right click the button - Unreal Kismet Editor.

8.jpg

In Global Sequence, add New Event - UI - On Click, and New Action - Level - Activate Level Event.

9.jpg

And hook those up.

10.jpg

In Activate Level Event, add a unique Event Name. I have "OpenYourLevel". When someone clicks the button it will now send out an event to the level. The level will then use that event, and look in its own Kismet what event corresponds to that "Event Name", and do whatever is hooked up to it. In our case that would be a console command to load the next level. As you can see it is bit of a hack, the UnrealScript is cleaner but far harder.

One last thing before we are done with this UIScene. Click somewhere in an empty space to get the properties of the UIScene itself pop up in the top right. Go to Flags - Pause Game While Active. Disable this. This would stop the kismet script from running, plus if you would build a decent background level this would also stop all animations you may add into it. You wouldn't want that.

11.jpg

Save your package. Packages must be manually saved or changes will be lost! Save it in the directory you made, so in my example that is UTGame\Content\ExampleGameContent\UPK.

Now hook this event into your level. Open the Level Kismet (green K in the top toolbar), and somewhere in the empty space add New Action - UI SceneS - Open Scene. Hook it up to Level Startup (New Event - Level Startup). And add the UI Scene you made to the properties of the Open Scene.

Update: Level Startup will be automatically renamed to Level Loaded next time you open the editor. Just for your information. Feel free to use New Event - Level Loaded right away too.


12.jpg

Add New Event - Remote Event, and a New Action - Misc - Console Command. In the Remote Event, add the same Event Name as you specified for the button, "OpenYourLevel" in my example. In the Console Command add a new command "open MG-examplegamelevel" - or whatever your playable level is called. This event will be run when the button is pressed, and through a console command it will load your level.
Now add an Action - Toggle - Toggle Cinematic Mode, and an Variable - Player and hook them up as in the screenshot. This will freeze the player on level start up.

Even better would be to use a matinee to also start a cutscene as soon as the level starts. Check out the Cutscene tutorial on Hourences.com for info on how to. You can build any kind of 3D background environment in this level, or you can simply overlay the entire screen with a piece of 2D art if that is what you want.

You are done! Note that this will not function in the editor. The editor does not allow you to run an "Open" console command.


Localization
Localization files contain all text from the game. To change the language of the game all you need to do is direct the game to another language file. That is the reasoning behind the Localization directory. We will set up an extremely simple INT file for "International" (aka English), with two lines of text.
I usually just delete all the INT files currently in the Localization folder, and start over from scratch. This will break the UT3 demo so if you were still planning on using that one don't do this.
First of all, close the editor. The editor only detects INT files on startup. It would not detect any INT file you create unless you restart it. Be sure to save both the level and the package!

Make a TXT file, and rename it to "MyGame.int". Then add

  • [ExampleOfASection]
    01=Most Awesome Title Ever
    02=To play click the button
The word between the brackets determine a section. Helps to organize things. The 01 and 02 determine the lines in that section. You don't really have to use numbers, it could be anything really.

Open the editor again, and open your level and interface package again. Open the UI Scene you made again. Right click - Place Widget - Label [Standard], and then do this a second time so you have two. Place them somewhere, and click one of them and look in the top right for its properties. Go to Data - Data Source - Mark Up String


13.jpg

Add "<strings:mygame.ExampleOfASection.01>" to Mark Up String.

This is NameOfIntFile.NameOfSection.NameOfLine.

You can do this another time for the second label. If you change the line in the INT file, it will follow along in the game/editor.


Ini Files - More Fun
Lets go back to the ini files and fix up some more. Close the editor. You cannot change ini files while having the editor run!

Open up DefaultEngine.ini - section [/B] [LIST] [*][B]MapExt=udk[/B] -...tecstudios.com/"]http://www.toltecstudios.com
 

assassinmine

New Member
mishe komak konin chetor mitoonam in karo bekonam man levelam kamel shode vali nemidoonam chetor mesle ye bazie kamel tmomm=esh konam .
manzooram ine ke betoonam wright konam roocd va too pc haye dige nasbesh konam. mamnoon misham komakam konid
 

جدیدترین ارسال ها

بالا