PDA

View Full Version : some scripting issues !



ken_13
11-12-2009, 10:34 AM
hi ,
i want to do these but can't please help me :
1- i want to write some function like this :
function dosome()
{
// as simple as it is
float x = 2+2;
}
but where can i put this .
2- the file that i create for writing script in it must name of the class that i declare in it . ( i want to do something ele !!! )
3- when i put two class definition in one file it cause error ( i think because of problem Number-2 )
4- where can i find the list of the method that an object have ?
( like this : StaticMeshComponent.AddImpulse(...) )
5- explain clearly to me that how can i bind a key to a function and where is the place that i must write them ?

Thank you .

Blaaguuu
11-12-2009, 11:00 AM
There are a lot of very basic questions about unrealscript, and programming in general, there... You should really take a good look at the documentation before you try writing anything. heres a good place to start: http://udn.epicgames.com/Three/DevelopmentKitHome.html

but to try to give some quick answers to your specific question (though I don't think they will help much on their own)
1: I don't believe you can initialize a variable on the same line as the definition, unless it is a const. Or atleast it is bad practice. You initialize vars in the default properties.
2: In Uscript the file name must be the same as te class declaration name. No way around it.
3: each file is a class. see #2.
4: there isn't really a full list of every function in the game... Use the Unreal Wiki (http://wiki.beyondunreal.com/), the UDN (http://udn.epicgames.com/Three/DevelopmentKitHome.html), or just browse the UT3 script files for useful functions.
5: that is a bit more indepth than I have time for, but it would have to do with commands in the UTInput.ini corresponding to 'exec' functions in your code.