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"

Editor crashes when using own C++ Blueprint

Hi,

I'm trying to get the version number, so that I can display it in my HUD.

Using one of the answer here showed me a yt-video that showed to add an own C++ Blueprint Class.

GetProjectVersion.h

 #pragma once
 
 #include "Kismet/BlueprintFunctionLibrary.h"
 #include "GetProjectVersion.generated.h"
 
 /**  *   */ UCLASS() class CLEMENTINEPA010_API UGetProjectVersion : public UBlueprintFunctionLibrary {     GENERATED_BODY()
              UFUNCTION(BlueprintPure, meta = (FriendlyName = "Project Version", CompactNodeTitle = "ProjectVersion"), Category = "Project Information")         static FString GetProjectVersion();          };


GetProjectVersion.cpp

 #include "MyProject.h"
 #include "GetProjectVersion.h"
 
 FString UGetProjectVersion::GetProjectVersion() {     FString ProjectVersion;     GConfig->GetString(         TEXT("/Script/EngineSettings.GeneralProjectSettings"),         TEXT("ProjectVersion"),         ProjectVersion,         GGameIni         );     return ProjectVersion; }

Any idea whats wrong with my code? It build without warnings and errors in Visual 2015.

Many thanks.

Best,

Tigger

Product Version: UE 4.10
Tags:
more ▼

asked Feb 10 '16 at 03:55 PM in Bug Reports

avatar image

MagicTigger
18 8 11 16

avatar image MagicTigger Feb 10 '16 at 04:07 PM

Binding: alt text

avatar image Sean L ♦♦ STAFF Feb 10 '16 at 08:03 PM

Hello,

  • Could you please provide the crash logs from your project's Saved->Logs folder?

  • Could you please cause the crash again, provide your Machine ID from the Crash Reporter window, and then hit send on the window? (Assuming that you are getting a crash reporter window).

  • Can you reproduce this crash in a clean project?

  • Do you have repro steps we can follow to reproduce the crash on our end?

avatar image MagicTigger Feb 10 '16 at 09:32 PM

Hi Sean!

many thanks for replying.

  • please find logs attached - please delete from this post when downloaded.

  • MachineId:32D6BE0A44013EBE99ABA892DC1E5C6A

  • no, not reproducible - as it works in a clean project.

  • but it seems there is an other problem in my project, as I'm not able to see the "new C++ Blueprint" in my right-click menu. (the "Get Version Number" in my picture above is the function itself - so no wonder that UE crashes...)

and: the steps I did can be found here: https://www.youtube.com/watch?v=4UVdL4gHTOw

So the new question is, why is my new C++ Blueprint not shown in my "All actions for this Blueprint" nor in "All Possible Actions"-right click?

Many thanks.

Best,

Tigger

avatar image MagicTigger Feb 10 '16 at 09:35 PM

As you can see in the clean project, it gives a warning and the C++ Blueprint has a different appearance than in my project.

nevertheless it works.

//strange//

CrashReproduce

avatar image Sean L ♦♦ STAFF Feb 11 '16 at 01:24 PM

Before you declare your function in your .h file, go ahead and add public: to ensure that the function can be called in other blueprints. After I did this, I was able to get the version number using your function and print it to the screen without any issue.

Your final declaration should look like this:

 public:
 
     UFUNCTION(BlueprintCallable, meta = (FriendlyName = "Project Version", CompactNodeTitle = "ProjectVersion"), Category = "Project Information")         
         static FString GetProjectVersion();
avatar image MagicTigger Feb 11 '16 at 07:41 PM

Dear Sean,

I did, but still not able to see this in my Project.

 public:
         UFUNCTION(BlueprintPure, meta = (DisplayName = "Project Version", CompactNodeTitle = "ProjectVersion"), Category = "Project Information")
         static FString GetProjectVersion();    
 

(changed FriedlyName to DisplayName as well)

screen:

still no project version

avatar image Sean L ♦♦ STAFF Feb 11 '16 at 07:42 PM

Did you try using the Project Version node instead, as you displayed in your picture above? When I used this, I was able to print out the correct version number after making the function Public.

avatar image MagicTigger Feb 11 '16 at 10:02 PM

Yes, same steps as in clean project.

  • right click

  • search for project version

but no display. (In my clean project it was displayed without making public as well)

Any idea?

avatar image Sean L ♦♦ STAFF Feb 12 '16 at 01:59 PM

Did you try using BlueprintCallable instead of BlueprintPure as I used in my example?

avatar image MagicTigger Feb 12 '16 at 03:25 PM

Yes, (now) I tried.

