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"

Cant Save Pawn with Struts and var attached

Hello, So im trying to save an array or pawns which have struts and variables attached to it. Every time I try to load the pawns then spawn them. I tend to get a not valid object on the saved array. I can load an array or struts no problem it seems to be only the array of pawns that is the problem. alt textalt text

Example of what im trying to do. alt text

Product Version: UE 4.21
Tags:
3.jpg (188.6 kB)
4.jpg (164.6 kB)
more ▼

asked Jan 10 '19 at 06:04 PM in Blueprint Scripting

avatar image

Snowynight
56 5 8 12

avatar image Nebula Games Inc Jan 10 '19 at 07:30 PM

Def gonna need way more info to figure out what is wrong with a save/load system. You need to post screen shots of how the arrays are created, the save game object creation, the load game script etc.

avatar image Snowynight Jan 10 '19 at 07:44 PM

alt textalt textalt textalt textalt text

s1.jpg (132.5 kB)
s2.jpg (107.2 kB)
s3.jpg (91.7 kB)
s4.jpg (36.1 kB)
s5.jpg (28.4 kB)
avatar image Nebula Games Inc Jan 10 '19 at 07:58 PM

You never actually "save" anything here. I don't see a "save function" just a load function where you create a save game object, set it as a variable, then load a game slot, cast to your save game object then save over the variable. That does not make logical sense. Think about the first time you run this, your logic is as follows:

  1. Create a blank save game object

  2. Save this as a variable

  3. Load game from slot ??? What slot? When did you save to slot?

  4. Overwrite blank save game object with the empty save game data from the non-existent slot

  5. Pull out the empty data and set the variables to wherever you got your array data from

Before you "Load" anything from slot, there should be a "Save Game To Slot" first...not after. The only "Save Game To Slot" node I see, comes after a load game....very weird.

avatar image Snowynight Jan 10 '19 at 08:07 PM

I forget to upload the 6th

alt text

s6.jpg (161.5 kB)
avatar image Nebula Games Inc Jan 10 '19 at 08:14 PM

Still can't figure out the order of all these operations. Order is very important when saving and loading. All the nodes you cut off (the long white execution lines) I need to see where they are going, who calls what functions etc. Can't really figure out the logical order of this stuff without seeing the beginning.

avatar image Snowynight Jan 10 '19 at 08:24 PM

This is in the level BP. I don't think you'll need any more than that to figure it out. alt textalt textalt text!alt text

cworld.jpg (246.8 kB)
levelbp.jpg (95.7 kB)
s1.jpg (132.5 kB)
s3.jpg (91.7 kB)
avatar image Snowynight Jan 10 '19 at 09:09 PM

Inside the pawn contains a strut and other variables. Im trying to save the paws with all the variables. instead of saving them individually.

avatar image Snowynight Jan 10 '19 at 10:51 PM

Made an example project to try and show what im trying to do. This is every thing. alt text

avatar image Snowynight Jan 10 '19 at 10:53 PM

Try and run it the engine crashes.

avatar image Nebula Games Inc Jan 11 '19 at 02:45 AM

What kind of error message comes up or do you mean a full crash and exit and you have to restart the editor? Also can you try just saving an array of pawns? Forget the struct for now?

avatar image Snowynight Jan 11 '19 at 08:10 PM

Don't worry thanks though. Im just giving up and just saving the var as stuts with index id.

(comments are locked)
10|2000 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
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