1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

Save DataObject Compile Error

Discussion in 'Programming' started by jag1949, Feb 13, 2004.

  1. jag1949

    jag1949 New Member

    Joined:
    Sep 28, 2003
    Messages:
    25
    Likes Received:
    0
    I'm getting an error when I try to save a dataObject. The corresponding log error is
    Warning: Can't save ..\Saves\MyObject.uvx: Graph is linked to external private object Package Package

    This error is outlined on the following wiki page.
    http://wiki.beyondunreal.com/wiki/Compiler_Errors

    I've tried moving the classes into the same package as my gametype, but still receive the error. The classes themselves have no private members or variables. What do I need to do to set the RF_Public flag on the offending package?
     
  2. jag1949

    jag1949 New Member

    Joined:
    Sep 28, 2003
    Messages:
    25
    Likes Received:
    0
    I believe I've found a work around for this issue -- It may even turn out to be a better solution than the original :D. However, I'm still interested in the answer if anyone knows about the compiler issue.
     
  3. CodePig

    CodePig New Member

    Joined:
    Apr 22, 2003
    Messages:
    124
    Likes Received:
    0
    Would you mind sharing your work-around?

    thanks,
    codepig
     
  4. jag1949

    jag1949 New Member

    Joined:
    Sep 28, 2003
    Messages:
    25
    Likes Received:
    0
    Not a solution, yet.

    It's not so much a general solution -- I avoided the problem rather than fixed it ;) . Previously, I had what amounted to an Assoc.Array that contained a bunch of objects. When trying to save the array object, I would receive the error (note: this was a runtime error despite the wiki reference to compiler errors). After several failed variations, I found a way to do pretty much what I wanted with a regular array. I haven't yet finished the code, so I am not positive it will work, but it *should*. That's why I've taken so long to respond. Sorry I haven't come up with a "real" solution yet. :)

    [Edit]
    I'll just put my findings in a new post.
     
    Last edited: Mar 18, 2004
  5. jag1949

    jag1949 New Member

    Joined:
    Sep 28, 2003
    Messages:
    25
    Likes Received:
    0
    A solution (for me at least)

    Okay folks, I believe I actually have a solution to this problem. Note, however, this is an answer to what I was doing incorrectly and not necessarily a general solution. I was receiving a runtime error due to faulty implementation on my part (I still don't know if the RF_PUBLIC flag can actually be set somewhere). That being said, if you are trying to save DataObject data and receive the private external graph error, this might help.

    Consider two objects A and B implemented as such:
    Code:
    class A extends Object;
    
    var B objectB;
    
    //function defs
    
    Code:
    class B extends Object;
    
    var int one;
    var int two;
    var int three;
    
    //function defs
    
    Now, we want to load and save this object from file, so we have a gametype (or some other class) that looks like the following we will receive the error.
    Code:
    class NewGameType extends xDeathMatch;
    
    var A objectToBeSaved;
    
    function PreBeginPlay()
    {
    	local B LocalObjectB;
    
    	//load the object from file
    	objectToBeSaved = self.LoadDataObject(class'A',"ObjectName","PackageName");
    	if(objectToBeSaved == None)
    		objectToBeSaved = self.CreateDataObject(class'A',"ObjectName","PackageName");
    
    	LocalObjectB.one = 1;
    	LocalObjectB.two = 2;
    	LocalObjectB.three = 3;
    	
    	objectToBeSaved.ObjectB = LocalObjectB;
    	
    	self.SavePackage("PackageName");
    }
    
    The problem is in the reference to the local object B (Note: now that I think of it, my object may not have been local, but hopefully the example will still make sense to my readers). So, we make the following adjustment.
    Code:
    class NewGameType extends xDeathMatch;
    
    var A objectToBeSaved;
    
    function PreBeginPlay()
    {
    	local class<A> objectToBeSaved;
    	local B LocalObjectB;
    	
    	//load the object from file
    	objectToBeSaved = self.LoadDataObject(class'A',"ObjectName","PackageName");
    	if(objectToBeSaved == None)
    		objectToBeSaved = self.CreateDataObject(class'A',"ObjectName","PackageName");
    
    	
    	LocalObjectB.one = 1;
    	LocalObjectB.two = 2;
    	LocalObjectB.three = 3;
    	
    	objectToBeSaved.ObjectB.one = LocalObjectB.one;
    	objectToBeSaved.ObjectB.two = LocalObjectB.two;
    	objectToBeSaved.ObjectB.three = LocalObjectB.three;
    	
    	self.SavePackage("PackageName");
    }
    
    And everything should load and save correctly. :D

    Note: This code has not actually been tested, but looked like it should work ;). It is really only meant as an example -- hopefully it has been worth looking over.
     

Share This Page