PDA

View Full Version : UT3 Source Code.....



bushbomb
12-12-2007, 12:59 PM
Using UDE and doing Export All Scripts under the Actors is what I did. It appears the classes are all exported and I was able to build a good class tree through WOTgreal Dev version.

The problem is that a lot of the code is Omitted for a lack of a better word. It looks like all the classes are exported, but some of the important files only seem to have a couple lines of code when there is clearly a lot of things that are programmed in it. Yes, there's enough to work with, but a lot of what I need to see how some of the UT2004 code would be changed to UT3 isn't in there. With UT2004 the downloaded source code seemed to be complete letting me understand how to make additions to my own mods.

Am I missing something or do you guys have the same results?

MrCobra
12-12-2007, 01:23 PM
I exported all scripts in tact after I installed the patch(es). I couldn't get it to fully export with the unpatched retail version.

bushbomb
12-12-2007, 01:26 PM
I'm on the version 1.1 patch and it says it exports all, but there appears to be a lot of code not inside some of the *.uc files on purpose. I have some examples, but the computer I code on is off at the house.

Pfhoenix
12-12-2007, 01:37 PM
I'd be willing to bet that the classes you're talking about simply have a lot of blank lines just after the class declaration, and that you didn't see that you could scroll down.

Bob_Gneu
12-12-2007, 01:38 PM
There are quite a few spots in the .uc code that are commented out and redacted because it was originally written in cpp. In order to be any more specific or helpful i would need to see an example of one of these files.

// (cpptext)

bushbomb
12-12-2007, 01:46 PM
There are quite a few spots in the .uc code that are commented out and redacted because it was originally written in cpp. In order to be any more specific or helpful i would need to see an example of one of these files.

// (cpptext)

that's what I see. For example, Interaction.uc is like so....


/**
* Copyright 1998-2007 Epic Games, Inc. All Rights Reserved.
*/
class Interaction extends UIRoot
native(UserInterface)
transient;

// (cpptext)
// (cpptext)
// (cpptext)
// (cpptext)
// (cpptext)
// (cpptext)
// (cpptext)
// (cpptext)
// (cpptext)
// (cpptext)
// (cpptext)
// (cpptext)

and a lot of (cpptext) lines later there is a few little functions at the end.

Bob_Gneu
12-12-2007, 02:12 PM
Yes, this is normal. its to tease you.

It was written in cpp to increase speed.

JaFO
12-12-2007, 02:29 PM
Indeed. The previous versions of UT also didn't export 'everything' that was in the scripts.
Epic also released an 'official' version of the scripts.

Keep in mind that you should never have to edit those files directly. It is an OOP so you can just subclass anything that needs changes. You'll only run into problems if you need to get at the core-classes, but chances are that you aren't following Epic's way of thinking or it simply is impossible as it requires native support.

bushbomb
12-12-2007, 02:31 PM
I just want example code really. The public release of the UT2004 Source codes had a lot more useful information to Guide us than the current exported script in my opinion.

Bob_Gneu
12-12-2007, 02:40 PM
no way, there are tons of uscript examples in there.
2k3/2k4 had the same.

JaFO
12-12-2007, 03:10 PM
Also look at the 'test-classes' that are in the code already.
They show how to use a few of the new features like interfaces ...

More documentation does help though, I'll have to agree but I also know how difficult it is to keep your code documented as it is a lot of work for something you don't expect to need yourself.

Bonehed316
12-12-2007, 09:58 PM
The official scripts are a much better place to get your source from, since you dont get all the ObjectArchetype garbage that you get form the exported ones.

Bob_Gneu
12-13-2007, 04:51 PM
What do you mean by "The official scripts" ?

Eliot
12-13-2007, 05:49 PM
What do you mean by "The official scripts" ?

released by epic games and not just exported with the editor.

Bob_Gneu
12-13-2007, 07:13 PM
Do you have a link? How are these ones that are released by epic more official than the ones that we explort from their packages?