Same result. :(

avatar image Sean L ♦♦ STAFF Feb 12 '16 at 03:30 PM

Could you please zip up your project and provide me with a link to Dropbox where I can download it? I'd like to take a closer look at it to see why our results aren't matching up.

If you'd like to keep it private, you can send me the link in a PM on the forums: https://forums.unrealengine.com/member.php?160394-Sean-Flint

avatar image MagicTigger Feb 12 '16 at 03:33 PM

had the same idea. ... you got mail.. ;)

avatar image Sean L ♦♦ STAFF Feb 12 '16 at 03:43 PM

Thank you. When you have the project uploaded, please post a comment on this post so that I will be aware that you have sent the link.

avatar image MagicTigger Feb 13 '16 at 06:12 PM

Dear Sean,

project is uploaded, please feel free to download and help me with my errors. :)

Many thanks! :)

avatar image Sean L ♦♦ STAFF Feb 16 '16 at 08:04 PM

I have attempted to download the project, but it keeps giving me an error while I am trying to download it. Could you attempt to download it using the link you provided me and let me know if you are able to successfully do so? Thank you.

avatar image MagicTigger Feb 18 '16 at 09:18 AM

Hi,

I sent you another link, please try.

Many thanks.

Cheers!

avatar image Sean L ♦♦ STAFF Feb 18 '16 at 02:45 PM

Thank you, this link is now working. What blueprint am I looking in to attempt to reproduce your issue?

avatar image MagicTigger Feb 18 '16 at 02:48 PM

Hi,

glad that it worked.

main menu in project in directory: Level:

Content-->UI-->Menu :: MainMenu

and the used widget(where I can't find the "ProjectVersion"): Widget:

Content-->UI-->Menu-->Widgets :: MainMenu

avatar image Sean L ♦♦ STAFF Feb 18 '16 at 03:43 PM

I can verify that I was not able to see the Project Version node in that blueprint. However, the version of the project that you sent me does not include the code you were using. Is there any way you could reupload a full version so I can see exactly what could be causing this issue in the code?

avatar image MagicTigger Feb 18 '16 at 04:55 PM

Strange, I used the zip Project from UE4 Editor to create this zip. Nevertheless, I'll create and upload a new zip file and will contact you here when done - hopefully tomorrow.

avatar image MagicTigger Feb 19 '16 at 10:27 AM

Sent you a new link. Please try. :)

Many thanks.

avatar image Sean L ♦♦ STAFF Feb 19 '16 at 06:47 PM

Are you able to see your GetProjectVersion C++ class if you search for it in the Content Browser? If so, try making a blueprint based on that and seeing if your function shows up in that blueprint.

avatar image MagicTigger Feb 22 '16 at 10:42 AM

hmm.. no, can't see it. :(

No GetVersion

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

hmm.. I made it work, but it still feels that there is an issue.

I did:

  • delete the Visual 2015 file/project

  • (re-)generated a visual project

  • tried to insert my Blueprint C++

  • BUT it didn't work saying that I need to rebuild the whole project

  • Rebuilded the project

  • (oh wonder) I can see my Blueprint C++ in content browser

  • inserted the code

  • clean build in Visual editor

  • BUT got errors that .dll wasn't readable

  • closed Visual 2015 and Editor

  • rebuild project again

  • now it's working

but again, this still feels wrong, as I tried in other of my projects and it works without rebuilding, just "Add Blueprint C++", insert code, clean build in Visual 2015 (without closing the one or the other) and finally using.

strange...

more ▼

answered Feb 22 '16 at 09:08 PM

avatar image

MagicTigger
18 8 11 16

avatar image Sean L ♦♦ STAFF Feb 23 '16 at 03:06 PM

I am glad to hear that you were able to get it working. While this is a strange occurrence, it is possible that there was something that got corrupted in the project which required you to rebuild the project in Visual Studio. Are you able to see the function now in your blueprint?

avatar image MagicTigger Feb 23 '16 at 03:57 PM

Yes, I can see and use the new Blueprint now.

But for every new C++ Blueprint I need to do this procedure as well, so just rebuilding (once) is not the solution.

For now my issue is fixed and I will handle it so, if there is a chance or idea how to fix it permanently I would be happy to get this solution. :)

Many thanks for your help.

avatar image Sean L ♦♦ STAFF Feb 23 '16 at 04:11 PM

As this issue has currently been unable to be reproduced in a clean project, unfortunately there isn't much else we can do. However, if you happen to see this issue appearing in other projects, or if it becomes a major blocker for you, please re-open this topic with additional repro information and I'll be glad to take another look at it.

Have a great day

avatar image Ratamorph Mar 09 '17 at 04:57 PM

I'm having this issue or something very similar to it. I ported my project from 4.14 (From epic launcher) to 4.15(From source + PS4) and now every time I try to do anything with a blueprint who's base class is in c++ the unreal editor crashes.

(comments are locked)
10|2000 characters needed characters left
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