• 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?".
  • Forum moderator applications are now open! Click here for details.
  • 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.
21
Posts
11
Years
  • Seen Apr 20, 2013
Hi, i made the following code to get the AuroraTicket and clear the flag (so that the Vermillion sailor will let me go to Birth Island). However it didn't work.

Code:
#dynamic 0x800000

#org @start
lock
faceplayer
checkflag 0x200
if 0x1 goto @done
msgbox @1 0x5
compare 0x800D 0x1
if 0x1 goto @take
msgbox @2 0x6
release
end

#org @done
msgbox @3 0x6
release
end

#org @take
giveitem 0x173 0x1 MSG_OBTAIN
msgbox @3 0x6
setflag 0x200
clearflag 0x2F1
release
end

#org @1
= Hi!\pWould you like an AURORA TICKET?.\pIt will allow access to BIRTH ISLAND. 

#org @2
= That's okay. I'm sure someone\nelse will enjoy it.

#org @3
= I knew you would want it.
What did i do wrong? Thanks.
 
Last edited:
13
Posts
12
Years
  • Seen Feb 26, 2014
I'm trying to do a wild Pokemon script and everything seems to be right, based on what I've read. However, this script will make a message box pop up, then the box and the sprite will disappear without a wild battle ever happening.

Code:
'-----------------------
#org 0x71B8C9
lock
faceplayer
msgbox 0x871B959 '"GRAAAAK!!"
callstd 0x2
startwildbattle 0x1 0x32 0x0
hidesprite LASTTALKED
setflag 0x999
release
end


'---------
' Strings
'---------
#org 0x71B959
= GRAAAAK!!
 
3
Posts
11
Years
  • Seen Dec 25, 2012
Game: LeafGreen
Type: Person Event
Editor: NotePad / PokeScript
Script: Trade a Rare Candy for a Lapras
This is the first script I've written, so I hope it isn't too afwul. Any advice on getting it to work (properly) would be great. In-game it gives you a Lapras, but doesn't properly check if you have a Rare Candy, nor does it take it from your bag. He won't talk to you afterwards either. :x
Spoiler:

