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. 

How to save whether an actor is destroyed

Hi everyone I'm currently making a zombie game and have an inventory and whether the apocalypse has started which save every tick but I can't seem to figure out how to save the items' data being whether it is destroyed or not, could someone please help me. thanks in advance

Product Version: UE 4.19
Tags:
more ▼

asked Jul 14 '18 at 09:48 PM in Blueprint Scripting

avatar image

Chad_kroeger2005
27 1 5 11

avatar image Chad_kroeger2005 Jul 14 '18 at 09:59 PM

I also forgot that I have a parent for the items (and weapons) so I don't need to put it in each blueprint

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

2 answers: sort voted first

OK so after looking for a while I finally found this tutorial: https://www.youtube.com/watch?v=8a87TFLhps0∈dex=27&list=PLmKKTERcjTPKEPl0nk48Tpmj-iWmzqo_Q&t=0s which then helped me do what I was hoping to achieve so for anyone having the same issue or a similar issue just follow this tutorial or if you want to make the entire system he does follow the whole 36 episodes and you'll be good to go. and thank you mightyenigma for all of your help I greatly appreciate it

more ▼

answered Jul 17 '18 at 01:42 PM

avatar image

Chad_kroeger2005
27 1 5 11

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

https://youtu.be/XjPdyoy7ySo

This sounds like what youre looking for. If it's not, explain some more.

more ▼

answered Jul 15 '18 at 12:38 AM

avatar image

mightyenigma
3.8k 18 20 20

avatar image Chad_kroeger2005 Jul 15 '18 at 01:56 AM

what if instead of destroying the actor I set the visibility. How would I save the visibility of the actor?

avatar image Chad_kroeger2005 Jul 15 '18 at 03:04 AM

I just tried a different tutorial And it won't work I have posted the screenshots below. If someone could help that would be greatly Appreciated alt text alt text

event-tick-pt1.png (266.2 kB)
event-tick-pt2.png (288.6 kB)
begin-play-pt1.png (224.1 kB)
begin-play-pt2.png (233.0 kB)
begin-play-pt-3.png (209.6 kB)
avatar image Chad_kroeger2005 Jul 15 '18 at 07:26 AM

anyone who can help me please???

avatar image Chad_kroeger2005 Jul 15 '18 at 11:39 AM

OK I figured it out but I need help because, whenever I pickup say an M4A1 and then reload the game it immediately removes all M4A1's in the scene could someone please tell me how to fix this? Please asap because I am in need of help now as I have other features to implement

avatar image mightyenigma Jul 15 '18 at 07:47 PM

It looks like youre savibg only one variable about whether something is picked up and then trying to use that one true/false to decide whether ALL of them are picked up. Did you check out the link I sent you?

avatar image Chad_kroeger2005 Jul 16 '18 at 05:58 AM

Yes I did have a look at the link you sent me however it didn't really help me so I'm just trying to figure out a different way to do it now

avatar image Chad_kroeger2005 Jul 16 '18 at 01:12 PM

I have also tried with an enumeration with different variables which is an array containing the M4A1, AK 47 and the sniper and then I have it so that if it contains the sniper set sniper visibility to hidden etc. but when I reload the game it sets all snipers placed to hidden any ideas why?

avatar image mightyenigma Jul 16 '18 at 04:38 PM

Because it looks like you're only saving one variable to control all of them.

avatar image Chad_kroeger2005 Jul 17 '18 at 05:15 AM

Oh ok so would I have to have seperate variables such as 'picked up M4A1' and 'picked up sniper 1' etc or would I do something else? if something else could you explain what?

avatar image mightyenigma Jul 18 '18 at 08:12 PM

You can do it that way but that would mean creating a variable with a new name for every pick-uppable item in the entire game! That would be a pain.

I'm not sure how I would do it. Maybe put a Tag on each item placed in each map, and in your GameInstance create a Set, and whenever you pick up an item (or even destroy anything), you can add that item's unique (and it has to be unique in the entire game) tag to the Set. Then when you load a map, each Item Blueprint's constructor or pre-constructor can check the GameInstance's ItemsPickedUp set, and see if it Finds the Tag you put in there (or matching string). If it does, then cancel construction or destroy the item.

You might want to do this at the Map level instead, or create a Save Object file with the same name as the Get Current Level Name node returns, and then you don't have to keep a huge Set of PIckedUpAndDestroyedObjects in memory at all times, just one file for each level, but then you'd also need to have the GameInstance load that File into its PickedUpAndDestroyedItems set every time a Level opens (Or each level blueprint could do it on its BeginPlay event) and loop through and destroy things that have been picked up or killed, instead of having the items do it (to eliminate confusion over whether the file has loaded before trying to read the Set.

avatar image Chad_kroeger2005 Jul 19 '18 at 02:25 AM

OK so I had a look yesterday and found this tutorial which helped me to achieve my end goal : https://www.youtube.com/watch?v=8a87TFLhps0 thank you for your help though I really appreciate it

(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