4ds files hacked

This is for general discussion about Hidden & Dangerous 2, talk about what you liked or what you didn't like about the sequel. Talk about multiplayer games, setup matches etc.
User avatar
2k
Sergeant
Posts: 57
Joined: Wed Jul 04, 2007 6:32 pm

Re: 4ds files hacked

Unread post by 2k » Fri Mar 18, 2011 11:25 pm

2Lars
It seems like 3ds max 2011 on the screenshot.

Hdmaster, sounds good, but i guess you forgot to post the update link. smile01

User avatar
Jason
Administrator
Posts: 1895
Joined: Thu Sep 02, 2004 7:26 pm
Location: Perth, Australia
Contact:

Re: 4ds files hacked

Unread post by Jason » Sat Mar 19, 2011 12:50 am

Looks very promising hdmaster, great work! keep it up! thup01 and please share as soon as you can
Lars wrote: Looks very promising  thup01
In case you wanted to know .. hd2 maps where made with 3dsmax4 ... from the screenshots i saw so far.
Just one question .. the screenshot is from witch program? Its looking a bit like the old gmax?
The two screenshots I have says 3d Max R.1, and show a H&D2 level. They also had the H&D2 editor that looks like the H&D Deluxe editor.
A new day, a new beginning

Fixing H&D2 Multiplayer tutorial

User avatar
Marvin (hun)
Sergeant
Posts: 59
Joined: Sat Mar 19, 2011 3:01 pm
Location: Hungary

Re: 4ds files hacked

Unread post by Marvin (hun) » Sat Mar 19, 2011 8:31 pm

I'm wonder about the lightmaps. Do you have any idea about it?
Is there a sun entity (like the other static lights)? 3dsmax is not a hd2-specified prog. Maybe the exporter will 'make' the lightmaps?

hdmaster
Sergeant
Posts: 84
Joined: Thu Jan 27, 2011 9:31 pm
Location: Germany

Re: 4ds files hacked

Unread post by hdmaster » Sun Mar 20, 2011 7:44 pm

No i haven't dealt with the lightmaps yet. I think the sun is somewhere defined in the scene2.bin files

Heres the new script: Download from RS.com
Last edited by hdmaster on Sun Mar 20, 2011 9:06 pm, edited 1 time in total.

User avatar
Marvin (hun)
Sergeant
Posts: 59
Joined: Sat Mar 19, 2011 3:01 pm
Location: Hungary

Re: 4ds files hacked

Unread post by Marvin (hun) » Sun Mar 20, 2011 8:10 pm

Sadly it doesn't work to me:
- I have the HD2 menu,
- but I get this message: -- Unknow property: "V_Winkel" in MtlBase:Placement" (and it opens the hd2_4ds.ms and show the line 138)

questions:
- Can I fix the texture's folder? (like in the previous version)
- Material Name: 4ds -what does it mean?
- Which is the correct value of Material Slot? Do I need to change it from 1?
- If I would like to import all of the 3 bin files, than firstly I have to check (for ex.) Scene2.bin and after click to "Select File", and same procedure with the other bins?

Thank You!

hdmaster
Sergeant
Posts: 84
Joined: Thu Jan 27, 2011 9:31 pm
Location: Germany

Re: 4ds files hacked

Unread post by hdmaster » Sun Mar 20, 2011 8:32 pm

Change "V_Winkel" to "V_Angle" and "W_Winkel" to "W_Angle". That should fix the problem
EDIT: I've fixed some other errors too, you should download it again and replace the "3ds Max\Scripts\H&D 2\hd2_4ds.ms" file with the new one

Yes you have to pick the texture folder by pressing the button where the caption says "Texture Folder:"
The Material Name is just the name of the multi-material that stores all textures of the imported file. It doenst matter what name it has
It depends how many things your're importing e.g. you import a map and the slot is set to 1, all the map's textures are stored in the first slot in the material editor (shortcut: M). Now if you're importing another map or model and the slot is still set to 1, it will overwrite the textures of the map imported in the beginning with the new ones. So you should select another free slot (you can look which slots are free in the material editor)
Yes, every .bin files has to be imported seperatly. For scene2.bin the scene2.bin option and for actors/sounds it doesnt matter which one of the both you choose. But it's important to differentiate between scene2.bin and the other two ones
Last edited by hdmaster on Sun Mar 20, 2011 10:15 pm, edited 1 time in total.

User avatar
2k
Sergeant
Posts: 57
Joined: Wed Jul 04, 2007 6:32 pm

Re: 4ds files hacked

Unread post by 2k » Mon Mar 21, 2011 9:40 pm

