News UnrealEd Files Mods FragBU Liandri Archives
BeyondUnreal Forums

Go Back   BeyondUnreal Forums > Unreal Development > Coding

Reply
 
Thread Tools Display Modes
Old 13th Feb 2004, 03:15 AM   #1
jag1949
Registered User
 
jag1949's Avatar
 
Join Date: Sep. 28th, 2003
Posts: 25
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?
jag1949 is offline   Reply With Quote
Old 14th Feb 2004, 06:21 PM   #2
jag1949
Registered User
 
jag1949's Avatar
 
Join Date: Sep. 28th, 2003
Posts: 25
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.
jag1949 is offline   Reply With Quote
Old 14th Feb 2004, 09:19 PM   #3
CodePig
Registered User
 
CodePig's Avatar
 
Join Date: Apr. 22nd, 2003
Posts: 124
Would you mind sharing your work-around?

thanks,
codepig
CodePig is offline   Reply With Quote
Old 16th Feb 2004, 02:18 AM   #4
jag1949
Registered User
 
jag1949's Avatar
 
Join Date: Sep. 28th, 2003
Posts: 25
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.
jag1949 is offline   Reply With Quote
Old 18th Mar 2004, 01:57 AM   #5
jag1949
Registered User
 
jag1949's Avatar
 
Join Date: Sep. 28th, 2003
Posts: 25
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.

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.
jag1949 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 09:49 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.

Copyright ©1998 - 2012, BeyondUnreal, Inc.
Privacy Policy | Terms of Use
Bandwidth provided by AtomicGamer