Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[Release] Speedy Scb to Obj, Sco Converter 1.6

Rival Gamers Owner
Loyal Member
Joined
Jul 7, 2007
Messages
962
Reaction score
161
hello i'm proud to release this converter i have been working on and off on for the last few 2 days

Programmed in: C++

Features:
Attempts to fix broken .wgt
Generates .wgts files (need to add source below this fix's the armours bug that is if you want to use it for .sco generation)
Convert separate scb files to sco
Convert separate scb files to obj
Convert all scb to obj in the same directory

Convert all scb to sco in the same directory

Download v1.6:

Virus Scan:

Modifications to RsBuild to work with new wgts files

Find (r3dObj.h):
Code:
void		TryLoadWeights(const char* baseFileName);

Add this under it:
Code:
void LoadSourceWeights(const char* fname);

Find(r3dObj.cpp):
Code:
void r3dMesh::TryLoadWeights( const char* baseFileName )
{
	// first, try .wgt
	char weightName[25];

	ToSkinFileName( weightName, baseFileName ) ;

if(r3d_access(weightName, 0) == 0) 
		LoadWeights( weightName );
}

Replace with:
Code:
void r3dMesh::TryLoadWeights( const char* baseFileName )
{
	// first, try .wgt
	char weightName[256], weightsource[256];

	ToSkinFileName( weightName, baseFileName ) ;
	sprintf(weightsource, "%ss", weightName);
	if(r3d_access(weightsource, 0) == 0) 
		LoadSourceWeights(weightsource);
	else if(r3d_access(weightName, 0) == 0) 
		LoadWeights( weightName );
}
void r3dMesh::LoadSourceWeights(const char* fname)
{
	AllocateWeights();

	for(int i=0;i<NumVertices;i++) {
		pWeights[i].BoneID[0] = 0;
		pWeights[i].Weight[0] = 0;
		pWeights[i].BoneID[1] = 0;
		pWeights[i].Weight[1] = 0;
		pWeights[i].BoneID[2] = 0;
		pWeights[i].Weight[2] = 0;
		pWeights[i].BoneID[3] = 0;
		pWeights[i].Weight[3] = 0;
	}


	r3dFile *f = r3d_open(fname, "rb");
	if(!f) r3dError("can't open %s\n", fname);
	char inbuf[256], buf1[128];
	int VertNum = 0;
	fgets(inbuf, sizeof(inbuf), f);
	sscanf(inbuf, "%s %d", buf1, &VertNum);

		for(int i=0; i<VertNum ;i++) 
	{
		
		
		r3dWeight& w = pWeights[i];

		float ws = 0.0f;
		for(int k=0; k<4; k++) 
		{
			
		byte  iBoneId = 0;
		float fWeight = 0;
	fgets(inbuf, sizeof(inbuf), f);
			if(sscanf(inbuf, "%d %f", &iBoneId, &fWeight) == 2)
		{
			if(!(fWeight >= 0.f && fWeight <= 1.f)) r3dOutToLog("Weight Issue: %f", fWeight);
			r3d_assert(fWeight >= 0.f && fWeight <= 1.f);
			w.Weight[k] = fWeight;
			w.BoneID[k] = iBoneId;

			ws += w.Weight[k];
			}
		}

		if(ws > 0.0f) 
		{
			// renormalize weights, because some Maya exporter dude screwed it up.
			w.Weight[0] /= ws; 
			w.Weight[1] /= ws; 
			w.Weight[2] /= ws; 
			w.Weight[3] /= ws; 
		}  
			
	}

	fclose(f);
	return;
}

ScreenShots:
uegL3DO - [Release] Speedy Scb to Obj, Sco Converter 1.6 - RaGEZONE Forums

J6wptJI - [Release] Speedy Scb to Obj, Sco Converter 1.6 - RaGEZONE Forums

pPgdInB - [Release] Speedy Scb to Obj, Sco Converter 1.6 - RaGEZONE Forums

ERG3cbD - [Release] Speedy Scb to Obj, Sco Converter 1.6 - RaGEZONE Forums


Let the leeching begin... lol

Credits:
Me
Warz
GigaToni (for the idea + hints about the weight files)
 

Attachments

You must be registered for see attachments list
Last edited:
☆Dying Dawn☆
Joined
Jan 30, 2012
Messages
971
Reaction score
727
Re: [Release] Warz Scb to Sco Converter

awesome release it's very useful for the RSBuild without scb convert :top:
 
Rival Gamers Owner
Loyal Member
Joined
Jul 7, 2007
Messages
962
Reaction score
161
Re: [Release] Warz Scb to Sco Converter

thanks well i made my rsbuild convert the scb's to sco but when i built a incremental update later on it bugs all textures and weights for some reason so i just made a converter and put rsbuild back to normal hopefully this will solve that :)



Version 1.1 released if you have the previous version it does not work.


edit unfortunately atm this only seems to work correctly with weapons and in some cases it does work with armour

weapon Converted:
sDdIpHl - [Release] Speedy Scb to Obj, Sco Converter 1.6 - RaGEZONE Forums


Rare armours that converted:
tVQh4KP - [Release] Speedy Scb to Obj, Sco Converter 1.6 - RaGEZONE Forums


Amour Converted(will fix soon):
TnBgAn - [Release] Speedy Scb to Obj, Sco Converter 1.6 - RaGEZONE Forums



anyone else got any insight to why some armour conversions cause such a bug? all the flag types are 1.

mind you i used Thailand data to convert
 

Attachments

You must be registered for see attachments list
Last edited:
Joined
Oct 22, 2013
Messages
421
Reaction score
176
Re: [Release] Warz Scb to Sco Converter v1.1

seems to work fine for armour for me just tryed it with the swat armor
REMOVED
 
  • Like
Reactions: Jae
Joined
Aug 14, 2009
Messages
2,304
Reaction score
1,189
Re: [Release] Warz Scb to Sco Converter v1.1

You should look into flags.

Flag 1 means it has weights
Flag 2 means multi UV

btw own_prox that bug is caused by the weight file. Not the model itself. (Weight file = wgt) for example:
It's flag 1 but it can't load the wgt
It's flag 1 but can't create the wgt (Only scb create wgt files.)
It's flag 1 but the wgt file is damaged.
 
Last edited:
Rival Gamers Owner
Loyal Member
Joined
Jul 7, 2007
Messages
962
Reaction score
161
Re: [Release] Warz Scb to Sco Converter v1.1

GigaToni
hmm yeah but when logging all the flag types for armour and weapons it seemed they were only flag type 1, but yeah ill add flags 4 support and look into adding flags 2

Flag 4 Loading:
Code:
// read UV2 section if it exists
	fgets(inbuf, sizeof(inbuf), f);
	if(_r3d_Mesh_LoadSecondUV && strncmp(inbuf, "[UV2]", 5) == 0)
	{
		r3d_assert(VertexSecondUVs == NULL);
		VertexSecondUVs = gfx_new r3dPoint2D[NumVertices];
		VertexFlags |= vfHaveSecondUV;

		for(int i=0; i<NumVertices; i++)
		{
			fgets(inbuf, sizeof(inbuf), f);

			int scanned = sscanf(inbuf, "%f %f", &VertexSecondUVs[i].x, &VertexSecondUVs[i].y);
			if(scanned != 2)
			{
				MessageBox(0, "Bad UV2 mesh format", f->GetFileName(), MB_OK);
				break;
			}
		}
	}

thats easy format in sco would be like this:
Code:
[UV2]
x y
x y

ill add support now

fpskiller
it only seems some amours happen to do this try items from thailand, like the valentine head pieces
here i uploaded them them:

Update:
V1.2 Released with flags 2 & 4 supported however i cannot find a file with such flags to test, if anyone can head me to a .scb or .sco that has them i will be able to actually test it

You should look into flags.

Flag 1 means it has weights
Flag 2 means multi UV

btw own_prox that bug is caused by the weight file. Not the model itself. (Weight file = wgt) for example:
It's flag 1 but it can't load the wgt
It's flag 1 but can't create the wgt (Only scb create wgt files.)
It's flag 1 but the wgt file is damaged.

so your telling me its due to me not saving weights properly in a sco format, if so thats gonna be annoying :)