Just checked the updated version of importer, it works allmost perfect. Great job on it! Got two questions. Is it possible to edit  maps path manually, so no need to do this every time?  How the things are going on exporter plugin?

hdmaster
Sergeant
Posts: 84
Joined: Thu Jan 27, 2011 9:31 pm
Location: Germany

Re: 4ds files hacked

Unread post by hdmaster » Tue Mar 22, 2011 6:18 pm

I already implemented that feature but there are a few lines of code missing in the 3ds Max\Scripts\H&D 2\ui_ImportTool.ms file. Change line 32 (should start with "button btnTextureFolder"  to "button btnTextureFolder "Select Folder" pos:[20,273] width:180 height:20" and add
"on roll_4ds open do(
btnTextureFolder.caption = hd2_4ds_textureFolder
)"
after line 40 (start with "radioButtons rdoType").

Now open the "settings.ini" in the same directory like the file before and change the value of "TextureFolder" to your maps path e.g. a correct line looks like this: "TextureFolder=C:\Program Files\H&D 2\_MAPS" (dont add slashes after the maps folder)

The path should now always be the one you've set in the settings.ini file and there's no need to change it everytime

Development of the exporter is currently stopped. I want to fix the importer first because maps like Africa 4 and other objects are not imported correctly. At the moment it's possible to export editable meshes in a hierarchical order but the rotation of the exported objects inside a file are wrong and texture coordinates are not correct, so you dont see the exported models in H&D 2

User avatar
Ikaros
Sergeant
Posts: 82
Joined: Wed Mar 23, 2011 11:30 am
Location: Italy
Contact:

Re: 4ds files hacked

Unread post by Ikaros » Wed Mar 23, 2011 2:46 pm

Hi! Great Work HDMaster!
I'm currently working on a "occupation editor":
index.php/topic,2061.0.html

Maybe ours works could complete each others.

It's impressive how 4DS look, loaded into 3dmax!

But... have you considered collisions too? As far as I know, scene.4DS only contains "ghost models", and collisions are defined in tree.klz
http://malgolan.altervista.org/
Italian politicians - Not in my name!

User avatar
betteryouthanme
Lieutenant
Posts: 116
Joined: Thu Jun 12, 2008 1:37 pm
Location: Germany
Contact:

Re: 4ds files hacked

Unread post by betteryouthanme » Wed Mar 23, 2011 3:29 pm

Seems you guys got the HD2 rock rollin'. thup01
My deep respect for all your effort and time spent, just amazing.

Regards

User avatar
Ikaros
Sergeant
Posts: 82
Joined: Wed Mar 23, 2011 11:30 am
Location: Italy
Contact:

Re: 4ds files hacked

Unread post by Ikaros » Thu Mar 24, 2011 9:07 pm

I noticed (as you said) some misplaced meshes. Especially in Africa3_MP, it's plenty of them!  :sad:

Image
The northwest tower is too much southward, almost over the west-gate. Stairways are floating. And many others...

By reading your hd2_4ds.ms script, I found it very familiar, because it works more or less the same way my 3d visualizator works. So I'll try to help you out understanding why some objects do not fit.

Could they have positions relative to another object? In Normandy2/map.4ds, to obtain correct position for blue/black areas, I had to sum "axisX" vertex coords + "axisX" position + "zoneX" position. "axisX" and "zoneX" are meshes you find inside that file.
http://malgolan.altervista.org/
Italian politicians - Not in my name!

User avatar
Ikaros
Sergeant
Posts: 82
Joined: Wed Mar 23, 2011 11:30 am
Location: Italy
Contact:

Re: 4ds files hacked

Unread post by Ikaros » Fri Mar 25, 2011 12:38 pm

Maybe I understood how relative positions works. Here are the first evidence:
[img width=800 height=488]http://malgolan.altervista.org/first_evidences.jpg[/img]

"Mesh index" refers to the order of meshes inside file (map.4ds from Normandy2, in this example).
"Mesh label" is the string present in every mesh
The 3 following colums contain the first 3 bytes of the meshes.

I know (empirically) that "axis" and "allied" meshes are positionated adding their position to the relative "zone" position.

In this file, you can notice that:
- if 1st byte is 6, position is absolute
- if 1st byte is 2A (42), position of this mesh must be added to position of Nth mesh in file, where N is the number inside 2nd byte.

Note also the suggestion for strange 2A 0 in "selectedzone" (relative position, but null pointer), that makes things consistent.

Asap, more evidences!
http://malgolan.altervista.org/
Italian politicians - Not in my name!

