![]() |
|
|
#1 |
|
Save DataObject Compile Error
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 |
|
I believe I've found a work around for this issue -- It may even turn out to be a better solution than the original
. However, I'm still interested in the answer if anyone knows about the compiler issue.
|
|
|
|
|
|
|
#3 |
|
Would you mind sharing your work-around?
thanks, codepig |
|
|
|
|
|
|
#4 |
|
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 by jag1949; 18th Mar 2004 at 01:57 AM. |
|
|
|
|
|
|
#5 |
|
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 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");
}
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");
}
![]() 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.
|
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|