• 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.
There's no corruption risks with making more free space, the corruption thing is actually talking about the mistake people made years ago when they thought Emerald used 00 bytes instead of FF bytes for free space, which caused sound glitches if people used Advance Map with Emerald. The tutorial I gave you fixes that and gives you more free space. And once you create more free space, you could use Advance Map with the freed offsets for a while, until MEH becomes beta status lol. And I haven't been hacking that long either, I struggle to make really big scripts sometimes haha.

Ah right.. I just get concerned becuase I've already written off one rom haha!

My thing is I'm confident in knowing how to do what I need to do, however if it throws an error at me i have no idea how to fix it! xD

Is the amount of free space in Emerald really SO limited that it's necessary to expand or whatever? I mean I don't create the most space requiring of scripts!
 
Yeah, the free space is very limited, especially in comparaison to FR/LG.
Scripts don't take a lot of space, but texts (dialogues) and sprites do take a lot of space.
 
Having trouble with this script:


#org @start
lock
giveitem 0x51 0x1 0x0
hidesprite 0x1
setflag 0x4B4
checkitem 0x51 0x1
compare 0x800D 0x1
if 0x1 goto @youhaveONEgoldenboneorg1
checkitem 0x51 0x2
compare 0x800D 0x1
if 0x1 goto @youhaveTWOgoldenboneorg1
checkitem 0x51 0x3
compare 0x800D 0x1
if 0x1 goto @youhaveTHREEgoldenboneorg1
checkitem 0x51 0x4
compare 0x800D 0x1
if 0x1 goto @youhaveFOURgoldenboneorg1
release
end


____________


What it's supposed to do is give you an item, then check how many of that item you have, then a msgbox will display saying "You have [number]/5 [item]s". However, when using the above script, it just keeps telling me I have 1 of the item even if I have more than one. Is there something I've missed? =/
 
It's supposed to give an item and then let the player know how many of that item the player has, but instead it just keeps going to the pointer for having 1 of that item. I'll post my full script here with strings if that makes it easier to understand, sorry im not good with explanations lol.


Code:
#org @start
lock
giveitem 0x51 0x1 0x0
hidesprite 0x1
setflag 0x4B4
checkitem 0x51 0x1
compare 0x800D 0x1
if 0x1 goto @youhaveONEgoldenboneorg1
checkitem 0x51 0x2
compare 0x800D 0x1
if 0x1 goto @youhaveTWOgoldenboneorg1
checkitem 0x51 0x3
compare 0x800D 0x1
if 0x1 goto @youhaveTHREEgoldenboneorg1
checkitem 0x51 0x4
compare 0x800D 0x1
if 0x1 goto @youhaveFOURgoldenboneorg1
release
end
#org @youhaveONEgoldenboneorg1
msgbox @youhaveONEgoldenbone1 0x6
release
end
#org @youhaveTWOgoldenboneorg1
msgbox @youhaveTWOgoldenbone1 0x6
release
end
#org @youhaveTHREEgoldenboneorg1
msgbox @youhaveTHREEgoldenbone1 0x6
release
end
#org @youhaveFOURgoldenboneorg1
msgbox @youhaveFOURgoldenbone1 0x6
release
end
#org @youhaveFOURgoldenbone1
[black_fr]You have [red_fr]4[black_fr]/5 GOLDEN BONES.
#org @youhaveTHREEgoldenbone1
[black_fr]You have [red_fr]3[black_fr]/5 GOLDEN BONES.
#org @youhaveTWOgoldenbone1
[black_fr]You have [red_fr]2[black_fr]/5 GOLDEN BONES.
#org @youhaveONEgoldenbone1
[black_fr]You have [red_fr]1[black_fr]/5 GOLDEN BONES.
 
Code:
#org @start
lock
giveitem 0x51 0x1 0x0
hidesprite 0x1
setflag 0x4B4
checkitem 0x51 0x1
compare 0x800D 0x1
if [B][COLOR="SeaGreen"]0x3[/COLOR][/B] goto @youhaveONEgoldenboneorg1
checkitem 0x51 0x2
compare 0x800D 0x1
if [B][COLOR="SeaGreen"]0x3[/COLOR][/B] goto @youhaveTWOgoldenboneorg1
checkitem 0x51 0x3
compare 0x800D 0x1
if [B][COLOR="SeaGreen"]0x3[/COLOR][/B] goto @youhaveTHREEgoldenboneorg1
checkitem 0x51 0x4
compare 0x800D 0x1
if [B][COLOR="SeaGreen"]0x3[/COLOR][/B] goto @youhaveFOURgoldenboneorg1
[COLOR="SeaGreen"][B]msgbox @youhaveMORETHANFOURgoldenbone1 0x6[/B][/COLOR]
release
end
#org @youhaveONEgoldenboneorg1
msgbox @youhaveONEgoldenbone1 0x6
release
end
#org @youhaveTWOgoldenboneorg1
msgbox @youhaveTWOgoldenbone1 0x6
release
end
#org @youhaveTHREEgoldenboneorg1
msgbox @youhaveTHREEgoldenbone1 0x6
release
end
#org @youhaveFOURgoldenboneorg1
msgbox @youhaveFOURgoldenbone1 0x6
release
end[COLOR="SeaGreen"]
[B]#org @youhaveMORETHANFOURgoldenbone1
[black_fr]You have [red_fr]4[black_fr]/5 GOLDEN BONES.[/B][/COLOR]
#org @youhaveFOURgoldenbone1
[black_fr]You have [red_fr]4[black_fr]/5 GOLDEN BONES.
#org @youhaveTHREEgoldenbone1
[black_fr]You have [red_fr]3[black_fr]/5 GOLDEN BONES.
#org @youhaveTWOgoldenbone1
[black_fr]You have [red_fr]2[black_fr]/5 GOLDEN BONES.
#org @youhaveONEgoldenbone1
[black_fr]You have [red_fr]1[black_fr]/5 GOLDEN BONES.
Try this. I also added the case in which the Player has more than 4.
 
