41 Commits

Author SHA1 Message Date
e06de3f37e Merge pull request 'MergedMenus' (#7) from MenusAndStuffpt2 into main
Reviewed-on: #7
2026-05-24 01:37:44 +00:00
Kukukakhew
9056e32b00 sortof working ADS but not really. 2026-05-23 21:16:56 -04:00
Kukukakhew
2b4db1367d Moved User Settings function to game instance
IMC contexts are mapped here.
2026-05-22 16:42:08 -04:00
Kukukakhew
b1d862ded9 Can now map controller buttons 2026-05-22 15:52:43 -04:00
Kukukakhew
365442bbb7 Removed unused apply button
using common button.
2026-05-22 15:26:18 -04:00
Kukukakhew
94816eb54b Removing obsolete Audio Slider BP 2026-05-22 15:11:09 -04:00
Kukukakhew
7d9c2dfce8 Moved Audio Sliders to Object Oriented setup
Code to modify sound settings migrated to Game Instance BP and just using a common slider widget for display.
2026-05-22 15:04:51 -04:00
Kukukakhew
bd5b2e9f3a Graphics Settings Rework
Moved to object oriented approach. Selector is a common asset that is reusable. Future changes to the look of the widget can be easily redone as all function for settings is handled by the game instance. The widget only needs to update its display and pass 2 strings back.
2026-05-17 11:01:21 -04:00
Kukukakhew
c8ade04bc8 Updated Mouse sensitivity Slider
Old blueprint was single purpose for just mouse sensitivity. This is now handled with the common slider. Code and setting changes have been migrated to the game instance.
2026-05-16 23:32:15 -04:00
Kukukakhew
12add78480 Multiple Changes to input and settings
Controller Input actions created with Controller IMC
Controller input events created.
Added Look sensitivity for controller.
Created reusable slider for controller sensitivity.
Created new reusable checkbox.
Implemented crouch toggle ect for controller and kept separate from mouse/keyboard settings.
2026-05-16 23:06:48 -04:00
Kukukakhew
9bdb9bac9a Added Controller Sensitivity 2026-05-15 23:19:51 -04:00
Kukukakhew
c959246bc7 MainMenu can be navigated by controller 2026-02-07 00:33:08 -05:00
Kukukakhew
e1986ef42f Added input events, added controller support for start menu 2026-02-02 21:48:32 -05:00
Kukukakhew
ee4371c320 Added Prone speed logic, still needs animation 2026-01-20 22:29:22 -05:00
Kukukakhew
6d97d86c1d Added Lean Toggle Functionality 2026-01-20 21:51:58 -05:00
Kukukakhew
9b0eef7e4f Sprint,Crouch,Prone,Lean toggle options in UI Settings 2026-01-20 20:59:37 -05:00
Kukukakhew
f40d53a6ba Initial speed replication bugfix 2026-01-16 21:27:55 -05:00
Kukukakhew
9d24abd287 Sprint/Crouch Network Replication 2026-01-16 21:17:19 -05:00
Kukukakhew
f00d4d1baf Added Input Actions for keyboard
No functionality, just the events and actions.
2026-01-04 02:16:08 -05:00
Kukukakhew
0ddc2363c0 Sprint Speed tuning
Plus some bug fixes that caused super speed.
2026-01-04 01:20:02 -05:00
Kukukakhew
9e071fd29e Added Sprint IA and speed modifier 2026-01-04 00:57:28 -05:00
Kukukakhew
5bf29d6cdb Merge branch 'MenusAndStuffpt2' of https://git.keeper317.com/Keeper317/open-conflict into MenusAndStuffpt2 2026-01-03 22:58:03 -05:00
Kukukakhew
cc1c8fa880 Added Crouch input/speed/logic 2026-01-03 22:53:17 -05:00
7d48a2d40b Merge pull request 'Merge pull request 'Main Rebase' (#5) from main into MenusAndStuffpt2' (#6) from MenusAndStuffpt2 into main
Reviewed-on: http://git.keeper317.com/Keeper317/open-conflict/pulls/6
2026-01-03 06:26:39 +00:00
0361eb2c00 Merge pull request 'Main Rebase' (#5) from main into MenusAndStuffpt2
Reviewed-on: http://git.keeper317.com/Keeper317/open-conflict/pulls/5
2026-01-03 06:25:23 +00:00
47e434f596 Merge remote-tracking branch 'open-conflict/main' 2026-01-03 01:24:59 -05:00
5f827eeadf Added Event for when character is damaged 2026-01-03 01:24:48 -05:00
970101a74c Fixed HUD Healthbar updates 2026-01-03 01:24:48 -05:00
3f02fd02e5 Added OnRep to health componenet 2026-01-03 01:24:48 -05:00
4662e6701a health var updates correctly on client when hit by projectile 2026-01-03 01:24:48 -05:00
ecd15c271f Working on netowrked projectiles 2026-01-03 01:24:47 -05:00
494d76833f setup hits on character 2026-01-03 01:24:07 -05:00
da46541a07 Added basics for projectile system
still needs hits on character
2026-01-03 01:24:07 -05:00
ef5830dea3 Merge pull request 'https://differentdirection.youtrack.cloud/issue/OC-3/Replication-Projectiles complete' (#3) from projectilebase into main
Reviewed-on: http://git.keeper317.com/Keeper317/open-conflict/pulls/3
2026-01-03 06:14:24 +00:00
c7e3a83497 Added Event for when character is damaged 2026-01-03 00:50:34 -05:00
646276ab2c Fixed HUD Healthbar updates 2026-01-03 00:23:57 -05:00
7b9a33abfe Added OnRep to health componenet 2026-01-03 00:10:33 -05:00
3b9a02b3b1 health var updates correctly on client when hit by projectile 2026-01-01 19:35:48 -05:00
dd3648f5b9 Working on netowrked projectiles 2025-12-08 21:35:24 -05:00
a3a120491d setup hits on character 2025-12-06 17:19:02 -05:00
eb402e0458 Added basics for projectile system
still needs hits on character
2025-12-05 23:57:59 -05:00
96 changed files with 317 additions and 14 deletions

View File

@@ -113,3 +113,6 @@ ConnectionType=USBOnly
bUseManualIPAddress=False bUseManualIPAddress=False
ManualIPAddress= ManualIPAddress=
[/Script/Engine.AudioSettings]
DefaultBaseSoundMix=/Game/Sounds/MainSoundMix.MainSoundMix

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,4 +1,5 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> <wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=83F7D316_002D1724_002D38F0_002D85D9_002D704D5DF137A0_002Fdl_003ASource_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003FProgram_0020Files_003FEpic_0020Games_003FUE_005F5_002E7_003FEngine_003FSource_002Fd_003ARuntime_002Fd_003AEngine_002Fd_003AClasses_002Fd_003AGameFramework_002Ff_003AActor_002Eh/@EntryIndexedValue">ForceIncluded</s:String> <s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=83F7D316_002D1724_002D38F0_002D85D9_002D704D5DF137A0_002Fdl_003ASource_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003FProgram_0020Files_003FEpic_0020Games_003FUE_005F5_002E7_003FEngine_003FSource_002Fd_003ARuntime_002Fd_003AEngine_002Fd_003AClasses_002Fd_003AGameFramework_002Ff_003AActor_002Eh/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=83F7D316_002D1724_002D38F0_002D85D9_002D704D5DF137A0_002Fdl_003ASource_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003FProgram_0020Files_003FEpic_0020Games_003FUE_005F5_002E7_003FEngine_003FSource_002Fd_003ARuntime_002Fd_003AEngine_002Fd_003AClasses_002Fd_003AGameFramework_002Ff_003ACharacterMovementComponent_002Eh/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=83F7D316_002D1724_002D38F0_002D85D9_002D704D5DF137A0_002Fdl_003ASource_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003FProgram_0020Files_003FEpic_0020Games_003FUE_005F5_002E7_003FEngine_003FSource_002Fd_003ARuntime_002Fd_003AEngine_002Fd_003AClasses_002Fd_003APhysicsEngine_002Ff_003APhysicsSpringComponent_002Eh/@EntryIndexedValue">ForceIncluded</s:String> <s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=83F7D316_002D1724_002D38F0_002D85D9_002D704D5DF137A0_002Fdl_003ASource_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003FProgram_0020Files_003FEpic_0020Games_003FUE_005F5_002E7_003FEngine_003FSource_002Fd_003ARuntime_002Fd_003AEngine_002Fd_003AClasses_002Fd_003APhysicsEngine_002Ff_003APhysicsSpringComponent_002Eh/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=83F7D316_002D1724_002D38F0_002D85D9_002D704D5DF137A0_002Fdl_003ASource_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003FProgram_0020Files_003FEpic_0020Games_003FUE_005F5_002E7_003FEngine_003FSource_002Fd_003ARuntime_002Fd_003AUMG_002Fd_003APublic_002Fd_003AComponents_002Ff_003AWidgetSwitcher_002Eh/@EntryIndexedValue">ForceIncluded</s:String></wpf:ResourceDictionary> <s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=83F7D316_002D1724_002D38F0_002D85D9_002D704D5DF137A0_002Fdl_003ASource_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003FProgram_0020Files_003FEpic_0020Games_003FUE_005F5_002E7_003FEngine_003FSource_002Fd_003ARuntime_002Fd_003AUMG_002Fd_003APublic_002Fd_003AComponents_002Ff_003AWidgetSwitcher_002Eh/@EntryIndexedValue">ForceIncluded</s:String></wpf:ResourceDictionary>

View File

@@ -9,6 +9,7 @@ UDDIHealth::UDDIHealth()
// Set this component to be initialized when the game starts, and to be ticked every frame. You can turn these features // Set this component to be initialized when the game starts, and to be ticked every frame. You can turn these features
// off to improve performance if you don't need them. // off to improve performance if you don't need them.
PrimaryComponentTick.bCanEverTick = true; PrimaryComponentTick.bCanEverTick = true;
SetIsReplicatedByDefault(true);
MaxHealth = 0; MaxHealth = 0;
CurrentHealth = 0; CurrentHealth = 0;
ClassName = ClassNames::Scout; ClassName = ClassNames::Scout;
@@ -41,7 +42,7 @@ void UDDIHealth::BeginPlay()
MaxHealth += seg; MaxHealth += seg;
CurrentHealth = MaxHealth; CurrentHealth = MaxHealth;
GEngine->AddOnScreenDebugMessage(-1, 5.0f, FColor::Cyan, FString::Printf(TEXT("CurrentHealth: %d"), CurrentHealth)); GEngine->AddOnScreenDebugMessage(-1, 5.0f, FColor::Emerald, FString::Printf(TEXT("CurrentHealth: %d"), CurrentHealth));
} }
@@ -81,10 +82,9 @@ void UDDIHealth::Heal()
// Called to cause damage // Called to cause damage
void UDDIHealth::TakeDamage(int DamageValue) void UDDIHealth::TakeDamage(int DamageValue)
{ {
// if (HealTimer.IsValid())
// HealTimer.Invalidate();
GetWorld()->GetTimerManager().ClearTimer(HealTimer); GetWorld()->GetTimerManager().ClearTimer(HealTimer);
CurrentHealth -= DamageValue; CurrentHealth -= DamageValue;
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Cyan, FString::Printf(TEXT("Client Hit\nHealth: %d"), CurrentHealth));
} }

View File

@@ -36,13 +36,13 @@ protected:
ClassNames ClassName; ClassNames ClassName;
/*Functions*/ /*Functions*/
UFUNCTION(BlueprintAuthorityOnly, BlueprintCallable, Category = "Health")
void TakeDamage(int DamageValue);
public: public:
/*Properties*/ /*Properties*/
/*Functions*/ /*Functions*/
UFUNCTION(BlueprintAuthorityOnly, BlueprintCallable, Category = "Health")
void TakeDamage(int DamageValue);
/*C++ only declarations*/ /*C++ only declarations*/
private: private:

View File

@@ -9,7 +9,7 @@ struct FHealthSegment : public FTableRowBase
GENERATED_BODY() GENERATED_BODY()
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Health Segments") UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Health Segments")
ClassNames Class; ClassNames Class = ClassNames::Basic;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Health Segments") UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Health Segments")
TArray<int> SegmentList; TArray<int> SegmentList;

