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 to load client's variables after joining a session.

Hello everyone. I'm having trouble with loading client variables (which are saved before joining a session) after joining a session. I'll explain my problem first.

I'm writing a 2 player fighting game with blueprints. I saved client's name, hero name, etc variables into a gameState blueprint before joining the session. But after joining the session, when I load them back, all the variables saved in the gameState are reset.

Can anyone help me how to save variables of client ( which are set before joining session ) and load them after joining session.

Product Version: UE 4.9
Tags:
more ▼

asked Apr 21 '16 at 08:46 AM in Blueprint Scripting

avatar image

Thura Oo
1 2 4 5

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

1 answer: sort voted first

You should save those kind of variables in Game Instance. This object does not get reset after map changing .

Also, On Post Login you could send request to client, with name and stuff and client would send it back to server when request received.

more ▼

answered Apr 21 '16 at 12:29 PM

avatar image

CriErr
1.2k 57 21 57

avatar image Thura Oo Apr 21 '16 at 01:38 PM

Thank you for your answer. I've tried with game instance but it doesn't succeed. I'll explain what is happening exactly.

For example, we have two players, so

Server has a game instance where name = "gg".

Another player (before joining session) also has a game instance where name = "John"

but after joining session, there is only one game instance left and whenever I called a variable from game instance, it answers "gg".

I really want to know is how can I save the variable set to "John" and load it after joining session. Or any other ways to solve such problems.

avatar image CriErr Apr 21 '16 at 01:45 PM

That's weird. So, save game maybe?

After Selecting name and stuff, save it to file and load the file after joining session..

(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