Try this. I also added the case in which the Player has more than 4.


Thank you so much for taking the time to try and help, I really appreciate it! Sadly, it still isn't working for some reason =/ it just keeps telling the player they only have 1 of the item even if you have more than 1. Weird!
 
I'm kinda useless with things like script tiles. I've read many tutorials on how to set them up but None have really got into my head. Could anyone possibly give me a concise step by step on how to set them up?

EDIT: Stuck with this one. It's supposed to check for 0 Fresh water then give 5 if there's none in the bag.

Code:
#org 0xE3D88F
lock
faceplayer
msgbox 0x8E3D8C6 MSG_FACE '"I'm a relief worker sent here from..."
checkitem 0x1A 0x0
if 0x5 goto 0x8E3D8AF
msgbox 0x8E3D935 MSG_FACE '"Oh, you already have some.... \nSh..."
release
end

'---------------
#org 0xE3D8AF
giveitem 0x1A 0x5 MSG_OBTAIN
msgbox 0x8E3D973 MSG_FACE '"You take care now, /nand if you ru..."
release
end


'---------
' Strings
'---------
#org 0xE3D8C6
= I'm a relief worker sent here from \nVentura Town. \pI'm giving out free Fresh Water \lto anyone that needs it!

#org 0xE3D935
= Oh, you already have some.... \nShouldn't be too greedy now!

#org 0xE3D973
= You take care now, /nand if you run out come /lstraight back!

It just gives 5 everytime I talk to him.
 
Last edited:
I'm kinda useless with things like script tiles. I've read many tutorials on how to set them up but None have really got into my head. Could anyone possibly give me a concise step by step on how to set them up?

EDIT: Stuck with this one. It's supposed to check for 0 Fresh water then give 5 if there's none in the bag.

Code:
#org 0xE3D88F
lock
faceplayer
msgbox 0x8E3D8C6 MSG_FACE '"I'm a relief worker sent here from..."
[B]checkitem 0x1A 0x1
compare 0x800D 0x1
if 0x0 goto 0x8E3D8AF[/B]
msgbox 0x8E3D935 MSG_FACE '"Oh, you already have some.... \nSh..."
release
end

'---------------
#org 0xE3D8AF
giveitem 0x1A 0x5 MSG_OBTAIN
msgbox 0x8E3D973 MSG_FACE '"You take care now, /nand if you ru..."
release
end


'---------
' Strings
'---------
#org 0xE3D8C6
= I'm a relief worker sent here from \nVentura Town. \pI'm giving out free Fresh Water \lto anyone that needs it!

#org 0xE3D935
= Oh, you already have some.... \nShouldn't be too greedy now!

#org 0xE3D973
= You take care now, \nand if you run out come \lstraight back!

It just gives 5 everytime I talk to him.
I haven't tested this out, so I'm not sure if it'll work, but changes are in bold. Try it out and see if it works.
EDIT: nvm it doesn't work just tested it
DOUBLE EDIT: Ok should work now, sorry about that. btw you used the slash (/) instead of the backslash (\) for some of the dialogue, I changed that for you.
 
Last edited:
Just curious what does the compare line actually do? I've seen it used but not a clue how to use it.

Thanks for the time though!
 
Just curious what does the compare line actually do? I've seen it used but not a clue how to use it.

Thanks for the time though!

Exactly what it says on the lid: It compares.
In this case, it compares the value 0x1 to 0x800D a.k.a. Last results, which is the value used in the Checkitem command: 0x1

Then it says if it is 0x0, or false, then jump to this.

Basically: Checkitem for 1 water, compare number player has to 1, if false, give 5.
 
It still just gives me 5 water each time I speak with him, and I copied line for line the script that was given! :/

Code:
'---------------
#org 0xE3D88F
lock
faceplayer
msgbox 0x8E3D8C6 MSG_FACE '"I'm a relief worker sent here from..."
checkitem 0x1A 0x1
compare LASTRESULT 0x1
if 0x0 goto 0x8E3D8AF
loadpointer 0x0 0x8E3D935 '"Oh, you already have some.... \nSh..."
release
end

