• 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.
5
Posts
11
Years
  • Seen Aug 28, 2012
I'm back to my second problem I was having with my basic script. I have XSE 1.1.1, and using FSF, I found an offset. Using this offset in my script (in the spoiler below), I compile it, and copy the offset into Advance Map. Then when I test my ROM, my character walks up one tile and then the whole screen goes black, when all I'm trying to do is talk to an NPC. Is there anyone who has any idea what I'm doing wrong, and what I can do to fix it?

Spoiler:


EDIT: I think I may have discovered part of the problem, even if I don't know the solution. Is the script offset # suppose to change when you switch back and forth between maps? Like, if I switch to a different map, and then come back, the code is different.
 
Last edited:

miksy91

Dark Energy is back in action! ;)
1,480
Posts
15
Years
I'm back to my second problem I was having with my basic script. I have XSE 1.1.1, and using FSF, I found an offset. Using this offset in my script (in the spoiler below), I compile it, and copy the offset into Advance Map. Then when I test my ROM, my character walks up one tile and then the whole screen goes black, when all I'm trying to do is talk to an NPC. Is there anyone who has any idea what I'm doing wrong, and what I can do to fix it?

Spoiler:


EDIT: I think I may have discovered part of the problem, even if I don't know the solution. Is the script offset # suppose to change when you switch back and forth between maps? Like, if I switch to a different map, and then come back, the code is different.
The #dynamic 0x481E00 there means that the script editor tries to calculate free space in ROM where to input your script data starting at offset 0x481E00. Best way to understand what it means is by having a backup of the original rom file and a hex editor (any hex editor will do, there are plenty of them around).

Compile your script data and open that offset it shows with a hex editor in both compiled rom and your backup rom. That way, you can see what the XSE did while compiling the script, and where #dynamic 0x481E00 lead the script data.

