• 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.
35
Posts
14
Years
  • Seen Feb 28, 2010
Hey Um, ive wrote this script where you come out of this cave where Team rocket have just attacked you. You walk over a script tile and this happens:

Code:
#dynamic 0x800000

#org @start
applymovement 0x02 @move
msgbox @1 0x6
release 
end

#org @move
#raw 0x52
#raw 0x4A
#raw 0x62
#raw 0xFE

#org @1
= Are you alright?

The Emulator freezes when i step over where the script should activate. Whats wrong? Thanks in advance for whoever helps :)
 

trebornosliw

Learning
516
Posts
14
Years
  • Age 31
  • Seen Jul 22, 2012
I have the same problem as Joshay with this script below; it just freezes up when I step on it (I want the player character to move one step down).
Spoiler:
 

Pokepal17

More cowbell~
1,519
Posts
15
Years
I have the same problem as Joshay with this script below; it just freezes up when I step on it (I want the player character to move one step down).
Spoiler:

Yopu need a waitmovement 0x0 after the applymovement. Also make sure the script tile's unknown is 0003 and var number is 4050 (or anyother free variable)

Also, you can put #raw values on the same line so instead of
#raw 0x10
#raw 0xFE

you can have

#raw 0x10 0xFE

Changes in bold.
 

ziglef

Just here for fun ^^
17
Posts
14
Years
Hey Um, ive wrote this script where you come out of this cave where Team rocket have just attacked you. You walk over a script tile and this happens:

Code:
#dynamic 0x800000

#org @start
applymovement 0x02 @move
[B]waitmovement 0x02[/B]
msgbox @1 0x6
release 
end

#org @move
#raw 0x52
#raw 0x4A
#raw 0x62
#raw 0xFE

#org @1
= Are you alright?
The Emulator freezes when i step over where the script should activate. Whats wrong? Thanks in advance for whoever helps :)

changes in bold, its just like Pokepal17 said, and you got put the var number in the script tile as well as 0003 in unknown (i normaly use 4050 as a var number and 0300 in unknown)
 

trebornosliw

Learning
516
Posts
14
Years
  • Age 31
  • Seen Jul 22, 2012
Yopu need a waitmovement 0x0 after the applymovement. Also make sure the script tile's unknown is 0003 and var number is 4050 (or anyother free variable)

Also, you can put #raw values on the same line so instead of
#raw 0x10
#raw 0xFE

you can have

#raw 0x10 0xFE

Changes in bold.
Thank you so much, this is perfect and it actually works now! I really appreciate it. Let me know if there's ever any way I can return the favor.
Is there a list somewhere of the different variables and unknowns I need to use in AM for this type of stuff? I mean any script, not just movements.
Thanks again!
 

Pokepal17

More cowbell~
1,519
Posts
15
Years
Thank you so much, this is perfect and it actually works now! I really appreciate it. Let me know if there's ever any way I can return the favor.
Is there a list somewhere of the different variables and unknowns I need to use in AM for this type of stuff? I mean any script, not just movements.
Thanks again!

Variables range from 0x4000 to 0xFFFF
The ones between 0x5000 amd 0x7000 are the safe ones ;)
 

ruby

[span="howdy;partner"][/span]
1,390
Posts
20
Years
  • Age 31
  • Seen Mar 27, 2024
Is there a check for whether the player is standing on a tile where a wild battle could occur?

I imagine it'd be a mix of checking the behaviour byte of the tile the player was on, and checking the wild pokemon data for that map.

Any ideas?
 

0m3GA ARS3NAL

Im comin' home...
1,816
Posts
16
Years
Is there a check for whether the player is standing on a tile where a wild battle could occur?

I imagine it'd be a mix of checking the behaviour byte of the tile the player was on, and checking the wild pokemon data for that map.

Any ideas?

Actually, there isn't, you would have to have it check for the player's X/Y coordinates.
You could use it to check if they are on a set of 'tall grass', but you need to be sure the X/Y numbers are the same as the tile you are standing on.
Lets say you are on tile 0xA 0x5

Example:
#org @start
lock
getplayerpos 0x5000 0x5001
compare 0x5000 0xA
if b_false goto @end
compare 0x5001 0x5
if b_false goto @end
//Script goes here//
release
end

#org @end
release
end
 

ruby

[span="howdy;partner"][/span]
1,390
Posts
20
Years
  • Age 31
  • Seen Mar 27, 2024
Hmmm, thats annoying..

I have the script set to run after clicking a custom option in the pause menu, which means it can be used anywhere.

I think I'll just have to put a check into the scripts of every indoor map and have the other script check for that.

Thanks. :]
 

trebornosliw

Learning
516
Posts
14
Years
  • Age 31
  • Seen Jul 22, 2012
Alright, so I have one more scripting crisis. In this script, person #215 is supposed to walk up to me, say a few lines, then the screen fades in and out and he dissapears. He doesn't move, though the text pops up and the player character turns just fine, and he doesn't go away when the screen fades in and out (though he's gone when I leave the map and come back). What gives?
Spoiler:
 

cooley

///Keepin' it simple
1,148
Posts
17
Years
Actually, there isn't, you would have to have it check for the player's X/Y coordinates.
You could use it to check if they are on a set of 'tall grass', but you need to be sure the X/Y numbers are the same as the tile you are standing on.
Lets say you are on tile 0xA 0x5

Example:
#org @start
lock
getplayerpos 0x5000 0x5001
compare 0x5000 0xA
if b_false goto @end
compare 0x5001 0x5
if b_false goto @end
//Script goes here//
release
end

#org @end
release
end
Well, you would use 0x8004 and 0x8005.. Since the check is temporary. And they most likely wouldn't work with 5000 and 5001. What you're doing is setting them into the variables 5000 and 5001.

