[Question][Request] How use Skel Mesh Vert Location for Particle Systems With a Weapon?

Dear Friends at Epic,

My goal = to use an emitter to spawn small fireball explosions from random places on the blade of a weapon that a character is holding, over time, via

Skel Mesh Vert Location
https://rocket.unrealengine.com/docs/ue4/INT/Engine/Subsystems/Rendering/ParticlesAndEffects/ParticleSystems/Reference/Modules/Location/index.html#skeletalmeshvertex/surfacelocation_skelvert/surfloc_


I have read the related documentation and have two issues:

#Issue 1

I can see how to set the Actor parameter via code:

UFUNCTION(BlueprintCallable, Category="Particles|Parameters")
void SetActorParameter(FName ParameterName, class AActor* Param);

But this seems to assume that the actor will be a skeletal mesh actor,

whereas my actor is a Character who has a weapon skeletal mesh attached by socket.

So it would seem to me that the way Skel Mesh Vert. Location system works needs expanded functionality to allow for specifying an exact Skeletal Mesh Component, rather than limiting to only using Skeletal Mesh Actors whose component is known to be exactly SkeletalMeshComponent?

(as opposed to a randomly named weapon skeletal mesh component pointer)


#Issue 2

The Editor Skeletal Mesh value, when given a value, does not cause any change within Cascade, the skeletal mesh component does not appear.


#Expansion of this Feature Would be Awesome

It would be awesome if we could use Characters and Character Weapons attached by socket (independent components from the Character itself)

with this feature!
https://rocket.unrealengine.com/docs/ue4/INT/Engine/Subsystems/Rendering/ParticlesAndEffects/ParticleSystems/Reference/Modules/Location/index.html#skeletalmeshvertex/surfacelocation_skelvert/surfloc_

:slight_smile:

Rama

Hi Rama,

We had a similar post come up in the Licensee side. I will copy the question & answer given for that. I hope it helps!


Question

Trying to get the Skel Vert/Surf Loc module to work on the player character. The problem I’m having is that I can’t set the Instance Parameters - Actor Parameter in the blueprint. I’ve tried setting it to the playerpawn, as well as a skeletal mesh actor spawned by the blueprint. I’ve even tried manually building the struct and setting the parameters actor parameter in the array element manually. It seems to only want to work with placed instances of a skeletal mesh actor.

Any information/advice is appreciated.


Answer

I’d guess the problem is in one of two places:

  1. Setting the parameter from blueprint is just not working. I wouldn’t expect this to be the case. You might try setting a code breakpoint to verify.

  2. The module is caching off the component before you set the parameter. You could try setting the parameter THEN calling SetTemplate to set the effect you want to fire off.

Dear Stephen,

Thanks for taking the time!

My question is more in regards to expanding this module to work with the Mesh of a Character

Currently the module only seems to work with Skeletal Mesh Actors where the skeletalmeshcomponent is the known component to apply the effect to.

But I would like to use a Character and also have the option to specify a weapon skeletal mesh that is a component added to the Character.

What is your sense of the ability or future ability to do something like this?

Thanks!

Rama

We plan to change the module so that you can specify any actor with it. Also, we may add an interface for specifying the component directly to handle cases in blueprint where you may have a multiple skeletal mesh components and wish to specify a particular component to use for spawning particles.

“Also, we may add an interface for specifying the component directly to handle cases in blueprint where you may have a multiple skeletal mesh components and wish to specify a particular component to use for spawning particles.”

That would be awesome Nick!

Then I can use my weapon components, which are native C++ components!

#Thanks Nick!

#:heart:

Rama

As per the rocket forum thread, you can use vertices or materials to emit from surfaces or meshes. This is a documented module:
https://udn.unrealengine.com/docs/ue4/INT/Engine/Subsystems/Rendering/ParticlesAndEffects/ParticleSystems/Reference/Modules/Location/index.html#skeletalmeshvertex/surfacelocation_skelvert/surfloc_

Here’s a basic example on how to set up an example in the world:

  1. Add a skeletal mesh to the level.
  2. Create a Particle System and open it.
  3. In Cascade, right-click on the emitter and choose a Location > Skel Vert/Surf Loc module.
  4. Click on Skel Vert/Surf Loc, and in the Properties panel, and fill in “Skel Mesh Actor Param Name”.
  5. Add the your new particle emitter to the level near the Skeletal Mesh.
  6. In the Details panel of the placed particle emitter, find the “Instance Parameters”, add a new element and enter your chosen parameter name.
  7. Set Param Type to PSPT_Actor
  8. For “Actor”, click the “Pick Actor” icon, and select the Skeletal Mesh actor located in the level

