• 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.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Dawn, Gloria, Juliana, or Summer - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • 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] One-time/otherwise changing script using IFs and SRAM/RAM data

wolfboyft

Pokémon Generation 2 Hacker
  • 165
    Posts
    10
    Years
    Complete newbie here. Well, not that complete, but still...

    How would I go about making a one-time/otherwise changing script that checks to see if the player has triggered any events—when said as yes, the current script continues, when no, it continues another way.

    Is this possible? Well, of course it is, you see it all the time... but how do I do it?

    Thanks...
     
    if "event_done" --> do regular stuff
    if "should_run_event" --> run event, and in the end, set 'event_done' bit
    if "don't_run_event_yet" --> do regular stuff
     
    if "event_done" --> do regular stuff
    if "should_run_event" --> run event, and in the end, set 'event_done' bit
    if "don't_run_event_yet" --> do regular stuff

    How do I go about setting bits? I had a feeling 'twas about that kind of thing. Also, thank Eula it's bits, because each event's 'done-ness' would be 8x bigger as a byte—your typical boolean for some random reason. Durh, why am I even saying this??

    Thanks BTW.
     
    I have PROBABLY gotten bits set, but my trigger won't... well, trigger. Ach!!

    Here are the trigger settings:

    Flags: 1... why does this only go up to FF if there are flags with 4 octets!??!
    Unknown 1: 0, umm... yeah.
    Script pointer: 7750
    Unknown 2: 0...?
    Unknown 3: 0...

    Here is the trigger's script:

    #org 0x183750
    '-----------------------------------
    checkbit1 0x4306
    if true 0x701A ' 0x18301A
    setbit1 0x4306
    3callasm 0xE07E04
    end

    #org 0x18301A
    '-----------------------------------
    setlasttalked 0x0
    2writetext 0x6AA0 ' 0x182AA0
    showemote 0x6 0x0 0x4
    showemote 0x0 0x0 0x2
    end


    #org 0x182AA0
    = \h01: [PLAYER]!!\e

    If it matters, here's the map script header thingy I was working on, when I still thought that map script headers were just scripts that ran on map entry (how neat would that be...? :( )

    *insert the stuff that was pointed to by 7750, seen above*

    Map script bank 0x60.
     
    Trigger triggers. Everything is awesome, except—the bit I chose, 4B06, does NOT GET SAVED into SRAM! Does into RAM, so resetting VBA/my GBC works etc, but turning off and on again resets the bit.
     
    Back
    Top