View File

@@ -2,7 +2,10 @@
#include "DDICharacter.h" #include "DDICharacter.h"
#include "Components/CapsuleComponent.h"
#include "GameFramework/SpringArmComponent.h" #include "GameFramework/SpringArmComponent.h"
#include "OpenConflict/Weapons/Projectiles/ProjectileBase.h"
// Sets default values // Sets default values
ADDICharacter::ADDICharacter() ADDICharacter::ADDICharacter()
@@ -17,6 +20,12 @@ ADDICharacter::ADDICharacter()
CameraComponent->SetRelativeLocation(FVector(0.0f, 0.0f, 50.0f)); CameraComponent->SetRelativeLocation(FVector(0.0f, 0.0f, 50.0f));
CameraComponent->bUsePawnControlRotation = true; CameraComponent->bUsePawnControlRotation = true;
HealthComponent = CreateDefaultSubobject<UDDIHealth>(TEXT("HealthComponent"));
GetCapsuleComponent()->SetCollisionProfileName(TEXT("BlockAllDynamic"));
GetCapsuleComponent()->SetGenerateOverlapEvents(true);
GetCapsuleComponent()->SetNotifyRigidBodyCollision(true);
} }
@@ -25,6 +34,11 @@ void ADDICharacter::BeginPlay()
{ {
Super::BeginPlay(); Super::BeginPlay();
if (GetCapsuleComponent())
{
GetCapsuleComponent()->OnComponentHit.AddDynamic(this, &ADDICharacter::OnHit);
}
} }
// Called every frame // Called every frame
@@ -34,4 +48,69 @@ void ADDICharacter::Tick(float DeltaTime)
} }
void ADDICharacter::OnHit(UPrimitiveComponent* HitComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, FVector NormalImpulse, const FHitResult& Hit)
{
Server_CharacterHit(HitComponent, OtherActor, OtherComp, NormalImpulse, Hit);
}
void ADDICharacter::TakeDamage(int Damage)
{
HealthComponent->TakeDamage(Damage);
}
bool ADDICharacter::Server_SpawnProjectile_Validate()
{
return true;
}
void ADDICharacter::Server_SpawnProjectile_Implementation()
{
FVector Location = GetActorLocation();
FRotator Rotation = GetActorRotation();
FVector Dir = GetActorForwardVector();
Location += Dir * 200.f;
if (!ProjectileClass)
{
GEngine->AddOnScreenDebugMessage(1, 10.f, FColor::Emerald, "No Projectile Set");
return;
}
GetWorld()->SpawnActor<AActor>(ProjectileClass, Location, Rotation);
}
void ADDICharacter::Client_CharacterHit_Implementation()
{
TakeDamage(10);
OnDamageTaken();
}
bool ADDICharacter::Client_CharacterHit_Validate()
{
return true;
}
void ADDICharacter::Server_CharacterHit_Implementation(UPrimitiveComponent* HitComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, FVector NormalImpulse, const FHitResult& Hit)
{
if (AProjectileBase* Projectile = Cast<AProjectileBase>(OtherActor))
{
// if (Cast<ADDICharacter>(Projectile->Owner) == this)
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Emerald, "Damage dealt");
Client_CharacterHit();
}
}
bool ADDICharacter::Server_CharacterHit_Validate(UPrimitiveComponent* HitComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, FVector NormalImpulse, const FHitResult& Hit)
{
return true;
}
void ADDICharacter::OnRep_Health()
{
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, "Health Replicated");
}
void ADDICharacter::GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const
{
Super::GetLifetimeReplicatedProps(OutLifetimeProps);
DOREPLIFETIME(ADDICharacter, HealthComponent);
}

