OBJ LOAD woes

  • 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.

The Knight Argent

New Member
Feb 5, 2000
17
0
0
47
www.doesntexist.net
OK. I decided to clean up my workflow a bit and moved my sound files to a uax file, my meshes to a usx file, and so forth. I learned that I would need to use EXEC OBJ LOAD lines to load the files during compile so UCC could find the resources stored within. However, the following code doesn't compile. UCC says it still can't find Sound 'ELMS2K3_Sounds.EvilLaugh' . Am I missing something?


Code:
//Load the sounds file, so it can find EvilLaugh.
#exec OBJ LOAD FILE=..\Sounds\ELMS2K3_Sounds.uax

class ELMS2K3_CoinPouch extends Inventory;


var int CoinCount;
var float CoinLimit;

function AddCoin()
{

    local sound EvilLaugh;
    EvilLaugh = Sound'ELMS2K3_Sounds.ELMS.EvilLaugh';

    // Add one coin
    CoinCount++;


    log("Player has " $ CoinCount $ " coins.");
	if (CoinCount >= CoinLimit)
	// Player has enough coins to buy a life
            {
        // Subtract the number of coins to buy a life
        CoinCount = CoinCount - CoinLimit;

        // Add one life to the player
        xpawn(owner).PlayerReplicationInfo.Deaths = xpawn(owner).PlayerReplicationInfo.Deaths - 1;   	    
        // Tell everyone about it.  <evil grin>
        xpawn(owner).PlaySound(EvilLaugh);
        xpawn(owner).ClientMessage ("You have gained an extra life!");
	}
}
 

Mr Evi1

New Member
Mar 22, 2002
336
0
0
UK
come.to
Make sure you don't have any copies of the uax anywhere other than the UT2003\Sounds directory. UCC seems to like looking in all sorts of folders for packages, and will use the first one it finds.

Try specifying 'EvilLaugh' as a var instead of local and set it in the default properties. Then UCC will load the package automatically without the need for the OBJ LOAD.
 

The Knight Argent

New Member
Feb 5, 2000
17
0
0
47
www.doesntexist.net
I moved the variable as you suggested and now I get 'unresolved references' from UCC. I have a total of 7 places in my code where I try to get an asset from another file, and they all fail. I'm missing something simple, I'm sure.

Just to cover the bases, I'm using WOTGreal for editing and am patched up.
 

Romanov

New Member
May 8, 2003
86
0
0
UK
can u post the exact error mesage it may be easier than guessing, no i dont think they have to 8.3 you shouldnt need to define a package for a uax, have u tried using playsound in your code and does this work? in othert words do you actually hear the sound in game?
 

[SAS]Solid Snake

New Member
Jun 7, 2002
2,633
0
0
40
New Zealand
www.digitalconfectioners.com
Check upper caps and lower caps. UCC seems really fussy on that too. The best way to get a proper reference in UCC I find, is to just make a map, put a static mesh on and assign its skin to your texture and then copy & paste the reference. Worked for me ... very oddly though.

Otherwise referencing as a variable would be better since it wouldn't need to load the package.
 

Dryn

