Game Mode override on dedicated server
Hi everyone, hope you are having a nice day.
I'm trying to do a multiplayer game with a dedicated server:
Basically you have two maps.
By default we have the game mode that will be used in Menu and then the gameLevel overrides the game mode with another one.
This is my network setup:
If I run I get access violation as soon as I call one of my functions of the game mode if this function tries to use any of properties, like it never initialized.
Because I'm able to call functions on my game mode it looks like I'm definetly using the right one. but TMap is not properly initialized, and it is when I put it as main game mode. :/
Anybody has any clue on what's going on?
Update: Is not because of the TMap. I've also tried to have an int. initialize it on the constructor and then print it when I call the function and it will show the value properly but it will crash right after.
ICan't show the crash itself because it says I don't have the symbols loaded for it and I have pragma optimize ("", off)
Update2: I forgot to mention that this function is called on BeginPlay of each pawn
If Role == Authority Call Func();
I've seen that if I called after, with "press O and then call func" it works!
is Game Mode BeginPlay being executed after pawns causing the error? then why does not happen if I set the game mode as main?
Update 3: In my main game mode. the one is set on the Project Settings, I have specified a custom player controller that shows a custom widget. Now when I click play on my battle level I can see the widget appearing and dissapearing right after, which means is first trying to use the main game mode and then is being overrided! If the widget is showing up I'm probably going through beginPlay at that point! so that could be the issue.
No clue how to deal with it though.
Solved: I didn't do Super::BeginPlay()... and was causing all kinds of issues.
How did I miss that....
answered Mar 26 '17 at 11:31 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here