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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

How do you remove the blue "Paused" text for when the game is paused in C++?

Hi

I have currently been all over the ShooterGame example code multiple times and cannot seem to find where the text is disabled (as mentioned in the first answer to this question https://answers.unrealengine.com/questions/24674/when-in-paused-game-how-to-remove-the-paused-text.html). I'm starting to lose my mind because either I'm blind and just can't see it or the function that performs the operation isn't explicitly named. All I need is for the text to not be there - everything else works perfectly.

I should also point out that I have been working entirely in blueprint so far and would like to avoid using C++ if possible, but I have worked with C++ for two years prior and have no problem understanding how the language works.

If anyone could shed some light on this then that would be seriously awesome!

Product Version: Not Selected
Tags:
more ▼

asked Jun 19 '14 at 09:59 PM in C++ Programming

avatar image

EchelonXIII
3 1 2 4

avatar image THX2000 Aug 16 '14 at 10:20 AM

Guys it's me again, probably this is getting pretty annoying but the problem is still there and i think i'm not alone in this situation. After looked some of the video tutors and checked Strategy game sample. I found something very strange. So the code in strategy game have this row in the constructor right: alt text

That's written by Epic you know and when i created the project (strategy-game) just creating and playing. When I pressed the button for in-game pause menu. I spotted the f***ing Blue text again despite the fact i didn't touched any code inside nothing you know . It's just not working by default with Epic's sample. Even when they've published the sample explanation they had this image attached: alt text

So, after all, I think there is something strange which I can't explain. Can I have your opinions, please.

Thanks.

thecode.jpg (344.2 kB)
paused.jpg (250.4 kB)
avatar image DrHobo Aug 16 '14 at 04:24 PM

I'm gonna get technical here ;-)

The SetSuppressTransitionmessage() is set inside the GameMode contructor. Now usually, constructors construct objects and should not rely too much of other objects because there might be a problem in the order each object is constructed or else BOOM! Faulty pointers. The GameMode is set up early in the hierarchy of things to construct so there is probably no engine ready at this stage. And that's why in this case the GEngine is checked (and the following viewport) to see whether it is NULL or not. If it is, we jump across whatever was inside those brackets. And SetSuppressTransitionMessage() will not be called.

Now, I just ran the Strategy program with the newest 4.4.0 and traced this call. Turns out the condition is jumped over because the GEngine pointer is set to NULL. What happens next is that further down the road, the GameMode constructor is called another time, probably because of some switching to another game mode along the way and then there is a valid engine and GEngine is not NULL and so is its viewport. And SetSuppressTransitionMessage() is finally called. With the 4.4.0 version, the blue text is no more.

But that second call to the constructor doesn't make things kosher. I don't know why Epic decided to make such a check there. How I do things is call SetSuppressTransitionMessage() in BeginPlay() or some early function after all is constructed, where I'm sure that everything is setup correctly. I do make a token check to Engine and Viewport, but that's just me wearing both a belt and suspenders. :-)

So It's possible that in earlier versions, or for some reasons due to the environment, only one call to Gamemode was done and it simply failed because Engine was NULL at that moment.

So that's my explanation. If you still need some help, I can fix a YouTube video or a Google Hangout to set things in the code providing you have your C++ environment up and running.

Regards.

avatar image THX2000 Aug 16 '14 at 05:44 PM

DrHobo,

Mate honestly i didn't get all of what you said about the first and second paragraph , but on the third one i'm on it :-).

So i'll try to now to create C++ project and i'll write Begin Play function there and inside it, i'll just set SetSuppressTransitionMessage(true) without any condition, i'll compile and i'll get back here with screenshots etc. and if this does not work

I will kindly ask you to make on video of what exactly are you doing ,you know because i'm freaking out ,this is so vital part of every game, there has to be solution which even newbie like me can deal with.

Thanks

avatar image THX2000 Aug 16 '14 at 06:09 PM

DrHobo,