weird part is heres how warz loads a sco:
cant seem to find anything about loading the weights in here

yeah i get you like when using 3dmax exporting, it exports a weight file,

does this mean infestation thailand has changed the wgt files ? because some work and some dont its weird


heres another weird thing when using rsbuild method to convert the scb to sco released on ragezone somewhere it worked the fist time every single model but when i did a update using incremental update it bugged them its really strange not sure why it did that.
 
Last edited:
Rival Gamers Owner
Loyal Member
Joined
Jul 7, 2007
Messages
962
Reaction score
161
Re: [Release] Warz Scb to Sco Converter v1.2

Update: V1.5 now generates .wgts files :) requires source edits to load these files (sorry), i tried to make a wgt file but for some reason after saving and then loading it the data corrupts it reads up to 59 weights fine, so i simply just made it dump to text which solved the issue

will upload some more screenshots when i tested my new armour :)

4b8862097f3360cd65b69357df27aad7 - [Release] Speedy Scb to Obj, Sco Converter 1.6 - RaGEZONE Forums


well after seeing that number i dont think i want add anything else im happy with 420 lines :), talking of 420 its about time i blaze 1

p.s any damaged weight value will be set to 1.f



This worked all armours work 100% now no issue enjoy the converter!
 

Attachments

You must be registered for see attachments list
Last edited:
Joined
May 18, 2013
Messages
852
Reaction score
323
Re: [Release] Warz Scb to Sco Converter v1.5

