Saved variables and custom objects

+
Saved variables and custom objects

Has anyone attempted or succeeded at making a custom object in their saved variables? I made a follower mod for Triss (http://forums.cdprojektred.com/thre...nshot-Thread?p=1922145&viewfull=1#post1922145) And I've written some code to save which followers are active and save some variables like;

public saved var permanentfollowers : array<CName>;
public saved var permanentfollowers_resource : array<string>;

But preferably I'd like to have one array of custom objects (especially when I want to save more variables...), but when I tried that I didn't work. So, has anyone tried\succeeded at doing so? Just wondering if I did something stupid or perhaps forgot to flag the custom class itself as something or whatever...
 

Guest 2364765

Guest
TBH saved variables themselves are picky.
I tried to save an entity template and it seemed fine, but then trying to retrieve it returned a NULL. Always.

I guess that saving simple stuff like strings, integers or floats works fine but with actual class objects, there's some magic involved that i don't know.
 
Last edited by a moderator:
Objects (class instances) in ws are actually memory references (or object list indexes), so saving them directly could indeed make no sense. As far as I can see, scripts have just a supporting role and all persistent objects are instanced via resources. References to such objects can probably be saved and retrieved.
 
Top Bottom