Otherwise, I believe your problem is the fact that XSE thinks you've found free space for inserting the script data in rom, and put it there although there wasn't free space for it. There is a of free space in the end of the rom; starting somewhere at 0x730000 (this is also something you may want to check with a hex editor to see what the rom looks like and all the room you've left for inserting your own data without replacing any existing data) I believe but can't remember for sure as I never hack FR.

So after doing all this, start with your backup rom and compile the script in free rom area.
 
8
Posts
11
Years
I'm trying to get a sprite to check the player for the EARTHBADGE (which I have renamed the HYDROBADGE) and then disappear if the player has it. I've tried writing my own script, but the only thing that happens is the game freezes when you attempt to talk the sprite. Can somebody please fix the error(s) in my script, and tell me what I need to change.

Here's my script:
Code:
'-----------------------
#org 0x2D8438
lock
faceplayer
checkflag 0x827
if 0x0 goto 0x2D8458
if 0x1 goto 0x2D8448
end

'-----------------------
#org 0x2D8458
callstd 0x4
msgbox 0x2D8478
release
end

'-----------------------
#org 0x2D8448
msgbox 0x2D8468
waitmsgbox
fanfare 0x101
waitfanfare
waitkeypress
release
hidesprite 0x3
end

'---------
' Strings
'---------
#org 0x2D8478
= Sorry, I can't let you through\nuntil you have defeated FYFE.\pThere are some tough trainers\nalong this ROAD!

#org 0x2D8468
= Well done for defeating FYFE!\pYou may pass now!
 

iLoveHate

Hmmmmmm.... :D
35
Posts
11
Years
I'm trying to get a sprite to check the player for the EARTHBADGE (which I have renamed the HYDROBADGE) and then disappear if the player has it. I've tried writing my own script, but the only thing that happens is the game freezes when you attempt to talk the sprite. Can somebody please fix the error(s) in my script, and tell me what I need to change.

Haia vespertine, maybe i can help.

this was your script i see
Spoiler:


First off, are you using XSE? i recommend xse 1.1.1
what was the offset number? was in above 800000

maybe you can try this:

Spoiler:


A little explanation:
#dynamic 0x800000[b: looking for offset 800000 or higher.
checkflag 0x827: I guess that has to be the hydrobadge.
msgbox @welldone 0x4: the 0x4 is the same ass callstd 4 alwats use 'closeonkeypress' after using the 0x4
hidesprite: is the person event no
setflag 0x101: im using this 1 to make the sprite dis-appear forever so it wont re-appear when you walk. the 0x1 is the person ID
fadescreen: i guess that isnt hard to find out.



I hope it helped, i just tested it. it worked for me, but be sure using xse with this script above. if you want xse 1.1.1 and cant find the download just ask me oki?
 
8
Posts
11
Years
Hi there, thank you so much for your help! When I use your script however the messagebox does not pop up, and the sprite just disappears and then reappears once you walk through it (without saying the messages or whatever). The fanfare does play however. This is what my script is after I made the necessary alterations (sprite number etc):

Code:
#dynamic 0x2D84E4

#org @start
lock
faceplayer
checkflag 0x827
if 0x0 goto @notyet
msgbox @welldone 0x4
closeonkeypress
fanfare 0x101
waitfanfare
fadescreen 0x1
hidesprite 0x3
setflag 0x301
fadescreen 0x0
release
end

#org @welldone
= Well done for defeating FYFE!\pYou may pass now!

#org @notyet
msgbox @no 0x4
closeonkeypress
release
end

#org @no
= Sorry, I can't let you through\nuntil you have defeated FYFE.\pThere  are some tough trainers\nalong this ROAD!
I edited lines;
0013: hidesprite 0x1 to hidesprite 0x3 (as the sprite's number is 3)
0014: setflag 0x101 to setflag 0x301 (as the sprite's number is 3)

Can you please tell me what I have done to cause an error? Thanks for your help!
 

PokemonMasters

Always Remember Forever&After
389
Posts
11
Years
anyone know how to make a mughshot before a battle? i know you neeed to make some kind of script for it. like before battling it shows both trainers pic with a vs sign.
 
17
Posts
13
Years
  • Seen Oct 15, 2018
Alright, I'm kind of having the same problem as EHero except I'm using Emerald. Everything works fine until the nicknaming part where nothing happens. I'm pretty sure I'm using the wrong script for nicknaming because I don't know what the offset for the nicknaming script in Emerald is. Could anyone help me? I know my pointers are a bit confusing... xD

Spoiler:

Edit:
Alright, having another problem with wildbattle. Script will be below. I have a charizard sitting in my character's room and have a Lv. 100 Swampert in my front slot with the Pokemon Menu enabled. I have the charizard's sprite set to Person ID 0200 and Movement type as Look Around. However, when I try to interact with the charizard and it just beeps and no text or anything happens. I can only think of two problems; 1. I screwed up in scripting or 2. I can't cause a battle because it's in the player's room. Can anyone help me out with this as well?

Spoiler:
Would really like help with this if anyone could! Thanks.
 
17
Posts
13
Years
  • Seen Oct 15, 2018


probably replace the "gosub" with "call"...

for the second one, I think you probably gave charizard the wrong offset in a-map.

All the "gosub" is doing is going to the @hallo5 pointer and using "call" to execute "0x1A74EB". I have gotten this to work perfectly in FireRed. If I wanted the code to be cleaner I could just use "call" but this is just basic practice. The problem is "0x1A74EB" isn't the nickname script in Pokemon Emerald, and I need to know what it is for the first script to work. I really don't want to get into making a custom naming script quite yet, though if I really have to I guess I can.

As for the second one, you're probably right because I've also gotten this to work in FireRed. Thanks for the helpo. ^-^
 

Infamously

Infamous me
15
Posts
13
Years
  • Seen Dec 30, 2012
All the "gosub" is doing is going to the @hallo5 pointer and using "call" to execute "0x1A74EB". I have gotten this to work perfectly in FireRed. If I wanted the code to be cleaner I could just use "call" but this is just basic practice. The problem is "0x1A74EB" isn't the nickname script in Pokemon Emerald, and I need to know what it is for the first script to work. I really don't want to get into making a custom naming script quite yet, though if I really have to I guess I can.

As for the second one, you're probably right because I've also gotten this to work in FireRed. Thanks for the helpo. ^-^

For the first script, why don't you de-compile an in-game script in your ROM and search of the offset pointing to the nicknaming feature (ultimately the script that asks whether you want to nickname your starter)? IIRC, the nickname bit (the called part) requires you to set a few variables. I'm not sure what those variables are, though.
 

Satoshi Ookami

Memento Mori
14,254
Posts
15
Years
All the "gosub" is doing is going to the @hallo5 pointer and using "call" to execute "0x1A74EB". I have gotten this to work perfectly in FireRed. If I wanted the code to be cleaner I could just use "call" but this is just basic practice. The problem is "0x1A74EB" isn't the nickname script in Pokemon Emerald, and I need to know what it is for the first script to work. I really don't want to get into making a custom naming script quite yet, though if I really have to I guess I can.

As for the second one, you're probably right because I've also gotten this to work in FireRed. Thanks for the helpo. ^-^
For some reason, nicknaming in custom scripts sometimes glitches... :/
If it's not really neccessary, you should omit it in your scripts and leave nicknaming to name rater.
 
13
Posts
12
Years
  • Seen Feb 26, 2014
Reposting my question.

I'm a bit new to scripting and I'm having trouble with this one.
I'm writing in XSE for a FireRed hack. The script is fired off by a trigger/"green S" tile.

What I want to happen is, after the right flags are set, have a person walk toward the player, say something, then initiate a battle. I've looked at the scripts for the Giovanni Silph Co. battle as well as the Pokemon Tower rival battle for comparison but can't see where the important differences are. My script is below (the overuse of #raw 62 is just filler from debugging).

The trigger behaves well enough before I have the flag set, so that works, at least. But once I set the flag, everything just freezes. Nobody moves, and no battle begins. I tried attaching the script to a person event, but that makes the person move without initiating the battle.

Spoiler:
 
2
Posts
11
Years
  • Seen Sep 24, 2012
Random Lines

I have a problem while scripting. After compiling, some random lines are added.
Example:
Code:
#org 0x2DD1F0
msgbox 0x8000006 0x69 '"-¿\h69\h9A1ï\h3D\h84\h82\h0A\h84pÌ..."
setvar 0x7000 0x1
goto 0x82DD203

'---------------
#org 0x2DD203
msgbox 0x8000006 0x69 '"-¿\h69\h9A1ï\h3D\h84\h82\h0A\h84pÌ..."
setvar 0x7000 0x1
goto 0x82DD216
Or some random commands like "updatecoins" appear.
I dont know what i am doing wrong. Please help me!

Game: FireRed
Type: Trigger
Editor: XSE

Thanks in advance, ManekenT
 

Infamously

Infamous me
15
Posts
13
Years
  • Seen Dec 30, 2012
I have a problem while scripting. After compiling, some random lines are added.
Example:
Code:
#org 0x2DD1F0
msgbox 0x8000006 0x69 '"-¿\h69\h9A1ï\h3D\h84\h82\h0A\h84pÌ..."
setvar 0x7000 0x1
goto 0x82DD203

'---------------
#org 0x2DD203
msgbox 0x8000006 0x69 '"-¿\h69\h9A1ï\h3D\h84\h82\h0A\h84pÌ..."
setvar 0x7000 0x1
goto 0x82DD216
Or some random commands like "updatecoins" appear.
I dont know what i am doing wrong. Please help me!

Game: FireRed
Type: Trigger
Editor: XSE

Thanks in advance, ManekenT

Would you mind posting the whole script? Or is that bit you posted the full script?
 

thanethane98

Self Proclaimed Expert
82
Posts
11
Years
  • Seen Nov 16, 2013
I have a problem while scripting. After compiling, some random lines are added.
Example:
Code:
#org 0x2DD1F0
msgbox 0x8000006 0x69 '"-¿\h69\h9A1ï\h3D\h84\h82\h0A\h84pÌ..."
setvar 0x7000 0x1
goto 0x82DD203

'---------------
#org 0x2DD203
msgbox 0x8000006 0x69 '"-¿\h69\h9A1ï\h3D\h84\h82\h0A\h84pÌ..."
setvar 0x7000 0x1
goto 0x82DD216
Or some random commands like "updatecoins" appear.
I dont know what i am doing wrong. Please help me!

Game: FireRed
Type: Trigger
Editor: XSE

Thanks in advance, ManekenT

This occurs when your script runs into other data in the rom. Try recompiling it with a dynamic offset (I suggest using some around 0x740000). That should fix your issue.
 
17
Posts
13
Years
  • Seen Oct 15, 2018


For the first script, why don't you de-compile an in-game script in your ROM and search of the offset pointing to the nicknaming feature (ultimately the script that asks whether you want to nickname your starter)? IIRC, the nickname bit (the called part) requires you to set a few variables. I'm not sure what those variables are, though.

I've this a couple of times with Steven's Beldum script. I can't seem to find it, but I'll try checking the starter script. Thanks. :3


For some reason, nicknaming in custom scripts sometimes glitches... :/
If it's not really neccessary, you should omit it in your scripts and leave nicknaming to name rater.

Meh, I will if ever decide to seriously make a rom hack; right now I'm just mostly scripting in a linear fashion based on diego's tutorial. Thanks~
 

SKRoy

Pokémon Hacker
66
Posts
14
Years
  • Age 27
  • Seen Feb 8, 2016
I have made a script, but when I use it nothing happend... What's wrong?

#dynamic 0x800000

#org @start
checkflag 0x1100
if 0x1 goto @done2
checkflag 0x820
if 0x1 goto @done
applymovement 0xFF @move
waitmovement 0x0
applymovement 0x05 @move1
waitmovement 0x0
lock
faceplayer
message @talk1 0x6
release
end

#org @talk1
= You don't have your first badge!

#org @move1
#raw 0x10
#raw 0xFE

#org @move
#raw 0x12
#raw 0xFE

#org @done
lock
faceplayer
message @1 0x6
givepokemon 0x385 0x5 0x0 0x0 0x0 0x0
fanfare 0x13E
message @2 0x4
waitfanfare
closeonkeypress
setflag 0x1100
message @3 0x5
compare LASTRESULT 0x1
if 0x1 gosub @name
message @4 0x6
release
end

#org @done2
release
end

#org @name
call 0x1A74EB
return

#org @1
= I see you have your first badge!\nNow I have something for you!

#org @2
= [black_fr]You received a Castform!

#org @3
= [black_fr]Would you like to give a\nnickname to Castform?

#org @4
= Please take care of Castform!
 
Status
Not open for further replies.
Back
Top