Dungeon Architect

Hey !

Thanks for your answers !

Problem 1 (instancing ultimate rock pack): as i said in a previous post, don’t waste your time on this (unless you need to understand what happened), i solved it experimentally by modifying the collisions. I didn’t understand anything but the problem is solved for me :slight_smile:

Problem 2 (accessing c++ variable from BP): your assumption is the core of the problem :slight_smile:

Unfortunately i spawn the dungeons at runtime so no, i don’t have them placed in the level, it’s the problem. I need a way to set the DungeonCppCode variable at runtime !

If i had the hand on the code, i would probably declare a public (visibleanywhere, blueprintreadonly) pointer/ref to the ADungeon in the emitters and set it as “this” when adding the emitter to the dungeon.

Your DungeonMarkerEmitter.h code would become something like:


class DUNGEONARCHITECTRUNTIME_API UDungeonMarkerEmitter : public UObject
{
	...]

	UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Dungeon)
	AActor* ParentDungeon;

	...]
}

And when adding the emitter in my dungeon class (inheriting from ADungeon), my own code would become:


// emitter
FString StrEmptySpaceDAEmitter = "Class'/Game/DLCDaDungeons/EmptySpaceThemes/Rules/MarkerEmitter/BPM_EmptySpaceEmitter.BPM_EmptySpaceEmitter_C'";
UClass* UClassEmitter = LoadObject<UClass>(NULL, *StrEmptySpaceDAEmitter);

// create an object from this BP class
UDungeonMarkerEmitter* DAEmptySpaceEmitter = NewObject<UDungeonMarkerEmitter>(this, UClassEmitter);

// if ok, use it
if (DAEmptySpaceEmitter)
{
	MarkerEmitters.Add(DAEmptySpaceEmitter);
	DAEmptySpaceEmitter->ParentDungeon = this; // YEEHAAA !!!
}


That would be a way to expose the owner dungeon in the emitters BP, then i would just grab it, cast it to my own inheriting class and become king of the world.

But i don’t have the hand on your code^^ and maybe there is a simpler way to do this from BP without modifying the code (couldn’t reach the owner ADungeon from the emitter BP though, hence the post ^^)

Cheers