Closed krojew closed 1 month ago
Thanks, will take a look! However if you want to include your own copyright at the top of the files, please also add the MIT license text so it's clear you're allowing the code to be included.
Sorry, that was autogenerated.
@sinbad anything else to change?
Sorry, I don't code over the weekend, will look at it today.
Thanks!
@krojew Would you be able to give details on how this component is supposed to be used? I'm not sure I've understood it properly.
I've run a quick test here by adding the comp to a spud actor, it does save/load with the world partition cell, but it also gets destroyed if a manual save is executed due to OnPreUnloadCell
being called.
I am also unsure how stable cell names are between builds, aren't cells regenerated on each cook thus potentially invalidating the cell name used by this component?
It should store the actor withing a cell, destroy it when the cell gets unloaded, and restore on cell loading. It shouldn't destroy anything on manual save - that's something I didn't notice. Can you make a fix for that?
I am also unsure how stable cell names are between builds, aren't cells regenerated on each cook thus potentially invalidating the cell name used by this component?
I think they should be stable. Do you have any more info on this?
Asked Epic, cell names are stable between cooks. They can however change in some cases such as changing the cell size, and probably other WP settings. So it shouldn't be an issue but should be expected if using this component. Maybe worth adding as a comment to the class.
Regarding the potential issue, it might just be due to a local setup. Could you share how an actor should be setup to use this component? Should it implement the ISpudObject interface? The SpudGuid? Any specific overrides?
The actor should be set up the same way as other runtime-spawned actors, so it needs the guid.
@Deams51 I might have a fix for the destruction on save tomorrow, but it's quite difficult to test, so no guarantees.
actor component version of https://github.com/sinbad/SPUD/pull/96 for improved versatility