Archived

This topic is now archived and is closed to further replies.

little help needed - milkshape loading and strings

This topic is 5701 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Im trying to create a function that reads a bunch of file paths to milkhshape models from a text file and loads them using the milkshape loading routine (look at rsn.gamedev.net). Unfortunately the load of the milkshape model is failing. I think its because of the strings formating but im not sure. I tried this to undo the formatting: char * string; int i = strlen(modelFilename); string = (char *)malloc(sizeof(char) * i); if (string == NULL) { MessageBox( NULL, "Insufficient memory", "Error", MB_OK | MB_ICONERROR ); pModel = NULL; delete(pModel); return(false); } _mbsnbcpy( (unsigned char *)string, (unsigned char *)modelFilename, sizeof(char) * i); but still nothing. Anyone know why the models are not loading?

Share this post


Link to post
Share on other sites
Didn''t work. The load continues to fail after i include the null character. May it be because im passing a char to this char * or would that make a difference?

Help much appreciated

Share this post


Link to post
Share on other sites
I think ive isolated the problem. It turns out that milkshape.cpp doesn''t want to load some of the newer models ive created for my game. They are fairly low poly and have a few textures (which compares to the successful high poly, many tex loads if done successfully). Also the load function seems to fail before the reloadtextures(); function is called. Anyone know why these newer models wont load?

things to know:
I created them with milkshape version 1.59. They also fail when i try to load them with the model viewer. Its says file type unknown.

I can email you the models if you''d like. I would like to post them after i figure out what is going on. They are objects like a hamburger, fries, and a few other objects that might prove "universal" to the games you may be developing. I also have a remake of Ness from Earthbound (a snes game), whose body can be edited to almost any childish character. Unfortunately it cant be loaded with the model viewer either.

Share this post


Link to post
Share on other sites
"Cheers!". I solved the problem. It seems that milkshape 1.5.9 screwes up the *.ms3d file so that Brett''s (outstanding) sdk wont load it. All this is fixed in 1.5.10.

Anyway happy debugging to the rest of you (for me programming is more debugging than anything else)

Ill post those models asap.

Share this post


Link to post
Share on other sites
I stand corrected. Changing to milkshape 1.5.10 fixes one of my problems. The problem with the model loading still persists.

The ifstream still does not want to load the string i read from another file.

Share this post


Link to post
Share on other sites
Its about 12:25 AM on sunday and i finally got the program to work. I just got pissed with the whole dynamic loading thing and decided to hard code the entire thing. It turns out that the problem with the string loading thing was just the tip of a whole bunch of run time errors. For example i commented out the code i recently wrote and everything went fine. I then uncommented it and whenever i tried to load a milkshape model everything freezes (illegal operation and blue screen of death).

Im not even going to bother trying to figure that one out.

But anyway, if you are still with me after reading all of this, thanks. Ill close on a high note. The guys on the NeHe forum are trying to organize a team oriented, internet oriented, game programming contest for the summer. It seems to be generating much interest amoung many programmers. The working theme is reprogramming old games but that may change. They are going to test out the team thing on the 4 elements contest at gamedev. If the game programming contest goes through ill hope to see you there.

And before i forget, Thanks Brett for the outstanding library. Ill try to put it to good use...eventually

Ancient Wisdom:
"Copy and paste fills the page, coding fills the mind...and the debugger."

Share this post


Link to post
Share on other sites