Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames

Engine.LevelInfo


00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231
00232
00233
00234
00235
00236
00237
00238
00239
00240
00241
00242
00243
00244
00245
00246
00247
00248
00249
00250
00251
00252
00253
00254
00255
00256
00257
00258
00259
00260
00261
00262
00263
00264
00265
00266
00267
00268
00269
00270
00271
00272
00273
00274
00275
00276
00277
00278
00279
00280
00281
00282
00283
00284
00285
00286
00287
00288
00289
00290
00291
00292
00293
00294
00295
00296
00297
00298
00299
00300
00301
00302
00303
00304
00305
00306
00307
00308
00309
00310
00311
00312
00313
00314
00315
00316
00317
00318
00319
00320
00321
00322
00323
00324
00325
00326
00327
00328
00329
00330
00331
00332
00333
00334
00335
00336
00337
00338
00339
00340
00341
00342
00343
00344
00345
00346
00347
00348
00349
00350
00351
00352
00353
00354
00355
00356
00357
00358
00359
00360
00361
00362
00363
00364
00365
00366
00367
00368
00369
00370
00371
00372
00373
00374
00375
00376
00377
00378
00379
00380
00381
00382
00383
00384
00385
00386
00387
00388
00389
00390
00391
00392
00393
00394
00395
00396
00397
00398
00399
00400
00401
00402
00403
00404
00405
00406
00407
00408
00409
00410
00411
00412
00413
00414
00415
00416
00417
00418
00419
00420
00421
00422
00423
00424
00425
00426
00427
00428
00429
00430
00431
00432
00433
00434
00435
00436
00437
00438
00439
00440
00441
00442
00443
00444
00445
00446
00447
00448
00449
00450
00451
00452
00453
00454
00455
00456
00457
00458
00459
00460
00461
00462
00463
00464
00465
00466
00467
00468
00469
00470
00471
00472
00473
00474
00475
00476
00477
00478
00479
00480
00481
00482
00483
00484
00485
00486
00487
00488
00489
00490
00491
00492
00493
00494
00495
00496
00497
00498
00499
00500
00501
00502
00503
00504
00505
00506
00507
00508
00509
00510
00511
00512
00513
00514
00515
00516
00517
00518
00519
00520
00521
00522
00523
00524
00525
00526
00527
00528
00529
00530
00531
00532
00533
00534
00535
00536
00537
00538
00539
00540
//=============================================================================
// LevelInfo contains information about the current level. There should
// be one per level and it should be actor 0. UnrealEd creates each level's
// LevelInfo automatically so you should never have to place one
// manually.
//
// The ZoneInfo properties in the LevelInfo are used to define
// the properties of all zones which don't themselves have ZoneInfo.
//=============================================================================
class LevelInfo extends ZoneInfo
    native
    nativereplication
    notplaceable;

// Textures.
//#exec Texture Import File=Textures\WireframeTexture.tga // use white square instead
#exec Texture Import File=Textures\WhiteSquareTexture.pcx
#exec Texture Import File=Textures\S_Vertex.tga Name=LargeVertex

//-----------------------------------------------------------------------------
// Level time.

// Time passage.
var float TimeDilation;          // Normally 1 - scales real time passage.

// Current time.
var           float TimeSeconds;   // Time in seconds since level began play.
var transient int   Year;          // Year.
var transient int   Month;         // Month.
var transient int   Day;           // Day of month.
var transient int   DayOfWeek;     // Day of week.
var transient int   Hour;          // Hour.
var transient int   Minute;        // Minute.
var transient int   Second;        // Second.
var transient int   Millisecond;   // Millisecond.
var           float PauseDelay;     // time at which to start pause

//-----------------------------------------------------------------------------
// Level Summary Info

var(LevelSummary) localized String Title;
var(LevelSummary) String Author;
var(LevelSummary) String Description;

var(LevelSummary) Material Screenshot;
var(LevelSummary) String DecoTextName;

