• 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.
10,078
Posts
15
Years
  • Age 32
  • UK
  • Seen Oct 17, 2023
Quick question:

A year or so ago, a friend and I started making a hack. We ran into the problem of accidentally saving new scripts over old scripts.

Now I know there is a free space finder thing that helps you find unused space, but my friend (who was doing the scripting) said that using a free space finder took a really long time.

Now, we're starting to make a hack again, but this time, instead of editing stuff like we were doing the first time around, we're starting from scratch. Could we just start at 0 (or wherever the beginning of script in the game is) and just save over everything? Or would we risk the chance of it saving over moves and accessing your PC and stuff like that?

You would single handedly corrupt that ROM with (probably) one script :3

What you should do is:

  1. Download XSE
  2. At the top of each script right 'Dynamic 0x740000'
  3. Then make all your pointers @descriptive
  4. Let XSE find the free space for you.
 
30
Posts
18
Years
  • Seen May 26, 2022
Code:
#dyn 0x740000
#org @begin
lock
faceplayer
msgbox @steven
callstd msg_normal
setvar 0x6008 0x129
setvar 0x600A 0x12B
trainerbattle 0x3 0x9 0x0 @defeat
[B]setvar 0x6008 0x
setvar 0x600A 0x[/B]
msgbox @afterwards
callstd msg_normal
release
end

#org @steven
= Oh? Did you come to look\nfor fossils as well?\p[.]\pYour name is \v\h01?\nMine is STEVEN.\pI came from the HOENN region\nto look for rare fossils here\lat MT. MOON.\pI can tell by your eyes that\nyou are no ordinary trainer.\pCoincidentally, I was the also\nCHAMPION of the HOENN region for\la short time, so I know that\llook.\pYou've been through a tough journey,\nwhich has now brought you here.\pIt is no coincidence we have met.\nLet us battle to determine your\lworth.

#org @defeat
= Kudos to you, \v\h01.\pI can see that I was not\nmistaken.

#org @afterwards
= Well, that was exciting.\pIt seems as if all the fossils\nhere have already been dug\lup.\pCome again, I'll be happy to\nshare some of my own with you.

I've added in the bolded text. You then just add the hex numbers for the ordinary battle theme (I'm not sure which, AdvanceMap has a list in the Header Tab). That should work, but I haven't tested it so I'm not 100% sure.

Thats what I tried to do but losing the battle would keep the changed music.
 
124
Posts
12
Years
I have been having this problem for a few months now and so far, no solution has been found.

I have a script that I know should work but doesn't.

This script is for Pokemon Ruby.

Spoiler:


This is supposed to teleport me to the first village (the coordinates are correct) but instead of teleporting, the screen just goes black and I can still move about.
 

Satoshi Ookami

Memento Mori
14,254
Posts
15
Years
I'm not really sure that these commands are the right ones...

Code:
movesprite 0x1 0xC 0xA
showsprite 0x1
pause 0x50

You should use applymovement and waitmovement.
Also I do not believe that the 0x1 is the one you want.
Player is 0xFF.
 
10,078
Posts
15
Years
  • Age 32
  • UK
  • Seen Oct 17, 2023
I have been having this problem for a few months now and so far, no solution has been found.

I have a script that I know should work but doesn't.

This script is for Pokemon Ruby.

Spoiler:


This is supposed to teleport me to the first village (the coordinates are correct) but instead of teleporting, the screen just goes black and I can still move about.

I think the person above misunderstood your question.

I've taken a look at a Ruby Rom and 0x0 0x9 is definitely the right map, and you must have enlarged it a bit I guess? That shouldn't make a difference so I'm not sure what's happening.

How about placing a new Warp Event in a-map where you want to go, and then use a normal warp:

warp 0x0 0x9 0xEVENT NUMBER 0x0 0x0

The warp event on the map won't work like a normal door/cave/whatever if it's on a normal tile, so it won't cause problems :)
 
48
Posts
12
Years
  • Seen Jul 30, 2012