'---------------
#org 0xE3D8AF
giveitem 0x1A 0x5 MSG_OBTAIN
msgbox 0x8E3D973 MSG_FACE '"You take care now, \nand if you ru..."
release
end


'---------
' Strings
'---------
#org 0xE3D8C6
= I'm a relief worker sent here from \nVentura Town. \pI'm giving out free Fresh Water \lto anyone that needs it!

#org 0xE3D935
= Oh, you already have some.... \nShouldn't be too greedy now!

#org 0xE3D973
= You take care now, \nand if you run out come \lstraight back!
 
(Using XSE)

I'm trying to create my own script to set the clock in Emerald, you know when your mom tells you to go upstairs and set your clock?

When I open the script in XSE, this is what I get:

Spoiler:


I'm just trying to make a script for this that prevents me from leaving my room until I set the clock. As you can see, there are a lot of var/flags...

If anyone can help me out, and also explain to me how to read a script that's already programmed.. thanks. :)
 
It still just gives me 5 water each time I speak with him, and I copied line for line the script that was given! :/

Code:
'---------------
#org 0xE3D88F
lock
faceplayer
msgbox 0x8E3D8C6 MSG_FACE '"I'm a relief worker sent here from..."
checkitem 0x1A 0x1
compare LASTRESULT 0x1
if 0x0 goto 0x8E3D8AF
loadpointer 0x0 0x8E3D935 '"Oh, you already have some.... \nSh..."
release
end

'---------------
#org 0xE3D8AF
giveitem 0x1A 0x5 MSG_OBTAIN
msgbox 0x8E3D973 MSG_FACE '"You take care now, \nand if you ru..."
release
end


'---------
' Strings
'---------
#org 0xE3D8C6
= I'm a relief worker sent here from \nVentura Town. \pI'm giving out free Fresh Water \lto anyone that needs it!

#org 0xE3D935
= Oh, you already have some.... \nShouldn't be too greedy now!

#org 0xE3D973
= You take care now, \nand if you run out come \lstraight back!
That loadpointer command shouldn't be there... Did you remove the script data from the rom before recompiling? Deleting the sprite on Advance Map won't help, because the script is still inside the rom. I would use a pre-processing command (such as clean or removeall), or fill the script data with FF bytes in a hex editor, and recompile the script I gave you.

(Using XSE)

I'm trying to create my own script to set the clock in Emerald, you know when your mom tells you to go upstairs and set your clock?

When I open the script in XSE, this is what I get:

Spoiler:


I'm just trying to make a script for this that prevents me from leaving my room until I set the clock. As you can see, there are a lot of var/flags...

If anyone can help me out, and also explain to me how to read a script that's already programmed.. thanks. :)
Ok I tried my best to help you. I can't really explain some of them though, since you'd have to look at related scripts to understand what the vars/flags are doing. I'm also not the best at deciphering scripts, so that too.
 
Last edited:
Game: Fire Red Type: BPRE Editor: XSE Script: Randomization
Spoiler:


I'm try to make a guy that when you buy a Pokemon from him he gives you a random Pokemon, the highest chance being Magikarp. The script isn't complete just for testing purposes. When I test the script it always chooses the first choice, and no other choice, is there something wrong with this?
 
Hello. I am using Firered as a base and I'm trying to make a new pokemart person script. I made the script and tried to put it into action but It doesn't work. If anyone could help me and tell me what I did wrong that would be great, Thank you.

P.S. I used XSE

P.S.S. I didn't forget the #dynamic. I just left it off when I copied it over.

Spoiler:
 
Game: Fire Red Type: BPRE Editor: XSE Script: Randomization
Spoiler:


I'm try to make a guy that when you buy a Pokemon from him he gives you a random Pokemon, the highest chance being Magikarp. The script isn't complete just for testing purposes. When I test the script it always chooses the first choice, and no other choice, is there something wrong with this?
Your script doesn't have a givepokemon command at all.
Try it with the changes I made to it.
 
This question might be a bit stupid, but oh well, yolo.
I wanna add the Pokedollar sign in a script, something like "Hey, here's (Pokedollar sign)500" but I have no clue on how to make the Pokedollar sign appear. Does anybody know how?

EDIT: Got it by looking at the Magikarp Salesman. It's [$]
 
Last edited:
This question might be a bit stupid, but oh well, yolo.
I wanna add the Pokedollar sign in a script, something like "Hey, here's (Pokedollar sign)500" but I have no clue on how to make the Pokedollar sign appear. Does anybody know how?

Here's the hex code for that sign: B7=$

\h is used with hex values. Here's an example:
That \hB7 is the currency sign of the Pokemon world.
So in this example, I'm going to use "$":
Here's a table of all the hex codes for each symbol:
Spoiler:
 
Status
Not open for further replies.
Back
Top