Btw I am “EverNewJoy” From the Forums:
My Tutorial Hub with lots of videos
Update
I tried editing the shootergame cpp files and using the rightclick vs file build feature as well
Dear Friends at Epic,
Hi there!
First of all thank you for the awesome UE4 engine!
I am trying to do a mostly code-based project.
I started with a third person c++ project.
I can run the project just fine in the editor.
I am using VS 2012 express.
-
In the editor if I launch vs it works just fine.
-
I can rebuild solution in VS
-
If I right click on uproject file and click “Generate Visual Studio Files” it does so quite happily without errors.
4. I have tried deleting the .sln file, which is recreated after #3 runs.
- But the changes I’ve made, either in VS or through external C++ editor, are not reflected in game (I right click on the uproject to run it by itself, but its the same in the editor too).
Here is the code I’ve changed that I am trying to get to show up in game.
Basically I extended the camera distance to 2000 as a test and I made it so the character yaw should rotate with controller
AVictoryGameCharacter::AVictoryGameCharacter(const class FPostConstructInitializeProperties& PCIP)
: Super(PCIP)
{
// Don't rotate when the controller rotates. Let that just affect the camera.
bUseControllerRotationPitch = false;
bUseControllerRotationYaw = true;
bUseControllerRotationRoll = false;
// Character moves in the direction of input...
CharacterMovement->bOrientToMovement = true;
// ...at this rotation rate
CharacterMovement->RotationRate = FRotator(360.0f, 360.0f, 360.0f);
// Create a follow camera
FollowCamera = PCIP.CreateDefaultSubobject(this, TEXT("FollowCamera"));
Components.Add(FollowCamera);
// Create a camera boom (pulls in towards the player if there is a collision)
CameraBoom = PCIP.CreateDefaultSubobject(this, TEXT("CameraBoom"));
CameraBoom->AttachTo(RootComponent);
Components.Add(CameraBoom);
// The camera follows at this distance behind the character
CameraBoom->TargetArmLength = 2000.0f;
// and offset by this amount
CameraBoom->SocketOffset = FVector::ZeroVector;
// Attach the camera to the end of the boom and let the boom adjust to match the controller orientation
// instead of the camera
FollowCamera->AttachTo(CameraBoom, USpringArmComponent::SocketName);
CameraBoom->bUseControllerViewRotation = true;
FollowCamera->bUseControllerViewRotation = false;
// Note: The skeletal mesh and anim blueprint references on the Mesh component (inherited from Character)
// are set in the derived blueprint asset named MyCharacter (to avoid direct content references in C++)
}
**Update:**
I downloaded the shootergame and edited the ShooterCharacter.cpp as follows:
The only change I made was to change the running speed modifier to 12
RunningSpeedModifier = 12f; //was 1.5
then I right clicked on shootergame.uproject to rebuild the vs files.
then I right click to play the shootergame
When sprint using SHIFT I the running speed is not reflecting my cpp edit
Please let me know how I can update cpp files and get them to show in game :)
AShooterCharacter::AShooterCharacter(const class FPostConstructInitializeProperties& PCIP)
: Super(PCIP.SetDefaultSubobjectClass(ACharacter::CharacterMovementComponentName))
{
Mesh1P = PCIP.CreateDefaultSubobject(this, TEXT("PawnMesh1P"));
Mesh1P->AttachParent = CapsuleComponent;
Mesh1P->bOnlyOwnerSee = true;
Mesh1P->bOwnerNoSee = false;
Mesh1P->bCastDynamicShadow = false;
Mesh1P->bReceivesDecals = false;
Mesh1P->SkinnedMeshUpdateFlag = SMU_OnlyTickPoseWhenRendered;
Mesh1P->PrimaryComponentTick.TickGroup = TG_PrePhysics;
Mesh1P->bChartDistanceFactor = false;
Mesh1P->BodyInstance.SetMovementChannel(ECC_PawnMovement);
Mesh1P->BodyInstance.SetCollisionEnabled(ECollisionEnabled::NoCollision);
Mesh1P->BodyInstance.SetResponseToAllChannels(ECR_Ignore);
Components.Add(Mesh1P);
Mesh->bOnlyOwnerSee = false;
Mesh->bOwnerNoSee = true;
Mesh->bReceivesDecals = false;
Mesh->BodyInstance.SetMovementChannel(ECC_PawnMovement);
Mesh->BodyInstance.SetCollisionEnabled(ECollisionEnabled::QueryAndPhysics);
Mesh->BodyInstance.SetResponseToChannel(COLLISION_WEAPON, ECR_Block);
Mesh->BodyInstance.SetResponseToChannel(COLLISION_PROJECTILE, ECR_Block);
Mesh->BodyInstance.SetResponseToChannel(ECC_Visibility, ECR_Block);
CapsuleComponent->BodyInstance.SetResponseToChannel(ECC_Camera, ECR_Ignore);
CapsuleComponent->BodyInstance.SetResponseToChannel(COLLISION_PROJECTILE, ECR_Block);
CapsuleComponent->BodyInstance.SetResponseToChannel(COLLISION_WEAPON, ECR_Ignore);
TargetingSpeedModifier = 0.5f;
bIsTargeting = false;
RunningSpeedModifier = 12f;
bWantsToRun = false;
bWantsToFire = false;
bReplicateHealthToAll = true;
LowHealthPercentage = 0.5f;
}