About Store Forum Documentation Contact



Post Reply 
Material load error
Author Message
Brainache Offline
Member

Post: #1
Material load error
Hey there.. when moving our game from the dev machine to others... I get the following error message:
"cant load F:\watch_scr\data\cmtrl\ms_wall_64.mtrl Additional path obj\watch\homes"

Why is it looking for a hardcoded path? the material is located in the ..\data\cmtrl folder.. and the .gfx files it uses are under the data folder as well...

Suggestions?

Thanks
07-20-2009 11:13 PM
Find all posts by this user Quote this message in a reply
menajev Offline
Member

Post: #2
Re: Material load error
R u sure, that when u made material, image was in \data\cmtrl folder?

Open material with some text editor and search for path.
07-21-2009 09:03 AM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #3
Re: Material load error
when you were using the material, it wasnt located in the "Data' path

you need to apply the material from the game path once again
07-21-2009 10:23 AM
Find all posts by this user Quote this message in a reply
Brainache Offline
Member

Post: #4
Re: Material load error
Thanks for the input folks - on the right path ... I do see that the path is hardcoded in the .mtrl file...

Here is my conundrum: These materials are being created during a model conversion process...
I am loading world studio .3dw files, converting them to .mesh / .phys / .obj and creating all .gfx and .mtrl files used by the world studio file... so I need to find a way to dynamically create these materials while not having the paths hardcoded...

This is how am setting the gfx images used by the material:
if (dif) mat.mat.diffuse=Images(gfxName);

At this point.. a valid .gfx file exists in the f:\watch_Src\data\cgfx folder...

When gfxName is set to a full path ie: ( f:\watch_src\data\cgfx\someimage.gfx ) it creates the materials and works flawlessly.. excpect the path is hardcoded...

When I try using gfxName as "someimage.gfx", "data/someimage.gfx"... it cant load the .gfx file.

Possable related: In my InitPre section:

If I do not set the IOPath... and just do PakAdd("data/engine.pak"); everything works...
but if I do: IOPath("data"); PakAdd("engine.pak"); ( which is how it is setup in my actual game code )..

i get a message saying Unable to load PosOS
( both this converter and the main game .exe are located in the same folder... )

Not concerend about the IOPath thing if there is a way to solve the material path... but I mention that as I have a hunch it may be related...

Any suggestions?

Thanks a ton!
07-21-2009 11:10 PM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #5
Re: Material load error
if you have the EXE here "f:\watch_src\watch.exe"
you have the data here "f:\watch_src\data"
you have the file here "f:\watch_src\data\cgfx\someimage.gfx"

then you need to set IOPath("data");
and load Images("cgfx/someimage.gfx");

and not the way you showed it: "someimage.gfx", "data/someimage.gfx"
07-22-2009 11:09 AM
Find all posts by this user Quote this message in a reply
Brainache Offline
Member

Post: #6
Re: Material load error
Doh! ( at work atm so cant verify.. but i think i DID leave out the cgfx part...)

So that leaves: When I use IOPath("data")... it causes a message saying 'Unable to load PosOS'

What is PosOS... (Might be Pos06... kinda hard to tell...)

Any ideas on that?
07-22-2009 01:56 PM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #7
Re: Material load error
oh, this may be a shader located in the "engine.pak"
make sure you load it properly, and you use the latest "engine.pak" version from the latest enginesdk
07-22-2009 02:05 PM
Find all posts by this user Quote this message in a reply
Brainache Offline
Member

Post: #8
Re: Material load error
Thanks for the help... turns out that I had a second call to IOPath occuring right before using the file I/O dialog box... not sure why I did that... its always the hidden, stupid things that drive one crazy...
07-23-2009 03:57 PM
Find all posts by this user Quote this message in a reply
Post Reply