var(LevelSummary) int IdealPlayerCountMin;
var(LevelSummary) int IdealPlayerCountMax;

var(LevelSummary) string ExtraInfo;

var(SinglePlayer) int   SinglePlayerTeamSize;

var(RadarMap) Material RadarMapImage;
var(RadarMap) float CustomRadarRange;

var() config enum EPhysicsDetailLevel
{
    PDL_Low,
    PDL_Medium,
    PDL_High
} PhysicsDetailLevel;

var() config enum EMeshLODDetailLevel
{
    MDL_Low,
    MDL_Medium,
    MDL_High,
    MDL_Ultra
} MeshLODDetailLevel;


// Karma - jag
var(Karma) float KarmaTimeScale;        // Karma physics timestep scaling.
var(Karma) float RagdollTimeScale;      // Ragdoll physics timestep scaling. This is applied on top of KarmaTimeScale.
var(Karma) int   MaxRagdolls;           // Maximum number of simultaneous rag-dolls.
var(Karma) float KarmaGravScale;        // Allows you to make ragdolls use lower friction than normal.
var(Karma) bool  bKStaticFriction;      // Better rag-doll/ground friction model, but more CPU.

var()      bool bKNoInit;               // Start _NO_ Karma for this level. Only really for the Entry level.
// jag

var         int LastTaunt[2];               // 'Global' last taunts used.

var config float    DecalStayScale;     // affects decal stay time

var() localized string LevelEnterText;  // Message to tell players when they enter.
var()           string LocalizedPkg;    // Package to look in for localizations.
var             PlayerReplicationInfo Pauser;          // If paused, name of person pausing the game.
var     LevelSummary Summary;
var           string VisibleGroups;         // List of the group names which were checked when the level was last saved
//-----------------------------------------------------------------------------
// Flags affecting the level.

var(LevelSummary) bool HideFromMenus;
var() bool           bLonePlayer;     // No multiplayer coordination, i.e. for entranceways.
var bool             bBegunPlay;      // Whether gameplay has begun.
var bool             bPlayersOnly;    // Only update players.
var bool             bFreezeKarma;    // Stop all Karma physics from being evolved.
var const EDetailMode   DetailMode;   // Client detail mode.
var bool             bDropDetail;     // frame rate is below DesiredFrameRate, so drop high detail actors
var bool             bAggressiveLOD;  // frame rate is well below DesiredFrameRate, so make LOD more aggressive
var bool             bStartup;        // Starting gameplay.
var config bool      bLowSoundDetail;
var bool             bPathsRebuilt;   // True if path network is valid
var bool             bHasPathNodes;
var bool            bLevelChange;
var globalconfig bool bShouldPreload;   // if true, preload all skins (initially set true if > 512 MB of system memory)
var globalconfig bool bDesireSkinPreload; // user set property
var globalconfig bool bKickLiveIdlers;  // if true, even playercontrollers with pawns can be kicked for idling
var bool            bSkinsPreloaded;    // set after skins are preloaded
var bool bClassicView;                  // FOV at least 90, eyeheight up, small weapons OBSOLETE
var(RadarMap) bool bShowRadarMap;
var(RadarMap) bool bUseTerrainForRadarRange;
var bool bIsSaveGame;                   // true while save game is being loaded (GameInfo bIsSaveGame stays true through entire game)
var(SaveGames) bool bSupportSaveGames;      // needs to be true to support savegames

//-----------------------------------------------------------------------------
// Renderer Management.
var config bool bNeverPrecache;

var() int           LevelTextureLODBias;
var float AnimMeshGlobalLOD;   //State of the dDynamic LOD reduction for animating meshes.

//-----------------------------------------------------------------------------
// Legend - used for saving the viewport camera positions
var() vector  CameraLocationDynamic;
var() vector  CameraLocationTop;
var() vector  CameraLocationFront;
var() vector  CameraLocationSide;
var() rotator CameraRotationDynamic;

//-----------------------------------------------------------------------------
// Audio properties.

