• 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.
Hi guys, I have another problem (ugh).
I made a script where you see a girl, talk to her, and you see three grunts and two trainers. The girl moves out the way, the trainers talk to you then you battle the grunt.
The script is working fine until you beat the GRUNT, then nothing happens. Talking to the girl again will re-activate the script, minus the trainer battle, and the grunts will disappear (which is what I want to happen). Then the two will speak, say they'll give you a rare candy, then nothing happens. Help D:
Spoiler:
 
Hi guys, I have another problem (ugh).
I made a script where you see a girl, talk to her, and you see three grunts and two trainers. The girl moves out the way, the trainers talk to you then you battle the grunt.
The script is working fine until you beat the GRUNT, then nothing happens. Talking to the girl again will re-activate the script, minus the trainer battle, and the grunts will disappear (which is what I want to happen). Then the two will speak, say they'll give you a rare candy, then nothing happens. Help D:
Spoiler:

trainerbattle 0x0 is only for normal trainer battles.
if you want a script wherein more events will happen after the battle, then use trainerbattle 0x1

Here's a quick edit of your script.
I'm at work atm, so I have no means of testing your script out, however, you should be able to see the difference anyway~


Code:
#org 0x80013D
lock
faceplayer
checkflag 0x251
if 0x1 goto 0x880019F
msgbox 0x88001A2 MSG_FACE '"Huh? Who are you?\n[player], eh?\l..."
playsong 0x113 0x0
applymovement 0x9 0x880072B
applymovement MOVE_PLAYER 0x8800730
msgbox 0x880022D MSG_FACE '"PSARO: Eh? Who's this?\n[player]: ..."
trainerbattle [COLOR="red"]0x1[/COLOR] 0x4 0x0 0x880030E 0x88003B2 [COLOR="red"]@continue[/COLOR]
[COLOR="red"]end

#org @continue[/COLOR]
fadescreen 0x1
hidesprite 0x06
hidesprite 0x07
hidesprite 0x08
fadescreen 0x0
msgbox 0x88003D9 MSG_FACE '"PSARO: Thanks.\nKIYA: Yeah, I appr..."
giveitem 0x44 0x1 0x2
setflag 0x252
msgbox 0x8800510 MSG_FACE '"MAY: WOAH! That... was... EPIC!\nO..."
setflag 0x26C
end

'---------------
#org 0x80019F
release
end


'---------
' Strings
'---------
#org 0x8001A2
= Huh? Who are you?\n[player], eh?\lWell, my brother, PSARO is\lfighting off those TEAM ANTIGUA\lGRUNTS. KIYA, the icy ELITE FOUR\lmember is helping!

#org 0x80022D
= PSARO: Eh? Who's this?\n[player]: I'm [player]!\lPSARO: [player], can you help us?\l[player]: Sure!\lPSARO: KIYA, we've got a plucky\ltrainer to help!\lKIYA: Great!\lGRUNT: So you've got a kid to do\lyour dirty work? Dignified.\lPSARO: He OFFERED to help!

#org 0x80030E
= GRUNT: Why did PSARO even get you\nto battle me?! You look weak. I\lwant challenge! But still...\lyou've got a confident look in\lyour eye... No matter, bring it\lon!

#org 0x8003B2
= Mayday, MAYDAY! I've been\ndefeated! 

#org 0x8003D9
= PSARO: Thanks.\nKIYA: Yeah, I appreciate it!\lPSARO: You deserve a reward!\lKIYA: How about this, it's a RARE\lCANDY! They level up your POKéMON!\lCool, huh?\lPSARO: MAY is my sister.\lKIYA: PSARO, I gotta go. League's\lgot a challenger.\lPSARO: I need to go too. KIYA, can\lyou drop me off at MUNFLO TOWN?\lKIYA: Sure!

#org 0x800510
= MAY: WOAH! That... was... EPIC!\nOne day, I'd like to battle you!\lI'm a new trainer. PSARO defeated\lthe LEAGUE in the region he lives\lin. But he decided he wanted to\lget stronger, so he wants to\lchallenge the league here. When he\lleft from a port in HOENN, I came\lwith him, armed with a TORCHIC the\lregional PROFESSOR, BIRCH gave me.\lOh, and another thing... A girl\lcalled ELISE came through here\learlier, said she was looking for\lyou? Have you met her before?\l[player]: Nope.\lMAY: Weird. Well, she's outside\lthe POKÉMART if you want her. Bye!


'-----------
' Movements
'-----------
#org 0x80072B
#raw 0x13 'Step Right (Normal)
#raw 0x11 'Step Up (Normal)
#raw 0x0 'Face Down
#raw 0xFE 'End of Movements

#org 0x800730
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0xFE 'End of Movements
 
Hi guys, I have another problem (ugh).
I made a script where you see a girl, talk to her, and you see three grunts and two trainers. The girl moves out the way, the trainers talk to you then you battle the grunt.
The script is working fine until you beat the GRUNT, then nothing happens. Talking to the girl again will re-activate the script, minus the trainer battle, and the grunts will disappear (which is what I want to happen). Then the two will speak, say they'll give you a rare candy, then nothing happens. Help D:
Spoiler:

Alternatively, you can use trainerbattle 0x3 0x[ID] 0x0 0x[pointer to defeat text]. This allows you to continue executing the script even after the battle finishes, and the only change you'll have to make in your script after that is the challenge text part, which isn't included. But that depends whether you want the encounter music before the trainer battle or not, which you could still add as a command yourself, but just using trainerbattle 0x1 is easier.
 
