Hello there!
I’m making a season selector that is based on material swapping. It takes a list of actors from MapInfo and sets materials, corresponding to the given season.
It works perfectly until it comes to level streaming. One cannot simply reference actors from another level. Is there a way to access MapInfo of every streamed level?
I don’t know of a way to access everything in this window, but you can make a brush. Open the brush settings, enter whatever information you need to enter, and create the brush, and then it can run any function you want, including iterating through all StaticMeshActors.
MyActor.WorldInfo gives me the same WorldInfo, regardless of the level MyActor belongs to. Therefore, MyActor.WorldInfo.GetMapInfo() will give me the same instance of MapInfo.
What I need is to read and write MapInfo of sub-levels. Is that even possible?
Maybe I’m not sure what you need to access the MapInfo for. Can you access the info you need like this?
for (i = 0; i < WorldInfo.StreamingLevels.Length; ++i)
{
// see if WorldInfo.StreamingLevels* has the information you need
}
Edit: Actually, you probably can’t… I just read through https://wiki.beyondunreal.com/UE3:LevelStreaming_(UDK) and it looks like there’s no relationship between this and the MapInfo of the level you loaded. Maybe MapInfo only works for the persistent level?
MapInfo only lets me to reference actors from persistent level, the rest are not allowed to be there. So, I thought that I could put information about sub-level actors in it’s own map info and then read it in a similar way with map info of persistent level.
Anyways, I made a workaround that utilizes automatically spawned actors for each sub-level. So, only persistent level stores it’s season data in map info, while sub-levels have it in these actors. Season change happens either together with persistent level, either in PostBeginPlay of the actor with season data (if the sub-level is loaded after the season change).