x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

GEngine's debug message doesn't show up

I'm trying to use this starter tutorial to learn about Unreal; Well, I'm already stuck in the first part (haha) which I just need to print a message.

The code is written as the tutorial say so:

MyGameMode.h :

 UCLASS()
 class AMyGameMode : public AGameMode
 {
     GENERATED_UCLASS_BODY()
 
     virtual void BeginPlay() override;
 };

MyGameMode.cpp:

 AMyGameMode::AMyGameMode(const class FPostConstructInitializeProperties& PCIP)
     : Super(PCIP)
 {
 
 }
 
 void AMyGameMode::BeginPlay()
 {
     Super::BeginPlay();
 
     StartMatch();
 
     if (GEngine)
     {
         GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, TEXT("SURVIVE"));
     }
 }

Also, my unreal version is 4.1; What possibly I could be missing here?

thanks in advance

Product Version: Not Selected
Tags:
more ▼

asked Oct 31 '14 at 12:16 PM in C++ Programming

avatar image

Roliveira
7 2 3 8

avatar image FortuneStudios Oct 31 '14 at 12:51 PM

hello, did you set it up as the level default game mode/ game default game mode?

avatar image Roliveira Oct 31 '14 at 12:56 PM

Sure; Any other tips?

avatar image FortuneStudios Oct 31 '14 at 12:59 PM

hmm, code seems fine to me, at first i thought it may have been a function mis-match (UE4 function names seem to change alot) but if it compiles that isnt the issue. can you start the game then eject(Shift +f1 i think is the key) and search in the scene outliner for the AMyGameMode class?

avatar image Roliveira Oct 31 '14 at 01:02 PM

I've noticed I couldn't see it before you say, which means probably it isn't being called/initialized, right?

avatar image FortuneStudios Oct 31 '14 at 01:06 PM

can you click on the 'world settings' tab within your game level and type 'game mode' into the world window search box, make sure the game mode override is set to your 'AMyGameMode' class. this tells the level that is the gamemode you want, hopefully that should do it

avatar image Roliveira Oct 31 '14 at 01:29 PM

You are right, I jumped this step somehow =/ noob failure haha post it as an answer thus I can accept - thank you

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

click on the 'world settings' tab within your game level and type 'game mode' into the world window search box, make sure the game mode override is set to your 'AMyGameMode' class. this tells the level that is the gamemode you want, hopefully that should do it. Glad i could help :)

more ▼

answered Oct 31 '14 at 01:33 PM

avatar image

FortuneStudios
65 7 9 13

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question