Jump to content

How to edit Sacred 2 gr2 files?


Recommended Posts

  • Replies 91
  • Created
  • Last Reply

Top Posters In This Topic

Now that you're asking, I've only just created a new version of grnreader ( from http://gr2decode.altervista.org/ ).

This command-line tool creates maxscript files and SMD files. The latter files also contain the skeleton (bones) and the texture coordinates.

Only today I've succeeded in properly translating the bone rotations to the Euler angles used inside SMD files.

 

Here's a pic:

 

HighElve02.jpg

 

This is the HighElve hero with her skeleton and default texture.

 

As you can see the model is upside down: a side effect of coordinate systems conversion (LH / RH).

I think this can be restored using the Mirror tool + face flipping.

 

Anyway, I've loaded this model in 3DSmax2008, THE tool for importing GR2 animations, but alas the GR2 files with Sacred 2 are too new.

I might try to load GR2 animations w. grnreader, but then I'd have to create the conversion to SMD sequence as well (which is probably a LOT, a lot of work..).

Better would be to find someone who likes to program w. VS2005 and the 3DSmax2008 SDK.

 

About my version of grnreader: it's called grnreader98 (v1.4), since I compiled it w. VC++ 98 (!).

I'm currently testing the debug version, and I added some user guidance (help option).

 

Cheers,

Pesmontis

 

ps. I would like to know who's interested in modding Sacred 2 meshes, skeletons and animations.

I mean: who's handy w. 3DSmax, Maya, and/or programming?

 

[Edit] I've released grnreader98 v1.4, get it here

[Edit] Source code can be downloaded here

Edited by Pesmontis
Link to comment

wow!I have grnreader here I download it,,they say just drag and drop the gr2 files in grnreader but there nothing happens,,now I currently downloading 3dsmax 2008 to see if my downloaded plugins work.. recently I use 3dsmax 2009 and 2010 but it dint work..I just want to edit some weapons,,,

 

I didnt get it?did you convert gr2 to smd? please can you post me a procedure on how to?coz im new on modelling..

Link to comment
ps. I would like to know who's interested in modding Sacred 2 meshes, skeletons and animations.

I mean: who's handy w. 3DSmax, Maya, and/or programming?

 

Hi Pesmontis,

 

I hoped you would turn your attention to the Sacred 2 granny files at some point, cause I too have tried some time to edit these files. I was able to convert the Sacred 2 gr files to a loadable obj file using evegr2toobj. However, after editing with 3dx max 2008 the conversion back to gr2 produced a file witch was only 14kb as opposed to the original 52kb. Needless to say it did not work ingame.

 

My thinking was, that a lot of other (custom made?) info is implemented into Sacred 2 granny files, which is lost during conversion. I know that there is for example information about the material and several other skeletons for weapon-glow and left and right hand skeletons stored in the file.

 

Hope you can figure it out, as I don't have any experience programming with the 3Ds Max SDK. :)

Link to comment

To iandave68:

The old versions of grnreader don't work,

and unlike the descriptions on the GR2 Decode pages, you cannot load Sacred 2 GR2 files directly into 3DSmax2008.

I released a new version of grnreader, which is independent of 3DSmax.

 

I think you want to read everything on the gr2decode pages first,

especially with regard to recommended (SMD) plugins and 3DSmax versions.

 

To czevak:

Yes, evegr2toobj is one way to go, but as you point out, it only draws partial info. out of GR2 files.

 

> ".. after editing with 3dx max 2008.."

Hey that's nice :-)

So you've got a working GR2 export plugin with 3DSmax2008?

You might check-out the tools listing at the END of this page: Warcraft III to HoMM.V Creature Conversion Guideline

 

I'm not familiar with the 3DSmax SDK either, but maybe it's possible to simply use exported methods from 3DSmax DLLs (like the functions in geom.dll).

btw. Do you have any programming experience?

 

Cheers,

Pesmontis

 

[Edit] I've released grnreader98 v1.4, get it here

[Edit] Source code can be downloaded here

Edited by Pesmontis
Link to comment

I try the exportron plugins but its not working..I use both 3dsmax9 and 2008 version.can some1 please post a direct link to DL the plugins coz im really hate reading...

Edited by iandave68
Link to comment

please help..I made a test weapon without texture..and export it as a gr2, but there a problems with the sword I dont have any error when loading sacred 2 but these is the result :

can any1 give a procedure on how to edit..im new to modeling..

untitled-1.jpg

Link to comment

Wow!

Nice job!

I guess you're the first to import a new GR2 file into Sacred 2!

 

Someone else has tried the same as you did and couldn't get it to work,

so ehm.. Could you tell us in as much detail as possible what you have done to export this GR2 file?

 

What's wrong with the model is that the position and orientation of the root bone are wrong.

I think from another weapon I've seen, this root bone has the same name as the weapon itself.

 

To correct things for your weapon I need to know a few things:

 

1.) Did you apply any special export settings when saving the model as a GR2 file ?

 

2.) To know what you are talking about, please tell us the GR2 file name of the weapon;

 

3.) Look in the button bar at the top of the 3DSmax window: move your mouse over the buttons and you will see pop-up descriptions of them.

