• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Other✓] hidesprite Not Working?

  • 29
    Posts
    10
    Years
    • Seen Jul 11, 2014
    This script is set up as a map script to trigger on entering map. Here's the code:

    Code:
    '---------------
    #org 0x804825
    checkflag 0x1210
    if 0x0 goto 0x880486E
    end
    
    '---------------
    #org 0x80486E
    hidesprite 0x01
    end

    In my mind, it's very straightforward and simple. I've used hidesprite many times before, but it was used alongside setflag and worked without a hitch. I don't believe I can use setflag here, (I probably can, but I think it would make it more complicated than it needs to be) because I want this sprite to appear after triggering an event, hence the checkflag.

    I've also tried reversing it and setting the sprite as hidden in order to use showsprite in place of hidesprite, but that hasn't worked either.

    Why won't this guy stay hidden?
     
    This script is set up as a map script to trigger on entering map.
    You can't have a level script that only has the command 'hidesprite'. In fact, 'hidesprite' in a level script would do nothing. You'll need 'setflag 0xXX' in order to keep the NPC hidden.

    For example: If you used 'hidesprite 0xXX' in a level script, the moment you walk into the map, the NPC will be hidden. However, once you take a single step, the NPC will reappear because a flag hasn't been set to keep him hidden.
     
    Should this work in the long run?

    Code:
    '---------------
    #org 0x873346
    checkflag 0x1210
    compare LASTRESULT 0x1
    if 0x0 goto 0x887A8CC
    compare LASTRESULT 0x1
    if 0x1 goto 0x887A8DF
    end
    
    '---------------
    #org 0x87A8CC
    hidesprite 0x1
    setflag 0x1211
    end
    
    '---------------
    #org 0x87A8DF
    clearflag 0x1211
    end

    He's hidden now, I just want to know if it's fine to let clearflag run every time after I setflag 1210.
     
    Thank you! But now I've got another problem... I don't think this pertains to what I just did at all, but right outside the house that I had that problem script in, my player sprite is changing randomly...

    If I go into a wild battle while in sight of an old man, (he's barely on-screen at one patch of grass) when I exit the battle my camera is still centered on the player sprite, but I'm controlling the old man. Any ideas?
     
    Oh dear. =/
    Yeah, this is a strange bug. Fortunately, it's an easy one to fix.

    When you're mapping, don't use NPCs with a movement permission of 'look down'. Rather, use the movement permission 'no movement'.
    This will create the exact same effect as 'look down' but you won't get any glitches out of it. You may think that you can't use a trainer that needs the permission 'look down', but I don't think the glitch applies to NPCs with the trainer box checked in A-map, as I've never gotten trainers to activate the glitch before.
     
    Ah, you're right, that is extremely strange. It never occurred to me that it could cause a bug. But, it's fixed, thanks so much!
     
    Back
    Top