I don't think Gigatoni or Synx understood what I was trying to say.
I was saying in the future he should make a .sco to .obj converter..
 
Rival Gamers Owner
Loyal Member
Joined
Jul 7, 2007
Messages
962
Reaction score
161
Re: [Release] Warz Scb to Sco Converter v1.5

i will add support soon i gotta build both files and compare the differences then manipulate it,
taking alook at obj file but i cant find any comparison in the numbers they must use some sort of forumla


90% done on .obj support faces was tricky
Code:
int a=0,b=0,c=0, counter = 1, ca, cb,cc;
	for(i = 0; i < s->Faces; i++)
    { 
		a = s->IndicesA[i] + 1;
		b = s->IndicesB[i] + 1;
		c = s->IndicesC[i] + 1;
		ca = counter++;
		cb = counter++;
		cc = counter++;
		fprintf(file, "f %d/%d/%d %d/%d/%d %d/%d/%d\n", a, ca, a, b, cb, b, c,cc, c);
    }

just got material and textures to do

301c4d068b0efa857b0289e7b97cc959 - [Release] Speedy Scb to Obj, Sco Converter 1.6 - RaGEZONE Forums
 

Attachments

You must be registered for see attachments list
Last edited:
Skilled Illusionist
Joined
Oct 9, 2013
Messages
375
Reaction score
274
Re: [Release] Warz Scb to Sco Converter v1.2

You should try a proper scb/sco to .obj converter..
Good work.

this is litterly pointless and a waste of time because GigaToni released sco import for 3ds max, which you can export obj from if you really want but that's pretty much unneeded as you can just work with the raw file....
 
Rival Gamers Owner
Loyal Member
Joined
Jul 7, 2007
Messages
962
Reaction score
161
Re: [Release] Warz Scb to Sco Converter v1.2

this is litterly pointless and a waste of time because GigaToni released sco import for 3ds max, which you can export obj from if you really want but that's pretty much unneeded as you can just work with the raw file....

haha true but a bit too late i already did it :), i guess the good advantage of using this is you can convert multiple files with no trouble.