Hope it helps.

But that is for skeletal mesh actors pre-instanced in the world, what about characters only spawned at runtime, and what about weapon skeletal meshes that are also spawned at runtime?

As per my original post, I have already observed I can dynamically set the actor parameter at runtime, but I still cannot specify the name of the skeletal mesh component, so I am not sure how a skeletal mesh component is being chosen internally :slight_smile:

Rama

If you could, please duplicate the effect I am doing in my video on the forums, using a Character Mesh, using just the Cascade Module, and then tell me how you did it.

http://forums.epicgames.com/threads/980760-Replicating-Rainbow-Particle-Creatures-(Thank-You-Gift-to-Epic-for-UE4-C-)

What I am doing has nothing to do with Skeletal Mesh Actors, I am using Characters and Weapon Skeletal Mesh Components attached to Character root components.

The Mesh needs to be animated and running around as an in-game playable character.

I originally wanted to do this for weapons, so weapons must be fully functional and attached to their Character owner, not just a Skeletal Mesh Actor, placedi n the world somewhere :slight_smile:

I created this UDN because I would highly enjoy it if the Cascade functionality was expanded to include runtime spawned Characters and Skeletal Mesh Weapon Components. If this functionality already exists do let me know how to use it please

Looking forward to any ideas you have in this regard!

The workflow is different, but the process is the same.

ParticleSystemComponent contains a member called InstanceParameters:

UPROPERTY(EditAnywhere, BlueprintReadWrite, editinline, Category=Particles)
TArray InstanceParameters;

This struct contains a ParamType and can take a parameter of type PSPT_Actor:

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=ParticleSysParam)
TEnumAsByte ParamType;

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=ParticleSysParam)
class AActor* Actor;

Your issue is that this combination expects a skeletal mesh actor and as far as I can tell automatically picks the default mesh component of that actor. A reasonable solution at present is to make your sword a hard-attached actor and not a component.

[Feature Suggestion] For the future, I think I’d personally like to see a PSPT_Component param type, as this would be much more flexible - for example in this instance where there is an actor with more than one skeletal mesh component.

“Your issue is that this combination expects a skeletal mesh actor and as far as I can tell automatically picks the default mesh component of that actor. A reasonable solution at present is to make your sword a hard-attached actor and not a component.”

Dear Luke,

There’s something that just isn’t clicking here

If you like at the class hierarchy

AActor->APawn->ACharacter

AActor->ASkeletalMeshActor

#I am not working with SkeletalMeshActors

#I am working with AActor->APawn->ACharacter,

so I cannot use the Cascade Module since it seems to expect SkeletalMeshActors and determines which component to use automatically.

My tone:

I am just trying to make this clear, not yelling, I am trying to make it very very clear where I am having my issue which caused to me to create my own solution so I could do vertex PSCs on an animated in-game playable Character

I do appreciate your feedback Luke, and I hope between the two of us we’ve brought more attention to this topic

If there is some hidden way to get from Skeletal Mesh Actor to Character, and thus use the Cascade module, that I dont understand let me know :slight_smile:

#Video Proof of Concept

I hope you now see that my video is a proof of concept for animated Character Vertex Particle System Effects

Playable characters that you can control, moving around, made only of particles at the vertex level :slight_smile:

Video Link to Proof of Concept

:slight_smile:

Rama

“A reasonable solution at present is to make your sword a hard-attached actor and not a component.”

I am not yet convinced that is a reasonable solution given the quantity of weapons that I have and the way I want to be able switch among them on the fly.

Also, why in heaven’s name would I want to instance weapons as actors?!

I would then have to manage them and replicate them and hide them and this would make my combat collision system much more clumsy


We are both clearly demonstrating that this awesome Cascade Module could use some love and attention from Epic to make it even more awesome.

That is the point of this thread/post, and I am happy to have had your additional input, but I simply dont think the module can work well for Character meshes and weapon skel mesh components at present, which is what I am requesting :slight_smile:

I’ll give this a try later when I have time (perhaps tomorrow), but I don’t see why it won’t accept a Character or Pawn as the actor parameter, I believe it should work and find the first mesh component to work with. I’ve had it working myself before with a non-SkeletalMeshActor actor, but this was some time ago.

Let me know what you discover!

I look forward to hearing more about your research once you get a chance to do it :slight_smile:

Rama