Other is the other actor from begin overlap- the actor that triggered the begin overlap event…
just for me, would you mind removing the “other” from the GetGameMode()?
So only the Skydome or SkySphere is NULL? Nothing before like the GameMode or the currentLevel?
Hm, you changed your LevelBlueprint to the Custom LevelScriptActor with this “Reparent Blueprint” and choosing your custom Class?
http://puu.sh/cQbwB/dca2fd12f0.jpg
And after that you changed the defaultvalue of the SkySphere Reference to the BP that is spawned already by us?
Yes, indeed. And infact I reparented the skysphere Bp to the custom skysphere class too…
I changed “Other” to Player Pawn (PlayerController->GetPawn()) and got the same result. GetGameMode has to have a reference passed in to it
Hmpf. I nearly reach my limits of debugging from afar. Have you tried creating a new BP of the custom skysphere class and using this instead of the one already existing?
And have you tried doing the GetGameMode with “this” instead of “other”? :X
The thing is, the only thing that is different in my setup is, that i didn’t use a custom TriggerBox made in c++, but one just spawned in the editor and referenced inside the LevelBlueprint. So i didn’t need to get the GameMode and the currentsublevel of it. CurrentSubLevel is a custom function you made inside your GameModeClass or?
You could try recreating this and check if maybe the custom trigger is the cause.
EDIT: Yeah i just looked up the function in the documentation. I meant using “this” instead of leaving it blank
I’ve got a check to see if there is a gamemode, that works. It’s simply not finding the skysphere. I’ve made a new skysphere bp and it doesnt see it. I’ve checked headers to see if I’ve missed one somewhere. That all seems ok. I agree Hmpf…
You could go into your LevelBlueprint and Print the DisplayName of the SkySphere Reference to make sure it’s really up. Since you are using the overlap function, it should already be filled with the Reference so it can’t be NULL… You are also retruning your CurrentLevel correctly? So not that he uses something that has no SkySphere Reference filled. Maybe the CurrentLevel is the wrong one x) Oh man, i guess we need some additional help here. We are missing something easy i guess.
Ah, thats interesting. I’m printing the displayname on begin play, from the persistent level and it works. I’ve set up a new box trigger- a normal vanilla one from the editor, put it in the sub level and tried to print the display name. It can’t see it. So the sublevel is not seeing the skydome…
My understanding of inheritance is that the reference to the skydome in the persistent level should be valid in the sub-level, because the sublevelscriptactor inherits from the persistent level. However, that doesnt take into consideration how the editor handles a manually assigned variable…
This is starting to make sense- if I assign a variable in the editor, to the persistent level, that variable may not be visible to the inherited class. I’m thinking that the fix to this is going to be to load a reference into the sub level, when it loads, something like that.
Ok this brings me another solution. I guess you aren’t getting the exact LevelScriptActor with your function. Take a look at Ramas Solus C++ things. If you scroll down a bit, you find “GetYourLevelBP”. It’s a function to use from the World to get the LevelScriptActor as retrun. If i’m not wrong, this should give you the oppertunity to get the PersistentLevel with the working SkySphere reference.
But… I was already referencing the persistent level in the C+± I switched to directly call the persistent level as part of the debugging process. Which makes it seem as if the loading of the sub-level is somehow invalidating the reference.
I think the reference has to be in the sub-level, and manually assigned to the sub-level. Even if its in the persistent level.
But your Sphere is located in the persistent level and not in one of your sublevels (Streamed Levels). So why getting the sublevel It should be enough to just get the persistent level (since here is your SkySphere) and cast it to the custom LevelScriptActor and use it -
EDIT: Are all your sublevels of type “YourLevelScriptActor” or only the persistent level?
They are both custom levelscript actors- and the sublevelscriptactor is of the persistentlevel type- it inherits from it
My solution idea doesnt work- if I put the reference in the sub level I cant manually assign it in the editor because the skysphere is in the persistent level…
And
CurrentLevel->SkySphere->GetName();
Doesn’t return the name like the LevelBluprint does? What the heck I didn’t work with LevelScriptActors in c++ yet, so i really don’t know why this is happening
It has to be about how the editor handles manually assigned variables. I think the only solution is to spawn these actors in C++. I can’t change the design of the levelscript actors because they contain alot of AI code that is more important for the game design…
You could open a new question where you ask about this behaviour, because i don’t have a clue anymore. I would love to help you getting this solved, but i don’t know what we could do because i’m not that into the c++ thing yet.
Thanks for all your help eXi!!!
Np, if you get this solved make a new answer here in this question with the infos and accept it. (:
Just a question, you have your PersistentLevelBP and the SubLevelBP, where did you set the variable? Because, shouldn’t it be normal that SubLevelBP has the same Variable, since it inherits from the PersistentLevel, but empty because you never filled the specific one? If i create 2 BP, one as the child of the other, setting a variable in the parent won’t set it in the sublevel as well.
Have you filled this variable in every of your sublevels per hand too?
This is the source of the problem eXi- well done!!! There is a reference to it in the sub level and it does need to be set by hand. However, the variable in the sub-level cannot be set. So the variable is always being set to NULL when the sub-level loads…
Hey eXi- write up your answer and I’ll accept it…