It's just like the earthquake script:
Code:
setvar 0x8004 0x4 - Up/Down maximun shake
setvar 0x8005 0x0 - ???
setvar 0x8006 0xF - Length of quake(0x0 is forever, 0xFF is VERY LONG XD)
setvar 0x8007 0x4 - Left/right maximum shake.
special 0x136

Blah blah.. The point is, without the 0x8005 and 8006, etc. The script won't work. These vars are made especially for these situations I think. I didn't reverse engineer or anything like that, it's just speculation based on knowledge and experience. Well... done!

trebornosliw said:
Alright, so I have one more scripting crisis. In this script, person #215 is supposed to walk up to me, say a few lines, then the screen fades in and out and he dissapears. He doesn't move, though the text pops up and the player character turns just fine, and he doesn't go away when the screen fades in and out (though he's gone when I leave the map and come back). What gives?

You need to put the flag ID of the person into A-map. Click on the person, and put the flag into Person ID.
 

ruby

[span="howdy;partner"][/span]
1,390
Posts
20
Years
  • Age 31
  • Seen Mar 27, 2024
Okay, another one for you if you can help;

I'm hacking Emerald and have activated special 0xD0 which starts 'safari mode'. Amongst other things this adds the PokeDex option into the pause menu, which I don't want.
I've tried clearing flag 0x861 which should disable it, but in this case it doesn't.

Any ideas on how I can remove this option from the pause menu?
 
Last edited:

trebornosliw

Learning
516
Posts
14
Years
  • Age 31
  • Seen Jul 22, 2012
cooley said:
You need to put the flag ID of the person into A-map. Click on the person, and put the flag into Person ID.
Already done, his person number is 215. The person event number is also 215... could that have distorted something?
Do I have to change the sprites var or unknowns? I already changed the map tile's unkown to 0003 and var to 4050.
Thanks.

@Counterfeit, you might try clearing flag 829? I don't know for sure.
 
Last edited:

cooley

///Keepin' it simple
1,148
Posts
17
Years
Already done, his person number is 215. The person event number is also 215... could that have distorted something?
Do I have to change the sprites var or unknowns? I already changed the map tile's unkown to 0003 and var to 4050.
Thanks.

@Counterfeit, you might try clearing flag 829? I don't know for sure.
I don't know how in the world someone's person number is 215.. Try to change it to something reasonable like 1 or 17. And also try to change the flag too, XSE has a list of used flags, and 215 is probably already used by the game.

You don't have to change anything in the person's sprite except view radius(for trainers) and movement usually it's 11.

Btw,
Flag 0x829 = pokedex in FireRed. ;)
@Counterfeit: Unless you can find the original pointer of that pause menu, you can't remove it
 

trebornosliw

Learning
516
Posts
14
Years
  • Age 31
  • Seen Jul 22, 2012
I don't know how in the world someone's person number is 215.. Try to change it to something reasonable like 1 or 17. And also try to change the flag too, XSE has a list of used flags, and 215 is probably already used by the game.

You don't have to change anything in the person's sprite except view radius(for trainers) and movement usually it's 11.

Btw, Flag 0x829 = pokedex in FireRed. ;)
@Counterfeit: Unless you can find the original pointer of that pause menu, you can't remove it
Okay thanks.
I know what flag 0x829 does, but I thought that clearing it might remove your Pokedex... apparently not. Thanks for the suggestion, I'll try it out.
 

Larvitar170

Noobie hacker
66
Posts
14
Years
A stupid mistake.

Game: Fire Red
Type: Movement (ONE TIME)
Editor: XSE
Script: Movement (ONE TIME)
Spoiler:

I'm trying to get the main characters mom to go to the spot and say that stuff to you. when I move to the script, the game just freezes.
 

Pokepal17

More cowbell~
1,519
Posts
15
Years
Game: Fire Red
Type: Movement (ONE TIME)
Editor: XSE
Script: Movement (ONE TIME)
Spoiler:

I'm trying to get the main characters mom to go to the spot and say that stuff to you. when I move to the script, the game just freezes.

Set the script tile's settings to the unknown as 0003 and the var number are 4050 (or any other unused variable).
 

ruby

[span="howdy;partner"][/span]
1,390
Posts
20
Years
  • Age 31
  • Seen Mar 27, 2024
I'm sure this has been asked before, I can't seem to find the answer anywhere;

What's the offset for the truck movement/sound script?

Preferably in Emerald, R/S will do though.
 

trebornosliw

Learning
516
Posts
14
Years
  • Age 31
  • Seen Jul 22, 2012
Okay, so I've reworked my script, and thanks to pokepal and cooley's expert guidance, the sprite will actually move correctly now. The only problem is that he reappears every time I exit the map... I've set his people number to 0001, so what have I messed up this time?
Thanks for the help guys, here's the script.
EDIT: The sprite's event number is also 1, second-to-top Unknown is 3, and Movement is 11.
This script takes place exactly one tile in front of the center warp into Viridian Forest (from route 2). The person I use in it is standing just to the left of the kid who says he and his friends are here to catch Bug Pokemon. If you like, enter the script and a sprite into your own ROM and test it for yourself; you'll see what I mean.
It would also be great if someone could write their own script for this scenario and show me, so I can see exactly how I'm supposed to do it. I can't figure out what I'm doing wrong and it's driving me insane.
Oh, and this is a side note, but I can't edit walking frames into the sprite. I saved this sprite over a sprite that doesn't normally move at all, so if I try to make a walking frame, it duplicates it over his standing frame. How do I fix that?
Spoiler:

Sorry if I'm asking too many questions at once...
 
Last edited:
Status
Not open for further replies.
Back
Top