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

Paper Mario

Ace Trainer
16
Posts
14
Years
    • Age 31
    • Home
    • Seen Mar 22, 2022
    Can i use a variable as level in the wildbattle command?
    For example if I want do a wild battle againist a Charizard which level is a random value between 1 and 100 I'd do this:

    Code:
    #dynamic 0x800000
    
    #org @start
    lock
    faceplayer
    random 0x64
    addvar 0x800D 0x1
    wildbattle 0x6 0x800D 0x0
    fadescreen 0x1
    hidesprite 0x800F
    fadescreen 0x0
    setflag 0x200
    release
    end

    Would this script work or not?
     

    tinix

    PearlShipper & C Programmer
    86
    Posts
    14
    Years
  • Can i use a variable as level in the wildbattle command?
    For example if I want do a wild battle againist a Charizard which level is a random value between 1 and 100 I'd do this:

    Code:
    #dynamic 0x800000
    
    #org @start
    lock
    faceplayer
    random 0x64
    addvar 0x800D 0x1
    wildbattle 0x6 0x800D 0x0
    fadescreen 0x1
    hidesprite 0x800F
    fadescreen 0x0
    setflag 0x200
    release
    end
    Would this script work or not?

    Probably no because Xse shows error 6 owerflow when trying to compile
     

    PeregrineFig

    Starting Pokémon Obsidian
    202
    Posts
    14
    Years
  • You need to hex edit the multichoice boxes, and it's annoying to do. I use JPAN's hacked engine, which makes custom multichoice boxes much, much easier.
     

    Paper Mario

    Ace Trainer
    16
    Posts
    14
    Years
    • Age 31
    • Home
    • Seen Mar 22, 2022
    It means that what the script actually thinks you are saying is:

    "Battle a lv 32781 Charizard"

    Which is what 800D is in decimal.
    And why the command

    hidesprite 0x800F

    isn't read as "hide the sprite number 800F" instead of "hide the sprite with the number contained in variable 800F" ?
     
    10,078
    Posts
    15
    Years
    • Age 32
    • UK
    • Seen Oct 17, 2023
    And why the command

    hidesprite 0x800F

    isn't read as "hide the sprite number 800F" instead of "hide the sprite with the number contained in variable 800F" ?

    The Hidesprite command should be 'hidesprite 0x(personeventnumber)' followed by a setting a flag with the person ID to make the change instantaneous and permanent.

    E.g. Person event = 2, Person ID = 1001 ->

    hidesprite 0x2
    setflag 0x1001

    If that's what you mean?
     

    Paper Mario

    Ace Trainer
    16
    Posts
    14
    Years
    • Age 31
    • Home
    • Seen Mar 22, 2022
    The Hidesprite command should be 'hidesprite 0x(personeventnumber)' followed by a setting a flag with the person ID to make the change instantaneous and permanent.

    E.g. Person event = 2, Person ID = 1001 ->

    hidesprite 0x2
    setflag 0x1001

    If that's what you mean?
    In this case the Person event is in the variable 800F, and in this case the command read the value in the variable instead the name of the variable as a number, i.e. the command hides the Person event 2 instad of the Person event 32783 (800F in Dec)

    Why the wildbattle command can't do the same as well? Why it reads the variable name as a number instead of the contained value?
     
    10,078
    Posts
    15
    Years
    • Age 32
    • UK
    • Seen Oct 17, 2023
    In this case the Person event is in the variable 800F, and in this case the command read the value in the variable instead the name of the variable as a number, i.e. the command hides the Person event 2 instad of the Person event 32783 (800F in Dec)

    Why the wildbattle command can't do the same as well? Why it reads the variable name as a number instead of the contained value?

    Nowhere in your script is a variable assigned to 800F? Also you shouldn't need to assign a value to a person event because even if the Charizard is a random level you would be using the same sprite.

    Does the sprite actually disappear in your script as it is at the moment?

    EDIT:

    It may work for the sprite because the range available for personevents is not limited to a range, whilst the level of a Pokémon must be in the range of 1-100 - but don't call me on that as I'm not sure.
     

    Paper Mario

    Ace Trainer
    16
    Posts
    14
    Years
    • Age 31
    • Home
    • Seen Mar 22, 2022
    Nowhere in your script is a variable assigned to 800F? Also you shouldn't need to assign a value to a person event because even if the Charizard is a random level you would be using the same sprite.

    Does the sprite actually disappear in your script as it is at the moment?
    You should know that in the variable 0x800F is automatically placed the number of the Person event that you talked last with. And the command reads the value in the variable instead of reading the name of the variable as a number. And it works how it's supposed to.


    It may work for the sprite because the range available for personevents is not limited to a range, whilst the level of a Pokémon must be in the range of 1-100 - but don't call me on that as I'm not sure.
    The range of Person events is limited to 255 (0x0 to 0xFF) in which 0x7F is the Camera (I think, because the command applymovement 0x7F @move moves the Camera) and 0xFF is the Player's sprite.
     
    1
    Posts
    14
    Years
    • Seen Feb 14, 2021
    Game: Pokemon Stone Version
    Type: Fire Red
    Editor: XSE
    Script: Ok so my rival is suppose to say the players name then walk over to you. Then he is suppose to tell you about a guy that has rare pokemon down at the dock. Then he is suppose to take you donw there. The player moves fine but the rival's sprite dosent move. I have the right player number. On advance script he is number 10.
    Spoiler:
     

    0m3GA ARS3NAL

    Im comin' home...
    1,816
    Posts
    16
    Years
  • Game: Pokemon Stone Version
    Type: Fire Red
    Editor: XSE
    Script: Ok so my rival is suppose to say the players name then walk over to you. Then he is suppose to tell you about a guy that has rare pokemon down at the dock. Then he is suppose to take you donw there. The player moves fine but the rival's sprite dosent move. I have the right player number. On advance script he is number 10.
    Code:
    [COLOR=#000000]#dynamic 0x802B15[/COLOR]
    
    [COLOR=#000000]#org @start
    msgbox @1 0x6
    applymovement [color=red]0xA[/color] @move
    waitmovement 0x0
    applymovement 0xFF @move4
    waitmovement 0x0
    msgbox @2 0x6
    applymovement [color=red]0xA[/color] @move2
    applymovement 0xFF @move3
    waitmovement 0x0
    fadesong 0x12C
    release
    end[/COLOR]
    [COLOR=#000000]#org @move
    #raw 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0xFE[/COLOR]
    [COLOR=#000000]#org @move4
    #raw 0x03 0xFE[/COLOR]
    [COLOR=#000000]#org @move2
    #raw 0x10 0x12 0x12 0x12 0x10 0x10 0x10 0x12 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x12 0x12 0x10 0x10 0x10 0x10 0x13 0x00 0xFE[/COLOR]
    [COLOR=#000000]#org @move3
    #raw 0x02 0x00 0x10 0x12 0x12 0x10 0x10 0x10 0x12 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x12 0x12 0x10 0x10 0x10 0x10 0x10 0x10 0xFE[/COLOR]
    [COLOR=#000000]#org @1
    = [PLAYER]![/COLOR]
    [COLOR=#000000]#org @2
    = Hey i have been looking for you \nThere is a guy down at the dock with \nsome really rare Pokemon!\pLets go check him out! Maby he\nmight give us some![/COLOR]
    [COLOR=#000000][/COLOR]

    Organized and fixed...
    The number 10 you are talking about, being the rivals sprite, shouldn't be written in hex, OR, you need to use 0xA...

    0xA = 10
    0x10 = 16, see the problem?

    PROTIP: You don't need to put #raw before every movement, AND you CAN have them all on the same line.
     
    62
    Posts
    14
    Years
    • Seen Oct 24, 2013
    In this case the Person event is in the variable 800F, and in this case the command read the value in the variable instead the name of the variable as a number, i.e. the command hides the Person event 2 instad of the Person event 32783 (800F in Dec)

    Why the wildbattle command can't do the same as well? Why it reads the variable name as a number instead of the contained value?

    Because the 2nd parameter of wildbattle command is set to read what's typed in, not a value in that var. For that to work, you would need to edit the database.
     

    Toon Link

    POKEMON TRAINER
    25
    Posts
    14
    Years
    • Seen May 14, 2014
    In Pokemon Fire Red how do you add rematch with the vs seeker to a trainer battle?
     

    PeregrineFig

    Starting Pokémon Obsidian
    202
    Posts
    14
    Years
  • In Pokemon Fire Red how do you add rematch with the vs seeker to a trainer battle?

    after the trainerbattle 0x0 part, do:

    special2 0x800D 0x39
    compare 0x800D 0x1
    if 0x1 goto (offset)

    And at the pointed-to offset, use a trainerbattle 0x5 with the rematch trainer. I figured this out from observing a Nintendo script:

    Spoiler:
     

    Paper Mario

    Ace Trainer
    16
    Posts
    14
    Years
    • Age 31
    • Home
    • Seen Mar 22, 2022
    Because the 2nd parameter of wildbattle command is set to read what's typed in, not a value in that var. For that to work, you would need to edit the database.
    So I have to edit the level byte in the offset with the wildbattle command in it, don't I?

    And I must use ASM in order to do this or there is a way via script?
     
    62
    Posts
    14
    Years
    • Seen Oct 24, 2013
    So I have to edit the level byte in the offset with the wildbattle command in it, don't I?

    And I must use ASM in order to do this or there is a way via script?

    I think the easiest way is to download XSE's source and change the database. I guess that will do. But I think you should change the game too through ASM.
     

    Evilcrizpy

    Advanced Mapper
    26
    Posts
    14
    Years
    • Seen Apr 9, 2010
    Game: Pokemon Fire Red
    Type: Person Script
    Editor: PRSV
    Script:
    Spoiler:


    The Person will not appear in game, and how would i make it so he moves, i have tried making him move.. but get complier errors. Thankyou.

    EDit:

    INgame Settings:
    Movement : 00
    Unknown : 00
    Trainer: []
    Unknown : 00
    View Radius : 00
     
    Status
    Not open for further replies.
    Back
    Top