Bonehed316
12-14-2007, 12:54 AM
http://udn.epicgames.com/Three/UT3Mods.html#UnrealScript%20Source%20Files

They are "more official" because they're the exact ones epic used to compile the game you're playing, minus the cpptext, for obvious reasons.

Theyre BETTER because they dont have a lot of the "garbage" that the other ones do.

As an example, heres the default properties of Projectile.uc



defaultproperties
{
TickGroup=TG_PreAsyncWork

Begin Object Class=SpriteComponent Name=Sprite
Sprite=Texture2D'EngineResources.S_Actor'
HiddenGame=True
AlwaysLoadOnClient=False
AlwaysLoadOnServer=False
End Object
Components.Add(Sprite)

Begin Object Class=CylinderComponent Name=CollisionCylinder
CollisionRadius=0
CollisionHeight=0
AlwaysLoadOnClient=True
AlwaysLoadOnServer=True
End Object
CollisionComponent=CollisionCylinder
CylinderComponent=CollisionCylinder
Components.Add(CollisionCylinder)

bCanBeDamaged=true
DamageRadius=+220.0
MaxSpeed=+02000.000000
Speed=+02000.000000
bRotationFollowsVelocity=false
bCollideActors=true
bCollideWorld=true
bNetTemporary=true
bGameRelevant=true
bReplicateInstigator=true
Physics=PHYS_Projectile
LifeSpan=+0014.000000
NetPriority=+00002.500000
MyDamageType=class'DamageType'
RemoteRole=ROLE_SimulatedProxy
NetCullDistanceSquared=+400000000.0
bBlockedByInstigator=true
}


You'll notice this is much cleaner than the version you export, as it doesn't have all the ObjectArchetype stuff, and the optional properties in and around the Begin Object / End Object blocks.

Pfhoenix
12-14-2007, 10:11 AM
That's the first I've seen of Epic released source for UT3. It ought to be announced better.

That page has seriously lacking documentation on publishing and cooking behavior, such as files being deleted from Published when a map is cooked/published, or how publishing a map cooks it and all its dependencies.

CaptainSnarf
12-14-2007, 01:07 PM
OMFG that needs to be announced at the top of Epics lungs!

I've been struggling with the exported scripts this whole time and they were gonna release that stuff the whole time?

Bob_Gneu
12-14-2007, 01:59 PM
Struggling? im not sure i see the benefit. If the code is exported and has only extra crap in it (namely extended defaultproperties and the commented out cpp tags all over the place) than how can you be struggling?

I just exported the code as of 1.1. update and from what i can see the code that i have hasnt even been updated. Ive exported four times thinking i must have something wrong. Bravo with finding this. There are quite a few files that are missing from the export that are in the 1.1 update, although they appear to be map related. This is quite distressing to see.

Mysterial
12-14-2007, 02:12 PM
such as files being deleted from Published when a map is cooked/published

That should have been fixed by the patch.

CaptainSnarf
12-16-2007, 11:31 AM
Struggling? im not sure i see the benefit. If the code is exported and has only extra crap in it (namely extended defaultproperties and the commented out cpp tags all over the place) than how can you be struggling?

I just exported the code as of 1.1. update and from what i can see the code that i have hasnt even been updated. Ive exported four times thinking i must have something wrong. Bravo with finding this. There are quite a few files that are missing from the export that are in the 1.1 update, although they appear to be map related. This is quite distressing to see.

I was struggling because:

1. I did not know what a lot of that stuff was in the exported scripts, stuff that's not in the released source. Archetype, etc. I'm a n00b.

2. I wasn't reading the error messages in front of me :rolleyes: . "When subclassing, don't include Class=XXX ". Some of the exported scripts will have 'Class=XXX' lines when the original source doesn't. Because of that, I was having success with the original source while failing with the export scripts even though I was following the exact same steps.

I'm very new to modding. I wasn't sure how it worked and I never expected Epic to release source like that. I thought the 'export scripts' feature was just a hack the rest of us were using to have some place to start out from. With the source release all I have to say is holy crap thanks Epic!