Announcing Section #4 for Survival Game - Setting up the survival game-loop

Perhaps this is a bug I need to look into. I haven’t seen this happen yet though.

Hey Tom!

I have a (yet another!) question.

On the ChoosePlayerStart() function, we initially call IsSpawnpointAllowed() and then call IsSpawnpointPreferred().

Everything looks nice and tidy. Then I noticed… The very same check done in IsSpawnpointAllowed() is done on IsSpawnpointPreferred().

This check:


	/* Check for extended playerstart class */
	ASPlayerStart* MyPlayerStart = Cast<ASPlayerStart>(SpawnPoint);
	if (MyPlayerStart)
	{
		return MyPlayerStart->GetIsPlayerOnly() && !Controller->PlayerState->bIsABot;
	}


Is there a reason for this I didn’t notice, or is it just repeating the same code? :slight_smile:
Can I just replace the code on IsSpawnpointPreferred() with a return true? :slight_smile:

Thank you again!

Theoretically it isn’t required there with the current code flow. If you look at the function name itself, it should work standalone when used elsewhere, so you can wonder: “how can a spawn be preferred, if it isn’t allowed” that’s why I still check inside that code, especially since I anticipate that function to be used elsewhere later on, with more complex spawning for different gamemodes.

The first call of IsAllowed is still useful too since we need to filter out the invalid spawns before we can start building a preferred list and a fallback list of spawnpoints.

Hope that helps!

  • Tom

Thanks for your help.

One question that may sound a bit offtopic…when I reconstructed the TimeOfDay Blueprint and tested it I ran into the following issue:

it seems that the Blueprint Function can’t access the Light Actor…but the Primary Sunlight Actor exist and is a directional light.
Are there any special changes to make in BP_SkySphere Actor that I may have overlooked? Or any special access settings for the primary sun actor in the TimeOfDay Blueprint?

I still try to find the error by myself, but at the moment my search is not very successful

BP_SkySphere is a built-in blueprint from the engine. You don’t have to create one yourself and there are no modifications required.

Yes, I know…but for any reasons I have this access issue to the directional light, so, at the moment it seems to me that the SkySphere can’t access the directional light. I’ll continue searching for the reason of my issue as soon as I’m at home.
I’ve noticed that in the Survival Game the GameModeClass is a blueprint and it also stores BP_SkySphere as a variable. My GameMode is taken directly from code so far, maybe it play a role in the problem.

Thanks for your reply.

Found the issue in my scene

The problem was that in my Testscene the directional light was not assigned in BP_SkySphere as directional light actor (in the details panel).
The weird thing is, I’ve tested it in a blank scene with all 3 lights added and it worked fine…here it seems the light was added automatically to the SkySphere Blueprint, in the former scene it wasn’t…once I’ve added it it worked.

Good to hear!

It seems that in 4.8.0 the GameMode Class (AGameMode) has no default timer anymore.

Yes there are some other API changes in 4.8 too. I’m upgrading the project this week for 4.8 support.

Hey folks, i have that strange problem with TimeOfManager blueprint when i open the project, but when i start play the map all work fine, i assigned all the sounds into blueprint and play right, simply i’m curious to understand what’s wrong on loading project and why all work fine, in theory my sounds had not to play if the ambient audio component is not loaded correctly.

EDIT:

Problem solved but i have no idea how :smiley:

看不懂…

Strings for the HUD(Survive, Prepare for…, ClientServerText)

Hey, I want to change the TextMessage that appears on the HUD(Survive!, Prepare for the next night, ServerClientText), but i can´t find the StringVariable and the class, where it is composed.

Hi ,

Quickest way to find this type of content is by simply doing a Ctrl+F in visual studio (as long as you suspect it’s defined in code and not in blueprint) The string you are looking for should come from the gamemode class (SCoopGamemode.cpp or SGameMode.cpp)

  • Tom

Finally found it in SPlayerController.cpp :smiley:

Ah good! Was just about to reply. The message type is EHUDMessage::Game_SurviveStart if anyone was wondering.

The message is broadcast through in this class: https://github.com/tomlooman/EpicSurvivalGameSeries/blob/master/SurvivalGame/Source/SurvivalGame/Private/World/SGameMode.cpp inside DefaultTimer()

  • Tom

You helped me a lot with that sample c++ project. Thank you

You’re welcome!

Hi mans! How I can increase the lights in night game mode? Please help, because new level i can’t modifiy the lights.