After compiling it (to 800000, this is the first script I've made for the ROM), it seems to be a bit ****ed up... Not exactly sure why-- If it was my fault, or something with the compiler, or something else. I dunno.
Spoiler:

 
19
Posts
11
Years
  • Seen Sep 2, 2021
Hi, I'm pretty new to these Pokemon Scripting so I guess the problem I'm having isn't going to be a big trouble for you.
So, I tried to create a simple script just to test. But I guess it didn't worked well. The script has to executed when the player steps on a script box. So I created the following script:
Code:
#org 0x8740040
'-----------------------------------
lock
checkflag 0x250
if true jump 0x8740058 ' Flag is set
msgbox 0x8740062 ' OAK: Hey! Wait!\nDon...
callstd MSG_NORMAL
setflag 0x250
release[QUOTE][QUOTE][/QUOTE][/QUOTE]
end

#org 0x8740058
'-----------------------------------
msgbox 0x8740095 ' OAK: Hey! Wait!\nDon...
callstd MSG_NORMAL
release
end


#org 0x8740062
= Hey, wait! You should first \nget your own pokemon!

#org 0x8740095
= Oh, so you have got your Pokemon, that's great!\p You should take this too.

I have not set any VAR Number or VAR Value. Also for Unknown I have just kept it to 03 and 0003
Also I'm using Pokemon Script Editor(PKSV) and Advanced Map 1.5 and for rom Pokemon Fire Red.

The script works with the spirit but not with the plain script boxes, why?
Please help me with this I really want to make my own hacked rom.
 
Last edited:
10
Posts
11
Years
  • Seen Sep 14, 2016
I wrote this script in PKSV, its meant to check if someone has beaten Brock, and turn them back if they haven't yet, but all it does is just freeze the screen. What's wrong with the script?

Its based on the policeman script from the Saffron city gatehouses in FR when you need the Tea.


#org 0x87404CC
'-----------------------------------
lockall
textcolor BLUE
applymovement PLAYER 0x81A75E7 ' look_left_delayed en...
pauseevent 0x0
checkflag FR_BADGE_1
if true jump 0x874054D ' Flag is set
msgbox 0x819E04B ' I think you still ha...
callstd MSG_NOCLOSE ' Non-closing message
closemsg
applymovement PLAYER 0x816F9C4 ' walk_down end
pauseevent 0x0
releaseall
end

#org 0x874054D
'-----------------------------------
msgbox 0x8740559 ' Well done on beating...
callstd MSG_NOCLOSE ' Non-closing message
closemsg
releaseall
end


#org 0x819E04B
= I think you still have\n something left to do.

#org 0x8740559
= Well done on beating Brock.

#org 0x81A75E7
M look_left_delayed end

#org 0x816F9C4
M walk_down end
 

FrozenInfernoZX

What is out there?
756
Posts
11
Years
Does anybody know the command to use to continue the script after a battle? No matter what I do, my script always ends after the battle.

Here's my script:
Spoiler:


I want him to say, "Don't talk to me!" right after the battle.
 

Renegade

Time for real life...
995
Posts
12
Years
Does anybody know the command to use to continue the script after a battle? No matter what I do, my script always ends after the battle.

Here's my script:
Spoiler:


I want him to say, "Don't talk to me!" right after the battle.

There are many tutorials on trainerbattle commands. You can find your answer here:
http://www.pokecommunity.com/showthread.php?t=164276
 
10
Posts
11
Years
  • Seen Sep 14, 2016
I have a basic generate givepokemon script made by pksv. What do I need to add to that to make the pokeball (the sprite I gave the event using A-map) disappear?
 
25
Posts
13
Years
  • Seen Nov 13, 2020
Whenever I save my game and load it. Both the variables and the flags are reset back to 0 even though I set them both to 1 in my script. I'm using pksv, but that shouldn't make a difference as far as I know.

Spoiler:


I have a basic generate givepokemon script made by pksv. What do I need to add to that to make the pokeball (the sprite I gave the event using A-map) disappear?

You need to set a flag in your script (you should start flags around 1000). Then you need to set the person id of the pokeball to the same number as the flag (if you setflag 1000 then the person id of the pokeball should be 1000).
 
Last edited:
5,256
Posts
16
Years
the variables in the 8000 range are temporary. they get reset so they can be used over and over. use variables in the 4000 range. davidjcobb has a list of the actually safe variables but the 4000 range in general is okay
 
25
Posts
13
Years
  • Seen Nov 13, 2020
the variables in the 8000 range are temporary. they get reset so they can be used over and over. use variables in the 4000 range. davidjcobb has a list of the actually safe variables but the 4000 range in general is okay

Could you give me the link? Oh and what about the flags? 1000 is checked for in the script, that has to be getting reset too

Alright. Now my game doesn't even start up. I started from a backup that does start and used the dynamic 740000 and I even looked in a hex editor to be sure it was writing in the right place, and it was. I am now using variable 4050, though it hasn't had a chance to set the variable, so that shouldn't be the problem. Anyway why is it when my script is added after 740000 that it causes my game to stop loading?

Alright. Now my game doesn't even start up. I started from a backup that does start and used the dynamic 740000 and I even looked in a hex editor to be sure it was writing in the right place, and it was. I am now using variable 4050, though it hasn't had a chance to set the variable, so that shouldn't be the problem. Anyway why is it when my script is added after 740000 that it causes my game to stop loading?
 
Last edited:

Kyouhei_ii00

I'm male
9
Posts
11
Years
  • Seen Jan 11, 2013
I made a trainer but I need to talk to it to battle.

Script:
Spoiler:


Here are the AMap settings:
Spoiler:


I want it so that the trainer walks up to the player then battles
 
Last edited:

Aryan143

The Fennekin Fan!
757
Posts
11
Years
i just want to know how can i insert a headbutt tree script like pokemon shiny gold.how can i?

Got it from a website-

#org $headbutt
#raw 0x7C 0x1D 0x00 'check to see if one of our pokes knows Headbutt!
compare LASTRESULT 0x06 'if none of them do
if 1 jump $could 'jump to the "this tree could be headbutted" comment
#raw 0x9D 0x00 0x0D 0x80 'store PKMN for animation
#raw 0x7F 0x00 0x0D 0x80 'store PKMNs name to \v\h02
#raw 0x82 0x01 0x1D 0x00 'store HEADBUTT to \v\h03
message $question
$question 1 = This tree could have a Pokemon\nin it. Use HEADBUTT?
boxset 0x5
compare LASTRESULT 0x00 'if they say no...
if 1 jump $end 'break off now
message $used 'show X used Y!
$used 1 = \v\h02 used \v\h03!
boxset 0x6
#raw 0x68 'im not sure what this is used for here, but best include it
#raw 0x9C 0x25 0x00 'there is no animation for HEADBUTT, so use the ROCK SMASH one
#raw 0x27 'as above
jump 0x1Be06F 'games inbuilt code for "Trees" pokemon encounter

#org $could
message $you
$you 1 = This tree could be HEADBUTTed!
boxset 0x6
release
end

#org $end
release
end
 

DrFuji

[I]Heiki Hecchara‌‌[/I]
1,691
Posts
14
Years
I made a trainer but I need to talk to it to battle.

Script:
Spoiler:


Here are the AMap settings:
Spoiler:


I want it so that the trainer walks up to the player then battles

You also need to tick the 'Trainer' box on the overworld.

i just want to know how can i insert a headbutt tree script like pokemon shiny gold.how can i?

This tutorial should be helpful if you want to make a new behaviour byte.

If you just want the headbuttable tree itself with a different list of Pokemon encounters to the tall grass/ ocean/ fishing lists then use the command 'special 0xAB' in a regular signpost script. This calls the tree-type encounter list when you edit the Wild Pokemon tab in Advance Map.
 

Kyouhei_ii00

I'm male
9
Posts
11
Years
  • Seen Jan 11, 2013
You also need to tick the 'Trainer' box on the overworld.
There isn't a tick box in the events of the person. Only ( trainer) setting then a text box with $00 as default. I use advance map 1.95.
 
Last edited:
105
Posts
12
Years
how can i make a script in which a wild pidgeotto comes to me and starts battling when i exit from pro.oak's lab and start going to route 1 after getting pokeballs & pokedex from him?
 
Status
Not open for further replies.
Back
Top