Gah!

Discussion in 'Programming' started by xezno, Apr 2, 2014.

  1. xezno

    xezno Member

    I've been trying for a while now. I'm trying to read from the spr2 code and I keep getting errors. My code so far:
    Code:
    Dim ifffile As New SimsLib.IFF.Iff("C:\Program Files\Maxis\The Sims Online\TSOClient\objectdata\objects\computerslaptop.spf")
    
            Dim imgconv As New ImageConverter
    
    
    
            PictureBox1.Image = imgconv.ConvertFrom(ifffile.GetSprite(1))
    
    and it won't convert the image. GAH!
  2. Fatbag

    Fatbag Member

    It "won't convert the image"? Give a more helpful description.
  3. xezno

    xezno Member

    NotSupportedException was unhandled:
    ImageConverter cannot convert from SimsLib.IFF.SPR2Parser.
  4. xezno

    xezno Member

    I know what it means, but how do you convert it?
  5. Fatbag

    Fatbag Member

    OBJD, TPRP, and TTAB are based on research by Rhys, Afr0, and Darren. They are supported by SimsLib and not yet by iff2html in the Niotso repository.
  6. aidancheddar

    aidancheddar Active Member

    Oh. Was unaware of that, especially after the code refactor.
  7. RHY3756547

    RHY3756547 FreeSO Developer Staff Member Moderator

    The IFF reader has been drastically rewritten for PD, so I can't provide much insight into how the old one works.

    However, from the error I can see that "ifffile.GetSprite(1)" is returning the type SPR2Parser, which obviously cannot be converted to an image. Not to mention that SPR2s can contain multiple frames, and that each frame has 3 images (z, alpha, colour), so you'd need to select the correct image by using the DRGPs, which you need to select by implementing OBJD and using BaseGraphic, and you'll only get animation if you implement the entire vm...

    So there's no easy way around this! You need to read and understand everything, and if it's old simslib you'll need to implement a lot.
  8. Afr0

    Afr0 Well-Known Member

    Yeah, the SPR2Parser should be able to get you DGRPs.
    SimsLib supports frames with z-buffers, but the OBJD is incomplete.
  9. xezno

    xezno Member

    argh. naht good.
  10. xezno

    xezno Member

    There's a new one? @RHY3756547
  11. RHY3756547

    RHY3756547 FreeSO Developer Staff Member Moderator

    Yes, it's part of tso.files.
  12. xezno

    xezno Member

    Ah I got it. It doesn't have SimsLib.IFF.Iff.GetSprite(index As Integer) though.
  13. Afr0

    Afr0 Well-Known Member

    May I just say, Xezno, I've looked over your code briefly (and run it, it seems to be very unstable, it crashed when I tried logging in) - why do you have a loading screen?
    Right now it just seems like you're freezing the current thread and throwing messages to the screen (that aren't even centered).
    All of this may seem very harsh, but the point is: If you're not loading anything, there's no point in a loading screen. You should save yourself the headache until you're actually loading something! :)
    xezno and aidancheddar like this.
  14. xezno

    xezno Member

    Meh. All there for looks, I guess.
  15. xezno

    xezno Member

    Also its not very unstable, its unstable to the extreme.
    Works on XP though...
  16. aidancheddar

    aidancheddar Active Member

    Sooo, pre-alpha.
  17. xezno

    xezno Member

    opentso is way in prealpha stage lol
  18. xezno

    xezno Member

    I think I may have found what crashes it
    EDIT: May have been fixed.
    Last edited: Apr 4, 2014

Share This Page