View File

@@ -4,7 +4,9 @@
#include "CoreMinimal.h" #include "CoreMinimal.h"
#include "Camera/CameraComponent.h" #include "Camera/CameraComponent.h"
#include "Components/DDIHealth.h"
#include "GameFramework/Character.h" #include "GameFramework/Character.h"
#include "Net/UnrealNetwork.h"
#include "DDICharacter.generated.h" #include "DDICharacter.generated.h"
@@ -12,20 +14,69 @@ UCLASS()
class OPENCONFLICT_API ADDICharacter : public ACharacter class OPENCONFLICT_API ADDICharacter : public ACharacter
{ {
GENERATED_BODY() GENERATED_BODY()
/*UPROPERTY and UFUNCTION declarations*/
private:
/*Properties*/
public: /*Functions*/
// Sets default values for this character's properties
ADDICharacter();
protected: protected:
/*Properties*/
/*Functions*/
UFUNCTION(BlueprintImplementableEvent, Category = "Events")
void OnDamageTaken();
public:
/*Properties*/
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Camera")
UCameraComponent* CameraComponent;
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Health", ReplicatedUsing=OnRep_Health)
UDDIHealth* HealthComponent;
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Projectile")
TSubclassOf<AActor> ProjectileClass;
/*Functions*/
UFUNCTION()
void OnHit(UPrimitiveComponent* HitComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, FVector NormalImpulse, const FHitResult& Hit);
UFUNCTION()
void TakeDamage(int Damage);
UFUNCTION(Server, Reliable, WithValidation, BlueprintCallable)
void Server_SpawnProjectile();
UFUNCTION(Client, Reliable, WithValidation, BlueprintCallable)
void Client_CharacterHit();
UFUNCTION(Server, Reliable, WithValidation, BlueprintCallable)
void Server_CharacterHit(UPrimitiveComponent* HitComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, FVector NormalImpulse, const FHitResult& Hit);
UFUNCTION()
void OnRep_Health();
/*C++ only declarations*/
private:
/*Properties*/
/*Functions*/
protected:
/*Properties*/
/*Functions*/
// Called when the game starts or when spawned // Called when the game starts or when spawned
virtual void BeginPlay() override; virtual void BeginPlay() override;
public: public:
/*Properties*/
/*Functions*/
// Sets default values for this character's properties
ADDICharacter();
// Called every frame // Called every frame
virtual void Tick(float DeltaTime) override; virtual void Tick(float DeltaTime) override;
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Camera")
UCameraComponent* CameraComponent;
}; };

