New UnrealScript In UT200X
See also:
- UnrealEd
- More control over actors' representation in UnrealEd.
- Syntax extension to class declarations to hide (inherited) editable property categories from the property sheet in UnrealEd:
hidecategories(category names)
- The previously existing
nousercreate
class attribute seems to have been renamed tonotplaceable
, and there's a new (redundant?)placeable
class attribute. Placeable classes are marked with an asterisk in the new actor browser. - Classes and objects can be marked as
editinline
, which allows their use and creation directly in another object's property sheet.
- Syntax extension to class declarations to hide (inherited) editable property categories from the property sheet in UnrealEd:
- Artificial Intelligence
- The class-level distinction between bots and players has shifted: You'll have models with plug-in "controllers" which can either be players (local or remote) or bot brains – that's going to make modding bot behavior very much easier. Not forgetting the ability to write a custom playerpawn and have it support all (including custom) models. You can also plug in controllers at will, allowing you to possess bots for example during a game.
- Bot AI is at higher levels split in team AI and squad AI. Each team is built of one or more squads which contain one or more bots.
See Also: Controller Overview
- Dynamic Array Support
- Are accessed like regular arrays, but provide a
Length
property (read/write) to set their size dynamically and various methods to add, insert and remove items. - Weapon Split
- Weapons have been split into various actors for handling firing, pickup view, muzzleflash?, etc.
- AccessControl
- does servery, adminy things, such as handle bans, kicks, cheats, etc.
- BroadcastHandler
- controls whether the player can say anything, recives any sort of ingame message, etc.
- New Iterators
- DynamicActors, loops over all actors that have been dynamically added since the game started (as opposed to "were statically present in the loaded map"). According to Mongo, all bStatic actors are "sorted" placed at the beginning of the actor list; all non-bStatic ones are placed after. The interator starts at the non-bStatic ones.
- AllObjects. The Garbage Collection array has been opened up to UnrealScript.
- More new native functions (besides Iterators)
- Hud drawing is simplified in the HUDBase? class, with the DrawSpriteWidget and DrawNumericWidget functions.
- Created
- All Objects now receive notification when they are created (similar to Actor.(Pre/Post)BeginPlay())
- Trig functions
- Asin(), Acos(), and Atan2() (the more exact atan) are open to unrealscript.
- DrawScale3D
- Can now scale by height, length, and width, as opposed to raw drawscale and fatness.
- Delegated Functions
- Basically method pointers, to be used in OnEvent-style events. See Delegate, UnrealScriptDelegates.
- Animation Control
- Coders will have a lot of control over animations, apparently. For instance, you can instruct an animation to only play for a certain bone (and its sub-bones), and a different animation on other bones. In other words, you can combine a running animation (for the legs) with a shooting animation (for the torso) and a talking or head turning animation (for the head). Source: [Nights Edge]
- Exec Directive
- new stuff in Exec Directive
- Class definition
- New modifier keywords and you can't use expands anymore. Always use extends now. (see Class Syntax)
- Actor names
- You'll find that actors you spawn will not have sequentially numbered names by default, instead they'll just have the name of their class which can make debugging tricky. Run UT2K3 with the "-makenames" switch and they'll be numbered just like in UT.
Mychaeel: I noticed an interesting new UnrealScript keyword in class ConstantColor (might be elsewhere too): cpptext { ... }
. Any ideas on that one?
EntropicLqd: Case-sensitive function delcarations that hook directly to C++ equivalents by the looks of it. Used in a fair number of places as well. Only used in native functions and only used to declare functions.
Mychaeel: I figured that much out myself. What I'm interested in is: What purpose does it serve? Does it directly output arbitrary C++ code into the C++ headers generated from the UnrealScript sources?
Trystan: I'm assuming you're working with the Epic sources and not the UnrealEd extracted sources. In the UnrealEd extracted sources each line of a cpptext indicator is simply // (cpptext), so apparently UnrealEd doesn't know what to do with it. A Google cached page showing it is at http://216.239.39.100/search?q=cache:pP3sM2uVC7oC:udn.epicgames.com/pub/Technical/AnimNotifies/+cpptext&hl=en&ie=UTF-8 - perhaps that will shed some light for your more experienced guys. (Er, the content isn't available straight from the Epic site since it's for licensees only, so I guess Mychaeel may want to delete this..) Looks like it's always used for virtual functions.. dunno, I'm sure you guys know all this.
Wormbo: I think I heared it in #unrealscript that the compiler comments out those lines to ensure the sources can be exported properly. Something with line numbers getting messed up.
Discussion
DJPaul: Need explanation/example of delegated functions quick sharp.
Wormbo: They are explained on the UDN: UnrealScriptDelegates