• 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.
7
Posts
13
Years
    • Seen Jul 10, 2012
    Thank you Dr.Fuji... the sprite now hides...

    however the naming thing didn't work, so I'll need to look into that more. (if anyone has a clue on how to fix it, just PM me...)

    in the mean time I have another question.

    Is there a way to give a pokemon a nickname before I give it to the player? (Like when you trade a pokemon from one person to another, and the received pokemon already has a nickname.) or give it any special qualities, like a special move or something like that?
     

    spidermight340

    Advanced Trainer
    27
    Posts
    14
    Years
    • Age 32
    • Seen Feb 21, 2011
    hi i have this road closed script but the person wont disappear when he should

    here is the pksv script plz help plz

    Code:
    #dyn 0x740000
    #org @start
    lockall
    checktrainerflag 0x1021
    if 0x1 jump @open
    message @text
    showmsg
    waitbutton
    releaseall
    end
    
    #org @text
    = I'm sorry, the road is closed\nuntil You beat pure gym
    
    #org @open
    message @opentxt
    showmsg
    waitbutton
    fadescreen 3
    closemsg
    disappear 0x1
    setflag 0x1021
    fadescreen 2
    releaseall
    end
    #org @opentxt
    = I'm sorry, th-\pOh right!\nYou beat pure gym
     
    1,421
    Posts
    13
    Years
  • hi i have this road closed script but the person wont disappear when he should

    here is the pksv script plz help plz

    Code:
    #dyn 0x740000
    #org @start
    lockall
    checktrainerflag 0x1021
    if 0x1 jump @open
    message @text
    showmsg
    waitbutton
    releaseall
    end
    
    #org @text
    = I'm sorry, the road is closed\nuntil You beat pure gym
    
    #org @open
    message @opentxt
    showmsg
    waitbutton
    fadescreen 3
    closemsg
    [COLOR=Red]disappear 0x1[/COLOR]
    setflag 0x1021
    fadescreen 2
    releaseall
    end
    #org @opentxt
    = I'm sorry, th-\pOh right!\nYou beat pure gym
    Why don't you try replacing disappear 0x1 with the setflag command? Just assign a flag to the Person ID and the same with the setflag command. Maybe that would work?
     
    Last edited:

    spidermight340

    Advanced Trainer
    27
    Posts
    14
    Years
    • Age 32
    • Seen Feb 21, 2011
    what are some unused flags for ruby and and flags that will let me use the road closed script ?
     

    SPG

    Pyroblock
    88
    Posts
    13
    Years
    • Seen May 4, 2013
    i got this far in the script what do i do now (yes some comands are wrong like it says ****ing ship but they will get changed for the real comand) if this helps its for a boat

    Spoiler:
     
    69
    Posts
    13
    Years
    • Seen Jan 8, 2012
    why was my post deleted?

    im having trouble understanding the "compare LASTRESULT" command and what it does can somebody help me understand how to use it?
     

    masterquestmq

    Enthusiastic Rom Hacker
    194
    Posts
    13
    Years
    • Seen Nov 19, 2023
    earthquake effect in FR

    cant seem to get it to work

    the command is special 0x136

    and according to diegoisawesome we need to include either of these vars b4 the special
    setvar 0x8004 0xF
    setvar 0x8005 0xF
    setvar 0x8006 0xF
    setvar 0x8007 0xFWhat does the F stand for?

    do we also need to include the waitstate command for earthquakes after the special.

    some clarification would be greatly appreciated
     

    DrFuji

    [I]Heiki Hecchara‌‌[/I]
    1,691
    Posts
    14
    Years
  • earthquake effect in FR

    cant seem to get it to work

    the command is special 0x136

    and according to diegoisawesome we need to include either of these vars b4 the special
    setvar 0x8004 0xF
    setvar 0x8005 0xF
    setvar 0x8006 0xF
    setvar 0x8007 0xFWhat does the F stand for?

    do we also need to include the waitstate command for earthquakes after the special.

    some clarification would be greatly appreciated

    The F tells the game how large the earthquake is (in terms of the screen shaking violently) on a scale from 0 to F (15). By setting all of the variables used to 0xF you're going to have a very strong earthquake. Here is an example of a smaller earthquake that is used in an untouched FR game:
    Code:
    setvar 0x8004 0x1
    setvar 0x8005 0x1
    setvar 0x8006 0x8
    setvar 0x8007 0x3
    special 0x136
    pause 0x3C

    As for the waitstate, I've never tried it after the earthquake, but the pause command works well if you time it correctly.
     

    masterquestmq

    Enthusiastic Rom Hacker
    194
    Posts
    13
    Years
    • Seen Nov 19, 2023
    Hide sprite Command

    How do we make a sprite permanently disappear?

    I made an event where a Pokemon passes you and
    stated the following

    #Dynamic 0x1629CD

    #org @start
    checkflag 0x201
    if 0x0 goto @hey!
    if 0x1 goto @end
    end

    #org @hey!
    lock
    applymovement 0xFF @you
    waitmovement 0xFF
    applymovement 0x01 @back
    waitmovement 0x01
    fadescreen 0x1
    msgbox @talk 0x6
    fadescreen 0x0
    hidesprite 0x01
    setflag 0x201
    release
    end

    script works fine the problem is when I enter a building and go back out the sprite returns to its original position.
     

    DrFuji

    [I]Heiki Hecchara‌‌[/I]
    1,691
    Posts
    14
    Years
  • How do we make a sprite permanently disappear?

    I made an event where a Pokemon passes you and
    stated the following

    #Dynamic 0x1629CD

    #org @start
    checkflag 0x201
    if 0x0 goto @hey!
    if 0x1 goto @end
    end

    #org @hey!
    lock
    applymovement 0xFF @you
    waitmovement 0xFF
    applymovement 0x01 @back
    waitmovement 0x01
    fadescreen 0x1
    msgbox @talk 0x6
    fadescreen 0x0
    hidesprite 0x01
    setflag 0x201
    release
    end

    script works fine the problem is when I enter a building and go back out the sprite returns to its original position.

    You need to put a flag which was set in the script (in this case - 201) in the 'Person ID' field in Advance Map.
     
    1,421
    Posts
    13
    Years
  • why was my post deleted?

    im having trouble understanding the "compare LASTRESULT" command and what it does can somebody help me understand how to use it?
    The compare lastresult command is used to check for an input by the player and then decide on the further continuation of the script.

    I'm quoting an exact example from diegoisawesome's XSE tutorial. (Too lazy to write a script myself :P )
    Spoiler:
    Code:
    msgbox @1 0x5
    compare LASTRESULT 0x1
    if 0x1 goto @take
    At this part of the script, a dialogue box will appear for the player with the message "Hello.Sorry to trouble you. I can't take care of my Charmander.Can you take care of it for me?" along with the option of a 'Yes' and a 'No'.

    If the option is 0x1 i.e., a 'Yes' it will proceed to the next part of the script and hand over a Pokemon. If the option is 0x0 i.e., a 'No', the script shall end there.

    That is what compare lastresult command is all about.
     

    masterquestmq

    Enthusiastic Rom Hacker
    194
    Posts
    13
    Years
    • Seen Nov 19, 2023
    Scripts Deleting itself

    Scripts deleting itself

    Well I have a small problem

    Sometime some talking scripts I make for my hack deletes itself.

    For instance today I made 7 normal talking scripts. CHecked them all working fine.
    3 hours later when i rechecked it only 6 were working

    when i tried to reopen the non working script it was empty?

    could this be a bug?
     
    Last edited:
    69
    Posts
    13
    Years
    • Seen Jan 8, 2012
    i cant get this script to stop freezing its a script block and my story line for my rom hack is you talk to your mom and she tells you "tomorrow is a long day go to sleep" and if you try and go out of the house without going to sleep its supposed to make your mom tell you "what are you still doing up go to sleep and make your charecter walk away from the door way. but it keeps freezing

    #dynamic 0xoffset

    #org @start
    checkflag 0x8C3
    if 0x0 goto @sleepy
    end

    #org @sleepy
    lock
    faceplayer
    msgbox @speak
    boxset 0x06
    applymovement 0xFF @move
    waitmovement 0x0
    release
    end

    #org @speak
    =talk talk talk talk

    #org @movement
    #raw 0x1E
    #raw 0xFE
     

    masterquestmq

    Enthusiastic Rom Hacker
    194
    Posts
    13
    Years
    • Seen Nov 19, 2023
    in A-map go to the script tile and put 0300 in unknown
    and 4050 below it in var number. (below the unkown box)

    should work now
     
    69
    Posts
    13
    Years
    • Seen Jan 8, 2012
    that worked like a charm but can you explain the whole setvar and unkown thing and why my script worked after i did that?
     

    metapod23

    Hardened Trainer
    673
    Posts
    15
    Years
    • Seen Aug 18, 2016
    that worked like a charm but can you explain the whole setvar and unkown thing and why my script worked after i did that?

    I'll explain :)

    A variable is just a simple number - there are quite a few variables that have not been used in the original game and those are the ones you should use for your scripts. You should not use 4050 over and over again, but you should use different variables for each script - I recommend writing down the ones you use and just keep going forward (i.e. next variable is 4051).

    All unused variables in the game are set to 0 to start with. In order to change the number a variable is set to, you use the setvar command (setvar stands for set variable).

    The most important things are the Var Number and Var Value boxes in A-Map. For instance, if you put 4050 as the var Number and 0000 as the Var Value for a script, that script will only activate when stepped on if variable number 4050 is set to the value 0. Since all variables are automatically set to 0 at the start of the game, the script will activate the first time you step on it, presuming you do not change the variable before hand in any other script.

    In order to prevent the script from running again, you just need to set the variable to something other than the Var Value you have given the script - the best number being the next in sequence.

    So, in a script you would want to happen only the first time it is stepped on, and not again, you would write "setvar 0x4050 0x1" - this would set the value of variable 4050 to 0001. Since it is set to 0001, it will not activate the next time it is stepped on, because you have told the script in A-Map to only activate when variable 4050 is set to 0.

    The reason you don't want to use 4050 or any other variable over and over again for different scripts, is because you'll likely be changing the variable's value - the only reason the scripts should share the same variable number is if they are somehow related to or dependent on each other, like if one script should only activate once another script has been completed.

    I hope all that makes sense. :)
     
    Status
    Not open for further replies.
    Back
    Top