var(Audio) string   Song;           // Filename of the streaming song.
var(Audio) float    PlayerDoppler;  // Player doppler shift, 0=none, 1=full.
var(Audio) float    MusicVolumeOverride;

//-----------------------------------------------------------------------------
// Miscellaneous information.

var() float Brightness;

var texture DefaultTexture;
var texture WireframeTexture;
var texture WhiteSquareTexture;
var texture LargeVertex;
var int HubStackLevel;
var transient enum ELevelAction
{
    LEVACT_None,
    LEVACT_Loading,
    LEVACT_Saving,
    LEVACT_Connecting,
    LEVACT_Precaching
} LevelAction;

var transient GameReplicationInfo GRI;

//-----------------------------------------------------------------------------
// Networking.

var enum ENetMode
{
    NM_Standalone,        // Standalone game.
    NM_DedicatedServer,   // Dedicated server, no local client.
    NM_ListenServer,      // Listen server.
    NM_Client             // Client only, no local server.
} NetMode;
var string ComputerName;  // Machine's name according to the OS.
var string EngineVersion; // Engine version.
var string MinNetVersion; // Min engine version that is net compatible.

//-----------------------------------------------------------------------------
// Gameplay rules

var() string DefaultGameType;
var() string PreCacheGame;
var GameInfo Game;
var float DefaultGravity;
var float LastVehicleCheck;
var() float StallZ; //vehicles stall if they reach this

//-----------------------------------------------------------------------------
// Navigation point and Pawn lists (chained using nextNavigationPoint and nextPawn).

var const NavigationPoint NavigationPointList;
var const Controller ControllerList;
var private PlayerController LocalPlayerController;     // player who is client here

//-----------------------------------------------------------------------------
// Headlights
var(Headlights) bool    bUseHeadlights;
var(Headlights) float   HeadlightScaling;

//-----------------------------------------------------------------------------
// Server related.

var string NextURL;
var bool bNextItems;
var float NextSwitchCountdown;

//-----------------------------------------------------------------------------
// Global object recycling pool.

var transient ObjectPool    ObjectPool;

//-----------------------------------------------------------------------------
// Additional resources to precache (e.g. Playerskins).

var transient array<material>   PrecacheMaterials;
var transient array<staticmesh> PrecacheStaticMeshes;

// common static mesh (for camouflage combo)

var(Camouflage) StaticMesh IndoorCamouflageMesh;
var(Camouflage) float IndoorMeshDrawscale;
var(Camouflage) StaticMesh OutdoorCamouflageMesh;
var(Camouflage) float OutdoorMeshDrawscale;

// When kicking up dust in this level - what colour to use?
var(DustColor) color DustColor;
var(DustColor) color WaterDustColor;


//-----------------------------------------------------------------------------
// Replication/Networking
var float MoveRepSize;
var globalconfig float MaxClientFrameRate;

// speed hack detection
var globalconfig float MaxTimeMargin;
var globalconfig float TimeMarginSlack;
var globalconfig float MinTimeMargin;


// these two properties are valid only during replication
var const PlayerController ReplicationViewer;   // during replication, set to the playercontroller to
                                                // which actors are currently being replicated
var const Actor  ReplicationViewTarget;             // during replication, set to the viewtarget to
                                                // which actors are currently being replicated

//-----------------------------------------------------------------------------
// Functions.

native simulated function DetailChange(EDetailMode NewDetailMode);
native simulated function bool IsEntry();
native simulated function UpdateDistanceFogLOD(float LOD);
native simulated function ForceLoadTexture(Texture Texture);
native simulated function PhysicsVolume GetPhysicsVolume(vector Loc);       // returns PhysicsVolume which encompasses Loc

simulated function PostBeginPlay()
{
    Super.PostBeginPlay();
    DecalStayScale = Max(DecalStayScale,0);
}