New Member
Feb 20, 2003
128
0
0
Visit site
THe only way I could get obj load statements to work is to have the .uax and the like within the UT2003 folders; ut2003/sounds/*.uax, etc. Even changing the line itself had no effect, or the paths in the ini; try that, and see if it works.
 

Wormbo

Administrator
Staff member
Jun 4, 2001
5,913
36
48
Germany
www.koehler-homepage.de
The #exec directives use the UT2003\YourMod directory as base path for relative paths. Just leaving out the path implies that the file you specified is in that directory. If UCC successfully loads the package you should be able to access its objects just throught e.g. Sound'EvilLaugh' without problems, although you have to make sure there are no other sounds with that name in any loaded package.


BTW: INI settings for package paths don't seem to be that important for importing packages. The following line works perfectly for me (see PlanetJailbreak for the proof ;)) and the package is in the UT2003\JBAddonLlama\StaticMeshes directory, which is not mentioned in any INI file at all:
Code:
#exec obj load file=StaticMeshes\LlamaHead.usx package=JBAddonLlama.LlamaHead

The "package=..." parameter has the advantage that the package is not simply loaded but imported into the code package. You don't need the original package after compiling anymore, that's why it's in such a strange location in my case.
 
Last edited:

The Knight Argent

New Member
Feb 5, 2000
17
0
0
47
www.doesntexist.net
OK you asked for it :)

First off, thanks to all you guys trying to help me out. I've read all of your comments and have tried all of them at one time or another.

Here's the most recent version of the code:

Code:
// ============================================================
// ELMS2K3.CoinPouch:
//     this object spawns with the player.  It keeps track of
//     the number of SoulCoins in his possession and grants the
//     extra life if enough are collected.
// ============================================================

//Load the sounds file, so it can find EvilLaugh.
//#exec OBJ LOAD FILE=..\Sounds\ELMS2K3_Sounds.uax

class ELMS2K3_CoinPouch extends Inventory;

var int CoinCount;
var float CoinLimit;
var sound EvilLaugh;

function AddCoin()
{

    // Add one coin
	CoinCount++;


    log("Player has " $ CoinCount $ " coins.");
	if (CoinCount >= CoinLimit)
	// Player has enough coins to buy a life
    {
		// Subtract the number of coins to buy a life
        CoinCount = CoinCount - CoinLimit;

        // Add one life to the player
        xpawn(owner).PlayerReplicationInfo.Deaths = xpawn(owner).PlayerReplicationInfo.Deaths - 1;
          // .GameReplicationInfo.MaxLives++;

	    // Tell everyone about it.  <evil grin>
        xpawn(owner).PlaySound(EvilLaugh);
        xpawn(owner).ClientMessage ("You have gained an extra life!");

	}
}

defaultproperties
{
    EvilLaugh = Sound'ELMS2K3_Sounds.ELMS.EvilLaugh'
}

And here's the error message:

Importing Defaults for ELMS2K3_CoinPouch
ObjectProperty ELMS2K3.ELMS2K3_CoinPouch.EvilLaugh: unresolved reference to 'Sound'ELMS2K3_Sounds.ELMS.EvilLaugh''

Please note that I double (and triple) checked the case, and verified that ELMS2K3_Sounds.eax exists in my UT2003/Sounds folder. I also verified that EvilLaugh exists in the EAX file and it is inside the ELMS group. FYI, I have tried the above code with and without the group section.

This is only one UC file of my package. I am having identical problems with five other files - some trying to access my UAX file, and some to ELMS2K3_Meshes.usx.
 
Last edited by a moderator:

The Knight Argent

New Member
Feb 5, 2000
17
0
0
47
www.doesntexist.net
Also, If I try to use OBJ LOADs, I get a message like this:

Warning: Failed to load '..\Sounds\ELMS2K3_Sounds.uax'. Can't find file for package 'ELMS2K3' (That's my main package name - the one I'm trying to compile)
 

Mr Evi1

New Member
Mar 22, 2002
336
0
0
UK
come.to
So it says it can't find the package you are compiling, not the sound package? Perhaps you should try using a different name for the sound package.
 

The Knight Argent

New Member
Feb 5, 2000
17
0
0
47
www.doesntexist.net
The way I understand that warning, it means that it couldn't load the file for use inside my main package. I have tried taking out the underscore, but that didn't help. I have to be missing something very basic here. This code is just like others I've seen from other mods and UT itself.
 

The Knight Argent

New Member
Feb 5, 2000
17
0
0
47
www.doesntexist.net
UCC can't find files

OK. My tribulations continue...

I have moved all of my references to other packages into defaultproperties, as Mr. Evi1 suggested. I now get the following errors on compile:


Code:
Log: Importing Defaults for ELMS2K3_CoinPouch
Warning: Failed to load 'ELMS2K3': Can't find file for package 'ELMS2K3'
Warning: Failed to load 'ELMS2K3_Meshes': Can't find file for package 'ELMS2K3'
Warning: Failed to load 'ELMS2K3_Sounds': Can't find file for package 'ELMS2K3'
Warning: Failed to load 'Sound ELMS2K3_Sounds.ELMS.EvilLaugh': Can't find file for package 'ELMS2K3'

And here's the code for said class:

Code:
// ============================================================
// ELMS2K3.CoinPouch:
//     this object spawns with the player.  It keeps track of
//     the number of SoulCoins in his possession and grants the
//     extra life if enough are collected.
// ============================================================



class ELMS2K3_CoinPouch extends Inventory;


var int CoinCount;
var float CoinLimit;
var sound EvilLaugh;

function AddCoin()
{

    // Add one coin
	CoinCount++;


    log("Player has " $ CoinCount $ " coins.");
	if (CoinCount >= CoinLimit)
	// Player has enough coins to buy a life
    {
		// Subtract the number of coins to buy a life
        CoinCount = CoinCount - CoinLimit;

        // Add one life to the player
        xpawn(owner).PlayerReplicationInfo.Deaths = xpawn(owner).PlayerReplicationInfo.Deaths - 1;
        // .GameReplicationInfo.MaxLives++;

	    // Tell everyone about it.  <evil grin>
        xpawn(owner).PlaySound(EvilLaugh);
        xpawn(owner).ClientMessage ("You have gained an extra life!");

	}
}

defaultproperties
{
    EvilLaugh=Sound'ELMS2K3_Sounds.ELMS.EvilLaugh'
}

I have checked the paths entries in UT2003.ini, and have tried various locations for the files, as well as various incarnations of OBJ LOAD lines, with different FILE clauses. Any other ideas?
 
Last edited by a moderator:

punk129

!!!!!!!!!!!11111111111
Jan 18, 2003
172
0
0
Germany
www.punk129.com
Log: Importing Defaults for ELMS2K3_CoinPouch
Warning: Failed to load 'ELMS2K3': Can't find file for package 'ELMS2K3'
Warning: Failed to load 'ELMS2K3_Meshes': Can't find file for package 'ELMS2K3'
Warning: Failed to load 'ELMS2K3_Sounds': Can't find file for package 'ELMS2K3'
Warning: Failed to load 'Sound ELMS2K3_Sounds.ELMS.EvilLaugh': Can't find file for package 'ELMS2K3'

What type of package is ELMS2k2 (the first warning)? Texture? Dont't use the same package name as in the codepackage.
 

Wormbo

Administrator
Staff member
Jun 4, 2001
5,913
36
48
Germany
www.koehler-homepage.de
Please don't start a new thread for the same problem.


What are the names of the packages (with extension) you use in your project?
You definately have to use "#exec obj load", but did you try using Sound'EvilLaugh' instead of the sound's long name already?
 

The Knight Argent

New Member
Feb 5, 2000
17
0
0
47
www.doesntexist.net
Sorry about that.

The packages I have are:

/Sounds/ELMS2K3_Sounds.uax
/StaticMeshes/ELMS2K3_Meshes.usx
/Textures/ELMS2K3_Textures.utx

and the package I'm trying to compile is ELMS2K3.u


I have tried your suggestion, Wormbo, and I get the same result.
 

Dryn

New Member
Feb 20, 2003
128
0
0
Visit site
Well, did you try using the ut2003 root folder paths instead of the MyProject paths? importing anything like a static mesh or a texture works through the MyProject organisation, but if its a pre-made unreal package, the only way I have been able to load on compile is to have them reside in the UT2003 folders; aka .utx in UT2003/Textures, and _only_ that location.

#exec OBJ LOAD FILE=FraySourceTextures.utx

That file is from my import class, and the associated .utf file resides in ut2003/textures; it _will not_ compile if the syntax or path changes, and the compile fails with the same error as seen above; it can't find the package in the right location, so it aborts.