I fixed this in this GitHub commit, but I guess it didn’t make it into 4.5.1. This will certainly be in the upcoming 4.6 release, so this should sort out your issue! I’d recommend getting a GitHub repository set up, as it can be handy for applying hotfixes like this - but if this is a maintenance hassle, you should find it easy just to bring the changes for this commit over to your local repository by hand, as it’s just a single file, and doesn’t depend on any other changes.
I can confirm this is fixed in the 4.6 preview. I can now keep a reference to another actor in a member variable, be it as a regular Actor pointer var, or inside an array. so thanks
but
like I pointed out to I moved on to the next step, and like I foresaw it came with problems.
what I’m doing now is doing a two-way referencing. actor A (the character) keeps a reference to actor B (his house), while actor B (the house) also keeps a reference to actor A (the owner of the house).
so I simulate, let the guy go buy his house, select both the guy and the house, hit K, and get an instant crash. this time around I can’t even go as far as having to press Stop Simulation, the crash is instant after pressing K.
I was already foreseeing this would be potentially dangerous (circular-referencing like that) but I wouldn’t think this is so exotic (I can think of a game with a character holding an inventory item like a weapon, and the weapon knows about his Owner. this is how it was in UT3 in unrealscript, and something similar is probably going on in ShooterGame since they are so alike)
so if this is not the correct way to do it, could I maybe get pointed into how?
I don’t think this is the error, however I just want to check to be safe. Have you made changes to your code to reflect the new code changes from 4.6? You can find information on what has changed in the C++ sections of the Release Notes, found here: Unreal Engine 4.6 Released! - Announcements - Epic Developer Community Forums!
I can confirm that Keeping the Simulation Changes of 2 actors that reference eachother still crashes, on full 4.6, having applied the C++ changes from the release notes (and 's post in the forums)
remember you also have my sources for reproducing - just simulate, wait a minute, select the character that went inside the box on the right, also select the box, press K, crash
I passed the callstack and log on to be assessed and will post again once I have more information. I just wanted to update you to let you know we are still looking at this.
open the test scene, press Simulate, wait for te characters to move to the boxes, select the character that went into the smaller box, selct it and wait for the properties to refresh (check the AI Lifestyle vars group), wait a few seconds, now with the character still selected also select the box, press K, crash
Unfortunately I no longer have a copy of your project and the filedropper link sent in a previous message is no longer populated, which is why I was asking. If you want to send another link with the project attached I can get it and see what we can do. Or, if you have repro steps that do not require your project we can attempt to repro it on our end without you having to upload your project again. Thank you!
I just sent you the link to my Project files via PM in the forums again.
I wonder why you guys deleted them on your end. like I told you I was already anticipating the problem would only be partially solved. and this question keeps getting marked as resolved, despite it’s been more than 8 months now and the problem is still there X_X
once again here are the repro steps:
compile the project of course
open eTestMap.umap, and start Simulate
wait for the AI characters to go to the Place Volume Actors
still simulating, select the character that went to the smaller of the two volumes. check its properties
under the “AI Life” category of the properties check the array of HomePlaces. when the AI character “buys” the place this array will have a new element created, with a reference to the new place
with the character still selected, now also select the Place Volume Actor that he went into, press K (keep simulation changes), stop simulating, and it will crash
I have great news! After the past few weeks of digging, it looks like this has finally been resolved in editor. We are not seeing it in 4.7 so it may be available with the next engine release. Please keep an eye out to see if this ends up helping!
I think it should be ok in the preview however I am not 100% certain as I tried this on an internal build from a later build date.I believe it should work, however.