Jump to content

Trying to find a Sacred 2 .gr2 Importer/Exporter for Blender


Recommended Posts

51 minutes ago, Lindor said:

well the importing was already partially solved( although the Reader plugin improves and simplifies the process by miles <3). But the exporting has been an unsolved issue ever since, so I'm back to the old problem, the only known way by me to export as .GR2 files is a leaked plugin for 3dsmax. I think there is only one way left... going through the plugin line by line and trying to reverse the process. I'm really not an experienced programmer, I've done a bunch of sorting algorithms and some mathematical stuff for my university in python and some mods for factorio and scrap mechanic in lua, but that's it. This might take a while and it's very likely that it might not even work.

Give Norbyte's tool a try. It's designed specifically for Divinity games though so it might not work for Sacred 2 but it's worth a try.

Edited by Inspired
Link to post

Haven't had much time the last couple days, but I saw your reply, thanks <3

I have some trouble again:

I downloaded v1.9.0. There are now binaries, just a library, and in order to build the .exe it says in the readme file to download and extract the gplex scanner and gppg parser generators into the external folder. Luckily, there are links to the version Norbyte's tool needs:



In fact, Norbytes rebuild_parser.bat seems to look for two specific binaries, gplex.exe and gppg.exe (I'm using notepad++, no worries):

external\gppg\binaries\gplex.exe /out:LSLib\LS\Story\Osiris.lex.cs LSLib\LS\Story\Osiris.lex
external\gppg\binaries\gppg.exe /out:LSLib\LS\Story\Osiris.yy.cs LSLib\LS\Story\Osiris.yy

Unfortunately when I downloaded from those links, there are no binaries again, but after extracting it includes the sourcecode.zip files which contain a generateall.bat file, which doesn't do anything after running. I've looked into the script and it looks like this:

REM generate resource resX file and copy to destination
csc GenerateResource.cs
move Content.resx ..\IncludeResources
del GenerateResource.exe

REM generate a fresh copy of parser.cs
gppg /gplex /nolines gplex.y
move parser.cs ..\GPLEX

REM generate a fresh copy of Scanner.cs
gplex gplex.lex
move Scanner.cs ..\GPLEX

if not exist GplexBuffers.cs goto finish
move GplexBuffers.cs ..\GPLEX

REM Ended

To me it looks like it's supposed to be run after the gppg.exe / gplex.exe are already built, to generate some additional files while maintaining the correct file and folder structure.

There are also .pdf files which are supposed to explain how gplex and gppg work, they have an installing section included, but e.g. for installing gppg it says the following:


However there are no .exe files in the bin folder, in fact the bin file isn't even included in the downloaded .zip archive, only the gplex sourcecode.zip file has a bin folder after extracting and it contains two empty folders, Debug and Release. Actually, the whole folder structure is completely different than what it says in the .pdf files for both gplex and gppg.

I'm so confused right now:Just_Cuz_21:. Am I supposed to build them from the source code via #C? Because I have zero experience with any C languages or parsing.

That's my thought process, hopefully it's not too embarrassing for you:D



I just remembered the .pdf files were not included, I downloaded them separately. I think from the same website, but not sure anymore.

Edited by Lindor
Link to post
  • 3 months later...

From time to time I search for new solutions for the .gr2 exporter problem. It seems that even with using Sacred2's granny.dll, the latest importers and exporters are not compatible, and I've tested a few, so the most chances come probably with plugins made for older games. I found an importer/exporter for Neverwinter Nights 2 by someone named FreshLook:
The tool searches for NWN2's granny2.dll. If I knew the folder structure of NWN2, specifically where it's granny2.dll is located, then I could probably make it using Sacred 2's granny2.dll and maybe it will work for Sacred 2 .gr2 files as well. Of course I looked into the scripts first (python, not a language I'm strong in but meh, it's enough) and tried to figure it out, it says:

	if (config.nwn2_home.empty())
		return 1;

	GR2_file::granny2dll_filename = config.nwn2_home + "\\granny2.dll";

So I redirected the line config.yml to

nwn2_home: G:\Sacred 2 Testing\TEST

and put Sacred 2's granny2.dll inside, but that didn't work, neither for importing nor exporting.

Does somebody have NWN2 and can tell me where it's granny2.dll is located?
I'll test a little bit more until then and try to refresh my python, maybe there are other problems that need to be addressed as well.


EDIT: uhmm, actually I don't think it's python, it's C which I'm completely unfamiliar with (only recognized because of the ";"s at the end of each section)
EDIT2: actually he says on the github page which file is which language. Some are C, some are C++, few are python. How comes it that I always find out this stuff minutes after posting?:dntknw:

Edited by Lindor
Link to post
  • Lindor changed the title to Trying to find a Sacred 2 .gr2 Importer/Exporter for Blender

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...