don't click here

Weird object loading problems

Discussion in 'Engineering & Reverse Engineering' started by StephenUK, May 21, 2006.

Thread Status:
Not open for further replies.
  1. StephenUK

    StephenUK

    Liquor in the front, poker in the rear Tech Member
    1,678
    0
    16
    Manchester, UK
    Quackshot Disassembly
    I've recently ported the harpoon object (the spear thing that moves up and down) from Sonic 1's Labyrinth Zone into my hack. Now, everything works perfectly, except for one thing. The object will only load if it's close to the start of the zone. If I move it away a certain distance, the object doesn't even begin to load, as confirmed by a savestate check. I've tried loads of different things, including rewriting the code a bit to get it to work, but nothing happened.

    Does anyone know why the objects aren't loading when they are away from the start? This has also happened with the Giant Ring object ported from S1, which is leading me to believe I'm overlooking something specific to S1 when porting.

    Any help is greatly appreciated.
     
  2. Sik

    Sik

    Sik is pronounced as "seek", not as "sick". Tech Member
    6,718
    1
    0
    being an asshole =P
    Maybe it's loaded but deleted. Remember, when you put an object with debug mode and get far from it, it disappears. Are you sure that it loads in that kind of table where the game mantains the list of objects of the level? I don't know too much of Sonic 2 since I don't hack it often (I'm more inside Sonic 3D now), but I suppose that it has one... Otherwise, how does it to act like that? :P
     
  3. StephenUK

    StephenUK

    Liquor in the front, poker in the rear Tech Member
    1,678
    0
    16
    Manchester, UK
    Quackshot Disassembly
    The thing is, I've compared the code to other objects, and I can't see any obvious details missing from in the code, such as a subroutine branch I need to include or anything.
     
  4. Hivebrain

    Hivebrain

    Administrator
    3,060
    181
    43
    53.4N, 1.5W
    Github
    Objects sometimes fail to load if you've listed them in the wrong order. They have to be listed in the order they appear on the x-axis.
     
  5. StephenUK

    StephenUK

    Liquor in the front, poker in the rear Tech Member
    1,678
    0
    16
    Manchester, UK
    Quackshot Disassembly
    Listed in what? If you mean in the objects layout, it was all done by SonED 2, so it should be fine, as it has been in other levels.
     
  6. StephenUK

    StephenUK

    Liquor in the front, poker in the rear Tech Member
    1,678
    0
    16
    Manchester, UK
    Quackshot Disassembly
    Sorry for the double post but it's needed. It turns out that S2 uses 2 very similar routines to what S1 used in this object. I was just jumping to the wrong one, which was causing the problem. Problem solved.

    [​IMG]
     
  7. LocalH

    LocalH

    roxoring your soxors Tech Member
    3,314
    35
    28
    Nunya
    Rock Band 3 Deluxe
    Awesome. That looks simply awesome.
     
  8. drx

    drx

    mfw Researcher
    2,254
    350
    63
    :rolleyes:
    Yeah, you should be sometimes very catious of what you're doing. For some subroutines, heavy editing the code, or just directly porting from one game to another is needed. As you all know, S2 is like S1+, so there's some things added, some improved, but that doesn't mean automatic reverse compatibility. It's even worse when you port stuff from like, S3 to S1. You can imagine why :P
     
  9. Hivebrain

    Hivebrain

    Administrator
    3,060
    181
    43
    53.4N, 1.5W
    Github
    It's sometimes better to write a new object than to port one. That's what I do, and I only look at the original object for inspiration.
     
  10. drx

    drx

    mfw Researcher
    2,254
    350
    63
    :rolleyes:
    you have way too much time on your hands :P bastard...
     
Thread Status:
Not open for further replies.