I found the problem, but I have no idea why.
You might be able to help me.
As you can see I have a class UKDamageType
The header
/* <source>UKDamageType module KDamageType.h
Interface of the UKDamageType class.</source>
<copyright>Kadeo Classes Copyright 2014 - Kadeo, All rights reserved.
This source code is only intended as a supplement to the
Kadeo Class Reference and related electronic documentation
provided with the library. See these sources for detailed
information regarding Kadeo products.</copyright>
<code>Source/KSGM/Objects/Weapons/KDamageType.h</code>
<created>09/2014</created>
<author>dominique.aigroz@kadeo.net<author>
*/
#pragma once
#include "GameFramework/DamageType.h"
#include "GameFramework/ForceFeedbackEffect.h"
#include "KDamageType.generated.h"
/** @brief Values that represent EKDamageTypeEnum.
* http://chemistry.about.com/od/elementgroups/a/noblegaseslist.htm
* - Helium
* Atomic Number: 2
* Helium Symbol: He
* Atomic Weight: 4.002602(2)
*
* - Neon
* Atomic Number: 10
* Symbol: Ne
* Atomic Weight: 20.1797
*
* - Argon
* Atomic Number: 18
* Symbol: Ar
* Atomic Weight: 39.948
*
* - Krypton
* Atomic Number: 36
* Symbol: Kr
* Atomic Weight: 83.80
*
* - Xenon
* Atomic Number: 54
* Symbol: Xe
* Atomic Weight: 131.29
*
* - Radon
* Atomic Number: 86
* Symbol: Rn
* Atomic Weight: 222.0176
*/
UENUM(BlueprintType)
enum class EKDamageTypeEnum : uint8
{
KDT_Orange UMETA(DisplayName = DKT_GEN_HELIUMORANGE), // 0
KDT_Yellow UMETA(DisplayName = DKT_GEN_NEONYELLOW), // 1
KDT_Blue UMETA(DisplayName = DKT_GEN_ARGONBLUE), // 2
KDT_Gold UMETA(DisplayName = DKT_GEN_KRYPTONGOLD), // 3
KDT_Purple UMETA(DisplayName = DKT_GEN_XENONPURPLE), // 4
KDT_Red UMETA(DisplayName = DKT_GEN_RADONRED), // 5
KDT_Green UMETA(DisplayName = DKT_GEN_NEUTRALGREEN), // 6
KDT_Max UMETA(Hidden) // count = 7
};
/**
* @brief DamageType class that specifies type of damage.
*/
UCLASS(const, Blueprintable, BlueprintType)
class KSGM_API UKDamageType : public UDamageType
{
GENERATED_UCLASS_BODY()
/** physical damage ? */
UPROPERTY(EditDefaultsOnly, Category = Damage)
bool Physical;
/** this damage type */
UPROPERTY(EditDefaultsOnly, Category = Damage)
EKDamageTypeEnum Type;
/** force feedback effect to play on a player hit by this damage type */
UPROPERTY(EditDefaultsOnly, Category=Effects)
UForceFeedbackEffect *HitForceFeedback;
/** force feedback effect to play on a player killed by this damage type */
UPROPERTY(EditDefaultsOnly, Category=Effects)
UForceFeedbackEffect *KilledForceFeedback;
};
/**
* @brief DamageType class that specifies the suicide.
*/
UCLASS(const, Blueprintable, BlueprintType)
class KSGM_API UKDamageType_Suicide : public UKDamageType
{
GENERATED_UCLASS_BODY()
};
The source file
/* <source>UKDamageType module KDamageType.cpp
Implementation of the UKDamageType class.</source>
<copyright>Kadeo Classes Copyright 2014 - Kadeo, All rights reserved.
This source code is only intended as a supplement to the
Kadeo User's Guide and related electronic documentation
provided with the library. See these sources for detailed
information regarding the Kadeo product.</copyright>
<code>Source/KSGM/Objects/Weapons/KDamageType.cpp</code>
<created>09/2014</created>
<author>dominique.aigroz@kadeo.net<author>
<example>
</example>
*/
#include "KSGM.h"
#include "KDamageType.h"
UKDamageType::UKDamageType(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
{
// By default
Physical = true;
Type = EKDamageTypeEnum::KDT_Max;
HitForceFeedback = nullptr;
KilledForceFeedback = nullptr;
}
UKDamageType_Suicide::UKDamageType_Suicide(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
{
}
This class is referenced in an USTRUCT
/**
* @brief FKWeaponConfig structure contains information
* on the weapon configuration.
*/
USTRUCT()
struct FKWeaponConfig
{
GENERATED_USTRUCT_BODY()
/** current weapon state */
EKWeaponState::Type CurrentState;
/** is weapon fire active? */
uint32 bWantsToFire : 1;
/** time of last successful weapon fire */
float LastFireTime;
/** app time (FApp::GetCurrentTime()) of last successful weapon fire */
double LastFireAppTime;
/** The title for this config */
UPROPERTY(EditDefaultsOnly, Category = WeaponStat)
FText Title;
/** time between two consecutive shots */
UPROPERTY(EditDefaultsOnly, Category = WeaponStat)
float TimeBetweenShots;
/** type of damage */
UPROPERTY(EditDefaultsOnly, Category = WeaponStat)
TSubclassOf<UKDamageType> DamageType;
/** @brief An array of alterations to apply to player hit by this damage type. */
UPROPERTY(EditDefaultsOnly, Category = WeaponStat)
TArray<struct FKCharacterAlteration> Alterations;
/** the amount of power taken by this attack */
UPROPERTY(EditDefaultsOnly, Category = WeaponStat)
float PowerConsumption;
/** weapon range */
UPROPERTY(EditDefaultsOnly, Category = WeaponStat)
float WeaponRange;
/** if full damage must be applied. if not the damage are calculated progressively from the center point. */
UPROPERTY(EditDefaultsOnly, Category = WeaponHUD)
bool FullDamage;
/** if the weapon supports targeting. */
UPROPERTY(EditDefaultsOnly, Category = WeaponHUD)
bool SupportTargeting;
/** the icon texture used in the action bar for representing this config */
UPROPERTY(EditDefaultsOnly, Category = ActionBar)
TAssetPtr<UTexture2D> IconTexture;
/** the configuration structure for animations */
UPROPERTY(EditDefaultsOnly, Category = Animation)
FKWeaponConfigAnim ConfigAnim;
/** current weapon config type */
UPROPERTY(EditDefaultsOnly, Category = General)
EKWeaponConfigType ConfigCurrentType;
/** the configuration structure for an instant damage like a bullet */
UPROPERTY(EditDefaultsOnly, meta = (EditCondition = "DisplayInstantConfig"), Category = Config)
FKWeaponConfigInstant Instant;
/** Internal flag to show/hide the FKWeaponConfigInstant structure. */
UPROPERTY()
bool DisplayInstantConfig;
/** the configuration structure for an instant damage like a missile */
UPROPERTY(EditDefaultsOnly, meta = (EditCondition = "DisplayProjectileConfig"), Category = Config)
FKWeaponConfigProjectile Projectile;
/** Internal flag to show/hide the FKWeaponConfigProjectile structure. */
UPROPERTY()
bool DisplayProjectileConfig;
/** the configuration structure for an instant damage like a spell */
UPROPERTY(EditDefaultsOnly, meta = (EditCondition = "DisplaySpellConfig"), Category = Config)
FKWeaponConfigSpell Spell;
/** Internal flag to show/hide the FKWeaponConfigSpell structure. */
UPROPERTY()
bool DisplaySpellConfig;
/** the configuration structure for an self team spell */
UPROPERTY(EditDefaultsOnly, meta = (EditCondition = "DisplaySelfTeamConfig"), Category = Config)
FKWeaponConfigSelfTeam SelfTeam;
/** Internal flag to show/hide the FKWeaponConfigSelfTeam structure. */
UPROPERTY()
bool DisplaySelfTeamConfig;
/**
* @brief When the config type has changed.
*/
void OnWeaponConfigTypeChanged()
{
switch (ConfigCurrentType)
{
case EKWeaponConfigType::Instant:
{
DisplayInstantConfig = true;
DisplayProjectileConfig = false;
DisplaySpellConfig = false;
DisplaySelfTeamConfig = false;
// The instant config does not support targeting
SupportTargeting = false;
break;
}
case EKWeaponConfigType::Projectile:
{
DisplayInstantConfig = false;
DisplayProjectileConfig = true;
DisplaySpellConfig = false;
DisplaySelfTeamConfig = false;
break;
}
case EKWeaponConfigType::Spell:
{
DisplayInstantConfig = false;
DisplayProjectileConfig = false;
DisplaySpellConfig = true;
DisplaySelfTeamConfig = false;
break;
}
case EKWeaponConfigType::SelfTeam:
{
DisplayInstantConfig = false;
DisplayProjectileConfig = false;
DisplaySpellConfig = false;
DisplaySelfTeamConfig = true;
break;
}
}
};
/** defaults */
FKWeaponConfig(EKWeaponConfigType InType = EKWeaponConfigType::Instant)
{
CurrentState = EKWeaponState::Idle;
ConfigCurrentType = InType;
DisplayInstantConfig = false;
DisplayProjectileConfig = false;
DisplaySpellConfig = false;
bWantsToFire = false;
FullDamage = false;
SupportTargeting = false;
TimeBetweenShots = 1.0f;
PowerConsumption = 0.0f;
WeaponRange = 10000.0f;
DamageType = UKDamageType::StaticClass();
LastFireTime = 0.0f;
LastFireAppTime = 0.0f;
// Apply right states based on the current config type
OnWeaponConfigTypeChanged();
}
};
IF I comment this line
DamageType = UKDamageType::StaticClass();
in the constructor, I can cook.
Any idea ?