Back again! Question, is there a script to being lead to an area, with directions like 'left once, then up twice etc.' also how do I get a enemy trainer to spot me [!] above their head? Sorry for being a pain to you guys... I owe SwiftSign a lot thanks dude.
 
10,078
Posts
15
Years
  • Age 32
  • UK
  • Seen Oct 17, 2023
Back again! Question, is there a script to being lead to an area, with directions like 'left once, then up twice etc.' also how do I get a enemy trainer to spot me [!] above their head? Sorry for being a pain to you guys... I owe SwiftSign a lot thanks dude.

For movements you should use:

...
applymovement 0xPERSONEVENTNUMBER @Movements
waitmovement 0x0
...

#org @Movements
#raw 0x12 0x11 0x11 0xFE

The #raw list describes the movements, here is Diegoisawesome's list:

Spoiler:



If you want to move the player use "applymovement 0xFF @Movements" instead.

Being spotted by a trainer isn't technically a script, you need to assign the battle script (which you could look up by decompiling an existing trainer) and then in A-Map, on the person event, tick the 'trainer' box or set the value to 1.
 
48
Posts
12
Years
  • Seen Jul 30, 2012
I really need to learn scripting better before asking here, I don't know how to repay you for helping me though SwiftSign! Thanks a lot!
 
124
Posts
12
Years
I'm not really sure that these commands are the right ones...

Code:
movesprite 0x1 0xC 0xA
showsprite 0x1
pause 0x50

You should use applymovement and waitmovement.
Also I do not believe that the 0x1 is the one you want.
Player is 0xFF.

I do believe you have misunderstood.
They are sprite commands.
Not movement commands.

Sorry for the confusion.




I think the person above misunderstood your question.

I've taken a look at a Ruby Rom and 0x0 0x9 is definitely the right map, and you must have enlarged it a bit I guess? That shouldn't make a difference so I'm not sure what's happening.

How about placing a new Warp Event in a-map where you want to go, and then use a normal warp:

warp 0x0 0x9 0xEVENT NUMBER 0x0 0x0

The warp event on the map won't work like a normal door/cave/whatever if it's on a normal tile, so it won't cause problems :)

I was afraid of that.. lol

It is really strange.
No-one can figure out why it is doing this.
It's a bit annoying really because I can't use a teleport script without having a Warp Event which is going to make things a little more difficult for my hack, but never mind.

Thanks for the help.
I'm sure I will think of a way to fit warps in my hack =]
 
Last edited:
2
Posts
12
Years
  • Seen Apr 22, 2012
I'm trying to make a script that only activates once you've beaten the Elite Four (Ruby). I went to the Champion's Room in AdvanceMap and found no script. What is the flag that signals the defeat of the Elite Four in Ruby?
 
7
Posts
12
Years
  • Seen May 7, 2012
I'm a little confused about offsets. Let's say I want to make another person event. I understand how to use commands and such, but how exactly do you determine what offset you need for each string of commands?
 

miksy91

Dark Energy is back in action! ;)
1,480
Posts
15
Years
I'm a little confused about offsets. Let's say I want to make another person event. I understand how to use commands and such, but how exactly do you determine what offset you need for each string of commands?
There are things called pointers in every possible game. In GBA games, they consist of four bytes which point to a 4-byte ram address (correctly said but you can just assume they point into rom data by "taking out" 08 when calculating a pointer).

See pointer documentation through a link in my description.

So basically, you can yourself determine where you want to put the data you wish. When you're for example creating a script, search for blank data in the rom, pick up the offset of it and make a certain event point to that script. Simple as that.
 
10,078
Posts
15
Years
  • Age 32
  • UK
  • Seen Oct 17, 2023
I'm a little confused about offsets. Let's say I want to make another person event. I understand how to use commands and such, but how exactly do you determine what offset you need for each string of commands?

I'm gonna add on that if you're hacking GBA then you can use XSE which directs all your pointers to the correct offsets, so you don't actually have to look up every individual pointer.
 
