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"

Storing variables and saving data.

So,.. I have read many articles about this topic but I am still confused about which metod to use. Lets say that I have a main character in an offline game. Where should I have variables like MaxHP, PlayerExp and so on. The second question is how should I save this information. I am thankful to anyone that will try to explain it to me.

Product Version: UE 4.16
Tags:
more ▼

asked Jun 19 '17 at 02:58 PM in Blueprint Scripting

avatar image

White Fantasy
3 1 3

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

2 answers: sort voted first

Well because you are making a single player game, it's really unnecessary to have variables in the playerstate because that is ment to be used in multiplayer games for things like your score and points. Variables that u have in the playerstate can be seen by any player in the game so it is usefull in multiplayer.

What u can do in your game is put variables in the game-instance. The game-instance exists over an engine session. So those variables will not get lost untill you quit the game.

Kwatskop

more ▼

answered Jun 19 '17 at 04:45 PM

avatar image

Kwatskop
16 1 4

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

If u open the blueprint from your character, you can make variables and if u set them they will be saved automatically. But if u want to change thme in game and want to keep them you indeed need to make a savegame.

Tuturial: https://www.youtube.com/watch?v=rbEESQUWgfM

more ▼

answered Jun 19 '17 at 03:18 PM

avatar image

Kwatskop
16 1 4

avatar image White Fantasy Jun 19 '17 at 03:30 PM

thx for the answear. I know that I can have variables in my character and it is also where I have them for now but some say that it is better to have them somwhere else like in PlayerState or something so I don't know what to do. Thx again.

(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