AWorldSettings::AWorldSettings(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer.DoNotCreateDefaultSubobject(TEXT("Sprite"))) { // Structure to hold one-time initialization struct FConstructorStatics { ConstructorHelpers::FObjectFinder<UClass> DmgType_Environmental_Object; FConstructorStatics() : DmgType_Environmental_Object(TEXT("/Engine/EngineDamageTypes/DmgTypeBP_Environmental.DmgTypeBP_Environmental_C")) { } }; static FConstructorStatics ConstructorStatics; bEnableWorldBoundsChecks = true; bEnableNavigationSystem = true; bEnableAISystem = true; bEnableWorldComposition = false; bEnableWorldOriginRebasing = false; #if WITH_EDITORONLY_DATA bEnableHierarchicalLODSystem = false; FHierarchicalSimplification LODBaseSetup; HierarchicalLODSetup.Add(LODBaseSetup); NumHLODLevels = HierarchicalLODSetup.Num(); #endif KillZ = -HALF_WORLD_MAX1; KillZDamageType = ConstructorStatics.DmgType_Environmental_Object.Object; WorldToMeters = 100.f; DefaultPhysicsVolumeClass = ADefaultPhysicsVolume::StaticClass(); GameNetworkManagerClass = AGameNetworkManager::StaticClass(); SetRemoteRoleForBackwardsCompat(ROLE_SimulatedProxy); bReplicates = true; bAlwaysRelevant = true; TimeDilation = 1.0f; MatineeTimeDilation = 1.0f; DemoPlayTimeDilation = 1.0f; PackedLightAndShadowMapTextureSize = 1024; bHidden = false; DefaultColorScale = FVector(1.0f, 1.0f, 1.0f); DefaultMaxDistanceFieldOcclusionDistance = 600; GlobalDistanceFieldViewDistance = 20000; bPlaceCellsOnlyAlongCameraTracks = false; VisibilityCellSize = 200; VisibilityAggressiveness = VIS_LeastAggressive; LevelLightingQuality = Quality_MAX; #if WITH_EDITORONLY_DATA bActorLabelEditable = false; #endif // WITH_EDITORONLY_DATA }
AAnimatedPlaneCharacter::AAnimatedPlaneCharacter(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer.DoNotCreateDefaultSubobject(ACharacter::MeshComponentName)) { // Try to create the sprite component m_animatedSprite = CreateOptionalDefaultSubobject<UAnimatedPlaneComponent>(AAnimatedPlaneCharacter::SpriteComponentName); if (m_animatedSprite) { m_animatedSprite->AlwaysLoadOnClient = true; m_animatedSprite->AlwaysLoadOnServer = true; m_animatedSprite->bOwnerNoSee = false; m_animatedSprite->bAffectDynamicIndirectLighting = true; m_animatedSprite->PrimaryComponentTick.TickGroup = TG_PrePhysics; m_animatedSprite->AttachParent = GetCapsuleComponent(); static FName CollisionProfileName(TEXT("CharacterMesh")); m_animatedSprite->SetCollisionProfileName(CollisionProfileName); m_animatedSprite->bGenerateOverlapEvents = false; m_animatedSprite->RelativeRotation = FRotator(90.0f, 0.0f, 0.0f); } // Don't rotate when the controller rotates. bUseControllerRotationPitch = false; bUseControllerRotationYaw = true; bUseControllerRotationRoll = false; // Create a camera boom attached to the root (capsule) CameraBoom = CreateDefaultSubobject<USpringArmComponent>(TEXT("CameraBoom")); CameraBoom->AttachTo(RootComponent); CameraBoom->bAbsoluteRotation = true; // Rotation of the character should not affect rotation of boom CameraBoom->bDoCollisionTest = false; CameraBoom->TargetArmLength = 500.f; CameraBoom->SocketOffset = FVector(0.f, 0.f, 75.f); CameraBoom->RelativeRotation = FRotator(0.f, 180.f, 0.f); // Create a camera and attach to boom SideViewCameraComponent = CreateDefaultSubobject<UCameraComponent>(TEXT("SideViewCamera")); SideViewCameraComponent->AttachTo(CameraBoom, USpringArmComponent::SocketName); SideViewCameraComponent->bUsePawnControlRotation = false; // We don't want the controller rotating the camera // Configure character movement GetCharacterMovement()->bOrientRotationToMovement = true; // Face in the direction we are moving.. GetCharacterMovement()->RotationRate = FRotator(0.0f, 720.0f, 0.0f); // ...at this rotation rate GetCharacterMovement()->GravityScale = 2.f; GetCharacterMovement()->AirControl = 0.80f; GetCharacterMovement()->JumpZVelocity = 1000.f; GetCharacterMovement()->GroundFriction = 3.f; GetCharacterMovement()->MaxWalkSpeed = 600.f; GetCharacterMovement()->MaxFlySpeed = 600.f; }
AGameModeBase::AGameModeBase(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer.DoNotCreateDefaultSubobject(TEXT("Sprite"))) { bNetLoadOnClient = false; bPauseable = true; bStartPlayersAsSpectators = false; DefaultPawnClass = ADefaultPawn::StaticClass(); PlayerControllerClass = APlayerController::StaticClass(); PlayerStateClass = APlayerState::StaticClass(); GameStateClass = AGameStateBase::StaticClass(); HUDClass = AHUD::StaticClass(); GameSessionClass = AGameSession::StaticClass(); SpectatorClass = ASpectatorPawn::StaticClass(); ReplaySpectatorPlayerControllerClass = APlayerController::StaticClass(); }
APaperCharacter::APaperCharacter(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer.DoNotCreateDefaultSubobject(ACharacter::MeshComponentName)) { // Try to create the sprite component Sprite = CreateOptionalDefaultSubobject<UPaperFlipbookComponent>(APaperCharacter::SpriteComponentName); if (Sprite) { Sprite->AlwaysLoadOnClient = true; Sprite->AlwaysLoadOnServer = true; Sprite->bOwnerNoSee = false; Sprite->bAffectDynamicIndirectLighting = true; Sprite->PrimaryComponentTick.TickGroup = TG_PrePhysics; Sprite->SetupAttachment(GetCapsuleComponent()); static FName CollisionProfileName(TEXT("CharacterMesh")); Sprite->SetCollisionProfileName(CollisionProfileName); Sprite->bGenerateOverlapEvents = false; } }
AUModCharacter::AUModCharacter(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer.DoNotCreateDefaultSubobject(ACharacter::MeshComponentName)) { // Set size for collision capsule GetCapsuleComponent()->InitCapsuleSize(42.f, 96.0f); // Create a CameraComponent PlayerCamera = CreateDefaultSubobject<UCameraComponent>(TEXT("FirstPersonCamera")); PlayerCamera->AttachParent = GetCapsuleComponent(); PlayerCamera->RelativeLocation = FVector(0, 0, 64.f); PlayerCamera->bUsePawnControlRotation = true; //Create a mesh component that will be used as world model PlayerModel = CreateDefaultSubobject<USkeletalMeshComponent>(TEXT("PlayerModel")); PlayerModel->SetOwnerNoSee(true); PlayerModel->AttachParent = PlayerCamera; PlayerModel->RelativeLocation = FVector(0.f, 0.f, -150.f); PlayerModel->bCastDynamicShadow = false; PlayerModel->CastShadow = false; if (Role == ROLE_Authority) { playerHealth = 100; playerMaxHealth = 100; } }