Level blueprint and GameMode

Sup guys!

Say I have a NPC, and 3 towns, the NPC has different speech in each town.
Each town has a shop that sells different items.

I feel like I should store the speeches of the NPC and item list into level blueprint, since each level has their own unique level blueprint

When my character interact with the NPC in different town, the NPC get the speech data from the level blueprint. When my character go to the shop of current level, the shop get its item list data from level blurprint as well.

However, I found out it’s hard to get data from level blueprint, since you cannot cast it.

If I should use GameMode, but that means I have to create GameModes for each level, what should I do.

Thanks!

How is the speech stored in the level BP? ( neither level BP or GM is a good place ).

Just create 2 arrays in level blueprint, 1 for item list, the other 1 for speech.

What am I looking for is a proper place to store the data

1 Like

If it’s just two arrays, you can put them in a blueprint actor that just drop in the level :slight_smile:

In that way, I still need to make a bunch of actors for each level, maybe I could load data dynamically at runtime base on the level name.

You only need one per level.

You had done this in the level BP anyway…

There’s a million ways of doing it though. You could just store everything in a custom data structure in the game instance.

Thanks! I’ve made a data table that has 2 columns, Level Name and Item List, and put it into a GameInstace Subsystem.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.