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"

How can I use Seamless Travel to persist data across map changes?

Hi guys,

I have been trying to get this Seamless Travel business working for some time now.

It appears that even after travelling "seamlessly" that all data on the PlayerControllers and PlayerStates are reset to their defaults and BeginPlay() is called on everything again. (Not sure if BeginPlay is intended by the engine, but I've been reading that PlayerStates should be able to keep data so that players can end up on the same team for example)

What are steps to troubleshoot this and get this data persistence working?

Thanks!

PS: I am calling SeamlessTravel on the World object, and have verified that the PlayerStates and GameState get added to the list of Actors to keep.

Product Version: Not Selected
Tags:
more ▼

asked May 02 '15 at 02:44 AM in C++ Programming

avatar image

Acren
460 46 50 70

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

3 answers: sort voted first

Override CopyProperties on PlayerState

Contrary to what I read, the PlayerState and GameState objects are not actually saved from one map to the next.

More accurately new ones are created and relevant data copied across.

Didn't look too far into GameState, but for PlayerState you have to manually specify how to copy your data to the new PlayerState when seamless travel occurs:

In your custom PlayerState class, override CopyProperties to copy all your values across to the new object.

 virtual void CopyProperties(class APlayerState* PlayerState);
 
 void AMyPlayerState::CopyProperties(class APlayerState* PlayerState)
 {
     APlayerState::CopyProperties(PlayerState);
 
     AMyPlayerState* myPlayerState = Cast<AMyPlayerState>(PlayerState);
 
     if (myPlayerState)
     {
                 // Copy all the properties that you want to keep across map change here
         myPlayerState->variable = variable;
     }
 }

The only other requirement is actually calling ServerTravel on the World to change map and setting bUseSeamlessTravel = true on your GameMode.

Surprised that there seems to be no documentation regarding any of this.

more ▼

answered May 02 '15 at 05:03 AM

avatar image

Acren
460 46 50 70

avatar image State128 Nov 03 '15 at 04:29 PM

Can't get it to work, even though i implement CopyProperties and set the bUseSeamlessTravel = true. Is there anythingelse i need to do? I've done a really simple project here: https://drive.google.com/folderview?id=0B3tss2rB4vfAZUhZUUF2WnFLTmc&usp=sharing

avatar image Syrill May 04 '16 at 08:05 AM

Have you set a transition map?

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

The properties must be public if you wanna copy them in the CopyProperties method.

more ▼

answered Jan 02 '17 at 07:02 PM

avatar image

Asier91
6 1

avatar image jdannenbring Apr 13 '17 at 12:33 AM

THANK YOU! Was stumped till I read this.

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

I don't understand how to do this

set the bUseSeamlessTravel = true

Where is this done? If it is in Visual Studio in the CPP source code where exactly ? I'm not a CPP person mostly working in Blueprints so this is quite scary for me to mess around with this. However i'm trying to make a VR experience and need to get rid of that annoying loading screen. So i'm planning on using a Transition map but one of the steps requires

set the bUseSeamlessTravel = true

and i can't figure it out.

Please help.

Thanks.

more ▼

answered Jun 08 '17 at 07:00 PM

avatar image

amitvfx
1

avatar image Acren Jun 10 '17 at 01:20 PM

Hi amitvfx,

In cpp the public member variable bUseSeamlessTravel is on the GameMode object, declared here: https://github.com/EpicGames/UnrealEngine/blob/release/Engine/Source/Runtime/Engine/Classes/GameFramework/GameModeBase.h#L533

Or you can open your GameMode blueprint and check it under the Game Mode category: alt text

seamlesstravel.png (10.4 kB)
(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