Skeetendo

’Cause all games were better on the GBC

You are not logged in.

#1 2020-06-15 08:12:14

rbroab
Member
Registered: 2017-06-13
Post 97/101

Event works, but corrupts the bag and sprites

I added Rotom to the game, and gave it an event to fight it. The event works. You find it in the television of the Hidden Power house after beating Morty. Everything about the event works. Doesn't crash or anything. But as soon as I walk into the house, the bag gets corrupted and filled with glitchy items. I don't even need to start the event. As soon as I walk in, the problems occur. If I remove the event, the problem goes away. So clearly something I've done isn't working, but I'm not sure what. NPC sprites also start glitching out.

The event works by checking if you beat Morty, then checking the time. It's a night only event. If you lose the battle, or knock it out, the event starts over because there's only one in the game.

LakeofRageHiddenPowerHouse_MapScriptHeader:
    db 0 ; scene scripts

    db 0 ; callbacks

    db 2 ; warp events
    warp_event  2,  7, LAKE_OF_RAGE, 1
    warp_event  3,  7, LAKE_OF_RAGE, 1

    db 0 ; coord events

    db 2 ; bg events
    bg_event  7,  1, SIGNPOST_JUMPSTD, radio2
    bg_event  5,  1, SIGNPOST_READ, RotomTVEvent


RotomTVEvent:
    checkevent EVENT_BEAT_MORTY
    iffalse .DontAppear
    checkevent EVENT_FOUGHT_ROTOM
    iftrue .DontAppear
    checktime 1 << NITE
    iffalse .NotDarkScript
    opentext
    writetext Text_InTV
    buttonsound
    closetext
    pause 15
    cry ROTOM
    pause 15
    opentext
    writetext Text_Pokemon
    yesorno
    iffalse .no
    writetext Text_ThumpTV
    buttonsound
    closetext
    cry ROTOM
    pause 15
    loadwildmon ROTOM, 25
    startbattle
    reloadmapafterbattle
    writebyte ROTOM
    special SpecialMonCheck
    iffalse RotomTVEvent
    setevent EVENT_FOUGHT_ROTOM
    pause 10
    opentext
    writetext Text_NormalTV
    buttonsound
    closetext
    end
    
.NotDarkScript
    opentext
    writetext Text_Static
    buttonsound
    closetext
    end    
    
.DontAppear
    opentext
    writetext Text_RegularTV
    buttonsound
    closetext
    end
    
.no
    closetext
    end



Text_InTV:
    text "The TV has an odd,"
    line "malevolent feel…"

    para "It's as if it is"
    line "staring at you…"
    done
    
Text_Pokemon    
    text "There's a #mon"
    line "in the TV!"
    
    para "Give the TV a"
    line "thump?"
    done

Text_ThumpTV:
    text "<PLAYER> thumped"
    line "the TV!"
    done
    
Text_NormalTV:
    text "The TV returned"
    line "to normal!"
    done
    
Text_Static
    text "Hmmm… Nothing"
    line "but static…"
    done
    
Text_RegularTV:
    text "There's nothing"
    line "but static…"
    done

Offline

Board footer

Powered by FluxBB