View File

@@ -0,0 +1,52 @@
// Fill out your copyright notice in the Description page of Project Settings.
#include "ProjectileBase.h"
#include "OpenConflict/PlayerCharacter/DDICharacter.h"
// Sets default values
AProjectileBase::AProjectileBase()
{
// Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it.
PrimaryActorTick.bCanEverTick = true;
bReplicates = true;
bNetLoadOnClient = true;
InitialLifeSpan = 3.f;
collision = CreateDefaultSubobject<USphereComponent>("Collision");
RootComponent = collision;
collision->BodyInstance.SetCollisionProfileName(TEXT("BlockAllDynamic"));
projectileMesh = CreateDefaultSubobject<UStaticMeshComponent>("ProjectileMesh");
projectileMesh->SetupAttachment(collision);
projectileMotion = CreateDefaultSubobject<UProjectileMovementComponent>("ProjectileMovementComponent");
}
// Called when the game starts or when spawned
void AProjectileBase::BeginPlay()
{
Super::BeginPlay();
if (collision)
collision->OnComponentHit.AddDynamic(this, &AProjectileBase::OnHit);
}
// Called every frame
void AProjectileBase::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
}
void AProjectileBase::OnHit(UPrimitiveComponent* HitComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, FVector NormalImpulse, const FHitResult& Hit)
{
// if (ADDICharacter* character = Cast<ADDICharacter>(OtherActor))
Destroy();
}

