DestructibleComponent::ApplyDamage & ApplyRadiusDamage not exposed to Rocket Users

Dear Friends at Epic,

I am spawning an apex destructible BP via code this way:

ADestructibleActor* NewDestruct = 
	GetWorld()->SpawnActor(
		SkelHeadDestructBP, 
		VictoryUnit->GetActorLocation() + 256 * VictoryUnit->GetActorRotation().Vector(),
		FRotator::ZeroRotator, 
		SpawnInfo 
);

I have tried Various apply damage functions, ApplyRadialDamage and ApplyPointDamage

but I cannot get a spawned apex destructible to be destroyed by C++ code

The only way I know to destroy an apex from c++, and it is quite the hacky mess, is to do the following:

-get a ref to an actual ARadialForce that exists in the level

-move this radial force via C++ to location where I spawn the apex

-fire the radial force by using a BlueprintImplementableFunction, because the ARadialForce functions are not exposed to Rocket users

I also cannot get ApplyRadialForce to work in Blueprints.

So far the only method that works for me in editor or C++ is an ARadialForce actor that has Destructible Damage specifically set.

This is very limiting!

Here are the c++ functions I’ve tried:

NewDestruct->TakeDamage(
       300, 
       FDamageEvent(), 
	this, 
	VictoryUnit 
);


TArray IgnoreNone;
UGameplayStatics::ApplyRadialDamage(
	this, //world context
	50, 	//dmg
	NewDestruct->GetActorLocation(),  //origin
	512, 	//radius
	UDamageType::StaticClass(), 
	IgnoreNone, 
	VictoryUnit, 
	this, 
	false //full damage
);

#Custom Damage Type

I tried making a custom damage type and setting the appropriate variables that did not work either

#Any Ideas?

Any way you know I can destroy an apex from C++ without moving around an ARadialForce and using a blueprintimplementable function due to Rocket symbol exposure limitations?

Thanks!

#The Answer

The only way to apply damage to apex seems to be two functions nestled inside of DestructibleComponent

#Apply Damage and Apply Radius Damage Are Not Exposed to Rocket Users

#These are critical functions, ESSENTIAL


Please Expose to Rocket Users


NewDestruct->DestructibleComponent->ApplyDamage(
	300, 
        FVector::ZeroVector, 
	FVector::ZeroVector, 
	500
);

They cannot be called from C++ !!!

// Take damage
	UFUNCTION(BlueprintCallable, Category=Destruction)
	void ApplyDamage(float DamageAmount, const FVector& HitLocation, const FVector& ImpulseDir, float ImpulseStrength);

	// Take radius damage
	UFUNCTION(BlueprintCallable, Category=Destruction)
	void ApplyRadiusDamage(float BaseDamage, const FVector& HurtOrigin, float DamageRadius, float ImpulseStrength, bool bFullDamage);

#Major Functionality Loss of Destructible Meshes If You Cant Destroy Them From C++

#Working with DestructibleComponents at Runtime

Please expose the DestructibleComponent symbols to rocket users so I have any hope of working with Apex in UE4, currently it is all walled off from me

(I’m very upset about this)

#Thanks!

The whole of the UDestructibleComponent class should have been exposed as ENGINE_API in CL 1985070. Hopefully this will fix your problem in future! Sorry for the trouble.

woohooo thanks !

The whole of the class!

  • Starts Salivating *

!!!

#:heart:

UFUNCTION(BlueprintCallable, BlueprintAuthorityOnly, Category=“Game|Damage”, meta=(HidePin=“WorldContextObject”, DefaultToSelf=“WorldContextObject”, AutoCreateRefTerm=“IgnoreActors”))
static bool ApplyRadialDamage(UObject* WorldContextObject, float BaseDamage, const FVector& Origin, float DamageRadius, TSubclassOf DamageTypeClass, const TArray<AActor*>& IgnoreActors, AActor* DamageCauser=NULL, AController* InstigatedByController=NULL, bool bDoFullDamage=false );

Yep real nice, but we are still apparently missing a way to to Apply RadialImpulse… I attempted this with a blueprint barrel explosion, the function to radialimpulse did nothing… And I have started digigng thru code to see why…

DECLARE_FUNCTION(execAddRadialImpulse)
{
P_GET_STRUCT(FVector,Origin);
P_GET_PROPERTY(UFloatProperty,Radius);
P_GET_PROPERTY(UFloatProperty,Strength);
P_GET_PROPERTY(UByteProperty,Falloff);
P_GET_UBOOL(bVelChange);
P_FINISH;
this->AddRadialImpulse(Origin,Radius,Strength,ERadialImpulseFalloff(Falloff),bVelChange);

Being the Code used in the Blueprint, it should apply this force to the actor next to it that shot it :slight_smile:

Hi SteeleDriver,

This post is from pre-release, however your contribution is much appreciated. I will lock the comments and close the thread. Thank you!