Can anyone help Me....when I use the special for battle with the ghost...there is a battle but the ghost has 0HP due to which as soon as we do a move the ghost faints....its for fire red rom

Can you post the script you compiled? I really can't help you if I can't see the script first.
 
Hey, today I made a small script and for some reason it doesn't work 100%.

Code:
#dyn 0x740000
#org @start
checkflag 0x253
if 0x1 jump :end
lock
faceplayer
msgbox @text ' You're a new trainer, right?\nHere, take this!
callstd MSG_NORMAL
copyvarifnotzero 0x8000 SAFARIBALL
copyvarifnotzero 0x8001 5
callstd MSG_OBTAIN
msgbox @afterText
callstd MSG_NORMAL
setflag 0x253
release
:end
end

#org @text
= You're a new trainer, right?\nHere, take this!

#org @afterText
= Safari Balls are usual used in the safari zone.\nUse them to catch POKéMON!

What happens is after the obtain message the NPC isn't locked and will just walk around again. The messages still works though.
 
Herro, im having an issue with a map where onceyou execute some scripts a bridge will appear. I have 2 level scripts in the map right now. The first is to hide 4 sprites that will reappear when those scripts are executed. The second is to check wether or not the scripts have been done so that the bridge will appear everytime you enter the map. Upon enetering the map the player is stuck and cannot move. With the first level script I do have the var set in a-map and such but the second doesnt since its set as a setmaptile level script. How do I fix this?
here are the scritps
First:
Spoiler:
Second:
Spoiler:
 
Herro, im having an issue with a map where onceyou execute some scripts a bridge will appear. I have 2 level scripts in the map right now. The first is to hide 4 sprites that will reappear when those scripts are executed. The second is to check wether or not the scripts have been done so that the bridge will appear everytime you enter the map. Upon enetering the map the player is stuck and cannot move. With the first level script I do have the var set in a-map and such but the second doesnt since its set as a setmaptile level script. How do I fix this?
here are the scritps
First:
Spoiler:
Second:
Spoiler:

You'll probably have to edit the map script through A-Map's Advance Mode.
https://www.pokecommunity.com/threads/191500
 
You'll probably have to edit the map script through A-Map's Advance Mode.
https://www.pokecommunity.com/threads/191500

Ok I looked at that tut and it turns out I was using the wrong level script type for the first script. But now I've run into another problem. When the setmaptile activates it doesnt change what they are just the movement permissions.
nevermind just needed to leave the room. But still.....
 
Last edited:

Ok I looked at that tut and it turns out I was using the wrong level script type for the first script. But now I've run into another problem. When the setmaptile activates it doesnt change what they are just the movement permissions.
nevermind just needed to leave the room. But still.....

Well, the level script is only executed once every time you enter the map. If you don't want to have the player leave the room for the tiles to change the first time, just use the same setmaptile commands in the script where the necessary flag (in your case 0x249) is set.
 
Well, the level script is only executed once every time you enter the map. If you don't want to have the player leave the room for the tiles to change the first time, just use the same setmaptile commands in the script where the necessary flag (in your case 0x249) is set.

Yea but thats the weird thing, i did put it into a script.
 
Yea but thats the weird thing, i did put it into a script.

Did you use special 0x8E after the setmaptile commands to "refresh" the map? I noticed that you used it for the level script, which isn't necessary, by the way, but you haven't posted the script that is executed later in the map.
 
Did you use special 0x8E after the setmaptile commands to "refresh" the map? I noticed that you used it for the level script, which isn't necessary, by the way, but you haven't posted the script that is executed later in the map.

I did. Heres the script:
Spoiler:
It works up untill the whole setmaptile. When it ends and i walk onto where it was supposed to change tiles and the movement perm works but it doesnt look like it.
 
I did. Heres the script:
Spoiler:
It works up untill the whole setmaptile. When it ends and i walk onto where it was supposed to change tiles and the movement perm works but it doesnt look like it.

It should work fine if you're hacking Ruby or Fire Red. However, if you're hacking Emerald, you should use special 0x91 to refresh the map so that the tile changes appear. special 0x8E in Emerald either does nothing or something else, this is why they appeared when you re-entered the map, since there is no need to refresh the map with setmaptile level scipts.

Now, if you're not using Emerald, then I find nothing wrong with the script. Once it gets to the '":Well done:\n:Now guide others to ..." part, the tiles should be changed.
 
nevermind just needed to leave the room. But still.....

if you're using saved states, and you saved in the map where you're putting the level scripts, then of course, you'll need to refresh the map by leaving and then entering the map again.
 
hello friends i m making a script such that when i step on a tile my mother[in game] comes with a seal following her and then gives me that seal and after giving me seal the seal's ow should disappear and the player's mom goes outside.The problem is that the script isn't compiling i hope a help from you all

Spoiler:
 
hello friends i m making a script such that when i step on a tile my mother[in game] comes with a seal following her and then gives me that seal and after giving me seal the seal's ow should disappear and the player's mom goes outside.The problem is that the script isn't compiling i hope a help from you all

Spoiler:

What do you mean it's not compiling? Are you getting an error? Also, I don't think you should use four-digit flags. According to this thread, flags over 0x900 overlap the RAM so they're not safe to use.
 
hello friends i m making a script such that when i step on a tile my mother[in game] comes with a seal following her and then gives me that seal and after giving me seal the seal's ow should disappear and the player's mom goes outside.The problem is that the script isn't compiling i hope a help from you all

Spoiler:
Are you sure you have your ROM open in XSE?
 
Status
Not open for further replies.
Back
Top