( search forums )
map name in .sdm file
Soldat Forums - Soldat Talk - Developers Corner
pongo
August 18, 2005, 5:01 pm
how get map name??

sorry za bad english

Deleted User
August 18, 2005, 6:58 pm
u can't atleast if you compare
one map and the map in the demo

pongo
September 6, 2005, 12:36 am
argh! Michal, give me .sdm format :) how? im wanna create demo player

mar77a
September 6, 2005, 9:34 pm
Did you try opening the .sdm with Notepad?

pongo
September 7, 2005, 12:17 pm
of course. Even with hexview... %|

Deleted User
September 7, 2005, 1:00 pm
What language are you using Pongo? I may be able to slap together some code for ya

EDIT:
I just looked and found the map name at offset 0x03 O.o

pongo
September 8, 2005, 11:17 am
.net framework 2.0
i use c#... u use vb? vb.net?

quote:I just looked and found the map name at offset 0x03 O.o
yes :)

add: [quote]yes :)[quote]yes? im not sure... damn!

Deleted User
September 9, 2005, 12:29 am
what? you dont know how to read from 0x03 ?

pongo
September 9, 2005, 10:01 am
?
may be. Give me code

Deleted User
September 9, 2005, 10:18 am
In what language do you want the code?

pongo
September 9, 2005, 11:15 am
any

Deleted User
September 9, 2005, 2:03 pm
Heres some quick VB Code.

[CODE]
Function GetMapName(Path As String) As String
Dim sBuffer As String
nFileNum = FreeFile
sBuffer = Space$(50)
Open Path For Binary Access _
Read Lock Read Write As #nFileNum
Get #nFileNum, 1, sBuffer
sBuffer = Mid(Left(sBuffer, InStr(sBuffer, vbNullChar)), 4)
GetMapName = sBuffer
Close #nFileNum
End Function
[/CODE]

pretty sloppy, but it gets the job done. Just call it with the full demo path.

pongo
September 9, 2005, 2:24 pm
its work only when Compression=0 :(

Deleted User
September 9, 2005, 2:58 pm
As I said in IRC, ask MichalM what compression is used on the demos and I will find a way to get the map name for you.