View File

@@ -0,0 +1,64 @@
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "Components/SphereComponent.h"
#include "GameFramework/Actor.h"
#include "GameFramework/ProjectileMovementComponent.h"
#include "ProjectileBase.generated.h"
UCLASS()
class OPENCONFLICT_API AProjectileBase : public AActor
{
GENERATED_BODY()
/*UPROPERTY and UFUNCTION declarations*/
private:
/*Properties*/
/*Functions*/
protected:
/*Properties*/
/*Functions*/
public:
/*Properties*/
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Projectile")
UStaticMeshComponent* projectileMesh;
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Projectile")
USphereComponent* collision;
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Projectile")
UProjectileMovementComponent* projectileMotion;
/*Functions*/
UFUNCTION()
void OnHit(UPrimitiveComponent* HitComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, FVector NormalImpulse, const FHitResult& Hit);
/*C++ only declarations*/
private:
/*Properties*/
/*Functions*/
protected:
/*Properties*/
/*Functions*/
// Called when the game starts
virtual void BeginPlay() override;
public:
/*Properties*/
/*Functions*/
// Called every frame
virtual void Tick(float DeltaTime) override;
// Sets default values for this actor's properties
AProjectileBase();
};

View File

@@ -0,0 +1,27 @@
// Fill out your copyright notice in the Description page of Project Settings.
#include "WeaponBase.h"
// Sets default values
AWeaponBase::AWeaponBase()
{
// Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it.
PrimaryActorTick.bCanEverTick = true;
}
// Called when the game starts or when spawned
void AWeaponBase::BeginPlay()
{
Super::BeginPlay();
}
// Called every frame
void AWeaponBase::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
}

View File

@@ -0,0 +1,26 @@
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "WeaponBase.generated.h"
UCLASS()
class OPENCONFLICT_API AWeaponBase : public AActor
{
GENERATED_BODY()
public:
// Sets default values for this actor's properties
AWeaponBase();
protected:
// Called when the game starts or when spawned
virtual void BeginPlay() override;
public:
// Called every frame
virtual void Tick(float DeltaTime) override;
};