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"

Save Game Boolean Not Working

I'm struggling to save a boolean variable from a class of objects (Door 5).

Basically, I want to save whether or not the door is open, and then load that back up.

This is working in the game, but as soon as I reload, it won't load the doors in the right state (open/closed).

This is the construction script of my object:

alt text

This is my saving of the game (in first person character blueprint).

alt text

This is my loading of the game (in first person character blueprint).

alt text

Product Version: UE 4.19
Tags:
more ▼

asked Apr 30 '18 at 12:48 PM in Blueprint Scripting

avatar image

dewdle
16 1 3 5

avatar image dewdle Apr 30 '18 at 12:50 PM

Note: the game is successfully saving the player location/rotation, but not the doors open/close!!!

avatar image Velrin Apr 30 '18 at 01:02 PM

Hey Dewdle,

It looks like your images did not post correctly on the thread. Can you post them again?

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

2 answers: sort voted first

SaveGames can't save Actor References, and you're trying to access an array of actors which is empty (which makes sense). You should instead save an array of booleans, and then apply that array in your third screenshot.

more ▼

answered Apr 30 '18 at 03:24 PM

avatar image

goncasmage
897 12 14 25

avatar image dewdle May 01 '18 at 12:46 AM

Any more detail on how to do that?

avatar image dewdle May 01 '18 at 02:35 AM
avatar image goncasmage May 01 '18 at 08:37 AM

When you're using the SetArrayElem node, you should actually be using the Add node. Because that way, you're accessing indeces that don't yet exist in the array. Try that.

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

I'm still having trouble saving Booleans. It seems all of the tutorials are for other variable types. Anyone else have tips?

more ▼

answered May 07 '18 at 11:28 AM

avatar image

dewdle
16 1 3 5

avatar image goncasmage May 07 '18 at 11:57 AM

Can you show your current setup? Also try commenting on the questions instead of creating a new one ;)

avatar image dewdle May 07 '18 at 11:18 PM

Sorry about that.

So I tried to save individual boolean variables, instead of an array, to see if that worked.

In my level blueprint:

I first get the actor (Fuse Box), and then get the variable from inside that actor (Usedlights). I then set the variable (Are Lights on Re Switch Box) in my Save Game actor, and save that to a slot.

https://i.gyazo.com/f58917e1d17dc3efe3dcf5b4f5ee12a4.png alt text

When I load the variable, I get the variable (Are Lights on Re Switch Box) from my Save Game actor, and then use a branch to determine what happens if it is true.

https://i.gyazo.com/b5c6a1293520d03f1e6d2777cc704322.png

alt text

In my Save Game actor:

alt text

avatar image goncasmage May 08 '18 at 08:26 AM

And that doesn't work? Show me how you're saving your boolean.

(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