View Full Version : How to script?
Where can i find my game scripts?
Blaaguuu
11-07-2009, 02:50 PM
The existing scripts are in the \UDK\UDK-2009-11\Development\Src\ directory. Your own scripts would go in the \MyMod\Classes\ directory, but you can obviously rename the MyMod folder to anything you want. You can edit the scripts with any text editor, but I would recommend using WOTGreal or nFringe. There are a lot of more in-depth guides around if you look into UT3 modding.
ok and how can i add script just make a text file Write the script and save as .??
and how can i add scripts to the game
sorry this my first look intro Unreal Engine
Wormbo
11-07-2009, 03:04 PM
There are many tutorials for the various UT series games. Pick up one of those (ideally one for UT3 as it's closest to the UDK) and adapt the instructions to the UDK tools and folder structure.
Blaaguuu
11-07-2009, 03:07 PM
You save the script files as .uc, like the existing UDK scripts.
I suggest you start with this:
http://udn.epicgames.com/Three/DevelopmentKitHome.html
Or like I said, just search around for for beginner UT3 modding tutorials... There so so many resources around already if you look for them. Working with the UDK and making a UT3 mod are almost exactly the same.
ok thanks for all but one last thing how can i after scripting add the script to my game?
Wormbo
11-07-2009, 03:19 PM
That really depends on the type of script. I recommend reading the related tutorials.
ok i have read most of it but i now i don't know how i can add Scripts to my game?
i have learn what's is new demo script and some other things about classes.
Blaaguuu
11-07-2009, 04:53 PM
Are you making a gametype, a mutator, or what? As Wormbo said, the type of script really dictates how you would go about implementing it.
I'm make a Third person shooter. i have only works with 3dGamestudio but i need a new Challenge with UDK Engine 3
Blaaguuu
11-07-2009, 05:06 PM
If you are making a whole new game, then eventually you would need to replace the 'frontend' map with one of your own, to totally change the entry-point for your game. But that is a lot of work, so if you just need to quickly test your gametype, you can do it by launching the UDK with a command line that specifies your gametype... you can do that by creating a new shortcut to UDK.exe, and edit the Target property on it like so:
D:\UDK\UDK-2009-11\Binaries\UDK.exe DM-Deck?Game=UTGame.UTDeathmatch
Just change it to point to the correct install location for the UDK binaries, set whatever map you want, and change the Game attribute to point to your game class, once it is compiled and placed in the \UTGame\Script\ folder.
yes i know it but i don't know how to add Script files
Blaaguuu
11-07-2009, 07:07 PM
add them to what?
Wormbo
11-07-2009, 07:08 PM
You write your code (according to the tutorials), then you compile it (also according to the tutorials), and bam! - They are when they belong.
danimal'
11-08-2009, 02:44 AM
Ugh you guys aren't being helpful.
Eeyk, you will create a .uc file (they're just text files). For instance if you wanted to create a gun, you'd create something like YourWeapon.uc that extends UTWeapon.uc, or one of the existing guns (UTWeap_RocketLauncher.uc).
To give your weapon to your player, you would do something like this:
DefaultInventory[0] = class'UTWeap_YourWeapon';
I strongly suggest following the tutorials here, they were made for UT3 but can be easily transferred:
http://www.moddb.com/engines/unreal-engine-3/tutorials
danimal
ok if i have a camera stand for Third person? and i named as Third_camera_stand_DM.uc how i can idd this to playerpoint of Camera point?
danimal'
11-08-2009, 05:00 AM
See the really quick tutorial code I threw up in the other thread for 3rd person camera:
http://forums.epicgames.com/showpost.php?p=26958520&postcount=14
The reason they're giving you less than helpful answers is that, basically you can't come in and say guys how do I do this. No one is going to code for you. They expect you to look around in existing tutorials, .uc files, and THEN ask slightly more targeted questions. Like when I first setup a 3rd person camera, it seemed too far back to me, so I looked around and saw the CameraScale setting, which indeed controls how close the camera is pulled. No one would have slaughtered me for asking "how do I set the camera distance to player", but if I said guys how do I make a 3rd person, I would have got a lot of eye rolling.
Spend time in the UDK Unrealscript section, and check out the many UT3 unreal script tutorials.
danimal
it's don't works.
can u tell me a website where to lear it
Demruth
11-08-2009, 06:40 AM
They did. You don't seem to be listening. Look around for tutorials. There is HEAPS of stuff out there related to Unreal Engine 3. If you're somewhat serious about creating content, you're going to have to get used to going off and finding information about things.
i will learn it but i'm not english i can't read 400 pages of text i search for a tutorials.
Demruth
11-08-2009, 10:10 AM
Fair enough. What language do you speak then?
Perhaps there's someone who can speak the same language, which will solve the problem of people getting frustrated because it seems like you're not listening to them, when in fact there's a language barrier.
i'm Dutch (NOT GERMANY) http://en.wikipedia.org/wiki/Netherlands
But there are no Dutch tutorials i can reading english but not so good :)
maparizeau
11-09-2009, 11:35 PM
Hi eeyk,
Unfortunately my Dutch is rusty (just another way of sarcastically saying I don't know Dutch! :-P)
A tip that I can give you is don't try to understand everything that is written in a tutorial or a forum. Sometimes they will use local expression when talking. So of course you won't understand everything.
Instead, just try to understand the key words in a text. No matter what language you speak, technical terms are easy to find. Of course, this imply that you need a technical background of some sort. Because if you want to make a game, you will need a technical background. If you don't, it will still be possible to make your game but it will be harder.
I've been working in computers for 14 years, programming for 3 and i'm still trying to figure out where to start. I've managed to make a very basic level, to create my mesh (characters and assets in 3ds max) and how to export them in UDK. Now I just need, like you to figure out how to script everything I want and put everything together. Some of the answers here are easy and logical for them but not for everyone. So just tell them.
But that's the beauty of it. It's hard and rewarding at the same time. Some of the guys here are very experienced in this stuff. Other like you and me are a bit newer to this. They call us noobs or newbys.
So when you ask a question, be as clear as possible and put as much details as possible. Also, if there's a word that you don't understand, look it up. There are many tool on the net to translate words. If they give a tutorial to follow and it doesn't answer your question, tell them or if there's parts that you don't understand, tell them as well but write and example of what you don't understand.
I think by following this, you will have a easier time communicating in English.
By the way, I'm French (Not from France, from Canada :-)) Now I lived in the US when I was young so I have an advantage. But work hard, learn to spot the key words and you will be fine.
ok but i do now only mapping and wait when i know how to script
musichopper
11-10-2009, 04:26 PM
I have the same problem in a sense man. I am also dutch... but I only speak English fluently.
The way it seems to work is that you change the ini files point to your game name and it will grab logical choices from your folders. Then you put your own little code files inside the proper folder within your own game folder and for simplicity and ease of not having to rewrite everything, you inherit the classes that are already provided and extend the class(s) you need to alter to have it do what you want.
This is how I am seeing it to have to happen. I am not very confident in this because I am used to the old school way of having one massive code file that does everything lol. And with OOP I am used to editor front ends that allow you to import your code into an internal placeholder sort of folder so you know they are being used and accessible right from the editor for ease of fast editing.
If my assumption is incorrect, please let us both know because I would like to start coding right away lol. I feel like a pro racecar driver... I know how to drive like the dickens but I know nothing about cars and have to install a new car part before I can drive it lol. If you catch my drift. The coding is the easy part....its the knowing how it is going to access my own code that is worrying me. very small hurdle and then the dam of creativity breaks.
http://udn.epicgames.com/Three/UnrealScriptReference.html <----- this should help you out some as well. I am sure you can have googles translate page convert it to your language of choice also.
But i know how to script but i don't know how to add a class to the game
musichopper
11-10-2009, 05:32 PM
I understand what you are saying. Do you mean how can you manually add the class into the game through the editor? or at runtime?
wildicv
11-10-2009, 05:51 PM
In order to work with the unreal scripting language you must have a very strong understanding of object oriented programming. A Background in c++ would be beneficial though. Using a script isn’t like adding a mesh to a editor. You would have to have your main.uc script point to other scripts *calling functions* from other scripts this is how you add more scripts.
musichopper
11-10-2009, 06:20 PM
In order to work with the unreal scripting language you must have a very strong understanding of object oriented programming. A Background in c++ would be beneficial though. Using a script isn’t like adding a mesh to a editor. You would have to have your main.uc script point to other scripts *calling functions* from other scripts this is how you add more scripts.
So when you drop a player start into your map through the editor it has no code attached to it? based on its name within its class in its code it inherited as a subclass from actor which was from object?
Or are you saying that when you do code something you can not add it into the map through the editor and the only ones you can add have already been included and hard coded into to editor itself?
I have a feeling you are way wrong about this lol.
I can extend the class of a pointlight but in the code of my own new pointlight have it contain some custom code dealing with whatever I want and even override its parent classes own code if need be.
From what I am reading, the editor can read out the values of variables like "var() int myVar" and lets you change them in the editor like every other class that has been created. You can give it a visual entity from inheritance of its parent class or code your own sprite texture or mesh to default to.
I didn't test this yet so my only confusion is where my creation will show up to drop into the editor to test before I dynamically add it at runtime (iff need be). Is it right where you right click and add actor... then select one of them? Do you need to restart the editor to be able to locate your new class first? Do you have to rebuild the game every time you make a change to any code for it to compile all your scrpits?
I have worked in OOP before but like I said, the editor for the engine included a nice import feature so I could KNOW FOR SURE that my own code was being used in builds. It would then have a list of all my code and I could double click the individual files to edit them while still in the editor.
I will just have to try some stuff myself and simply add a new extension to a class with no change to it or a minor change and try and add it into a map etc.
EDIT: Tried it and it works fine for me lol. Guess you don't have to be a c++ guru to get your custom code into the editor within about... 10 minutes of hacking around... to make it easier to find I restarted the editor so it would have to recompile the script base including my new custom code I placed in myMod/classes/ make sure to allow this folder within your ini file.. forget which one.. just have to kill the ";" before it so it isnt a comment anymore... then once the editor starts up including the new code I went into the actor classes window and found my code in there... also make sure your code has "placeable" right after your class info at the top. added it to the basic map ran a build... played it and it works. easy as can be. Now I am going to make some changes code wise and see how they relate.
click the code in the actor classes window and then right click on the perspective view and select.. add "whatever you named your actor" ... there you have it.
I need to find a way to have it update my code without restarting the editor tho. Should be somewhere in the editor itself to do so.. or by finding the exe that does it and shortcutting it etc.
May You can help me if i say it in dutch
___
ik weet niet hoe ik een Script / Class in me Game krijg toegevoegd.
dus bijvoorbeeld ik heb een Script gemaakt waar in je extra hoog kan springen hoe voeg ik die dan toe?
musichopper
11-11-2009, 08:16 PM
http://www.google.com/language_tools?hl=EN
mikepurvis
11-11-2009, 08:34 PM
If you made a GameType and compiled your script with Unreal Frontend, go to the UDK/Binaries/ folder and make a shortcut to UDK.exe open the properties on the shortcut. you can add a switch to run a map and your GameType ( Script ).
Like this.
[CODE]
C:\Users\Mike\Documents\UDK\Binaries\UDK.exe DM-MyMapName?game=MyGamePackageName.MyGameType
[/CODE
Powered by vBulletin® Version 4.1.6 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.