it was'nt too much to programming anyways the .obj support
Code:
void SaveObj(SCB* s, char* path)
{
    FILE *file = fopen(path, "wb");

    int i;
    for(i = 0; i < s->NumVertices; i++) fprintf(file, "v %.6f %.6f %.6f\n", s->VertexPositions[i].x, s->VertexPositions[i].y, s->VertexPositions[i].z);
	fprintf(file, "\n");
	for(i = 0; i < s->NumVertices; i++) fprintf(file, "vn %.6f %.6f %.6f\n", s->VertexNormals[i].x, s->VertexNormals[i].y, s->VertexNormals[i].z);
	fprintf(file, "\n");
	for(i = 0; i < s->Faces; i++) 
	{
		fprintf(file, "vt %.12f %.12f\n", s->VertexUVs[s->IndicesA[i]].x, s->VertexUVs[s->IndicesA[i]].y);
		fprintf(file, "vt %.12f %.12f\n", s->VertexUVs[s->IndicesB[i]].x, s->VertexUVs[s->IndicesB[i]].y);
		fprintf(file, "vt %.12f %.12f\n", s->VertexUVs[s->IndicesC[i]].x, s->VertexUVs[s->IndicesC[i]].y);
	}

	int a=0,b=0,c=0, counter = 1, ca, cb,cc;
	for(i = 0; i < s->Faces; i++)
    { 
		a = s->IndicesA[i] + 1;
		b = s->IndicesB[i] + 1;
		c = s->IndicesC[i] + 1;
		ca = counter++;
		cb = counter++;
		cc = counter++;
		fprintf(file, "f %d/%d/%d %d/%d/%d %d/%d/%d\n", a, ca, a, b, cb, b, c,cc, c);
    }
    fclose(file);

}


v1.6: supports converting to .obj (do note you will have to manually place a texture in 3d max)
 
Last edited:
Joined
May 18, 2013
Messages
852
Reaction score
323
Re: [Release] Warz Scb to Sco Converter v1.2

haha true but a bit too late i already did it :), i guess the good advantage of using this is you can convert multiple files with no trouble.

it was'nt too much to programming anyways the .obj support
Code:
void SaveObj(SCB* s, char* path)
{
    FILE *file = fopen(path, "wb");

    int i;
    for(i = 0; i < s->NumVertices; i++) fprintf(file, "v %.6f %.6f %.6f\n", s->VertexPositions[i].x, s->VertexPositions[i].y, s->VertexPositions[i].z);
    fprintf(file, "\n");
    for(i = 0; i < s->NumVertices; i++) fprintf(file, "vn %.6f %.6f %.6f\n", s->VertexNormals[i].x, s->VertexNormals[i].y, s->VertexNormals[i].z);
    fprintf(file, "\n");
    for(i = 0; i < s->Faces; i++) 
    {
        fprintf(file, "vt %.12f %.12f\n", s->VertexUVs[s->IndicesA[i]].x, s->VertexUVs[s->IndicesA[i]].y);
        fprintf(file, "vt %.12f %.12f\n", s->VertexUVs[s->IndicesB[i]].x, s->VertexUVs[s->IndicesB[i]].y);
        fprintf(file, "vt %.12f %.12f\n", s->VertexUVs[s->IndicesC[i]].x, s->VertexUVs[s->IndicesC[i]].y);
    }

    int a=0,b=0,c=0, counter = 1, ca, cb,cc;
    for(i = 0; i < s->Faces; i++)
    { 
        a = s->IndicesA[i] + 1;
        b = s->IndicesB[i] + 1;
        c = s->IndicesC[i] + 1;
        ca = counter++;
        cb = counter++;
        cc = counter++;
        fprintf(file, "f %d/%d/%d %d/%d/%d %d/%d/%d\n", a, ca, a, b, cb, b, c,cc, c);
    }
    fclose(file);

}


v1.6: supports converting to .obj (do note you will have to manually place a texture in 3d max)
Ducking sweeeett. Nice to have this instead of the babbles converter which barely worked.
 
Newbie Spellweaver
Joined
Apr 1, 2015
Messages
72
Reaction score
6
Works perfect for the items structure but still doesn't show the items light, like the light of the heart or the laser blade awesome!
own_prox - [Release] Speedy Scb to Obj, Sco Converter 1.6 - RaGEZONE Forums
 

Attachments

You must be registered for see attachments list
Last edited:
Newbie Spellweaver
Joined
Sep 6, 2014
Messages
35
Reaction score
10
after use speedy scb to sco the program is make file .mgts it not work in game

how to fix it?

rename this file to .mgt ?
 
Back
Top