Results 1 to 30 of 53

Thread: Cracking the .sd files

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default Re: Cracking the .sd files

    I need to make some images for a full tutorial, but here is what I did for my wales faction in wales mod.

    1. downloaded the wales coat of arms from online (wikipedia).
    2. edited the coat of arms to turn the white background into a transparancy
    3. saved this as wales_coa.xcf (gimps format)
    4. used that file to produce: faction_symbols/wales.tga, menu/symbols/fe_buttons*/symbol*_wales.tga and menu/symbols/fe_faction_units/wales.tga
    5. created a new 128x128 tga file, and put the coa of there in both big form and small form (one to represent the mini symbol, and one to represent the big symbol) -- walesCoa.tga
    6. copied this tga file into c:\Programs Files\SEGA\Medieval II Total War\data\ui\southern_european\interface
    7. using my code (for which I have a download link on one of my posts, I ran):

    ./addFileToSd shared.sd walesCoa.tga

    ./addFileToSd strategy.sd walesCoa.tga

    ./addVariableToSd shared.sd SMALL_FACTION_LOGO_WALES 3 96 119 89 127

    ./addVariableToSd.exe strategy.sd FACTION_LOGO_WALES 5 31 93 28 98



    tell me what you think, roy.

  2. #2
    Harbinger of... saliva Member alpaca's Avatar
    Join Date
    Aug 2003
    Location
    Germany
    Posts
    2,767

    Default Re: Cracking the .sd files

    Well I think too many console commands for the average modder
    Anyways, waiting for your new version because I'm too lazy to install cygwin again.

    By the way, I can confirm that our first byte seems to be a boolean flag of whether the game should use the alpha channel or not with this pic (mapping with the sign function: 0 is 0, all else is 1)
    Last edited by alpaca; 03-14-2007 at 17:53.

  3. #3
    blaaaaaaaaaarg! Senior Member Lusted's Avatar
    Join Date
    Feb 2005
    Posts
    1,773

    Default Re: Cracking the .sd files

    Yeah, creating a new tga would also be my favourite approach if the game supports it (we could even make a generic version and call it mod_strat.tga and mod_shared.tga or maybe use the same image for both). I think maximum size is 512*512 though - or at least most of the vanilla files have that size.
    We can fit the 9 faction symbols needed(big and small) in a file that size. Having a generic one with instructions on how to edit it would be good.

    Roy, i'll give that a try at some point.

  4. #4
    Harbinger of... saliva Member alpaca's Avatar
    Join Date
    Aug 2003
    Location
    Germany
    Posts
    2,767

    Default Re: Cracking the .sd files

    Well I'm currently working on a python utility that'll work with a simple description file that contains all instructions that should go into the sd file and looks like this:
    Code:
    tga=stratpage_01.tga
    
    entry=FACTION_LOGO_PAPAL_STATES
    topleft=205,1
    bottomright=16,76
    You will specify the tga you want to use, then all the entries that should be linked to that page file.

    It also contains some other possible commands that you can use but don't have to (i.e. advanced options like disabling alpha info for an entry, using a different image for mouse-over information, etc.)

  5. #5

    Default Re: Cracking the .sd files

    hmmm..... maybe better then what I have right now... though I bet I could make a format like that work without too much problem, that seems alot easier then what I'm trying to do now, could I create a c++ utility that dumps to that format? because I already have a reader, so maybe just change the dumpContents function.

    Tell me what you think, Roy.

  6. #6
    Harbinger of... saliva Member alpaca's Avatar
    Join Date
    Aug 2003
    Location
    Germany
    Posts
    2,767

    Default Re: Cracking the .sd files

    Quote Originally Posted by roy_d_merkel
    hmmm..... maybe better then what I have right now... though I bet I could make a format like that work without too much problem, that seems alot easier then what I'm trying to do now, could I create a c++ utility that dumps to that format? because I already have a reader, so maybe just change the dumpContents function.

    Tell me what you think, Roy.
    Well I actually planned to write a dumper function into that script, too, because I kinda feel it belongs in there (and because I need it for testing :P) - I use OOP and already have a class reader for the sd files anyways.
    I'm using python because it's extremely productive for such small command-line utilities and people who want to can easily edit the code a bit and redistribute their version.

    Anyways, I may get this thing finished today, so your time may be better invested towards figuring out what this mystery value and the mystery coordinate do.
    Oh, and rest assured you will get due mention in the readme and the release thread, roy
    Last edited by alpaca; 03-14-2007 at 22:08.

  7. #7
    Harbinger of... saliva Member alpaca's Avatar
    Join Date
    Aug 2003
    Location
    Germany
    Posts
    2,767

    Default Re: Cracking the .sd files

    Well, finally got apparently everything working - I'll test adding a new symbol tomorrow and make a release, but I'm pretty confident that it works (well the dumped and re-interpreted sd files look pretty close to the originals and they seem to work in-game)

  8. #8

    Default Re: Cracking the .sd files

    ./addFileToSd shared.sd walesCoa.tga

    ./addFileToSd strategy.sd walesCoa.tga

    ./addVariableToSd shared.sd SMALL_FACTION_LOGO_WALES 3 96 119 89 127

    ./addVariableToSd.exe strategy.sd FACTION_LOGO_WALES 5 31 93 28 98
    What do these numbers mean?

  9. #9
    Harbinger of... saliva Member alpaca's Avatar
    Join Date
    Aug 2003
    Location
    Germany
    Posts
    2,767

    Default Re: Cracking the .sd files

    In order: Index of the page you can find this element in, then left, right, top, bottom borders of the image
    You won't have to bother with the index with the tool I'm working on but you'll need to specify the coordinates.

  10. #10
    Harbinger of... saliva Member alpaca's Avatar
    Join Date
    Aug 2003
    Location
    Germany
    Posts
    2,767

    Default Re: Cracking the .sd files

    Well stuff looks good. Here's a screen of a new faction logo I created (the Yorkshire rose).

    I also moved the cycle arrow a bit around for testing purposes but that didn't work too well



    Mouse-over info works fine, although the highlight state is still the shield (can't see it too well but it's there) because it'll be the same for all factions, but that's something for you 2d artists to worry about and not my problem



    A release should be ready in an hour or so. Not sure about a tutorial, might take me a bit longer - or maybe I'll take a short break before I start on it

  11. #11

    Default Re: Cracking the .sd files

    Actually I get a nonshield roll-over for mine, the reason is that the roll over for the faction symbol isn't read from the .sd file, but instead another file...

    I think the file is in menu/symbols/faction.tga


    So you need the .sd to make the COA for everything except for the faction choose screen, and the roll over effect, because these come from the file system.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Single Sign On provided by vBSSO