Sunday, September 29, 2013

List Of IDEs For Unrealscript


There are lots of text editors out there. you can simple grab one and write as you want. unrealscript support even notepad. but a good IDE can help you very much

what kind of behaviors that good IDE must have?
  • Syntax highlighting
  • Code hinting capability
  • line numbers (if it is necessary) 
  • Etc

good ides that i found for unrealscript
  1. Eclipse IDE with unrealscript plugging
  2. Notepad++ 
  3. Sublime Text
//More coming in  this post. :) sorry about early release


Friday, August 23, 2013

Unrealscript defaultproperties Block

Unrealscript defaultproperties Block :
  • Purpose of the defauldproperties block is initialize variables default values.
  • Example: If you crated variable: var int x;
  • You should initialize the variable "x" inside the defauldproperties. x=9 
  • In unrealscript you cannot initialize values outside. (But inside a functions in some cases).
Example:

UnrealScript Basic Syntax: Variable Types And Objects

UnrealScript Basic Syntax: Variable Types And Objects

(covers how to create variables, sketching advance variable types how to create class instance (objects) and other few things)

  • Unrealscript is not case sensitive.
  • You can Declare Variables outside "DefaultProperties" but you cannot initialize them.(Learn more about default property block go here)
  • You must Initialize your Variables in the DefaultProperties.

Creating primitive variables: Unreal support the primitive types string, Boolean, integer, float
  • Syntax: var [keyword] type name OR local [keyword] type name
  • About:
    •  Replace type to int or bool or string or float as you want & named it how ever you want. (typical variable naming conversion applied same with unrealscript such as you can't begging the name with special letter like *&^%$# or a number and etc). 
    • If variable use local keyword it local to the function so it declare inside a function and it can be initialize inside the function. if you use var key word it is global. you can access it in another class or method, if it is not declared as private or public. key word section not necessary if you aren't define it it will be automatically public. 
  • Examples: 
    • var int pens; //pens can hold only whole numbers such as 1, 2, 3, ... it cannot hold 1.2
    • var float waterLiter; //It can numbers whole numbers and floating point numbers like 3.123 
    • var string sayHello; // It can hold letters like 'hello world'
    • var bool isItRain; // It can only hold 2 values "True" Or "False" 

Advance variables: Arrays, Dynamic Arrays, Enumerations, Structures, Vectors, Rotators

Wednesday, August 21, 2013

How To Compile Uncrealscript Codes

Store the source code Properly:

  • All your Source Code Should Be Stored in the Src folder which located in your installation Directory and inside the Development  Folder
  • It should proper package. create a folder and name what ever you like but folder name not contain spaces or any special characters. Inside that create folder called "Classes" and put all your source code in that folder

Setting up the Compiler Configuration:

  • Navigate to the UDK installation Folder, and go to Engine\Config (which locate all your Configurations) 
  • And Finds "BaseEngine.ini" and Open it up in any Text Editor (so notepad should work)
  • Search "EditPackages" and you will find Bunch of configurations. like below

EditPackagesInPath=..\..\Development\Src
EditPackages=Core
EditPackages=Engine
EditPackages=IpDrv
EditPackages=GFxUI
EditPackages=GameFramework
EditPackages=UnrealEd
EditPackages=GFxUIEditor
EditPackages=WinDrv
EditPackages=OnlineSubsystemPC
EditPackages=OnlineSubsystemGameSpy
EditPackages=OnlineSubsystemLive
EditPackages=OnlineSubsystemSteamworks
EditPackages=OnlineSubsystemGameCenter
EditPackages=SubstanceAir
EditPackages=SubstanceAirEd

  • After the Last "EditPackage" one Type: EditPackage = {Your package name}
  • Remember we create folder inside the Development\src folder and store all the source code. replace {Your Package name} with that name.
  • For example if you named that package as MyTestCode the final Configurations should be
EditPackagesInPath=..\..\Development\Src
EditPackages=Core
EditPackages=Engine
EditPackages=IpDrv
EditPackages=GFxUI
EditPackages=GameFramework
EditPackages=UnrealEd
EditPackages=GFxUIEditor
EditPackages=WinDrv
EditPackages=OnlineSubsystemPC
EditPackages=OnlineSubsystemGameSpy
EditPackages=OnlineSubsystemLive
EditPackages=OnlineSubsystemSteamworks
EditPackages=OnlineSubsystemGameCenter
EditPackages=SubstanceAir
EditPackages=SubstanceAirEd
EditPackages=MyTestCode

And Save BaseEngine.ini file and close it.
  • Create a Shortcut of the Command Prompt and Right Click the shortcut> go to the properties and change "start in" location to your UDK installation directory Binaries\Win32 and press OK and close the property window
  • Open that shortcut we created and type the command "udk make" and it Should Compile Your Code
That's It. Thank You!

First Unrealscript code "Hello World"

First you have to create a placeable Actor. which is very simple
  • Create A class and Named it what ever you want. and Inherit it from the Actor
  • After that add "placeable" key word so it will be placeable in our level. (You can drag and drop it to your map)
Then create a function called "PostBeginPlay" type the name exactly. This function gets called soon as the game starts.

Inside that function type `log("Hello World")
'log( ) Function is outputs what ever string passed as parameter, to the function into the log file.

You can find the log files in UDK installation directory UDKGame\Logs. You will see lots of 2 log files and bunch of backups depending on how many times you launch games. open "Launch.log" and Find our "Hello World" string.
(If you open it up in the notepad you can search the string by pressing ctrl+f )

Compile The code.

Open Up the UDK and Find our Class. It called HelloWorld. Drag and Drop the Class into our editor. and Run the Game.

You Should Find the HelloWorld String In the log files.

Tuesday, August 20, 2013

Folder Structure of the UDK

Folder Structure of the Unreal Development Kit.


After installing UDK. It will create a folder called UDK in your installation Directory. Inside UDK folder you will have another folder name begins with UDK and the version number, version number depends on the UDK version that you installed to the computer. So you can installed multiple versions and test them without worrying overriding, there will be separated in that directory. (You can rename or change this structure while you installing UDK, so this may deferent)

Inside above folder there are 4 folders named as Binaries, Development, Engine, and UDKGame.

Binaries: Holds Game executable, Unrealscript compiler and the All the designing Tools that comes with The UDK. So Animators and Designers use this folder a lot.