Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Creating a Particle Module

I was following this tutorial on creating a particle module and wanted to report some problems with it.

Non-exposed API

Firstly, as noted in this question, you can't write your own particle modules as the relevant classes are not in the public facing API. I don't know if there is a good reason for this, but it certainly should be noted in the tutorial.

BTW, this is a massive pain. I had hoped to create a plugin with some boid particle modules, but requiring people to change the engine makes this not feasible. It is a major limitation and annoyance.

Missing Include

Also pointed out in that question, the CPP file needs to #include "ParticleEmitterInstances.h".

Wrong Header File Code Sample

Secondly, the code sample provided for the header is not even valid C++. Instead it should read:

 UCLASS(editinlinenew, collapsecategories, hidecategories = Object)
 class BOIDPARTICLES_API UParticleModuleColourByVelocity : public UParticleModuleColorBase
     UParticleModuleColourByVelocity(const FObjectInitializer& PCIP);
     UPROPERTY(EditAnywhere, Category = Color)
     struct FRawDistributionVector ScaleVelocity;
     virtual void Spawn(FParticleEmitterInstance* Owner, int32 Offset, float SpawnTime, FBaseParticle* ParticleBase);
     virtual void Update(FParticleEmitterInstance* Owner, int32 Offset, float DeltaTime);    

Crucially, the UPROPERY decoration rather than the presumably old-style var stuff.

Wrong Source File Code Sample

Further, in the constructor body, instead of using the non-existent ConstructorHelpers::CreateDefaultSubobject it should use PCIP.CreateDefaultSubobject(this, TEXT("DistributionScaleVelocity")); where PCIP is the FObjectInitializer passed in the constructor.

No GPU Explanation

Finally, the tutorial goes in to no detail about how to make the module work on the GPU, perhaps because it isn't possible in general. In any case, it should be explicitly explained.

Product Version: UE 4.6
more ▼

asked Jun 03 '15 at 11:39 AM in C++ Programming

avatar image

646 44 59 91

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question