If you can go ahead directly with the video, that would be awesome, because after trying wait not in my power i'm obviously, not going to make it by myself :-)

Best Regards THX2000

avatar image DrHobo Aug 16 '14 at 10:59 PM

The video is done.

Before you go: FIRST Accept the answer I have given the first time, below this, by clicking on the check mark . Your questions, while interesting and challenging, were off topic and because of that, the question is no longer marked as RESOLVED.

SECOND Any other comments should be directed to the YouTube channel.

https://www.youtube.com/watch?v=NwCmhwdvWnM I have found a much easier solution for Blueprint users because the others discussed here had side effects on the usage of BeginPlay() in Blueprints.

Regards.

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

1 answer: sort voted first

Try this: You need to get a pointer to the current player's viewport, then use SetSuppressTransitionMessage();

 ULocalPlayer* ThisPlayer = GetWorld()->GetFirstLocalPlayerFromController(); 
 UGameViewportClient* TheViewportClient = ThisPlayer->ViewportClient;
 TheViewportClient->SetSuppressTransitionMessage(true);

It worked for me. :-)

more ▼

answered Jun 23 '14 at 03:17 PM

avatar image

DrHobo
271 32 35 54

avatar image Nikolai Mohilchock Jun 23 '14 at 05:18 PM

Is there a Blueprint equivalent to this? How do we get access to set that variable's boolean flag in the graph editor?

avatar image DrHobo Jun 23 '14 at 06:20 PM

There is a discussion here about the subject: it seems it is not implemented in Blueprint.

https://answers.unrealengine.com/questions/24674/when-in-paused-game-how-to-remove-the-paused-text.html

avatar image EchelonXIII Jul 23 '14 at 10:21 PM

Sorry it took so long to get back to this, but the above solution worked perfectly! It just looks a little different for me because the majority of the game is done with Blueprints. For anyone else in the same boat as me (using Blueprints), create a custom game mode and insert this block of code in the initialise function:

 if(GEngine && GEngine->GameViewport)
 {
     GEngine->GameViewport->SetSuppressTransitionMessage(true);
 }

Again, thanks for the answer to this increasingly frustrating problem DrHobo! Hopefully they'll add support for this in Blueprint in the future.

avatar image THX2000 Aug 07 '14 at 06:28 PM

Hello EchelonXIII

Can you explain deeply what should I do after I pasted that code into the initialise function.I've created new game mode and pasted the code but the text is still there. I'm very new to C++ coding :), but I really wish to get rid of the blue paused texts.

Can you help with this please. :)

alt text

is this even right(what I did so far).

avatar image EchelonXIII Aug 07 '14 at 09:23 PM

What you've done there is add an "if" statement to your header (.h) file, which generally only holds function declarations (i.e. where you specify what functions the class will have and their parameters). When that header file was created a code (.cpp) file would have also been generated, so the correct thing to do would be to create something like an Initialise function in the header file and then chuck that block of code inside of that in the code file. The following images will demonstrate this

alt text

alt text

You could even just place the code in the constructor (in my case the AGameModeVikings "function") if you didn't want it in Initialise.

Hopefully this has helped, but if you (or anyone else who finds this) are still unclear on what functions are then this is a good explanation: http://www.cplusplus.com/doc/tutorial/functions/. They have a million explanations for other coding areas as well as some tutorials, so I would definitely recommend that site for any coding beginners!

avatar image THX2000 Aug 12 '14 at 09:19 AM

Sorry mate but i tried what you said and still nothing. Last time, can you please explain is Step By step. Here is what i'm doing i have my project open right I'm using only blueprints. 1. File-> addCode to the project 2. i'm choosing game mode class - > choosing where to be created 3. it asked me whether i want to edit the code or no i'm clicking yes. 4. i'm edinting the code as you said except for the names of the projects. 5. Start the game press button i've set for pause and then i can see the blue text.

Can you please answer like this step by step .

Best Regards THX2000