simulated function class<GameInfo> GetGameClass()
{
    local class<GameInfo> G;

    if(Level.Game != None)
        return Level.Game.Class;

    if (GRI != None && GRI.GameClass != "")
        G = class<GameInfo>(DynamicLoadObject(GRI.GameClass,class'Class'));
    if(G != None)
        return G;

    if ( DefaultGameType != "" )
        G = class<GameInfo>(DynamicLoadObject(DefaultGameType,class'Class'));

    return G;
}

simulated event FillPrecacheMaterialsArray( bool FullPrecache )
{
    local Actor A;
    local class<GameInfo> G;
    local bool bRealDesire;

    if ( NetMode == NM_DedicatedServer )
        return;
    if ( !bSkinsPreloaded || FullPrecache )
    {
        if ( Game != None )
            G = Game.Class;
        else if ( (GRI != None) && (GRI.GameClass != "") )
            G = class<GameInfo>(DynamicLoadObject(GRI.GameClass,class'Class'));
        if ( G != None )
        {
            G.Static.PreCacheGameTextures(self);
            bSkinsPreloaded = true;
        }
        if ( (G == None) && (DefaultGameType != "") )
            G = class<GameInfo>(DynamicLoadObject(DefaultGameType,class'Class'));
        if ( G == None )
            G = class<GameInfo>(DynamicLoadObject(PreCacheGame,class'Class'));
        if ( G != None )
        {
            bRealDesire = bDesireSkinPreload;
            bDesireSkinPreload = false;
            G.Static.PreCacheGameTextures(self);
            bDesireSkinPreload = bRealDesire;
        }
    }
    ForEach AllActors(class'Actor',A)
    {
        if ( !A.bAlreadyPrecachedMaterials || FullPrecache )
        {
            A.UpdatePrecacheMaterials();
            A.bAlreadyPrecachedMaterials = true;
        }
    }
}

// OBSOLETE
simulated function PrecacheAnnouncements();

simulated event FillPrecacheStaticMeshesArray( bool FullPrecache )
{
    local Actor A;
    local class<GameInfo> G;

    if ( NetMode == NM_DedicatedServer )
        return;
    if ( Game == None )
    {
        if ( (GRI != None) && (GRI.GameClass != "") )
            G = class<GameInfo>(DynamicLoadObject(GRI.GameClass,class'Class'));
        if ( (G == None) && (DefaultGameType != "") )
            G = class<GameInfo>(DynamicLoadObject(DefaultGameType,class'Class'));
        if ( G == None )
            G = class<GameInfo>(DynamicLoadObject(PreCacheGame,class'Class'));
        if ( G != None )
            G.Static.PreCacheGameStaticMeshes(self);
    }

    ForEach AllActors(class'Actor',A)
        if ( !A.bAlreadyPrecachedMeshes || FullPrecache )
        {
            A.UpdatePrecacheStaticMeshes();
            A.bAlreadyPrecachedMeshes = true;
        }
}

simulated function AddPrecacheMaterial(Material mat)
{
    local int Index;

    if ( NetMode == NM_DedicatedServer )
        return;
    if (mat == None)
        return;

    Index = Level.PrecacheMaterials.Length;
    PrecacheMaterials.Insert(Index, 1);
    PrecacheMaterials[Index] = mat;
}

simulated function AddPrecacheStaticMesh(StaticMesh stat)
{
    local int Index;

    if ( NetMode == NM_DedicatedServer )
        return;
    if (stat == None)
        return;

    Index = Level.PrecacheStaticMeshes.Length;
    PrecacheStaticMeshes.Insert(Index, 1);
    PrecacheStaticMeshes[Index] = stat;
}

//
// Return the URL of this level on the local machine.
//
native simulated function string GetLocalURL();

//
// Demo build flag
//
native simulated static final function bool IsDemoBuild();  // True if this is a demo build.

// software rendering flag
native simulated static final function bool IsSoftwareRendering();

//
// Return the URL of this level, which may possibly
// exist on a remote machine.
//
native simulated function string GetAddressURL();

//
// Returns whether we are currently in the process of connecting to a URL
//
native simulated function bool IsPendingConnection();

