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"

event on map load/switch

Hi, I write a plugin which add some components to existing actors and reacts if they get unregistered. Now I need to detect if the user switches the map and do some work before they get unregistered. I can not place the code in the OnUnregister() of the components, because I only want to react if the map(or level) gets switched.

I tried to place a dummy actor in the current map and listen on its BeginDestroy(). This works, but would be useful only, if this is called before any other actor component gets unregistered. This does not happen.

Here a debug log which should explain the point in time to react:

 <-- user double clicks in unreal editor content browser on a map to load -->
 Cmd: MAP LOAD FILE="../devproject_4_16/Content/StarterContent/Maps/Advanced_Lighting.umap" TEMPLATE=0 SHOWPROGRESS=1 FEATURELEVEL=3
 LightingResults: New page: Lighting Build
 LoadErrors: New page: Loading map: Advanced_Lighting.umap
 <-- Last point to react! -->
 LogTemp:Warning: Actor component unregistered.
 <--  To late; one of the interesting components already have unregistered -->
 LogTemp:Warning: Actor component unregistered.
 MapCheck: New page: Map Check
 LightingResults: New page: Lighting Build
 LogTemp:Warning: BeginDestroy   <-- here comes the BeginDestroy event from the dummy actor. Unfortunately to late!

How to get in this tiny time slot after map switch begins?

Thanks for any help, solarisx

Product Version: UE 4.16
more ▼

asked May 31 '17 at 02:12 PM in C++ Programming

avatar image

63 4 8 13

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

1 answer: sort voted first

How about using FWorldDelegates::LevelRemovedFromWorld delegate?

more ▼

answered Jun 01 '17 at 02:37 AM

avatar image

158 5 3 8

avatar image solarisx Jun 01 '17 at 08:49 AM

FWorldDelegates::LevelRemovedFromWorld does not fire in my case, but thanks for pointing me on FWorldDelegates! Was focused on Levels and Maps and did not thought of World. So I found FWorldDelegates::OnPreWorldInitialization, which is what I need.

Thanks very much!

(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