avatar image EchelonXIII Aug 12 '14 at 09:36 PM

Are you sure you're sticking the block of code inside the .cpp file? In case you got the images mixed up from my above post, the top image is the .h file and the lower image is the .cpp file. I may be wrong about putting the "if" statement inside the default function that gets created with the .cpp, so if you copy what I have written in my images (obviously swapping AGameModeVikings out for whatever your game mode is called) there is no reason why it shouldn't work. Other than that the steps that you've taken are correct.

If you still have issues after doing that then all I can suggest is creating a new project and doing the same thing there, just to make sure there isn't something you've done wrong in your blueprints.

Hope this helps!

avatar image THX2000 Aug 13 '14 at 12:35 PM

HI EchelonXIII,

NOT WORKING Mate :) i'm attaching the two files(btw i know a lil bit of programming i know about the header file etc.) alt text

After that i compiled the code by pressing this button in UE4 editor.

alt text

everything was completed and then start the game i had level blueprint (alt text) to enable the pause menu and nothing.

So till nothing. Do you have any other suggestions. Is it normal if I click on the blueprints drop-down to NOT SEE any game mode created ?

Regards

compile.jpg (189.0 kB)
bp.jpg (47.0 kB)
avatar image THX2000 Aug 13 '14 at 12:36 PM

alt text

h_cpp_files.jpg (201.6 kB)
avatar image THX2000 Aug 13 '14 at 12:42 PM

alt text Hi Mate after saving and recompile it gave me an error ?

error.jpg (96.1 kB)
avatar image DrHobo Aug 13 '14 at 02:19 PM

Let me have a shot at this:

I will not discuss the validity of the code you entered or your log messages simply because you've started this in bad way since the very beginning. Even though you put the right code in the file, it still may not work. Trying to compile new C++ code through the editor is a no-no; it's been clearly told many times in Epic's own C++ tutorials that you can find online here: https://www.youtube.com/watch?v=Q3AvZmZEPyc and here: https://www.youtube.com/watch?v=nzq7hGmxLP8

The editor can only compile new code in existing functions and part of your error messages are due to this. Add a variable or new signature and BOOM! Instant incomprehensible messages will spit out in the error log. You need to close the editor, compile it natively then load it in the editor. Larger support for a more "intelligent" hot-reload from the editor is not due before 4.4 or 4.5, I believe.

Also, you've added a new GameMode code in your project when you already have an existing GameMode blueprint that might get in conflict with it. It might compile but will it load ? I'm not sure. You'll need to delete the blueprint and create it again based on your new class without forgetting setting it up as a default blueprint and set all the other classes that need to be attached to it just like the original. Personally, I've never tried to add C++ to an existing BP project because it's so much work. The reverse, however, is trivial.

What I suggest is to follow these videos (try the first one, it's short and to the point) and learn C++ programming and compiling under Unreal 4 with them, even at its basic level, then start from scratch with a C++ program. You'll have a default GameMode where you can put the pause code and carry on in Blueprint. Yes, you can mix C++ and Blueprint this way. But you'll also have a C++ program ready for any additional little trick you might find helpful in the future.

Regards.

avatar image EchelonXIII Aug 13 '14 at 09:41 PM

@THX2000 So I just realised that I completely forgot to mention that you need to set the game mode to your custom one in the World Settings (or Project Settings->Maps & Modes), then assigning any controller classes or whatnot to that. If you weren't doing that then that could be why it wasn't working initially, so my bad :P

But yes, if you follow the tutorials/advice that DrHobo has given then you should definitely be able to get it to work (as well as achieve a better understanding of C++).

Sorry this has taken so long to work out! EchelonXIII

avatar image THX2000 Aug 14 '14 at 06:59 AM

EchelonXIII & DrHobo ....thank you so much guys. Really, for the time you've spend answering me. I'll follow your advice and look at these tutors.

Anyway Thank you !!!

Best Regards THX2000

(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