//
// Jump the server to a new level.
//
event ServerTravel( string URL, bool bItems )
{
    if ( InStr(url,"%")>=0 )
    {
        log("URL Contains illegal character '%'.");
        return;
    }

    if (InStr(url,":")>=0 || InStr(url,"/")>=0 || InStr(url,"\\")>=0)
    {
        log("URL blocked");
        return;
    }

    if( NextURL=="" )
    {
        bLevelChange = true;
        bNextItems          = bItems;
        NextURL             = URL;
        if( Game!=None )
            Game.ProcessServerTravel( URL, bItems );
        else
            NextSwitchCountdown = 0;
    }
}

//
// ensure the DefaultPhysicsVolume class is loaded.
//
function ThisIsNeverExecuted()
{
    local DefaultPhysicsVolume P;
    P = None;
}

/* Reset()
reset actor to initial state - used when restarting level without reloading.
*/
function Reset()
{
    DefaultGravity =  Default.DefaultGravity;

    // perform garbage collection of objects (not done during gameplay)
    ConsoleCommand("OBJ GARBAGE");
    Super.Reset();
}

//-----------------------------------------------------------------------------
// Network replication.

replication
{
    reliable if( bNetDirty && Role==ROLE_Authority )
        Pauser, TimeDilation, DefaultGravity;

    reliable if( bNetInitial && Role==ROLE_Authority )
        RagdollTimeScale, KarmaTimeScale, KarmaGravScale;
}

//
//	PreBeginPlay
//

simulated event PreBeginPlay()
{
    // Create the object pool.
    Super.PreBeginPlay();

    ObjectPool = new(xLevel) class'ObjectPool';
}

simulated function PlayerController GetLocalPlayerController()
{
    local PlayerController PC;

    if ( Level.NetMode == NM_DedicatedServer )
        return None;
    if ( LocalPlayerController != None )
        return LocalPlayerController;

    ForEach DynamicActors(class'PlayerController', PC)
    {
        if ( Viewport(PC.Player) != None )
        {
            LocalPlayerController = PC;
            break;
        }
    }
    return LocalPlayerController;
}

defaultproperties
{
     TimeDilation=1.100000
     Title="Untitled"
     Author="Anonymous"
     IdealPlayerCountMin=6
     IdealPlayerCountMax=10
     CustomRadarRange=10000.000000
     PhysicsDetailLevel=PDL_Medium
     MeshLODDetailLevel=MDL_Medium
     KarmaTimeScale=0.900000
     RagdollTimeScale=1.000000
     MaxRagdolls=4
     KarmaGravScale=1.000000
     bKStaticFriction=True
     DecalStayScale=1.000000
     VisibleGroups="None"
     DetailMode=DM_SuperHigh
     bShowRadarMap=True
     bUseTerrainForRadarRange=True
     AnimMeshGlobalLOD=1.000000
     MusicVolumeOverride=-1.000000
     Brightness=1.000000
     DefaultTexture=Texture'Engine.DefaultTexture'
     WireframeTexture=Texture'Engine.WhiteSquareTexture'
     WhiteSquareTexture=Texture'Engine.WhiteSquareTexture'
     LargeVertex=Texture'Engine.LargeVertex'
     PreCacheGame="xGame.xDeathMatch"
     DefaultGravity=-950.000000
     StallZ=10000.000000
     bUseHeadlights=True
     HeadlightScaling=1.000000
     IndoorMeshDrawscale=1.000000
     OutdoorMeshDrawscale=1.000000
     WaterDustColor=(B=255,G=255,R=255)
     MoveRepSize=42.000000
     MaxClientFrameRate=90.000000
     MaxTimeMargin=1.000000
     TimeMarginSlack=1.350000
     MinTimeMargin=-1.000000
     bWorldGeometry=True
     bAlwaysRelevant=True
     RemoteRole=ROLE_DumbProxy
     bHiddenEd=True
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: Mon 23/10/2006 20:25:18.000 - Creation time: Wed 7/2/2007 19:16:43.140 - Created with UnCodeX