I was literally in the process of typing the following question:
Ok, I am working on Building Escape and I had this funny idea to have trigger volumes result in specific code being
executed.
My way of doing this is as follows:
I put the trigger volume in the level, and change its name to something I’ll recognize easily (e.g. FireAlarmTrigger for the example where I’m hung up).
I put a component on the Default Pawn actor, a C++ component called Talk (so, it’s really class BUILDINGESCAPE_API UTalk : public UActorComponent). I added this to the default pawn blueprint…uh, wait a minute…“the duck” is telling me that the problem is I put it on a blueprint but what I’m adding is a level object…
So, the duck answered me just fine. I guess I have to finish the question so non-ducks know what I’m talking about:
As I was saying, I added the Talk component to the default pawn blueprint.
Part of this talk component are lists of trigger volumes, and what to do about them. Currently the only thing I do is “say something”, where something is an FString:
UPROPERTY(EditAnywhere)
TArray<ATriggerVolume*> Triggers;
UPROPERTY(EditAnywhere)
TArray<FString> SayThis;
TArray<bool> AlreadySaid;
The first array is the list of triggers. The second is a list of what to say for each trigger. The third, not editible in the Detail’s window, just notes something is already said and don’t say it again when reentering the trigger volume. Currently, all “Say” does is log what is to be said as a warning.
Now, SayThis works fine—I can put text in it in the details window if I open the default pawn blueprint, and click on the Talk component.
However, I cannot put a trigger volume from the level into the array. When I click on it, it shows a list of trigger volumes in the level, but when I select one, it reverts to None, and the log window shows the following message:
LogProperty:Warning: Illegal TEXT reference to a private object in external package (TriggerVolume /Game/Maps/NewMap.NewMap:PersistentLevel.FireAlarmTrigger) from referencer (Talk /Game/Blueprints/DefaultPawn_Blueprint.DefaultPawn_Blueprint_C:Talk_GEN_VARIABLE). Import failed...
LogProperty:Warning: Illegal TEXT reference to a private object in external package (TriggerVolume /Game/Maps/NewMap.NewMap:PersistentLevel.FireAlarmTrigger) from referencer (Talk /Engine/Transient.World_2:PersistentLevel.DefaultPawn_Blueprint_C_0.Talk). Import failed...
LogProperty:Warning: Illegal TEXT reference to a private object in external package (TriggerVolume /Game/Maps/NewMap.NewMap:PersistentLevel.FireAlarmTrigger) from referencer (Talk /Engine/Transient.World_3:PersistentLevel.DefaultPawn_Blueprint_C_1.Talk). Import failed...
So, I was in the middle of typing the question and the duck answered me: I am trying to put an instance of something in the level into the blueprint which is not yet instanced!
So the good news is, I know what’s wrong. I think.
The bad news is…I haven’t figured out a workaround, and so far the Duck is silent…
Any ideas?
This doesn’t go with a specific lecture, but I chose the last lecture I watched (not counting way back, months ago, when I’d done this before) before trying this.
gee–for some reason the “About a specific lecture? choose it here” window only gives me 5 choices, so I can’t select the right one. It is either right after Iterating Over TArray With For, or one or two lectures beyond that. And I guess this is a Discourse bug instance too, then…