Find the button called "Select and Rotate". Right click this button while your root bone is selected and tell us what you see;

 

4.) Do the same with the button called "Select and Move": Right click it, and tell us what you see.

 

5.) How did you import the model into 3DSmax ?

Did you use 3DSmax7 or max 2008 ?

Which import tool did you use ?

 

I think with all this you've got something on your plate ;-)

Please be as precise and exact as you can.

Simply use many words to describe GUI elements, so that things will be clear.

Link to comment

first of all im new at modeling so I dont know the bone stuff...when I import it on 3dsmax 2008 only the editable mesh is visible..dont know where to find the bones,,if there a bone!

 

here's the way I import and export it ( l_schwert2h-e1.GR2 located on graphics11.zip)

 

1.I extract the gr2 files using grnreader98 (1.4)and the .ms and smd is generated..

 

2.import the gr2 (.ms) using the run script command on 3dsmax,,then the weapon is loaded as it is,,

 

3.I rigth click the sword and convert it as editable mesh,ive notice that when I convert is as editable poly it will distroy the form and look so ugly,,,

 

" note: when I add a box on the weapon and convert the box to a editable mesh and attach the sword,,the only visible on other viewport ( top ,front, left ) is only the box, no weapon...but on the perspective view the weapon is visible "

 

4.I add some box to the weapon as a test if its working on the ingame,I didnt apply any texture yet..

 

5.then export it..I choice the granny runetime GR2 I click save,,theres a pop up window gr2 export setting , all I did is click the export button,,I didnt change anything....

 

my second export of the weapon is correct..I really dont know what I did.hahaha

 

hhhh.jpg

 

 

just a few Question.

1.is the weapon have bones?

 

2.I know how to apply texture but how do I save or export it as a dds or tga something,,

 

sorry for my very bab bad english...!

Link to comment

In 3DSmax, the weapon probably has no bones.

Using the grnreader98 maxscript does not create bones.

I guess when you export a GR2 file, the exporter creates one bone.

 

btw. I do not have 'l_schwert2h-e1.GR2'.

I think you are using the Ice & Blood expansion.

 

To create DDS textures, I recommend using the NVidia DDS plugin for Photoshop

 

Different types of DDS files exist.

In Sacred 2 I have seen the DDS types "DXT1" and "DXT5 interpolated alpha".

For the hq maps, I think you can safely use DDS DXT1 for the socalled 'diffuse lighting' maps (<sword name>_d.dds).

 

[Edit] I quickly checked the normal maps ( <sword name>_n.dds ).

[Edit] Their DDS type is "8.8 VU 16 bpp signed" ( or "V8U8 DuDv (16 bit, EMBM)" ).

 

In order to see which type of DDS you want to replace, I recommend using 'Deep Exploration'.

 

Did you try to look at the rotation / position of your mesh ? ( the 3DSmax buttons I described ).

 

 

 

first of all im new at modeling so I dont know the bone stuff...when I import it on 3dsmax 2008 only the editable mesh is visible..dont know where to find the bones,,if there a bone!

 

here's the way I import and export it ( l_schwert2h-e1.GR2 located on graphics11.zip)

 

1.I extract the gr2 files using grnreader98 (1.4)and the .ms and smd is generated..

 

2.import the gr2 (.ms) using the run script command on 3dsmax,,then the weapon is loaded as it is,,

 

3.I rigth click the sword and convert it as editable mesh,ive notice that when I convert is as editable poly it will distroy the form and look so ugly,,,

 

" note: when I add a box on the weapon and convert the box to a editable mesh and attach the sword,,the only visible on other viewport ( top ,front, left ) is only the box, no weapon...but on the perspective view the weapon is visible "

 

4.I add some box to the weapon as a test if its working on the ingame,I didnt apply any texture yet..

 

5.then export it..I choice the granny runetime GR2 I click save,,theres a pop up window gr2 export setting , all I did is click the export button,,I didnt change anything....

 

my second export of the weapon is correct..I really dont know what I did.hahaha

 

http://i751.photobucket.com/albums/xx159/t...code68/hhhh.jpg

 

 

just a few Question.

1.is the weapon have bones?

 

2.I know how to apply texture but how do I save or export it as a dds or tga something,,

 

sorry for my very bab bad english...!

Edited by Pesmontis
Link to comment

thanks for your fast reply..

 

to Pesmontis:

 

you mean I should make the dds with the _d and _n ?

 

do I have to put my dds too on hq folder..I really dont understand,where should I make the texture? on phoshop or in the 3dsmax,,I try on 3dsmax I use uvw unwrap

and is the output of my unwrap

mysword.jpg

 

my problem is how do I apply the texture ingame?

can you please teach me how on how to apply it?

Link to comment

> ".. You mean I should make the dds with the _d and _n ?.."

No, I think you only want to edit the "_d" DDS file(s).

 

The "_n" DDS files contain socalled normal maps.

You only want to edit them if you know what normal maps do to your model.

 

> ".. Where should I make the texture?.."

You want to produce all textures with Photoshop and the NVidia DDS plugin.

 

