don't click here

SonLVL

Discussion in 'Engineering & Reverse Engineering' started by MainMemory, Feb 7, 2011.

  1. TheInvisibleSun

    TheInvisibleSun

    OVER THE TOP TECHNO-BLAST Member
    1,638
    199
    43
    Buffalo, NY, USA
    The Water
    Finally got it to work! Thanks a lot for the help Main Memory.
     
  2. Azu

    Azu

    I must be stupid. Member
    [EC]
    art=../Images/Pachinko/EC.png
    artcmp=Uncompressed
    mapasm=-8,-8

    Like this?
     
  3. MainMemory

    MainMemory

    Has-Been Modder Tech Member
    4,820
    412
    63
    Myself
    No, like this:

    [EC]
    image=../Images/Pachinko/EC.png
    offset=-8,-8
     
  4. Azu

    Azu

    I must be stupid. Member
    Code (Text):
    1.  
    2. [4A]
    3. image=../Images/Pach/E6.png
    4. offset=-32,-32
    5. [E6]
    6. image=../Images/Pach/E6.png
    7. offset=-8,-8
    8. [E7]
    9. image=../Images/Pach/E6.png
    10. offset=-8,-8
    11. [EC]
    12. image=../Images/Pach/EC.png
    13. offset=-32,-32
    14. [ED]
    15. image=../Images/Pach/ED.png
    16. offset=-8,-8

    SonLvl gives me an error when I try to open a level after editing the obj.ini


    Code (Text):
    1.  
    2. Opening INI file "D:\Emulation\Gens\Sonic Retro Disassemblies\MegaDrive\Sonic & Knuckles Split Disassembly - Copy\S3KLVL INI Files\S3KLVL.ini"...
    3. Game type is S3K.
    4. Loading Angel Island Zone Act 1...
    5. Loading 8x8 tiles from file "../Levels/AIZ/Tiles/Act 1 Primary.bin", using compression KosinskiM...
    6. Loading 8x8 tiles from file "../Levels/AIZ/Tiles/Act 1 Main Level.bin", using compression KosinskiM...
    7. Loading 16x16 blocks from file "../Levels/AIZ/Blocks/Act 1 Primary.bin", using compression Kosinski...
    8. Loading 16x16 blocks from file "../Levels/AIZ/Blocks/Act 1 Main Level.bin", using compression Kosinski...
    9. Loading 128x128 chunks from file "../Levels/AIZ/Chunks/Act 1.bin", using compression Kosinski...
    10. Loading layout from file "../Levels/AIZ/Layout/1.bin", using compression Uncompressed...
    11. Loading palette file "../General/Sprites/Sonic/Palettes/SonicAndTails.bin"...
    12. Source: 0 Destination: 0 Length: 16
    13. Loading palette file "../Levels/AIZ/Palettes/Main.bin"...
    14. Source: 0 Destination: 16 Length: 48
    15. Loading palette file "../Levels/AIZ/Palettes/Water.bin"...
    16. Source: 0 Destination: 0 Length: 64
    17. Loading object definition file "obj.ini".
    18. Loading S3K Ring Definition...
    19. Loading ObjectDefinition type S3KObjectDefinitions.Common.Monitor from "Common\Monitor.cs"...
    20. Loading type from cached assembly "dllcache\S3KObjectDefinitions.Common.Monitor.dll"...
    21. Loading ObjectDefinition type S3KObjectDefinitions.Common.PathSwapper from "Common\PathSwapper.cs"...
    22. Loading type from cached assembly "dllcache\S3KObjectDefinitions.Common.PathSwapper.dll"...
    23. System.ArgumentException: Value does not fall within the expected range.
    24.    at SonicRetro.SonLVL.BitmapBits..ctor(Bitmap bmp) in C:\RetroSVN\Programs\SonLVL\SonLVL\BitmapBits.cs:line 49
    25.    at SonicRetro.SonLVL.DefaultObjectDefinition.Init(Dictionary'2 data) in C:\RetroSVN\Programs\SonLVL\SonLVL\ObjectDefinition.cs:line 91
    26.    at SonicRetro.SonLVL.MainForm.LoadObjectDefinitions(String file) in C:\RetroSVN\Programs\SonLVL\SonLVL\MainForm.cs:line 3527
    27.    at SonicRetro.SonLVL.MainForm.backgroundWorker1_DoWork(Object sender, DoWorkEventArgs e) in C:\RetroSVN\Programs\SonLVL\SonLVL\MainForm.cs:line 828
    28.  
    From the log.
     
  5. MainMemory

    MainMemory

    Has-Been Modder Tech Member
    4,820
    412
    63
    Myself
    The image has to have 256 colors (8-bit).
     
  6. Azu

    Azu

    I must be stupid. Member
    Well, I tired using a another sprite as a test and it gave me the same error.
     
  7. MainMemory

    MainMemory

    Has-Been Modder Tech Member
    4,820
    412
    63
    Myself
    Then neither of those sprites are 8-bit. How are you getting them?
     
  8. Azu

    Azu

    I must be stupid. Member
    I used Photoshop to make the icons.

    [​IMG]
    [​IMG]

    By another sprite, I did something like this.

    [EC]
    art=../General/Sprites/SS Entry/Entry Ring.bin
    artcmp=Uncompressed
    mapasm=../General/Sprites/SS Entry/Map - Entry Ring.asm
    dplcasm=../General/Sprites/SS Entry/DPLC - Special Stage Entry Ring.asm
    frame=8
     
  9. MainMemory

    MainMemory

    Has-Been Modder Tech Member
    4,820
    412
    63
    Myself
    Photoshop is probably optimizing the image by reducing it to 16 colors. Besides that, the image specifically needs to match the level's palette, so even if it did work, it'll be using colors from Sonic's palette line.

    The best way to make definitions is to just specify the art, mappings, palette, frame and optionally DPLCs.
     
  10. Azu

    Azu

    I must be stupid. Member
    Would using Paint work?

    Ha, got it to work.

    "The best way to make definitions is to just specify the art, mappings, palette, frame and optionally DPLCs. "

    So, would I go in the asm to do this? Or define it in the Obj.ini?
     
  11. MainMemory

    MainMemory

    Has-Been Modder Tech Member
    4,820
    412
    63
    Myself
    It might, but you would have no control over which colors it used.
     
  12. Azu

    Azu

    I must be stupid. Member
    I go it work using IfranView. It was as what you said. Photoshop was saving them as automatic bitmap images. Most likely 16bit.

    "The best way to make definitions is to just specify the art, mappings, palette, frame and optionally DPLCs. "
    So, would I go in the asm to do this? Or define it in the Obj.ini?
     
  13. MainMemory

    MainMemory

    Has-Been Modder Tech Member
    4,820
    412
    63
    Myself
    In the Obj.ini file.
     
  14. Azu

    Azu

    I must be stupid. Member
    How would I defined the palette so that it fits the stage? Do I have to look the the asm? I see something like "Pal=1". Do I change this?
     
  15. MainMemory

    MainMemory

    Has-Been Modder Tech Member
    4,820
    412
    63
    Myself
    Using an image or mappings? For an image, you have to specifically choose palette indexes to match the level (extract the palette as a PNG to help), for mappings change the pal number from 0 to 3 until it works.
     
  16. Azu

    Azu

    I must be stupid. Member
    The collision disappears (wall without the triangle bumpers) when saving the pachinko bouns stages.
     
  17. MainMemory

    MainMemory

    Has-Been Modder Tech Member
    4,820
    412
    63
    Myself
    I forgot to fix the saving when I fixed the loading earlier.

    I also added object definitions for the invisible objects and the bumper in the Pachinko bonus. Everything else uses art from the middle of an art file.
     
  18. MainMemory

    MainMemory

    Has-Been Modder Tech Member
    4,820
    412
    63
    Myself
    Flamewing has made new definitions for the pathswappers in Sonic 2 and S3K:
    [​IMG]
     
  19. FeliciaVal

    FeliciaVal

    Member
    693
    11
    18
    Spain
    is there any special condition for importing art? I've tried to replace a random chunk with custom art from another stage and didn't seem to work, it doesn't load the image at all (it was a transparent png I made in PS)
     
  20. MainMemory

    MainMemory

    Has-Been Modder Tech Member
    4,820
    412
    63
    Myself
    It has to be a multiple of the size of the type of data you're importing, it has to be BMP, PNG, GIF or JPG, it can't use premultiplied alpha values (it probably doesn't), and you can only have 256 chunks. If all that's okay it should add it to the end of the list.