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

Help Thread: Script Help Thread

Status
Not open for further replies.

Joexv

ManMadeOfGouda joexv.github.io
1,037
Posts
11
Years
  • So, just a small nitpick, is there a way to move the camera when teleporting the player? I want it to be a bit more centered.
    Check this thread out http://www.pokemonhackersonline.com/showthread.php?t=14471


    Ok I have my own issue. After talking to joy and her healing my pokemon the screen glitches up:
    Spoiler:


    I do have a sethealing place all set up too. Im using jpans hacked engine too.
    Heres the script:
    Spoiler:
     

    U.Flame

    Maker of Short Games
    1,326
    Posts
    15
    Years
  • I'm attempting another tile script and this time I'm getting a weird error when I try to compile it. It says "unknown keyword "e" at line 20." Line 20 is immediately below the dialogue. As you can see, it's completely blank. Why am I getting this error?
    Spoiler:


    Whoa, I see the issue. When I pasted this, the dialogue is separated. But it still looks normal and straight in XSE, what's causing this?
     

    Joexv

    ManMadeOfGouda joexv.github.io
    1,037
    Posts
    11
    Years
  • I'm attempting another tile script and this time I'm getting a weird error when I try to compile it. It says "unknown keyword "e" at line 20." Line 20 is immediately below the dialogue. As you can see, it's completely blank. Why am I getting this error?
    Spoiler:


    Whoa, I see the issue. When I pasted this, the dialogue is separated. But it still looks normal and straight in XSE, what's causing this?

    Its a line break. No idea what causes it but the easiest way to fix it is to rewrite the whole thing.
     

    U.Flame

    Maker of Short Games
    1,326
    Posts
    15
    Years
  • Thanks, that was strange. Now, there's a problem with the actual script. I set person event #7 to teleport and move, but that doesn't happen. Is there something I did wrong?
     

    Joexv

    ManMadeOfGouda joexv.github.io
    1,037
    Posts
    11
    Years
  • Well movesprite seems to only work(for me anyways) if the sprite is 1 square offscreen and then moved on screen. Try that.
     

    U.Flame

    Maker of Short Games
    1,326
    Posts
    15
    Years
  • Alright, I've decided to take a different approach then. I'll have the sprite be invisible in the doorway, and use it for the scene, like many other events do. How would I set this up? What commands do I use to make the sprite permanently invisible before and after the scene, and visible only during?
     

    Joexv

    ManMadeOfGouda joexv.github.io
    1,037
    Posts
    11
    Years
  • Alright, I've decided to take a different approach then. I'll have the sprite be invisible in the doorway, and use it for the scene, like many other events do. How would I set this up? What commands do I use to make the sprite permanently invisible before and after the scene, and visible only during?

    Ok so in a-maps header area add a level script. [2]
    for the level script have this script
    Code:
    #dynamic 0x800000
    #org @start
    setflag 0x#   //make sure that what ever this free flag is to set it as the sprite you want invisible's person id
    hidesprite 0x#
    end

    Now you may want this to be checked other wise it'll hide the sprite even after the event has passed.

    Then add to your script

    Code:
    ...
    clearflag 0x#
    showsprite 0x#
    ...

    Anyone got an answer to my nurse joy script question?
     
    10,078
    Posts
    15
    Years
    • UK
    • Seen Oct 17, 2023
    Alright, I've decided to take a different approach then. I'll have the sprite be invisible in the doorway, and use it for the scene, like many other events do. How would I set this up? What commands do I use to make the sprite permanently invisible before and after the scene, and visible only during?

    Rather than do what Joe suggested, I would just use a flag that's already set by default - just make sure its something that MUST be set. Then there's no need for a level script, as you don't need to actually use the 'hidesprite' command.

    During your event you just need showsprite - if you're moving the sprite/allowing the player to move slightly then you'll need to clear the flag too. Shouldn't be a problem assuming you want to hide the person at the end - just setflag, hidesprite, done :).
     

    Dionen

    deprived of sleep
    295
    Posts
    12
    Years
  • Thanks, that was strange. Now, there's a problem with the actual script. I set person event #7 to teleport and move, but that doesn't happen. Is there something I did wrong?
    use "movesprite2" instead of movesprite.

    if it doesn't work, use special 0x8E right after (i'm not so sure about it)
     

    Dionen

    deprived of sleep
    295
    Posts
    12
    Years
  • Thanks guys, I already went ahead and used Joexv's suggestions before I noticed you guys simplifying it, and it worked either way. There is one last problem though. At the end of the script, the NPC is set to walk off-screen and disappear. Instead, she disappears at the start of her last movement, and the player can move right away. Even without setting her disappearance, the player can move while she is, which shouldn't happen. Did I miss a step?
    Spoiler:
    applymovement 0x7 @soneecmove2
    applymovement 0xFF @playermove2
    waitmovement 0x0
    When you write this you are just waiting for the player movement

    applymovement 0xFF @playermove2
    applymovement 0x7 @soneecmove2
    waitmovement 0x0
    This will work (but they will start at the same time. to avoid it just add another "waitmovement 0x0").
     

    U.Flame

    Maker of Short Games
    1,326
    Posts
    15
    Years
  • When you write this you are just waiting for the player movement


    This will work (but they will start at the same time. to avoid it just add another "waitmovement 0x0").

    Yeah I actually just found out the moment before you posted. I appreciate it though.
     

    DrFuji

    [I]Heiki Hecchara‌‌[/I]
    1,691
    Posts
    14
    Years
  • Check this thread out http://www.pokemonhackersonline.com/showthread.php?t=14471


    Ok I have my own issue. After talking to joy and her healing my pokemon the screen glitches up:
    Spoiler:


    I do have a sethealing place all set up too. Im using jpans hacked engine too.
    Heres the script:
    Spoiler:

    There seems to be a problem with special 0x1B1 in JPAN's engine which causes an unexpected glitch with special 0x183 and the buffer system. Both of the specials are related to the wireless functionality of the game and are used in the Nurse Joy script to check if there are people in the Wireless Room on the second floor. Unlike in the base game, special 0x1B1 always seems to return 0x1 to 0x800D which indicates that somebody else is nearby on wireless. The script then continues on to special 0x183 which buffers the name of the person playing in buffer1. But since special 0x1B1 will always indicate that somebody is playing when they actually aren't, 0x183 will buffer nothing into buffer1. Then, when Nurse Joy tries to tell the player who is in the Wireless Room the game will crash when she tries to display the non-existent buffer1 text. You can see that this is the cause of your problem by using a command like bufferpokemon in your script to fill buffer1 immediately before Nurse Joy speaks as the script will work as normal. If somebody better versed in ASM or these specials thinks I've gotten something wrong in this explanation, please speak up :3c

    If you're really desperate to have full wireless functionality you can try and fix whatever's wrong with special 0x1B1, but if you're a sane person you can just remove the parts of the script related to the Wireless Room. Here's an edited version of the base script that will work for you.

    Spoiler:
     
    11
    Posts
    9
    Years
    • Seen Dec 17, 2014
    After executing a green S tile script, the hero becomes stuck. Music played fine, so the game didn't freeze.
    I'm using Advance Map 1.95, and XSE.
    Can anyone help me out here?

    Spoiler:
     

    Dionen

    deprived of sleep
    295
    Posts
    12
    Years
  • After executing a green S tile script, the hero becomes stuck. Music played fine, so the game didn't freeze.
    I'm using Advance Map 1.95, and XSE.
    Can anyone help me out here?

    Spoiler:

    Try "compare" instead of "checkflag":

    #dynamic 0x800000

    #org @main
    compare 0x4014 0x1
    if 0x1 goto @end

    lock
    applymovement 0x7 @move1
    waitmovement 0x0
    textcolor 0x0
    msgbox @talk1 0x6
    textcolor 0x0
    msgbox @talk2 0x4
    closeonkeypress
    ...
    ...
     

    Joexv

    ManMadeOfGouda joexv.github.io
    1,037
    Posts
    11
    Years
  • After executing a green S tile script, the hero becomes stuck. Music played fine, so the game didn't freeze.
    I'm using Advance Map 1.95, and XSE.
    Can anyone help me out here?

    Spoiler:

    Ok well first off you can remove the checkflag. Its not needed as the script tiles are setup so that if you dont want your event to run again you just make sure the variable you set for the event is 1 or more above the var value in a-map. So lets say you want your script to run once in a-map and the variable you are using hasnt been used before, you type in the variable into the var number box and then leave var value at 0.
    Then in your script like you do have setvar 0x# 0x1. You should probably put this near the front of the script before any commands other than lock are activated. Checkflags/compares are ok to put before it as long as you put another setvar to where they may send you.

    And 2ndly did you make sure to set the var number in a-map?:)
     
    11
    Posts
    9
    Years
    • Seen Dec 17, 2014
    Try "compare" instead of "checkflag":
    Ok well first off you can remove the checkflag. Its not needed as the script tiles are setup so that if you dont want your event to run again you just make sure the variable you set for the event is 1 or more above the var value in a-map. So lets say you want your script to run once in a-map and the variable you are using hasnt been used before, you type in the variable into the var number box and then leave var value at 0.
    Then in your script like you do have setvar 0x# 0x1. You should probably put this near the front of the script before any commands other than lock are activated. Checkflags/compares are ok to put before it as long as you put another setvar to where they may send you.

    And 2ndly did you make sure to set the var number in a-map?:)

    Thanks for your help, but replacing checkflag with compare var# varvalue returned the same result. I also tried putting setvar near the front, but the same thing happened.
    I'll explain the map and script in more detail.
    I actually have two additional script tiles in the map; they have var# 4013. The script I used for them is basically the same as the one I used in my var# 4014 tile except for the number of msgbox and applymovement. The strange thing is 4013 script works fine (the hero doesn't become stuck after the script executes).
    Both scripts generate some textboxes and ultimately move the hero to some other location in the map.
    I'll post my a-map screenshot and both scripts below.

    I need to ask you for your help again. Thank you. :)

    Edit: The problem is solved. It had something to do with the moving tiles.
     
    Last edited:

    Blah

    Free supporter
    1,924
    Posts
    11
    Years
  • #dynamic 0x800000

    #org @start
    msgbox @hello 0x2
    end

    #org @hello
    = not working

    why it is not working

    I don't use XSE, but isn't 0x2 the yes/no box? Maybe if you changed it to 0x6 it would work. Anyways, not locking the player during a msgbox can lead to buggy outcomes.
     
    5,256
    Posts
    16
    Years
  • I don't use XSE, but isn't 0x2 the yes/no box? Maybe if you changed it to 0x6 it would work. Anyways, not locking the player during a msgbox can lead to buggy outcomes.

    0x2 is actually a syntactic shortcut done by XSE for:
    Code:
    [font="courier new"]message @string1
    callstd 0x2[/font]
    which is actually how it is used in earlier versions, and that standard script basically includes the lock, faceplayer and release, so the OP's script is actually fine.

    0x5 is the standard for yes/no boxes.

    The reason why it isn't working is probably more of a problem with compiling / insertion, not the script itself. What version of XSE are you using, how are you inserting it, what exactly isn't working?
     
    214
    Posts
    10
    Years
  • My version is 1.0 when i go ingame to check it if it is working and then boom it does not work.The person i put doesnt react when i talk to him
     
    Status
    Not open for further replies.
    Back
    Top