• 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.
  • 219
    Posts
    16
    Years
    Wildbattle [wildPokemon number in hex] [level] [item]

    That's all there is to it. Just type in any command in the main box in XSE and press F1. It'll tell you what you need to put and stuff.
    But after I use the 2nd way of Shiny Hack Maker and write this code into ROM, the game restart :
    Code:
    #org @start  ' I write this code into a OW.
    lock
    faceplayer
    callasm 0x71A24C  ' This is the offset I use the Shiny Hack Maker
    wildbattle 0x20 0x46 0x0
    release
    end
     

    Hiche..

     
  • 979
    Posts
    16
    Years
    • Seen Dec 27, 2014
    But after I use the 2nd way of Shiny Hack Maker and write this code into ROM, the game restart :
    Code:
    #org @start  ' I write this code into a OW.
    lock
    faceplayer
    callasm 0x71A24C  ' This is the offset I use the Shiny Hack Maker
    wildbattle 0x20 0x46 0x0
    release
    end

    Try it like this:
    Spoiler:


    Hope it works.
     

    HackMew

    Mewtwo Strikes Back
  • 1,314
    Posts
    17
    Years
    • Seen Oct 26, 2011
    I've got a small problem...
    Spoiler:

    The problem is the nickname part. It keeps going if it's yes and freezes if it's no.
    I've tried
    Code:
    Compare 0x0
    if 0x1 goto
    
    and
    
    Compare 0x1
    if 0x0 goto...
    
    and
    compare 0x1
    if 0x1 goto...

    But none of them work.

    Here's the fixed + optimized script:

    Spoiler:


    Few notes. Since you're using FireRed and you wanted to change the text color to just blue and red, respectively, you simply need to use the textcolor command.
    Proper values are:
    0x0 = Blue
    0x1 = Red
    0x3 = Black

    Once you use a textcolor command, the changes will be permanent till the end of the script, or till you use another textcolor command.

    Also, make sure the script at 0x1A74EB looks like this:

    Code:
    '---------------
    #org 0x1A74EB
    fadescreen 0x1
    special 0x9E
    waitstate
    return

    Finally, since you're using the new beta version of XSE, autobanking is not turned on by default any more due to expanded ROM support. Basically to prevent taking memory addresses as regular offsets while writing them to the ROM.


    Hey Guys i have a problem with this level script

    Spoiler:



    yes i know i spelt Cqindaquil wrong

    Heres what happens
    [Archive] Script help thread

    this just keeps repeating


    Please Help

    First of all that's not really a level script, rather a part of it. Anyway, your script is kinda screwed up. Since the script will happen at the very beginning of the game, and no more, checking flag 0x828 is just pointless.
    Also, you wrote setvar 4033 0x1, while you actually meant 0x4033. 0x stands for hexadecimal, and it's not an optional, indeed. When you write 4033, that would be like typing 0xFC1 (in hex). Crearly not the right value.
    After each applymovement you should put a waitmovement 0x0 too.
    Yet another thing, some of the latest AM version will even screw up the level script structure. Hence my suggestion to load any level script directly with XSE. All you have to do is to check the Professional Header View option, copy the Map Script offset, paste it into XSE, check the Level Script option near the decompile button and then decompile it.

    Here's the fixed script:

    Spoiler:



    Who knows the warp command for XSE?
    because warp 0x[bank] 0x[mapnumber] 0x[warp number] doesn't work...

    There are basically two ways, depending on the choice of using coordinates or not.
    The most obvious way is the following:

    Code:
    warp [bank] [map] [warp] 0x0 0x0

    Then there's the less obvious way:
    Code:
    warp [bank] [map] 0xFF [X] [Y]

    As you can see here the warp is 0xFF, which acts like a "coordinate enabler".
    An example is the Oak script found at FR/LG beginning.


    I'm really new to scripting, and need some assistance. ^^; What am I doing wrong with this (XSE) script? I can compile it and everything, but when I go to talk to the sprite on the overworld, she does absolutely nothing except make that "beep" sound when you normally talk to a sprite. (During the course of making changes, I've gotten her to actually talk and start the battle, but all the text boxes are glitchy and she never follows any of the movement commands, meaning if you keep talking to her, you're in an endless battle loop. The script below is the one that yields the "nothing" result).

    What I want the sprite to do is say a line while facing in a different direction from you, then turn and get an exclamation point over her head, while the "female rival" music plays. Then I want her to talk a bit more, after which a battle will start. After the battle, she'll talk a little more, than walk up a step, than walk left off the screen and vanish. Flags relating to having met her are either set or cleared.

    Thanks so much in advance!

    Spoiler:

    Well, it seems like you misunderstood how offset/pointer works.
    Let's take the first line for example.

    Code:
    #org 0x1E40CF
    lockall
    msgbox 0x1E40D0

    First you tell the compiler to go to offset 0x1E40CF. Then you write a lockall command at that offset. Then it comes a msgbox command, and now offset would 0x1E40D0. At this point, you use 0x1E40D0 as pointer to the text data. But at 0x1E40D0 there's the msgbox command. Same happens with the rest of the script. Also, pay attention to the "0x" prefix.
    0x means hexadecimal. So, if you want to hide people number 16, you would do

    Code:
    hidesprite 0x10

    or, eventually

    Code:
    hidesprite 0x16

    That said, here's the dynamic version of the script, I've adjusted few things.
    Note: to properlt hide a person forever you need to set the proper flag (People ID) after using hidesprite. I changed the flag value to 0x1001, so you'll need to change the People ID on AM accordingly. Also, you'll need to edit the rest of the string in order to make them use dynamic pointers. See the script above as example:

    Spoiler:



    Spoiler:


    It works perfectly, but the pointer $talk0 is being said after the wrap command.

    Here's what it looks like in XSE.

    Spoiler:


    The same message came twice(the large sized words). I placed it only one place.
    Is there a problem?

    The message came twice because the warp command wasn't compiled fine - that is, with just 3 params instead of 5. Placing 4 nops after the warp command would solve that. Of course, using XSE at first you wouldn't have gotten that problem.


    The following script (Emerald) is supposed to force the player back if the player does not have the Hoenn PokéDex, and it should give the player the National PokéDex if he/she already has the Hoenn PokéDex.

    In Advance-Map, the script takes the form of a script tile.

    Spoiler:

    The script works well when I don't have the Hoenn PokéDex (I freeze, message box appears, I walk back). However, when I already have the Hoenn PokéDex, I can walk straight through as though there were no script tile there (i.e. no message box, no National PokéDex). Does anyone have suggestions?

    Thanks.

    I tried your script and it worked, actually.
    Proof:

    [Archive] Script help thread


    Make sure your script tile has the right values:
    Unknown: 0003 (older version of AM would show it as 03 00)
    Var Number: 40XX (older: XX 40)
    Var Value: 0000

    XX stands for a hex value between 0x2 and 0xFF, basically. Since those values can be used by the game already, you may have to experiment a little.
    You may even try something like 50XX.


    Oh~~I think it's the time to ask a question:how to use the wildbattle command in XSE?I don't think it's the same as pokescript...

    Well, since you're beta-testing the newest one, you should check the Command Help.
    Now there are 2 wildbattle constructs. (Yeah, wildbattle is not a command actually).


    I put this script in using PokeSav 1.52 and my ROM died. Is there something wrong with it?
    Spoiler:
    And yes, I tested the ROM before and it worked.

    Not just something - everything. I dunno if you noticed, but after you compiled that script, the ROM header got completely overwritten with garbage. Now, if you're able to manually fix the header using a hex editor, do it. You'll need to get the right data from a proper ROM. Otherwhise you'll have to take another ROM.

    Once you're ready, get XSE and compile this script below. Since it was a total mess, I removed any movements etc. You'll need to add them by yourself.

    Spoiler:



    Wait, there's a removeitem command?
    Is there a removepokemon command then?

    No, there isn't one.


    But after I use the 2nd way of Shiny Hack Maker and write this code into ROM, the game restart :
    Code:
    #org @start  ' I write this code into a OW.
    lock
    faceplayer
    callasm 0x71A24C  ' This is the offset I use the Shiny Hack Maker
    wildbattle 0x20 0x46 0x0
    release
    end

    The problem is you're not using the callasm command properly.
    Being a THUMB routine, the pointer must be an even odd number.
    Here's the fixed version:

    Spoiler:
     
    Last edited:
  • 219
    Posts
    16
    Years
    I tried these two fixed scripts,but the game just stopped there...
    I think I should try a giveegg command to test the Shiny Hack Maker...
    Anyway,thanks.
     
    Last edited:

    Hiche..

     
  • 979
    Posts
    16
    Years
    • Seen Dec 27, 2014
    Can someone explain for me what writebytetoooffset does? I don't seem to get it. And an example would be appreciated.
    Thanks.
     
  • 185
    Posts
    16
    Years
    Can someone explain for me what writebytetoooffset does? I don't seem to get it. And an example would be appreciated.
    Thanks.

    I'm not sure, but if you know the needed offsets, and you know which bytes should come in which order, I think you can modify the wild pokemon data without using a tool. Take as example... Lets say you want diffirent pokemon to appear after a certain event has happened. Well, in the event script, use writebytetoooffset, use the right bytes and offsets, and you'll get diffirent pokemon data on a certain map.

    I think I'm gonna try that now... I'll PM you if it should work.

    EDIT: Oh well, it doesn't seem to work, which means that my guess was wrong.... Well, you should wait for HackMew to reply to this.
     
    Last edited:
  • 857
    Posts
    15
    Years
    Can someone explain for me what writebytetoooffset does? I don't seem to get it. And an example would be appreciated.
    Thanks.
    Taken from XSE:
    Sets the byte at the specified offset to a certain value

    I'm guessing it changes or adds what a specified offset is.
    (Even I don't understand what my guess means!)

    Maybe the quote from XSE will help, anyways.
     

    machomuu

    Stuck in Hot Girl Summer
  • 10,507
    Posts
    16
    Years
    Hey guys, can someone please tell me how to do a trainerbattle in XSE (I just recently converted from pokescript) and quite possibly an applying movement, I have someone looking down, and want them to move right go in the warp they are also in guarding (it's behind them)
     
  • 857
    Posts
    15
    Years
    Hey guys, can someone please tell me how to do a trainerbattle in XSE (I just recently converted from pokescript) and quite possibly an applying movement, I have someone looking down, and want them to move right go in the warp they are also in guarding (it's behind them)

    Heres an example:

    Code:
    #org @main
    lock
    faceplayer
    trainerbattle 0x1 0x1 0x1 @before @after
    release
    end
    
    #org @before
    = Before txt
    
    #org @after
    = after txt
     

    Surf

    ...
  • 1,196
    Posts
    15
    Years
    • Age 29
    • Rust
    • Seen Jul 31, 2011
    #org $headbutt
    checkitem item no.
    compare LASTRESULT 0x06
    if 1 jump $could '

    message $question
    $question 1 = This tree could have a Pokemon\nin it. Slather the bark in Honey?
    boxset 0x5
    compare LASTRESULT 0x00
    if 1 jump $end
    message $used
    $used 1 = Slathered the bark in Honey.
    boxset 0x6
    #raw 0x68
    #raw 0x27 '
    jump 0x1Be06F

    #org $could
    message $you
    $you 1 = It's a Honey Tree!
    boxset 0x6
    release
    end

    #org $end
    release
    end


    this is my unteasted honey tree script for Pokescript

    try it please
     
  • 224
    Posts
    16
    Years
    • Seen Mar 8, 2016
    Hey all, I just started scripting like 2 days ago and I'm beginning to understand it. So far, I have 2 problems I couldn't work out.
    I am writing these scripts for Pokemon Ruby and using Pokescript.

    1. I made a givepokemon script, and everything works fine except for one thing. If you say "yes" to nicknaming your pokemon, after you nickname a textbox should come up saying "Thanks!". The same thing goes for if you say No. However, if I click yes for nicknaming the pokemon, after I nickname it the "Thanks" Textbox doesn't come up.

    Here is the script:
    Spoiler:


    The other script I'm having trouble with is applymovement. Everything works fine, but after the script ends if you try to talk to the person that moved he says something like: "May: Let's go back to Professor Birch's lab" or something. Is it because I used a flag that has been already set? Also how can I add a message that the person says if you talk to him after the script had finished?

    Here is the script:

    Spoiler:
     

    HackMew

    Mewtwo Strikes Back
  • 1,314
    Posts
    17
    Years
    • Seen Oct 26, 2011
    Can someone explain for me what writebytetoooffset does? I don't seem to get it. And an example would be appreciated.
    Thanks.

    Just what the Command Help says. Remember that the ROM, while you're playing it, it's Read Only (it's called ROM for something :P). So you just can't edit it. Instead, you can edit the RAM.
    RAM addresses are for example 0x2XXXXXX - 0x3XXXXXX.

    To test the command:

    Code:
    writebytetooffset 0x2222000 0xAB

    This will write 0xAB at 0x2222000. To check that, just open the Memory Viewer under VBA Tools menu, select 8 bit, type "02222000" in the text box and check Automatic Update.
    Finally run a script with a writebytetooffset command. You'll notice the memory will get updated.
     

    /Circa

    a face in the clouds.
  • 881
    Posts
    16
    Years
    I have a script that works perfectly, until I reach the end of it. It's a movement script where someone comes and gives you three Pokemon, after that they go away, then when they reach their final spot the player warps into the middle of nowhere, I know they warp because I looked at the script to try and fix it with the 'Open Script' in AM, using XSE. I didn't add the warp, but everytime I remove it and fix the end it comes back up in the game and then the script.

    I don't know whats causing the problem or have any idea about it, but it would be good if someone can help me here. I don't think anythings wrong with the script but if you need it I can post it.
     
    Status
    Not open for further replies.
    Back
    Top