• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • 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.

Script Help Thread (DO NOT REQUEST SCRIPTS)

Status
Not open for further replies.

Quickster

Dream or Drop?
351
Posts
16
Years
    • Seen Apr 4, 2016
    Is it possible to read the time played in a game,specifically fire red, and create scripts around taht,for example.Checks the time and if its been played for at least an hour a cript will be able to happen?
     

    Ven

    Tyrian
    124
    Posts
    14
    Years
    • Seen Mar 19, 2011
    Game: FireRed
    Type: Event
    Editor: XSE
    Script:
    Spoiler:

    Screenshots and/or Videos: N/A
    My main problem is on move2 move3 and move 4.
    Move2 Work's perfectly, but the other two don't move at all, also the waitmovement command won't work, and it just goes straight to the text.
    Also, I'm trying to make all three movements happen at the same time.
     

    Pokepal17

    More cowbell~
    1,519
    Posts
    15
    Years
  • Is it possible to read the time played in a game,specifically fire red, and create scripts around taht,for example.Checks the time and if its been played for at least an hour a cript will be able to happen?

    Yep, I believe the command comparefarbytetobyte is what you would need. :P
     

    colcolstyles

    Yours truly
    1,588
    Posts
    15
    Years
  • Is it possible to read the time played in a game,specifically fire red, and create scripts around taht,for example.Checks the time and if its been played for at least an hour a cript will be able to happen?
    Try reading HackMew's first ASM tutorial in the Documents and Tutorials section. If you adapt his code, you should be able to obtain the current playing time down to the millisecond.

    For future reference, this question would be better asked in the Simple Questions Thread.
     

    Quickster

    Dream or Drop?
    351
    Posts
    16
    Years
    • Seen Apr 4, 2016
    Try reading HackMew's first ASM tutorial in the Documents and Tutorials section. If you adapt his code, you should be able to obtain the current playing time down to the millisecond.

    For future reference, this question would be better asked in the Simple Questions Thread.

    Thanks,and ill remember to ask in the simple questions if it doenst directly involve a script,i was just hoping this could be done by scripting.
     

    Pokepal17

    More cowbell~
    1,519
    Posts
    15
    Years
  • Thanks,and ill remember to ask in the simple questions if it doenst directly involve a script,i was just hoping this could be done by scripting.

    It can, didn't you see my post that replied to yours on the other page?

    Anyway, I'll repeat it. You can use the scripting commmand: comparefarbytetobyte.
     

    /Circa

    a face in the clouds.
    881
    Posts
    16
    Years
  • In one of my maps, as soon as I take a left or right onto the script tiles the game freezes.

    Code:
    '---------------
    #org 0x298D2A
    checkflag 0x202
    if 0x1 goto 0x8298D6F
    lock
    faceplayer
    showsprite 0x4
    msgbox 0x8298D90 MSG_NORMAL '"Hold on kiddo!"
    applymovement MOVE_PLAYER 0x8298D72
    waitmovement 0x0
    applymovement 0x4 0x8298D75
    waitmovement 0x0
    msgbox 0x8298DA1 MSG_NORMAL '"Where the hell did you come from?\..."
    applymovement 0x4 0x8298D83
    waitmovement 0x0
    hidesprite 0x4
    setflag 0x202
    release
    end
    
    '---------------
    #org 0x298D6F
    release
    end
    
    
    '---------
    ' Strings
    '---------
    #org 0x298D90
    = Hold on kiddo!
    
    #org 0x298DA1
    = Where the hell did you come from?\nI saw that statue glow,\pthen you just pop out of nowhere!\nHmph... Ill figure it out.
    
    
    '-----------
    ' Movements
    '-----------
    #org 0x298D72
    #raw 0x2 'Face Left
    #raw 0xFE 'End of Movements
    
    #org 0x298D75
    #raw 0x20 'Step Right (Fast)
    #raw 0x20 'Step Right (Fast)
    #raw 0x20 'Step Right (Fast)
    #raw 0x20 'Step Right (Fast)
    #raw 0x20 'Step Right (Fast)
    #raw 0x20 'Step Right (Fast)
    #raw 0x20 'Step Right (Fast)
    #raw 0x20 'Step Right (Fast)
    #raw 0x20 'Step Right (Fast)
    #raw 0x20 'Step Right (Fast)
    #raw 0x20 'Step Right (Fast)
    #raw 0x55 'Jump in Place (Facing Right)
    #raw 0xFE 'End of Movements
    
    #org 0x298D83
    #raw 0x1F 'Step Left (Fast)
    #raw 0x1F 'Step Left (Fast)
    #raw 0x1F 'Step Left (Fast)
    #raw 0x1F 'Step Left (Fast)
    #raw 0x1F 'Step Left (Fast)
    #raw 0x1F 'Step Left (Fast)
    #raw 0x1F 'Step Left (Fast)
    #raw 0x1F 'Step Left (Fast)
    #raw 0x1F 'Step Left (Fast)
    #raw 0x1F 'Step Left (Fast)
    #raw 0x1F 'Step Left (Fast)
    #raw 0xFE 'End of Movements

    I don't know if it's the script or if it's my rom.
     

    Pokepal17

    More cowbell~
    1,519
    Posts
    15
    Years
  • That actually sounds quite interesting. How would you go about using that?

    Comparefarbytetobyte compares a byte at a certain ram address with a certain value, It's useful for seeing how much time has passed or even for seeing what the player's gender is.

    It's layout is this:

    comparefarbytetobyte 0xpointer to ram address with byte value to compare with. 0xbyte to compare with.
     

    Larsie13

    Guest
    0
    Posts
    In FR, the location for the playtime is at 0x20245C6 in the RAM. The first two bytes you'll find there are the hours of playtime, second byte minutes, then seconds and last, but not least, the milliseconds.
    In R/S, the offset is 0x2024EB2, and in Emerald 0x2024A96. And indeed, you can check them with comparefarbytetobyte. To check for at least an hour of playtime, you would use:
    Code:
    comparefarbytetobyte 0x20245C6 0x1
    if 0x4 goto @script
    (Obviously, that's for FR/LG. In R/S/E, only the offset changes. The rest remains the same.)
     

    Sierraffinity

    Desperately trying to retire from ROM hacking
    1,069
    Posts
    16
    Years
  • In FR, the location for the playtime is at 0x20245C6 in the RAM. The first two bytes you'll find there are the hours of playtime, second byte minutes, then seconds and last, but not least, the milliseconds.
    In R/S, the offset is 0x2024EB2, and in Emerald 0x2024A96. And indeed, you can check them with comparefarbytetobyte. To check for at least an hour of playtime, you would use:
    Code:
    comparefarbytetobyte 0x20245C6 0x1
    if 0x4 goto @script
    (Obviously, that's for FR/LG. In R/S/E, only the offset changes. The rest remains the same.)
    Actually, this is not the case. The play time data, along with most of the other player data, actually moves around due to DMA (Direct Memory Access). The offset of the data is determined by a pointer at 0x300500C (which is in the IRAM, in case you're wondering.
    You'll have to use ASM to access it. Read HackMew's Knowledge, ASM Tutorial 1, which explains how to access the player data.
     
    39
    Posts
    15
    Years
    • Age 29
    • Seen Aug 20, 2010
    I edited the map for Cinnabar Island (img21.imageshack.us/img21/1884/cinnabarisland.png), and now the script to keep you out of the Gym until you have the Secret Key doesn't work. How do I fix this?
     

    Pokepal17

    More cowbell~
    1,519
    Posts
    15
    Years
  • I edited the map for Cinnabar Island (img21.imageshack.us/img21/1884/cinnabarisland.png), and now the script to keep you out of the Gym until you have the Secret Key doesn't work. How do I fix this?

    You'll need to move the script tile to in front of Cinnibar Island's gym.
     

    NarutoActor

    The rocks cry out to me
    1,974
    Posts
    15
    Years
  • I have a script problem(duh)
    the player is in a tight hallway and professor oke is one tile above you. I want him to follow you left and right so I wrote a script.
    My first attempt used flags, and it worked on paper but no in game.
    I then tried a referent way of doing things. I tried comparing the players facing so if he is facing left oke will move left, and if he faces right oke will move right. But When I play the game no matter what I do oke only moves left

    '---------------
    #org 0x71BBE4
    lock
    getplayerpos 0x6000 0x6001
    compare PLAYERFACING 0x3
    if 0x1 goto 0x871BC3E
    compare PLAYERFACING 0x4
    if 0x1 goto 0x871BC63
    end

    '---------------
    #org 0x71BC3E
    applymovement 0x17 0x871BC70
    waitmovement 0x0
    release
    end

    '---------------
    #org 0x71BC63
    applymovement 0x17 0x871BC73
    waitmovement 0x0
    release
    end


    '-----------
    ' Movements
    '-----------
    #org 0x71BC70
    #raw 0x12 'Step Left (Normal)
    #raw 0xFE 'End of Movements

    #org 0x71BC73
    #raw 0x13 'Step Right (Normal)
    #raw 0xFE 'End of Movements
     

    Ven

    Tyrian
    124
    Posts
    14
    Years
    • Seen Mar 19, 2011
    I'd really appreciate it if someone could help me with this.

    Game: FireRed
    Type: Event
    Editor: XSE
    Script:
    Spoiler:

    Screenshots and/or Videos: N/A
    My main problem is on move2 move3 and move 4.
    Move2 Work's perfectly, but the other two don't move at all, also the waitmovement command won't work, and it just goes straight to the text.
    Also, I'm trying to make all three movements happen at the same time.
     

    Bela

    Banned
    262
    Posts
    15
    Years
  • Game: Pokémon Rose Version (Fire Red Hack)

    Type: A Trigger Script (you walk over a green script tile)

    Editor: I'm using PokeScript to put the script into the game, and I'm using XSE to view the script.

    Script:

    What I wrote and compiled with PokeScript:

    Spoiler:


    The script, as seen in XSE:

    Spoiler:


    Here's what happens:

    Spoiler:


    I previously edited the script and had this in XSE:

    Spoiler:


    With this result in-game:

    Spoiler:


    So, in short, XSE shows that the messages I want to have in this dialogue do in fact appear, and the movements for the player do, in fact, appear--it's the part right after setting variable 0x4001 that is messing up.

    What this script is SUPPOSED to do is:

    1. Stop the player and set the appropriate variable for the movement part of the script.
    2. First message from the mother
    3. Movement towards the mother
    4. Another message
    5. Followed by another message
    6. Oak question (Yes: go to 9, No: go to 7)
    7. Elm question (Yes: go to 10, No: go to 8)
    8. Birch question (Yes: go to 11, No: go to 5)
    9: Another message from the mom, and a variable is set (go to 12)
    10: Another message from the mom, and a variable is set (go to 12)
    11: Another message from the mom, and a variable is set (go to 12)
    12: A final message by the mom, a variable is set to prevent this script from occurring again, and the script ends.
     

    Ninja Caterpie

    AAAAAAAAAAAAA
    5,979
    Posts
    16
    Years
  • Game: Pokémon Rose Version (Fire Red Hack)

    Type: A Trigger Script (you walk over a green script tile)

    Editor: I'm using PokeScript to put the script into the game, and I'm using XSE to view the script.

    Script:

    What I wrote and compiled with PokeScript:

    Spoiler:


    The script, as seen in XSE:

    Spoiler:


    Here's what happens:

    Spoiler:


    I previously edited the script and had this in XSE:

    Spoiler:


    With this result in-game:

    Spoiler:


    So, in short, XSE shows that the messages I want to have in this dialogue do in fact appear, and the movements for the player do, in fact, appear--it's the part right after setting variable 0x4001 that is messing up.

    What this script is SUPPOSED to do is:

    1. Stop the player and set the appropriate variable for the movement part of the script.
    2. First message from the mother
    3. Movement towards the mother
    4. Another message
    5. Followed by another message
    6. Oak question (Yes: go to 9, No: go to 7)
    7. Elm question (Yes: go to 10, No: go to 8)
    8. Birch question (Yes: go to 11, No: go to 5)
    9: Another message from the mom, and a variable is set (go to 12)
    10: Another message from the mom, and a variable is set (go to 12)
    11: Another message from the mom, and a variable is set (go to 12)
    12: A final message by the mom, a variable is set to prevent this script from occurring again, and the script ends.

    ...which is why you should use XSE to write and compile scripts.
     

    Pokepal17

    More cowbell~
    1,519
    Posts
    15
    Years
  • I have a script problem(duh)
    the player is in a tight hallway and professor oke is one tile above you. I want him to follow you left and right so I wrote a script.
    My first attempt used flags, and it worked on paper but no in game.
    I then tried a referent way of doing things. I tried comparing the players facing so if he is facing left oke will move left, and if he faces right oke will move right. But When I play the game no matter what I do oke only moves left

    '---------------
    #org 0x71BBE4
    lock
    getplayerpos 0x6000 0x6001
    compare PLAYERFACING 0x3
    if 0x1 goto 0x871BC3E
    compare PLAYERFACING 0x4
    if 0x1 goto 0x871BC63
    end

    '---------------
    #org 0x71BC3E
    applymovement 0x17 0x871BC70
    waitmovement 0x0
    release
    end

    '---------------
    #org 0x71BC63
    applymovement 0x17 0x871BC73
    waitmovement 0x0
    release
    end


    '-----------
    ' Movements
    '-----------
    #org 0x71BC70
    #raw 0x12 'Step Left (Normal)
    #raw 0xFE 'End of Movements

    #org 0x71BC73
    #raw 0x13 'Step Right (Normal)
    #raw 0xFE 'End of Movements

    First of all, remove the getplayerpos, it's not necessary. Also replace the compare PLAYERFACING 0x3 and 0x4 with PLAYERFACING FACE_LEFT and FACE_RIGHT.
     
    Status
    Not open for further replies.
    Back
    Top