Section 4.5. rdSpawnStuffActor – Data and Structures

// [rdInst v1.35] Drag Meshes from the content browser into this list in the editor to populate the spawn data
TArray<UStaticMesh*> dragInMeshes;

// [rdInst v1.35] Drag Actors from the content browser into this list in the editor to populate the spawn data
TArray<UObject*> dragInActors;

// [rdInst v1.35] Drag NiagaraSystems from the content browser into this list in the editor to populate the spawn data
TArray<UNiagaraSystem*> dragInVFX;

// [rdInst v1.35] Drag Actors in the level into this list in the editor to populate the spawn data
TArray<AActor*> dragInLiveActors;

// [rdInst v1.35] Object Data that gets spawned
TArray<FrdSpawnStuffData> spawnData={FrdSpawnStuffData()};

// [rdInst v1.35] Current SpawnData index (usually controlled by the scalability level)
int32 currentSpawnDataIndex=0;

// [rdInst v1.35] True when this SpawnActor has spawned
bool hasSpawned=false;

// [rdInst v1.35] non-zero when objects are still spawning with distributed spawns
uint8 isStillSpawning=0;

// [rdInst v1.35] Pointer to the Landscape
ALandscape* landscape=nullptr;

// [rdInst v1.35] Pointer to the Landscape
FVector4 landscapeScale=FVector4(0.0f,0.0f,1.0f,1.0f);

// [rdInst v1.35] Root Component
USceneComponent* popRootComponent=nullptr;

// [rdInst v1.35] Volume Box
UBoxComponent* volumeBox=nullptr;

// [rdInst v1.35] FrdSpawnStuffData Structure
// The details of the spawn area and type, the rdSpawnStuffActor has one of these, but when 
//   spawning SpawnPoints - just this struct is stored to avoid the need for unnecessary actors in the level
USTRUCT(BlueprintType)
struct FrdSpawnStuffData {
	GENERATED_BODY()
public:

	UPROPERTY(EditAnywhere,BlueprintReadWrite,Category=rdSpawnStuffActor)
	TArray<FrdObjectPlacementData> items;

	// The distance at which to spawn items, 0 = always spawn
	UPROPERTY(EditAnywhere,BlueprintReadWrite,Category=rdSpawnStuffActor)
	double				distance=0.0f;

	// The bounds of the spawn volume
	UPROPERTY(EditAnywhere,BlueprintReadWrite,Category=rdSpawnStuffActor)
	FBoxSphereBounds	bounds;

	// The over-all density for the spawn data
	UPROPERTY(EditAnywhere,BlueprintReadWrite,Category=rdSpawnStuffActor)
	float				mainDensity=1.0f;

	// Width of the grid - the larger the value, the less populated 
	UPROPERTY(Category=rdSpawnStuffActor,EditAnywhere,BlueprintReadWrite)
	float				gridWidth=2000.0f;

	// Height of the grid - the larger the value, the less populated 
	UPROPERTY(Category=rdSpawnStuffActor,EditAnywhere,BlueprintReadWrite)
	float				gridHeight=2000.0f;

	// Splatmap to use for controlling the spawn data
	UPROPERTY(EditAnywhere,BlueprintReadWrite,Category=rdSpawnStuffActor)
	UTexture2D*			splatMap=nullptr;

	// Splatmap covers the entire Landscape
	UPROPERTY(EditAnywhere,BlueprintReadWrite,Category=rdSpawnStuffActor)
	bool				splatMapCoversLandscape=true;

	// Number of frames to split the spawning over
	UPROPERTY(Category=rdSpawnStuffActor,EditAnywhere,BlueprintReadWrite)
	int32				distributeFrames=1;

	// Data stored by the baking process - do not touch
	UPROPERTY(EditDefaultsOnly,Category=rdSpawnStuffActor,meta=(DisplayName="(Do Not Edit)"))
	TArray<FrdBakedSpawnObjects>	bakedData;
};

// [rdInst v1.35] FrdBakedSpawnObjects Structure
// Contains the type of object to create and a list of the transforms
USTRUCT(BlueprintType)
struct FrdBakedSpawnObjects {
	GENERATED_BODY()
public:

	UPROPERTY(Category=rdBakedSpawnObjects,EditAnywhere)
	UStaticMesh*	mesh=nullptr;

	UPROPERTY(Category=rdBakedSpawnObjects,EditAnywhere)
	UClass*			actorClass=nullptr;

	UPROPERTY(Category=rdBakedSpawnObjects,EditAnywhere)
	AActor*			actTemplate=nullptr;

	UPROPERTY(Category=rdBakedSpawnObjects,EditAnywhere)
	UNiagaraSystem*	vfx=nullptr;

	UPROPERTY(Category=rdBakedSpawnObjects,EditAnywhere)
	bool			pooled=false;

	UPROPERTY(Category=rdBakedSpawnObjects,EditAnywhere)
	int32			itemIndex=-1;

	UPROPERTY(EditDefaultsOnly,Category=rdBakedSpawnObjects)
	TArray<FTransform> transforms;
};