User avatar
Ikaros
Sergeant
Posts: 82
Joined: Wed Mar 23, 2011 11:30 am
Location: Italy
Contact:

Re: 4ds files hacked

Unread post by Ikaros » Fri Mar 25, 2011 1:18 pm

Seems to work. I changed 2nd byte of 1st axis area (axis1) from 19 to 7 (zone4, northmost zone). Here are the results (before and after):
[img width=800 height=600]http://malgolan.altervista.org/_ext/Min ... before.jpg[/img]
[img width=800 height=600]http://malgolan.altervista.org/_ext/Min ... _after.jpg[/img]
The black area (which contains also the black eagle) now is misplaced and is where zone4 is.
It also changed in shape, I cannot understand why  :?:

I also noticed a second thing. If 2nd byte refers to a subsequent mesh (instead of a previous, as always happens in this file), the whole map.4ds crashes.
http://malgolan.altervista.org/
Italian politicians - Not in my name!

User avatar
Marvin (hun)
Sergeant
Posts: 59
Joined: Sat Mar 19, 2011 3:01 pm
Location: Hungary

Re: 4ds files hacked

Unread post by Marvin (hun) » Fri Mar 25, 2011 1:25 pm

Hi HDmaster!

I haven't any coding knowledge (this is why my cooperative wolf3d-remake mod for HL2 finally died), but I havent enough patience to try to collect the textures into separated folders, if it can help for mappers, during the mesh-texturing.

Why do i think that this is necessary? (...OMG, I hope I can propond it understandingly with my low english)
- After I extracted the dta file of HD2 I found 7995 (!) textures in the folder with their DX1-DX2-DX3 versions. I think, that is an unhuman work to find the best texture for the mesh during the mapping work.
- If It's OK to you, I can start to depart them into separated folders (recommend by terrain, like Africa, Arctic, Czech....etc.)

For using of the other mappers:
- after I depart the texture files into folders, I try to make a simple file-list which includes every filename with his actual folders,
- it needs that someone have to write a short prog which can separate the fresh-extracted textures (from HD2's dta) on his computer by using my list,
- the 3dsmax will use this folder-structure to find much quicker the needed texture,
- in this way the exporter must not save the foldernames of the texture, just only the texture-names. In this way every other man can use the new maps in the game, because the prog will automatically read the textures from the dta file (because it knows only the texturename of the mesh)

It would be good to keeping the HD2 style and feeling of the maps, so there won't be accidentaly for example Czech house-wall texture in an Africa-style map.

It's just an idea, if you say that it is ok (or you have a better idea) just reply and I start the work.

Keep up the good work!
Last edited by Marvin (hun) on Fri Mar 25, 2011 1:31 pm, edited 1 time in total.

hdmaster
Sergeant
Posts: 84
Joined: Thu Jan 27, 2011 9:31 pm
Location: Germany

Re: 4ds files hacked

Unread post by hdmaster » Fri Mar 25, 2011 3:23 pm

@Ikaros: You're right. The short after 0x2A and 0x06 is the index of the parent object and makes the object a child of the indexed one. My script builds that parent-child hierarchy by adding both positions (thats the line with the attachObject function), but the strange thing is that this does not work correctly for every map like Africa 3. But also objects that start with 0x06 (dummies) have relative and not absolute positions . The 0 of selected zone simply means that it has no parent object.
So the hierarchy of your file looks like the following:

| - center
   | - mapa scale
      | - zone5
         | - allied5
         | - zone_disabled5
         | - axis5
      | - zone4
         | - allied4
         | - zone_disabled4
         | - axis4
      | - zone3
         | - allied3
         | - zone_disabled3
         | - axis4
      | - zone2
         | - allied2
         | - zone_disabled2
         | - axis2
      | - zone1
         | - allied1
         | - zone_disabled1
         | - axis1
| - selectzone

I've already had a closer look on the Africa2 map, because there occurs the same problem with dunes that are not correctly positioned. The problem is that the wrong positions are added together, so instead of X1+X2, Y1+Y2, Z1+Z2 (1 is the parent object and 2 the child) it has to be X1-Y2, Y1+X1, Z1+Z2. But unfortunatly that works only for this map, maybe other axis have to be swapped.

And yes, 4ds files don't contain any collision data except bones and their weight etc, that may be relevant for collision.

@Marvin:
Thats a good idea. I could write a program for you that reads out all the path changes of the files that you may sort so you don't have to make a list for hundreds of files. With that information i can write a simple prog that sorts them on other computer, too.

Post Reply

Who is online

Users browsing this forum: Majestic-12 [Bot] and 67 guests