SUBSIM Radio Room Forums



SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997

Go Back   SUBSIM Radio Room Forums > Silent Hunter 3 - 4 - 5 > SH5 Mods Workshop
Forget password? Reset here

Reply
 
Thread Tools Display Modes
Old 10-12-11, 10:59 AM   #1
Anvart
Admiral
 
Join Date: Jan 2006
Location: Russia ®
Posts: 2,481
Downloads: 122
Uploads: 1
I think no need to write about known things here.
... better to write personal messages...
Your "fantasy" look pretty funny...
Here we have to publish ready-made solutions - templates... i think.


@privateer... you are right... but name must be more shortly.
e.g.:
enum Format : int
{NoCompression = 0, Oodle1Compression = 2};
... The names of the parent objects are complementing this short name.
...
@ TDW... your verbosity is tedious and poorly translated.
__________________
Alex ®


Moses said: "Don't create yourself an idol"...

Last edited by Anvart; 10-13-11 at 02:35 AM.
Anvart is offline   Reply With Quote
Old 10-12-11, 11:53 AM   #2
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by Anvart View Post
I think no need to write about known things here.
... better to write personal messages...
Your "fantasy" look pretty funny...
Here we have to publish ready-made solutions - templates... i think.


@privateer... you are right... but name must be more shortly.
@ TDW... you ignore a lot of important information..?
...
Guys, you're marking time...
What fantasy? You call it fantasy to try and understand something. Please Anvart not even you know the GR2 format. I'm showing what I'm doing in trying to understand the GR2 format. Maybe others will benefit from it.

What known things are you talking about? You don't want to share information with everyone? The sharing of any information regarding the GR2 format will only benefit everyone.

And what important information am I ignoring?

Found a little interesting discovery:

The first pointer in a GR2 file points to the first string in the embedded strings (which is usually 3D Studio MAX in SH5 GR2 files). I never found out how it reads the additional strings after that up to 'General'. But I think I found out how: the second pointer is an unknown of 0x6 and has an offsetinsectiondata of 0xA0. 0xA0 is 160 decimal. 160 decimal / 8 bytes = 20 and 20 is the exact amount of additional strings that need to be read in. Coincidence? Maybe but don't think so. Works on all SH5 GR2 files I've tried so far.

With that piece solved I can now dynamically write out the strings in the GR2 file (allowing user to change the strings read in).
TheDarkWraith is offline   Reply With Quote
Old 10-12-11, 02:07 PM   #3
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

ran into a little trip up.....was writing the embedded strings into the new GR2 file dynamically (vice from pointer info read in to allow user to change the strings read in) and ran into problem of when multiple strings are being referenced by one string. I was just blindly writing the embedded strings into the file from the pointer data but since changing to this dynamic nature it has exposed a problem. The problem is starting with pointer 62 and on from section 0 pointers the pointers aren't 'writing' embedded strings - they are attaching embedded string info to pointer locations in the file.....
TheDarkWraith is offline   Reply With Quote
Old 10-12-11, 03:03 PM   #4
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

fixed the problem. Needed to define a new pointer type that dealt with string references

A new version of the C# AntiGranny code file can be found at post #1
TheDarkWraith is offline   Reply With Quote
Old 10-12-11, 03:06 PM   #5
tonschk
Sea Lord
 
Join Date: Mar 2007
Posts: 1,897
Downloads: 172
Uploads: 0
Default

Quote:
Originally Posted by TheDarkWraith View Post
fixed the problem. Needed to define a new pointer type that dealt with string references

A new version of the C# AntiGranny code file can be found at post #1
Amazing TheDarkWraith
__________________
What we do in life echoes in Eternity
tonschk is offline   Reply With Quote
Old 10-12-11, 03:12 PM   #6
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by tonschk View Post
Amazing TheDarkWraith
It's not close to anything near amazing. I'm struggling trying to figure this beast out....but god do I love a challenge

The art tool section (with it's embedded strings) seems to be the hardest part of this beast to tackle so far. I'm halfway through the art tool section now

As I'm writing it now it will be able to create new GR2 files from scratch. If I can write a new GR2 file from scratch then editing existing ones should be a walk in the park. When I say from scratch I mean you feed it a dat file and it creates a GR2 file from it.

Look over my AntiGranny code file. Make changes to it, experiment with it. The only way to figure something out is to take it apart, make some assumptions, and test....
TheDarkWraith is offline   Reply With Quote
Old 10-12-11, 03:53 PM   #7
Rongel
Grey Wolf
 
Join Date: Jan 2009
Location: Finland
Posts: 857
Downloads: 174
Uploads: 0
Default

Quote:
When I say from scratch I mean you feed it a dat file and it creates a GR2 file from it.
Aargh! I don't understand much of this but that sounds just about perfect concerning the imported ships!
Rongel is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 04:49 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Copyright © 1995- 2026 Subsim®
"Subsim" is a registered trademark, all rights reserved.