Detecting uncompiled MyLevel-Actors

Tutorials and discussions about Mapping - Introduce your own ones!
Post Reply
User avatar
Barbie
Godlike
Posts: 2792
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Detecting uncompiled MyLevel-Actors

Post by Barbie »

I noticed that in at least two maps ("MH-Asmodeus_Aions", "MH-CitadelV2{fix}") ScriptedPawns are embedded in MyLevel with uncompiled code. This results in strange effects, for example counting Monsters returns zero or Events on Monsters death are not risen.

Is there any way to detect Actors with uncompiled code? In T3D view they look equal:
Spoiler
uncompiled MH-Asmodeus_Aions wrote:

Code: Select all

Begin Actor Class=EAPupae Name=EAPupae0
    FootRegion=(Zone=ZoneInfo'MyLevel.ZoneInfo2',iLeaf=15,ZoneNumber=1)
    HeadRegion=(Zone=ZoneInfo'MyLevel.ZoneInfo2',iLeaf=15,ZoneNumber=1)
    Level=LevelInfo'MyLevel.LevelInfo0'
    Tag=EAPupae
    Base=LevelInfo'MyLevel.LevelInfo0'
    Region=(Zone=ZoneInfo'MyLevel.ZoneInfo2',iLeaf=15,ZoneNumber=1)
    Location=(X=-2.100036,Y=4656.000000,Z=656.000000)
    OldLocation=(X=-2.100036,Y=4656.000000,Z=656.000000)
    Name=EAPupae0
End Actor
compiled MH-Asmodeus_Aions wrote:

Code: Select all

Begin Actor Class=EAPupae Name=EAPupae0
    FootRegion=(Zone=ZoneInfo'MyLevel.ZoneInfo2',iLeaf=582,ZoneNumber=6)
    HeadRegion=(Zone=ZoneInfo'MyLevel.ZoneInfo2',iLeaf=582,ZoneNumber=6)
    Level=LevelInfo'MyLevel.LevelInfo0'
    Tag=EAPupae
    Base=LevelInfo'MyLevel.LevelInfo0'
    Region=(Zone=ZoneInfo'MyLevel.ZoneInfo2',iLeaf=582,ZoneNumber=6)
    Location=(X=-2.100036,Y=4656.000000,Z=656.000000)
    OldLocation=(X=-2.100036,Y=4656.000000,Z=656.000000)
    Name=EAPupae0
End Actor
<EDIT>
It is only a guess that the code is uncompiled, because I don't know how to detect. I conclude it because compiling and rebuilding the map makes these strange effects vanish.
</EDIT>
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
User avatar
sektor2111
Godlike
Posts: 6403
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Detecting uncompiled MyLevel-Actors

Post by sektor2111 »

The dude making that map was bitching at others "cube-drawers" but here he simply proved that he can do an a$$. I know that 0 counted monsters for that Level, so I changed those with normal monsters as long as "E" ones were dumber than sh!t. Example, get a slow nice ride through those Kralls, do not make noise or something, they are totally ignoring you = 0 battle.

Monsters Skaarj implemented directly in maps can be set for holding UT weaponry without to mock with a null subclass. Then look at "weapons" from that MyLevel...

Later conclusion: At a moment, doing some normal mistakes (each modder/mapper might do mistakes - it's human nature), but usually a normal dude returns to that work releasing a fix because of... some self respect. Oh well... I did not see any official fix released for this case... do drew conclusions...
User avatar
sektor2111
Godlike
Posts: 6403
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Detecting uncompiled MyLevel-Actors

Post by sektor2111 »

Bumping with something...
If you can capture whatever flags for these objects/actors un-compiled. I think they might have whatever flag "...BrokenLinks" or such. I have a small recall about what I read a few time ago where a message was supposed to be shown but I didn't figure it yet. I'm looking for a snippet.

Edit: I think flag it's called PKG_BrokenLinks, perhaps you can figure an external scripted solution for checking these flags and avoid these assets.
Spoiler

Code: Select all

	// CLASS functions
	//
	else if( ParseCommand(&Str,TEXT("CLASS")) )
	{
		if( ParseCommand(&Str,TEXT("SPEW")) )
		{
			UBOOL All = ParseCommand(&Str,TEXT("ALL"));
			for( TObjectIterator<UClass> It; It; ++It )
			{
				if( It->ScriptText && (All || (It->GetFlags() & RF_SourceModified)) )
				{
					// Make package directory.
					appStrcpy( TempFname, TEXT("..") PATH_SEPARATOR );
					appStrcat( TempFname, It->GetOuter()->GetName() );
					GFileManager->MakeDirectory( TempFname, 0 );

					// Make package\Classes directory.
					appStrcat( TempFname, PATH_SEPARATOR TEXT("Classes") );
					GFileManager->MakeDirectory( TempFname, 0 );

					// Save file.
					appStrcat( TempFname, PATH_SEPARATOR );
					appStrcat( TempFname, It->GetName() );
					appStrcat( TempFname, TEXT(".uc") );
					debugf( NAME_Log, TEXT("Spewing: %s"), TempFname );
					UExporter::ExportToFile( *It, NULL, TempFname );
				}
			}
			Processed=1;
		}
		else if( ParseCommand(&Str,TEXT("LOAD")) ) // CLASS LOAD FILE=..
		{
			if( Parse( Str, TEXT("FILE="), TempFname, 80 ) )
			{
				Ar.Logf( TEXT("Loading class from %s..."), TempFname );
				if( appStrfind(TempFname,TEXT("UC")) )
				{
					FName PkgName, ObjName;
					if
					(	Parse(Str,TEXT("PACKAGE="),PkgName)
					&&	Parse(Str,TEXT("NAME="),ObjName) )
					{
						// Import it.
						ImportObject<UClass>( CreatePackage(NULL,*PkgName), ObjName, RF_Public|RF_Standalone, TempFname );
					}
					else Ar.Log(TEXT("Missing package name"));
				}
				else if( appStrfind( TempFname, TEXT("U")) )
				{
					// Load from Unrealfile.
					UPackage* Pkg = Cast<UPackage>(LoadPackage( NULL, TempFname, LOAD_Forgiving ));
					if( Pkg && (Pkg->PackageFlags & PKG_BrokenLinks) )
					{
						debugf( TEXT("Some classes were broken; a recompile is required") );
						for( TObjectIterator<UClass> It; It; ++It )
						{
							if( It->IsIn(Pkg) )
							{
								It->Dependencies.Empty();
								It->Script.Empty();
							}
						}
					}
				}
				else Ar.Log( NAME_ExecWarning, TEXT("Unrecognized file type") );
			}
			else Ar.Log(NAME_ExecWarning,TEXT("Missing filename"));
			Processed=1;
		}
		else if( ParseCommand(&Str,TEXT("NEW")) ) // CLASS NEW
		{
			UClass *Parent;
			FName PackageName;
			if
			(	ParseObject<UClass>( Str, TEXT("PARENT="), Parent, ANY_PACKAGE )
			&&	Parse( Str, TEXT("PACKAGE="), PackageName )
			&&	Parse( Str, TEXT("NAME="), TempStr, NAME_SIZE ) )
			{
				UPackage* Pkg = CreatePackage(NULL,*PackageName);
				UClass* Class = new( Pkg, TempStr, RF_Public|RF_Standalone )UClass( Parent );
				if( Class )
					Class->ScriptText = new( Class->GetOuter(), TempStr, RF_NotForClient|RF_NotForServer )UTextBuffer;
				else
					Ar.Log( NAME_ExecWarning, TEXT("Class not found") );
			}
			Processed=1;
		}
	}
Post Reply