• 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] Script for Nickname causes error

  • 15
    Posts
    3
    Years
    • Seen Jun 9, 2024
    Hi,
    I wrote this Script for an event on a Scripting Tile (Green "S" Tile).
    My Problem is whenever it reaches the Nickname Part and one selects YES the script ends and the player can move around and
    even step back on the Script Tile again.
    I would like to know why it does that.
    Any Help is welcome.😄

    Here is the Script:

    #dynamic 0x800000
    #org @start
    lock
    faceplayer
    spriteface 0xA 0x2
    spriteface 0xFF 0x1
    msgbox @talk 0x6
    applymovement 0xA @m1
    waitmovement 0x0
    msgbox @t1 0x6
    givepokemon 0x19 0x2D 0xCA 0x0 0x0 0x0 //gives a lvl45 Pikachu

    fanfare 0x13E
    msgbox @notify 0x4 //msgbox that you got a Pokemon
    waitfanfare
    closeonkeypress
    msgbox @qname 0x5 //Asks the player if they want to nickname their pokemon
    compare 0x800D 0x1 //Checks to see if the player selected 'Yes'
    if 0x1 gosub @nickname //If yes then the @nickname script will run and then return
    giveitem 0xC5 0x2 MSG_OBTAIN //gives 2 Lucky Eggs


    msgbox @t2 0x6
    applymovement 0xA @m2
    waitmovement 0x0
    hidesprite 0xA
    setflag 0x286
    hidesprite 0xA
    setvar 0x4018 0x1
    release
    end

    #org @m1
    #raw 0x12
    #raw 0x12
    #raw 0x11
    #raw 0x11
    #raw 0x11
    #raw 0x11
    #raw 0x11
    #raw 0x11
    #raw 0x11
    #raw 0x11
    #raw 0x13
    #raw 0x11
    #raw 0xFE

    #org @talk
    = WAIT, [PLAYER]!\nHOLD UP, WAIT A MINUTE!!!

    #org @t1
    = ..... //omitted

    #org @t2
    = .... //omitted

    #org @nickname
    call 0x1A74E
    return

    #org @notify
    = [Player] received a PIKACHU!

    #org @qname
    = Would you like to give PIKACHU a\nnickname?

    #org @m2
    #raw 0x10
    #raw 0x12
    #raw 0x10
    #raw 0x10
    #raw 0x10
    #raw 0x10
    #raw 0x10
    #raw 0x10
    #raw 0x10
    #raw 0xFE
     
  • 120
    Posts
    5
    Years
    • Seen Nov 2, 2023
    I'm pretty sure that this script part of the script will only nickname the first pokemon in the party but here it goes

    msgbox @nicknamemsg 0x5
    compare lastresult 0x1
    if 0x1 call @nickname

    #org @nickname
    setvar 0x8004 0x0
    fadescreen 0x1
    special 0x9E
    waitstate
    return

    '-----------------------------
    this may help for pokemon received in the middle of the game:


    #org @nickname
    countpokemon
    subvar 0x800D 0x1
    copyvar 0x8004 0x800D
    call @namethepokemon
    release
    end

    #org @namethepokemon
    fadescreen 0x1
    special 0x9E
    waitstate
    return
     
  • 15
    Posts
    3
    Years
    • Seen Jun 9, 2024
    Thanks mcferaligatr.😄
    It works now.
    Only Problem is it deletes your sixth slot Party pokemon if you have one.😅
     
    Back
    Top