[Help] Need help for a change to GHZ's boss

Discussion in 'Discussion and Q&A Archive' started by Giovanni, Sep 29, 2016.

  1. Giovanni

    Giovanni It's Joe-vanni, not Geo-vanni. Member

    Joined:
    Apr 16, 2015
    Messages:
    311
    Location:
    Italy
    I have managed to edit GHZ's boss. As you all know, when Robotnik spawns, he goes to the left and behaves normally. I changed his ASM code to make him go right and offscreen. The only problem is that his sprite still faces to the left while going right. Is there a way to flip Robotnik's sprite during the "cutscene"?
    Here is a screenshot that represents what I'm talking about.
    Cattura.PNG
     
  2. StephenUK

    StephenUK Working on a Quackshot disassembly Member

    Joined:
    Aug 5, 2007
    Messages:
    1,026
    Set/Clear bit 0 of byte 01 in the objects status table to alter orientation.
     
    Ashuro likes this.
  3. Ashuro

    Ashuro Anti-Cosmic Metal Of Death Member

    Joined:
    Sep 27, 2014
    Messages:
    550
    Location:
    France
    I always wanted to make a boss like in the advance series:

    Eggman go to the right at high speed and sonic have to run to hurt eggman, with the bakcground and foreground withan endless scroll, and when we beat eggman, make the prison capsule apears.

    I'm really sure, it's easy to do, but i'm still nt capable of it. This thread helped me to understand a little more how to do it. :eek:
     
  4. Giovanni

    Giovanni It's Joe-vanni, not Geo-vanni. Member

    Joined:
    Apr 16, 2015
    Messages:
    311
    Location:
    Italy
    I've found these parts of code.
    Code:
    BGHZ_ShipMain:    ; Routine 2
            moveq    #0,d0
            move.b    ob2ndRout(a0),d0
            move.w    BGHZ_ShipIndex(pc,d0.w),d1
            jsr    BGHZ_ShipIndex(pc,d1.w)
            lea    (Ani_Eggman).l,a1
            jsr    (AnimateSprite).l
            move.b    obStatus(a0),d0
            andi.b    #3,d0
            andi.b    #$FC,obRender(a0)
            or.b    d0,obRender(a0)
            jmp    (DisplaySprite).l
    Code:
    loc_177E6:
            move.b    $3F(a0),d0
            jsr    (CalcSine).l
            asr.w    #6,d0
            add.w    $38(a0),d0
            move.w    d0,obY(a0)
            move.w    $30(a0),obX(a0)
            addq.b    #2,$3F(a0)
            cmpi.b    #8,ob2ndRout(a0)
            bcc.s    locret_1784A
            tst.b    obStatus(a0)
            bmi.s    loc_1784C
            tst.b    obColType(a0)
            bne.s    locret_1784A
            tst.b    $3E(a0)
            bne.s    BGHZ_ShipFlash
            move.b    #$20,$3E(a0)    ; set number of    times for ship to flash
            sfx    sfx_HitBoss,0,0,0    ; play boss damage sound
    Should I edit one of the two "obStatus" I've found or should I search somewhere else? I've already tried doing this, and what I've got was... not the best looking thing. Probably I didn't understand what you've meant with "Object status table". Also I'm using the GitHub disassembly
     
  5. StephenUK

    StephenUK Working on a Quackshot disassembly Member

    Joined:
    Aug 5, 2007
    Messages:
    1,026
    If you don't understand what I meant by object status table, then you are currently attempting something out of your depth, as this table contains all of the necessary variables for basic object function. Head on over to http://info.sonicretro.org and read up on the variables used within object programming in the community hacking guide, and the use of RAM variables in general. I don't believe that by giving you a direct answer will help you in the long run, as this is something you need to learn and understand or you'll only end up coming back with a he'll of a lot more questions.
     
  6. Giovanni

    Giovanni It's Joe-vanni, not Geo-vanni. Member

    Joined:
    Apr 16, 2015
    Messages:
    311
    Location:
    Italy
    Right now, I can't really tell you how much I would like to thank you.
    Thanks to what I've learned, I managed to find an alternative way.
    Instead of doing what you've asked me to, I've added a line that flips Robotnik at a certain point in the cutscene. Doing so, it came out just like in my imagination.
    Cattura.PNG
    Now, this fix got me another problem. I now have to guess his X/Y position. Is there a way to let the game check only his X position? This would make my life easier. (I've tried doing something myself, but I failed)

    Again, thank you for helping me. Really.
     
  7. StephenUK

    StephenUK Working on a Quackshot disassembly Member

    Joined:
    Aug 5, 2007
    Messages:
    1,026
    Once again, the information you need is in the link I provided. Rather than playing guess work with the code, use the link I provided and look at the code and you will be able to work out what each line is doing, and therefore know how to manipulate the code to your liking.
     
    Animemaster likes this.