124
Posts
12
Years
I'm trying to make a script that only activates once you've beaten the Elite Four (Ruby). I went to the Champion's Room in AdvanceMap and found no script. What is the flag that signals the defeat of the Elite Four in Ruby?

There is no flag.
It's just another script.

If you are looking for the Hall of Fame script, I suggest looking into the Level Scripts that are in the Hall of Fame map.
 
7
Posts
12
Years
  • Seen May 7, 2012
I'm gonna add on that if you're hacking GBA then you can use XSE which directs all your pointers to the correct offsets, so you don't actually have to look up every individual pointer.

I am using XSE. What would I have to do for XSE to determine the offsets?
 
2
Posts
12
Years
  • Seen Apr 22, 2012


There is no flag.
It's just another script.

If you are looking for the Hall of Fame script, I suggest looking into the Level Scripts that are in the Hall of Fame map.

The level script doesn't contain any information about the battle with Steven, and none of the events in the map have any scripts. Where is the script containing the battle detail with the Champion (Ruby)?
 

Winter Wonderland

Puts the fun in dysfunctional
305
Posts
12
Years
Hey, I've tried looking through the Diegoisawesome tutorial for XSE and couldn't find anything about it, so I came here to see if anyone else knew. I know there's a way to give someone a Pokemon, that much is obvious. However, I can find nothing on doing the inverse. I was wondering if any of you knew a way to remove a Pokemon from the Player. Thanks in advance to whoever can provide the answer. :)
 

DrFuji

[I]Heiki Hecchara‌‌[/I]
1,691
Posts
14
Years
I am using XSE. What would I have to do for XSE to determine the offsets?

By including the command '#dynamic 0x800000' at the begining of your script, XSE will immediately start searching for free space in your ROM from that point on. Once you compile your script, a box should pop up with a scroll bar full of numbers and word which you have used as pointers (the #org commands you have used in your script). Select the numbers which correlate to the beginning of your script (@start if you're just copying examples in tutorials word-for-word) and press the copy button. Open up you ROM in Advance Map and paste the offset that you copied into the script offset box on your object.

Hey, I've tried looking through the Diegoisawesome tutorial for XSE and couldn't find anything about it, so I came here to see if anyone else knew. I know there's a way to give someone a Pokemon, that much is obvious. However, I can find nothing on doing the inverse. I was wondering if any of you knew a way to remove a Pokemon from the Player. Thanks in advance to whoever can provide the answer. :)

HackMew has provided two ASM codes that allow you to take Pokemon away from a player.
 
Last edited:
2
Posts
14
Years
  • Seen Feb 18, 2013
All of this is working except the warp and I honestly don't know why! :(
Anyone got any ideas? Thanks in advance!

#dynamic 0x800000

#org @start
lock
faceplayer
msgbox @1 0x5
compare 0x800D 0x1
if 0x1 goto @check
msgbox @2 0x6
release
end

#org @check
checkitem 0x16F 0x1
compare 0x800D 0x1
if 0x4 goto @got
release
end

#org @got
msgbox @3 0x6
pause 0x14
special 0x187
compare LASTRESULT 0x2
if 0x1 goto 0x81A7AE0
special 0x188
fadescreen 0x1
special 0x17B
waitstate
goto @warp
end

#org @warp
warp 0x32 0x4 0x1 0x0 0x0

#org @3
= All aboard!

#org @1
= Would you like to ride the\n FERRY?

#org @2
= No ride today!
 
10,078
Posts
15
Years
  • Age 32
  • UK
  • Seen Oct 17, 2023
All of this is working except the warp and I honestly don't know why! :(
Anyone got any ideas? Thanks in advance!


#org @warp
warp 0x32 0x4 0x1 0x0 0x0

I would imagine 32 is your decimal number, you need to convert it to hex if you're using the '0x__' format. You can use the calculator on XSE or windows calculator in advanced mode.

For the record though, 32 -> 0x20

warp 0x20 0x4 0x1 0x0 0x0
 
Status
Not open for further replies.
Back
Top