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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

tranfering variables to other blueprints

Hello, I'm relatively new to blueprint scripting. I watched and searched for tutorials on global variables, but I'm having a struggle. Currently I'm trying to implement a client side login system, where first client makes a account and then after it creates a new widget called main menu. And on the main menu I wanted to show the user's stats such as usernames and levels and high score. I'm trying to make the username typed on the previous widget (User-Creation Menu) to the UserMainMenu widget. But whenever you go to other widget such as options in mainmenu and come back to mainmenu it disappears. And I know that every time when you close a widget it resets and deletes the variable. Can somebody help me?

This is from the UserCreation menu where the Username text variable is sent to mainmenu. alt text This is the function in User mainmenu widget. alt text And this is me trying to get save username function in User main menu. (But doesn't work) I know the problem lies in where from creation menu to user mainmenu it works, but after mainmenu to other widgets such as options, shops and inventory it get's to none. But I don't know how to do this someone help me! alt text

Product Version: UE 4.15
Tags:
1.png (118.0 kB)
2.png (49.2 kB)
キャフチャ.png (373.5 kB)
more ▼

asked Sep 18 '17 at 03:30 PM in Blueprint Scripting

avatar image

Joyful
26 1 5 6

avatar image Joyful Sep 19 '17 at 06:02 AM

Anyone know a way to solve this?

avatar image Joyful Sep 20 '17 at 04:58 PM

Can someone please help me with casting?

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

1 answer: sort voted first

you can store your global variables in game instance. game instance will not destroy when open level.

you can create your own GameInstance class, remember to change setting to use your own GameInstance class.

more ▼

answered Sep 19 '17 at 12:11 PM

avatar image

feiwu
296 2 6 20

avatar image Joyful Sep 19 '17 at 02:54 PM

Thank you for your reply!!!

Would it also work, when there is a new user, and it creates a new username and password? Does it destroy the old user data or would it keep the old user data and create new user data? I'm sorry, if you didn't get my explanation.

In my game instance I have username and made it editable. SO in my user Creation menu it saves the username and user password to game-instance. To recall/ load information to other widget User main menu, I'm a bit lost, I know I have to cast it to my game-instance (SAVE THE GAME) but from there I'm a bit confused. Would you mind helping me? alt text

キャフチャ.png (242.9 kB)
avatar image feiwu Sep 19 '17 at 03:53 PM

you can load from save object, or just read from Game Instance.

alt text

gameinstance.png (69.5 kB)
avatar image feiwu Sep 19 '17 at 03:55 PM

Remember set the variables to Game Instance before close widget,

then on the other widget construct,you can read the value from game instance object.

avatar image Joyful Sep 19 '17 at 04:09 PM

For cast to game instance I don't know what to plug for object. Since my function is get Username and the return value is set to text and it has to be an object to be connected to the casting node. Also if I plug "Get game instance node" then it says it would always fail.

alt text

My get username function. alt text

castingnode.png (274.4 kB)
function1.png (228.4 kB)
avatar image Joyful Sep 20 '17 at 06:32 AM

I'm a bit confused on what to plug in for the object node in the cast game instance.

(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