Using the socalled 'UVW unwrap' modifier in 3DSmax can produce normal maps as you have shown.

Load such a normal map in Photoshop to enhance it,

and export it as a DDS type "8.8 VU 16 bpp signed".

 

Note that all DDS textures must have height and width equal to a power of two eg.:

1024 x 1024 / 512 x 512 / 256 x 256 / 128 x 128 / 64 x 64 etc.

 

You can also use for instance 1024 x 512.

 

If you create a DDS texture, make sure you include "all MIPmaps" (for Sacred 2).

 

> ".. How do I apply the texture in-game?.."

You have to create a directory structure in the 'pak' directory,

equal to the path for the original texture inside one of the graphics##.zip files.

Copy your new DDS textures there.

 

[Edit] I have tested your method and I think I now have an invisible dagger for my HighElve.

[Edit] Therefor I need to ask you: did you apply a texture to your model in 3DSmax?

[Edit] Can you reproduce how you did this?

 

Thanks in advance,

Pesmontis

Edited by Pesmontis
Link to comment

I think the answer for your question about the position and the rotation is this..

this is my SC

 

Few question: its posible to make the sword transfarent..how do I make it..I try in material editor to make it transfarnt but when I xport it theres nothing happend,,

how do I make transfarent in dds texture.?

 

jhjh.jpg

 

[Edit] Therefor I need to ask you: did you apply a texture to your model in 3DSmax?

Yes! succesfully

 

all I did is make a unwrap on 3dsmax and save it as a dds..

then I followed your instruction about the dds type.I open the dds files on photoshop and save it again as _d _n _sg( _sg with alpha chanel) for some glow effect..

 

the glowing part of the sword is the effect of the _sg.dss with alpha chanel

the original size of this sword is the size of the dagger,I made bigger to be cool..

 

gloe.jpg

Edited by iandave68
Link to comment

Alright, thanks for showing us all these possibilities,

I think you have cleverly applied these different textures :-)

 

I have tested your method and this is the result:

HEnewDagger.jpg

 

So your method is reproducable, albeit (for the moment) only for static objects.

 

I'd like to propose a little pause in showing new possibilities,

in order to write-up a (simple) instruction for everyone to use.

 

Hopefully after that we won't be showered with new meshes ;-)

 

Cheers & thanks again :-)

Pesmontis

Link to comment

Reimporting armor gr2 files into the game has met with certain difficulties. The original g2 was exported to smd + ms, edited in 3ds max 8 and exported to gr2 using rad tools 2.7.0.30 exporter plugin. Mesh, material, bone sequence restored seccessfully. However primary topology was messed up, indices totals were present and correct, but no SidetoNeighborMap or TriangletoBoneIndices totals were present. Also Skeleton LOD was introduced ( there was none in original ). For these reasons the game crashes upon loading main menu with s2render.dll error.

 

Is there any way to properly restore topology and completely remove skeleton LOD?

Edited by dimitrius154
Link to comment

> ".. Is there any way to properly restore topology and completely remove skeleton LOD?.."

 

For the time being I recommend exporting ONLY the mesh.

In fact, in my test I completely deleted all other objects from my max file.

 

Upon GR2 export I had nothing selected, and I used the <Export> menu option (NOT the <Export Selected> option).

 

The main things I changed were the position and the rotation of the mesh itself.

I tried to make the handle of the weapon coincide with the original root bone (which was called 'lowpoly' in the tested model).

 

I used SMD import (not the ms script, because it carries NO texture coordinates).

 

To have proper Weapon orientation in the game I rotated (world rotation) +90 degrees around the x-axis.

Edited by Pesmontis
Link to comment

I've made several attempts to reimport armor pieces as mesh only gr2. these items were classified as either cloth_armor or armor in itemtypes.txt. While there were no errors ingame, the edited parts would not show up either.

Link to comment

> ".. would not show up.."

Well, the model is probably there, but I think it's displayed entirely transparent (!).

In 3DSmax, make sure you have a texture as the diffuse channel in a standard material.

Apply that material to the mesh.

 

If that doesn't help it also might require applying some (opaque) vertex colors.

 

> ".. should I make it on material editor or on the dds files.how?.."

I cannot guarantee this will work in Sacred 2,

but here's a description:

 

In Photoshop, you have as "Layers" toolbox (in the right lower corner of the standard Photoshop set-up).

In this "Layers" toolbox, you see three tabs: "Layers", "Channels", and "Paths".

 

Click the "Channels" tab.

Select the channel called "Alpha 1".

 

If there is no "Alpha 1", you can create one:

Right-click one of the other channels and select <Duplicate Channel>.

Type "Alpha 1" as the name for this new channel.

 

This is the transparency channel.

You want to clear everything in this channel to an all white color.

 

Go back to RGB channel (select the RGB channel), and using eg. the 'Polygon Lasso' tool, you select everything you want to be transparent.

 

Select the Alpha 1 channel.

Paint with a black color inside your selection to make the selected parts entirely transparent.

Use a grey color to have only partial transparency.

 

You can control the 'opaqueness' with the darkness of your grey color.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...
Please Sign In or Sign Up