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"

Custom blueprint callbacks don't get called unless I press compile on each level blueprint.

Hello,

This issue happens randomly and I can detect it while playing in editor or even worse in a packaged build...

I have my custom blueprint actors which has several dispatcher events like "OnPlayerClicked", "OnAnimationFinished", "OnPlayerEntered"...etc There are several callbacks in the level blueprint for those actors. The problem is randomly (I could not detect when..) those callbacks are not called.. Then I found out that if I press "Compile" on each level/sub-level blueprint then on next play, they get called! It seems like sometimes callbacks are invalided, somehow!

A quick solution maybe a tool to re-compile all maps' level blueprints.

This happens randomly and quite frustrating. I can foresee it will result in nightmares when our project gets bigger and new maps are added. Since you won't know then your events won't get called. Player would click a hotspot and nothing will happen!

Thank you in advance for your responses, Best,

Galip

Product Version: UE 4.12
Tags:
more ▼

asked Aug 15 '16 at 10:23 AM in Bug Reports

avatar image

galipka
21 2 4

avatar image Adam Davis STAFF Aug 15 '16 at 01:59 PM

Hi galipka,

  • Does this occur in a clean, blank project with no additional content or is it limited to one project?

  • What steps can I take to reproduce this on my end?

  • Have you tried adding IsValid checks before the functions are utilized to see if any are registering NULL values?

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

3 answers: sort voted first

Hi Adam,

Thanks for clarification, but it looks like we will need to re-write all the big blueprints we have built far. Considering we are in full-production now, we will have to go on like this... I wish the engine had a scripting language support for C# or Java. This way, blueprint development related problems like this would never exist... But every choice has ups and downs. We chose UE4 for great visuals and we will keep using it..

more ▼

answered Aug 21 '16 at 06:08 PM

avatar image

galipka
21 2 4

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

Hi Adam,

  • Currently it is limited to one project. I suspect this problem occurs with complex blueprints and code size.

  • There are no specific steps to reproduce it. I think it is related to initial value reset bug which is still happening with cyclic references with blueprints inheriting each other. And I am using inheritance with my base blueprints.

  • The problem is, engine completely ignoring blueprint callbacks/events. Since they are not called, there is no opportunity to put breakpoints and check values. Those ignored callbacks/events are all added from editor, by right-clicking blueprint actors and selecting "Add Event" option. So editor creates and places them into the level blueprint...

  • Good thing is this problem can be resolved by pressing "Compile" manually on every level blueprint.

  • The bad thing is you don't know when it will happen next..

more ▼

answered Aug 15 '16 at 02:32 PM

avatar image

galipka
21 2 4

avatar image Adam Davis STAFF Aug 15 '16 at 03:16 PM

If you have any circular dependencies, try breaking the circular reference to see if the error stops. In general it is not recommended to have any circular dependencies within a project, as this can cause numerous errors, especially when using blueprints. Break these and see if the error still occurs.

avatar image galipka Aug 15 '16 at 03:47 PM

Are there any tips to detect circular references and resolve them? Breaking them sounds like to change the way blueprints interchange data and call each others events and functions...

avatar image Adam Davis STAFF Aug 15 '16 at 05:40 PM

unfortunately no, this is a manual process. But you are correct, you will need to re-write the segment of code forming a cyclic dependency to form a more linear interaction.

avatar image galipka Aug 16 '16 at 07:15 AM

We are using full blueprints for game logic and mechanics. Do Epic have a tutorial to avoid circular references or minimize them? This thread clearly states that they are unavoidable, and reflects my situations as well:

https://answers.unrealengine.com/questions/186871/howto-fix-circular-references.html

avatar image Adam Davis STAFF Aug 17 '16 at 02:02 PM

Hi galipka,

Unfortunately the information in that thread is slightly misleading. Avoiding a circular reference is tricky, but manageable in the vast majority of cases. The problem with them lies in that a blueprint "up the chain" of blueprints referenced requires functionality from another blueprint "down the chain" to be able to run a function needed "up the chain". This is, in general, bad coding practice. We try to avoid this as much as possible because it often leads to errors with bad calls, compilation problems, re-referencing errors, etc. There have been a number of fixes implemented to try and get the editor to work more with circular dependencies, but this is a bandaid over the initial issue, which is the dependency itself. At times it is completely unavoidable, but this is few and far between and alternative solutions should be sought first before relying on a cyclic dependency, as stated above this will lead to more problems than solutions.

At present we do not have a tutorial on avoiding/minimizing circular references. One way to avoid this, though, would be to separate what functionality is being called by each blueprint. Intercommunication is perfectly fine, as long as the information one blueprint is not required to immediately run functionality in another. For instance in that thread you linked, Napoleon mentions a HUD blueprint searching for inventory information while the player searches for references to the HUD. These can be separated so that the HUD is called in the player using "Create Widget", when the widget is created, it does not immediately gather the inventory information, instead it calls that function only when a custom event is called to show the inventory screen. This gives the same functionality as before, but breaks it up so the two actors are not cyclically dependent upon one another.

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

Hi galipka,

We have not heard from you in several days. I am marking this as answered for tracking purposes. If you are still experiencing this error after fixing the cyclic dependencies, please post back here and I'll be happy to take another look.

more ▼

answered Aug 20 '16 at 08:20 PM

(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