Heres A Brain Jerker!!!
by Chris "DiGi" Timberlake · in General Discussion · 05/31/2004 (7:10 pm) · 13 replies
Ok, I got my map made in my version of Tread 3D (I'm making a map editor based upon it). And so far i've gotten a nice error, which has me puzzled. Let me post the output.
and that line reads,
Edit: Not the full .map file.
Quote:[ Execing Map2Diff... ]
spawn: J:\projects\AW\example\aw\data\maps\objects\map2dif.exe J:\projects\AW\example\aw\data\maps\objects\house.map
Successfully opened map file: J:\projects\AW\example\aw\data\maps\objects\house.map
Parsing mapfile...Error processing entity brushlist on or near line: J:\projects\AW\example\aw\data\maps\objects\house.map: 4Error parsing map file: J:\projects\AW\example\aw\data\maps\objects\house.map
and that line reads,
Quote:
{
"classname" "worldspawn"
"wad" "D:\Documents and Settings\DiGi\My Documents\maps\aw.wad"
{
( 280 -564 182 ) ( 280 -564 -182 ) ( -472 -564 -182 ) F -120 -349 0 1 1
( -472 -564 182 ) ( -472 -564 -182 ) ( -472 -548 -182 ) F 236 -349 0 1 1
( 280 -548 -182 ) ( 280 -564 -182 ) ( 280 -564 182 ) F 236 -418 0 1 1
( 280 -564 182 ) ( -472 -564 182 ) ( -472 -548 182 ) F -120 -236 0 1 1
( -472 -548 -182 ) ( -472 -564 -182 ) ( 280 -564 -182 ) F 72 -236 0 1 1
( -472 -548 182 ) ( -472 -548 -182 ) ( 280 -548 -182 ) F 72 -349 0 1 1
}
{
( -456 -476 -122 ) ( -352 -476 -122 ) ( -352 -548 -122 ) F 200 -732 0 1 1
( -456 -548 -146 ) ( -352 -548 -146 ) ( -352 -476 -146 ) F 200 -292 0 1 1
( -456 -548 -122 ) ( -352 -548 -122 ) ( -352 -548 -146 ) F 200 -378 0 1 1
( -352 -476 -122 ) ( -456 -476 -122 ) ( -456 -476 -146 ) F 608 -378 0 1 1
( -456 -476 -122 ) ( -456 -548 -122 ) ( -456 -548 -146 ) F 732 -378 0 1 1
( -352 -548 -122 ) ( -352 -476 -122 ) ( -352 -476 -146 ) F 292 -378 0 1 1
}
{
( -352 -476 -138 ) ( -320 -476 -138 ) ( -320 -548 -138 ) F 96 -732 0 1 1
( -352 -548 -182 ) ( -320 -548 -182 ) ( -320 -476 -182 ) F 96 -292 0 1 1
( -352 -548 -138 ) ( -320 -548 -138 ) ( -320 -548 -182 ) F 96 -394 0 1 1
( -320 -476 -138 ) ( -352 -476 -138 ) ( -352 -476 -182 ) F 576 -394 0 1 1
( -352 -476 -138 ) ( -352 -548 -138 ) ( -352 -548 -182 ) F 732 -394 0 1 1
( -320 -548 -138 ) ( -320 -476 -138 ) ( -320 -476 -182 ) F 292 -394 0 1 1
Edit: Not the full .map file.
About the author
#2
( -32 0 -128 ) ( -32 -128 -128 ) ( 96 0 -128 ) MYTEXTURE [ 1 0 0 32 ] [ 0 -1 0 -32 ] 0 1 -1
Where the first three sets of points define the plane, texture name is next, the set of data in the [] is first the U axis and second the V axis, then the following 0 is the texture rotation, the last two values are scale.
Compare that to your format:
( -352 -476 -138 ) ( -320 -476 -138 ) ( -320 -548 -138 ) F 96 -732 0 1 1
Looks like the UV texture axis info is missing/incorrectly defined.
05/31/2004 (7:50 pm)
From what I can see (based on the limited knowledge I have of the .map format), it looks like your brush data is invalid. Within each brush you have a list of planes with texture info. For example:( -32 0 -128 ) ( -32 -128 -128 ) ( 96 0 -128 ) MYTEXTURE [ 1 0 0 32 ] [ 0 -1 0 -32 ] 0 1 -1
Where the first three sets of points define the plane, texture name is next, the set of data in the [] is first the U axis and second the V axis, then the following 0 is the texture rotation, the last two values are scale.
Compare that to your format:
( -352 -476 -138 ) ( -320 -476 -138 ) ( -320 -548 -138 ) F 96 -732 0 1 1
Looks like the UV texture axis info is missing/incorrectly defined.
#3
05/31/2004 (8:00 pm)
Its not exporting the texture data then, i have it textures, i moves the texter cordinates, around, and its still the same thing.
#4
Edit: I figuare posting too much in one post gets annoying and will clutter forums but anyway, does this look right? I'm not sure, but it didn't look right too me.
05/31/2004 (8:09 pm)
Update: I load a premade .map file and it says unable to read plane then it says missing brush texture and crashes. =\Edit: I figuare posting too much in one post gets annoying and will clutter forums but anyway, does this look right? I'm not sure, but it didn't look right too me.
// We override this to remove the "wad" key from the worldspawn.
int CHalfLifeMapFile::ReadEntity(CEntity** ppEntity, CTread3DDoc* pDocument, CTokenizer& Tokenizer)
{
int r = CQuakeMapFile::ReadEntity(ppEntity, pDocument, Tokenizer);
if(r != QRF_WORLDSPAWN)
return r;
// Remove the key.
(*ppEntity)->DeleteKey("wad");
return r;
}
// We override this to write the texture name in UPPERCASE
bool CHalfLifeMapFile::WriteFace(CFace* pFace, CTread3DDoc* pDocument, fstream& file)
{
int i;
// Just skip.
if(pFace->GetNumPoints() < 3)
{
Warning("CQuakeMapFile::WriteFace(): < 3 pts.");
return true;
}
// Write the 3 point plane def.
vec3_t* vPoints = pFace->GetPoints();
for(i = 0; i < 3; i++)
file << "( " << (int)(floor(vPoints[i][0] - 0.5) + 1) << " " << (int)(floor(vPoints[i][1] - 0.5) + 1) << " " << (int)(floor(vPoints[i][2] - 0.5) + 1) << " ) ";
CString sTexture = pFace->GetTextureName();
sTexture.MakeUpper();
file << sTexture;
vec_t vShifts[2], vScales[2];
pFace->GetTexScales(vScales);
pFace->GetTexShifts(vShifts);
file << " " << (int)vShifts[0] << " " << (int)vShifts[1] << " " << (int)pFace->GetRotation() << " " << vScales[0] << " " << vScales[1];
file << "\n";
m_nFaceCount++;
return true;
}
bool CHalfLifeMapFile::WriteWorldspawn(CEntity* pEntity, CTread3DDoc* pDocument, CLinkedList<CBaseObject>* pObjectList, CLinkedList<CBaseObject>* pSelectedObjectList, fstream& file)
{
file << "{\n";
file << "\"classname\" \"worldspawn\"\n";
// Write keys;
ENTITYKEY* pKey;
CLinkedList<ENTITYKEY>* pKeyList = pEntity->GetKeyList();
pKeyList->First();
for(pKey = pKeyList->GetCurItem(); pKey != NULL; pKey = pKeyList->GetNextItem())
{
if(pKey->sName == "$SURFACE_77X" || pKey->sName == "$CONTENTS_77X")
continue;
if(pKey->sValue == "0" || pKey->sValue == "")
continue;
file << "\"" << pKey->sName << "\"" << " \"" << pKey->sValue << "\"\n";
}
// Write the .wad list.
file << "\"wad\" \"";
bool bSemi = false;
GAMEPAKFILE* pPak;
CLinkedList<GAMEPAKFILE>* pPakList = GetGameAPI()->GetCurrentGame()->GetPakFileList();
pPakList->First();
for(pPak = pPakList->GetCurItem(); pPak != NULL; pPak = pPakList->GetNextItem())
{
if(bSemi)
file << ";";
bSemi = true;
file << pPak->sFilename;
}
file << "\"\n";
// Normal.
if(!WriteObjectList(pObjectList, OBJECT_CLASS_BRUSH|OBJECT_CLASS_GROUP, pDocument, file))
return false;
if(!WriteObjectList(pSelectedObjectList, OBJECT_CLASS_BRUSH|OBJECT_CLASS_GROUP, pDocument, file))
return false;
file << "}\n";
return true;
}
#5
06/01/2004 (1:07 am)
The map file you are testing seems to be the newer format of Half-life's .map system. Correct? Tread3d only reads the older ones I believe.
#6
The .map file format which Torque uses (since you mentioned map2dif) needs the texture data described in the format I posted earlier. It looks like your just outputting the texture "shift" (which I guess is offset/translation) after the texture name. The rotation and scale data should be ok though.
06/01/2004 (4:43 am)
I haven't seen the new map file system but that sounds like something you should check up on.The .map file format which Torque uses (since you mentioned map2dif) needs the texture data described in the format I posted earlier. It looks like your just outputting the texture "shift" (which I guess is offset/translation) after the texture name. The rotation and scale data should be ok though.
#7
06/01/2004 (8:10 am)
O.o I think it may be inheriting some stuff from a plugin file which IS NOT installed.
#8
06/01/2004 (8:21 am)
Does your map file have V220 or some such id string, map2dif requires version 220 half-life format. It has been a while since I worked with it but it should say 220 in the header somewhere.
#9
06/01/2004 (8:36 am)
No, it didn't say anything about it, although in a plugin file's header is displayed an idea of how a map format works (off the top of his head). The code was written in 1999, I donno when V220 came out.Quote://
// Reads/Writes Quake .map files. The CBaseTreadMapFile defines two routines: WriteMap() and ReadMap().
// Tread will invoke those procedures to, well, read and write maps of that type. Once those calls are
// made Tread has gone through the verification process, so reverifying type may be overkill. This code
// is straight out of Tread. We define other virtual calls here because it's very easy to "tweak" the file
// loading to make it work with Quake2 and HalfLife.
//
// The TREAD2XHEADERINFO structure defines information about the map being read/written, such as game type
// and the position of the different views. WriteMap() defines two lists that must be saved: the normal list
// and the selected object list. Tread doesn't consolidate things into a single list for map io. During reading
// you should use the document to attach objects to the map for the most part. The code in this class should give
// you a pretty good idea of how this is to be done. You can get away with linking object straight into the object
// list, and it often is faster to do this. Each call to AddObjectToMap() and AddObjectToSelection() causes Tread
// to updates certain class counts (it keeps tracks of the count of types of objects in the lists). Most of this
// code should make sense to those familiar with the Quake map format. For those not familiar with it, here's what it
// looks like:
//
// {
// "classname" "worldspawn"
// { // brush 1
// ( x y z ) ( x y z ) ( x y z ) shiftx shifty scalex scaley rotation "texture"
// }
// }
//
// At least, I think that's what it is. That was off the top of my head, so forgive me if that wasn't
// quite right.
//
// Unfortunately, it's nearly impossible to tell a Quake map from a Quake2 map from a HalfLife map. You just really can't.
// Treads GDF2 scripts define a global definition called: def_gamemaptype. This allows map code to figure out if it should
// take control of reading/writing maps.
//
// IMPORTANT NOTE: the hFile parameter passed on the ReadMap() / WriteMap() should *not* be closed. If you have to close
// the file (as we do in the code here) you must re-open it or Tread will die when you return from the call.
//
#10
06/01/2004 (9:12 am)
The simplest thing you can try is create something in WorldCraft save it as .map and the look at that file, that is what all the files should look like.
#11
Edit: Does anyone have a example of how .map files are to be in source??
06/01/2004 (9:33 am)
Ok, thnx, i was looking @ the .map files that came w/ torque, and i see the difference, but when i load it in tread, it crashes with "Unable to read plane"Edit: Does anyone have a example of how .map files are to be in source??
#12
Are you serious? SMALL fee?
06/01/2004 (11:48 pm)
Quote:Yes, it will, although I might charge a small fee like 100$ per project
Are you serious? SMALL fee?
#13
06/02/2004 (12:04 pm)
I'm not charging 1000$, 100$ is commercial use, they get special features, and an editor with their own format and copyrights name and such.
Torque 3D Owner Chris "DiGi" Timberlake