• 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.

[Archive] Script help thread

Status
Not open for further replies.

destinedjagold

You can contact me in PC's discord server...
8,593
Posts
16
Years
    • Seen Dec 23, 2023
    Thanks for the help dshayabusa and thex4, just one more (unrelated) question: is there a scripting command for getting the in-game clock time in ruby?

    here's a script example of the clock. ;)
    thethethethe helped me make it. :)

    Code:
    #org $start
    checkflag 0x29E
    if 0x1 goto $done
    message $fix
    boxset 6
    call 0x1B6A9B
    pause 0x1E
    setflag 0x29E
    release
    end
    
    #org $done
    message $sun
    boxset 6
    call 0x1B6A91
    end
    
    #org $sun
    $sun 1 = \v\h01: It's a sundial...
    
    #org $fix
    $fix 1 = \v\h01: Oh... It's a sundial...\p\v\h01: I wonder what's the\ntime today...

    dunno if this is the right code. :\
     
    857
    Posts
    15
    Years
  • Compiled, this script changes...
    And if I change the script so It doesn't change, it freezes...
    Spoiler:
     

    Surf

    ...
    1,196
    Posts
    15
    Years
    • Age 29
    • Rust
    • Seen Jul 31, 2011
    I need some help with this script i compile it and it goes like this

    Spoiler:


    but when opened it just goes like this:
    '-----------------------
    #org 0x2DE517
    Please help
     
    857
    Posts
    15
    Years
  • I need some help with this script i compile it and it goes like this

    Spoiler:


    but when opened it just goes like this:
    '-----------------------
    #org 0x2DE517
    Please help
    Get an offset with more bytes and try again.
     

    Eletj

    Once Eletj, Always Eletj
    363
    Posts
    16
    Years
  • Can someone help me with this? If I
    Sorry bout it being compiled.
    Spoiler:

    Help much appreciated.
     

    Surf

    ...
    1,196
    Posts
    15
    Years
    • Age 29
    • Rust
    • Seen Jul 31, 2011
    i don't get what our saying

    Compiled, this script changes...
    And if I change the script so It doesn't change, it freezes...
    Spoiler:
    I think you need a sprite to do the walking so just make a person event with no offset
     
    Last edited:

    HackMew

    Mewtwo Strikes Back
    1,314
    Posts
    17
    Years
    • Seen Oct 26, 2011
    Compiled, this script changes...
    And if I change the script so It doesn't change, it freezes...
    Spoiler:

    Remember you should always put an end.
    Also, avoid using flag 0x200 over and over again. Safer flags are those ranging from 0x1000 to 0xFFFF. A lot more than you'll ever need.
    When using an if for checking flags, there's no need to put two ifs. In fact, if the first if is not executed, the rest of the script would be executed instead.
    Checking flags, however, doesn't make sense if you don't set them.
    After each applymovement command you should put a waitmovement 0x0 too.
    And don't forget to put callstd/boxset in the right place. That is, right after the message/msgbox command.

    This is the fixed script. It should work fine even if I haven't tested it.

    Spoiler:



    I need some help with this script i compile it and it goes like this

    Spoiler:


    but when opened it just goes like this:
    '-----------------------
    #org 0x2DE517
    Please help

    When compiling a dynamic script, the offset you specify in the #dynamic part isn't going to be the exact same offset where the script will be actually compiled. This happen in most case since that offset (in your case 0x2DE517) is what XSE uses to search free space from.
    Once compiled, the compiler log will show you the actual offset where the script got compiled.
    As I said earlier, remember to use setflag after checking it.


    Can someone help me with this? If I
    Sorry bout it being compiled.
    Spoiler:

    Help much appreciated.

    I guess you recompiled the script after compiling it. Well, you should know that if you don't pay attention, scripts may get ovewritten themselves, and that explains why you're getting a nop instead of end.
    Don't forget to put callstd/boxset right after the message/msgbox command, anyway.

    Try using this:

    Spoiler:
     
    Last edited:

    Eletj

    Once Eletj, Always Eletj
    363
    Posts
    16
    Years
  • Hackmew, I tried the script, but the game still just freezes. I also tried compiling at a different offset. Didn't work either.
     

    HackMew

    Mewtwo Strikes Back
    1,314
    Posts
    17
    Years
    • Seen Oct 26, 2011
    Hackmew, I tried the script, but the game still just freezes. I also tried compiling at a different offset. Didn't work either.

    The offset isn't the problem, obviously. The thing is you shouldn't use random setvar/special when you don't know what they do. Hence the freeze.
    Also, if you give the player his/her fist Pokémon, you should enable the POKéMON menu flag as well. In FireRed it's 0x828. I did other few adjustments here and there.

    Here's the fixed and working script. Simply compile it.

    Spoiler:
     

    pokedude565

    Guest
    0
    Posts
    For having people follow you, is it the same script for that person everytime or different for each tile.
     

    Thrace

    @tion
    1,048
    Posts
    16
    Years
    • Seen Oct 2, 2016
    For having people follow you, is it the same script for that person everytime or different for each tile.
    Not entirely sure what you mean... Are you asking if you can have more than one movement per script? If so then yes you can:

    Code:
    applymovement 0x1 @move
    waitmovement 0
    
    #org @move
    #raw [put as many movements as you want here] 0xfe
     

    Eletj

    Once Eletj, Always Eletj
    363
    Posts
    16
    Years
  • Spoiler:

    Sorry again Hackmew, but it still just freezes.
     

    HackMew

    Mewtwo Strikes Back
    1,314
    Posts
    17
    Years
    • Seen Oct 26, 2011
    Spoiler:

    Sorry again Hackmew, but it still just freezes.

    I'm sorry bu you must be doing something wrong.

    [Archive] Script help thread



    To solve the problem:
    1. Make sure you're using latest version of XSE (just in case, it shouldn't really matter)
    2. Compile the script and assign the proper offset to a person
    3. Clear any savegames you may have
    4. Load your ROM, enter and exit a building and try your script

    If the script still doesn't work, try using a clean ROM instead, repeating all the steps above.
     

    Eletj

    Once Eletj, Always Eletj
    363
    Posts
    16
    Years
  • It worked on a clean rom. Thanks Heaps Hackmew, but can I get it to dissappear afterwards (If you cant tell, Im knew at scripting:))
     

    HackMew

    Mewtwo Strikes Back
    1,314
    Posts
    17
    Years
    • Seen Oct 26, 2011
    It worked on a clean rom. Thanks Heaps Hackmew, but can I get it to dissappear afterwards (If you cant tell, Im knew at scripting:))

    Well, all you need is a flag which is a unique value acting like a switch that can enable and/or disable custom events. Which means you shouldn't share the same flag for different events.

    And here's a little tip: to get better texts without worrying about \n \p etc, use the Text Adjuster under the Tools menu.

    I'll edit your script to show you how. For further info, check the info I posted some posts above and try it yourself.

    Spoiler:
     

    Eletj

    Once Eletj, Always Eletj
    363
    Posts
    16
    Years
  • Spoiler:


    Do you have to setflag 0x1001, because its not working. The first part of the script works fine, and the player gets everything. But if you click it again. it just replays the script
     

    HackMew

    Mewtwo Strikes Back
    1,314
    Posts
    17
    Years
    • Seen Oct 26, 2011
    Spoiler:


    Do you have to setflag 0x1001, because its not working. The first part of the script works fine, and the player gets everything. But if you click it again. it just replays the script

    Yes, you have to add a setflag 0x1001 after the if command.
     

    Gold Tom

    Krazier Than You
    438
    Posts
    19
    Years
  • I made this script, I'm having some trouble, it won't work for me, can anyone see a problem with it?

    Spoiler:
     
    Status
    Not open for further replies.
    Back
    Top