• 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.
9
Posts
13
Years
  • Seen May 23, 2011
Game: Pokemon Fire Red
Type: US
Editor: XSE
Script:
Spoiler:

I've bolded the suspected problem area.
The script will not remove two pokemon like I want it to.
The problem is centered around the script concerning ASM. The ASM is from HackMew (pokecommunity.com/showthread.php?t=206138) but the problem is my understanding. Obviously I am not giving the script the right information in order to remove the pokemon (My own custom pokemon taking up the slots of rattata and raticate). So my question is what do I need to do to give the ASM the right info?
 
Last edited:

metapod23

Hardened Trainer
673
Posts
15
Years
  • Seen Aug 18, 2016
Game: Pokemon Fire Red
Type: US
Editor: XSE
Script:
Spoiler:

I've bolded the suspected problem area.
The script will not remove two pokemon like I want it to.
The problem is centered around the script concerning ASM. The ASM is from HackMew (pokecommunity.com/showthread.php?t=206138) but the problem is my understanding. Obviously I am not giving the script the right information in order to remove the pokemon (My own custom pokemon taking up the slots of rattata and raticate). So my question is what do I need to do to give the ASM the right info?

I haven't used HackMew's routine (yet), but I believe that you don't put the Pokémon's number, but the slot #, so it would only be 0-5 that works.

0 would be the first slot in your party, and 5 would be the last slot in your party.

I'm not sure why you have the setvar 0x4036 stuff, though, but using 0x13 and 0x14 (Rattata and Raticate's #s) won't do anything, because you need to put in the slot # of the Pokémon you want to remove from your party (0-5). Obviously, this will make it harder to release a specific Pokémon, but you might be able to combine that asm bit with this script I did to make it work, but I'm not sure you can:

http://www.pokecommunity.com/showthread.php?t=210016

I don't know if there's a way to compare a Pokemon in a particular slot # to a particular Pokémon ... if you figure something out, let me know, because I've just been using the Daycare script to do this in my hack. :) You could probably do the same thing, if you removed the daycare from your game.
 
Last edited:
9
Posts
13
Years
  • Seen May 23, 2011
I haven't used HackMew's routine (yet), but I believe that you don't put the Pokémon's number, but the slot #, so it would only be 0-5 that works.

0 would be the first slot in your party, and 5 would be the last slot in your party.

I'm not sure why you have the setvar 0x4036 stuff, though, but using 0x13 and 0x14 (Rattata and Raticate's #s) won't do anything, because you need to put in the slot # of the Pokémon you want to remove from your party (0-5). Obviously, this will make it harder to release a specific Pokémon, but you might be able to combine that asm bit with this script I did to make it work, but I'm not sure you can:

pokecommunity.com/showthread.php?t=210016

I don't know if there's a way to compare a Pokemon in a particular slot # to a particular Pokémon ... if you figure something out, let me know, because I've just been using the Daycare script to do this in my hack. :) You could probably do the same thing, if you removed the daycare from your game.
The setvar stuff is the result of me using part of someone elses script and my lack of understanding. I'd rather not destroy the Daycare...What I want to do seems simple enough and I feel like I shouldn't have to re-write part of the game just to remove two pokemon from the game.
 

Nerketur

PokéScripter
104
Posts
13
Years
Does anybody know the offset of the script in Pokemon Ruby that gives you the Pokedex for the first time? If I can find that, I will be able to modify it to give a national Pokedex from the start.

Nope. But you can find it if you look for the Professor's script. I'm more of a FR/LG hacker, sadly.

So I'm trying to get the Lab in Cinnabar to allow me to revive all three Kanto fossils. I've commented a lot of the original code, and I'm trying to find where it prevents the Dome fossil from being recognized. I've caught the part at the beginning where it checks if either of the story fossils were revived, and I know that part works because after reviving the Old Amber and Helix fossil, the crazy scientist performs says the line if you don't have a fossil, instead of the one when there are no more fossils to revive.

commented original code:
Spoiler:
my replacement code:
Spoiler:
Any help would be appreciated.

Ok, yours is the most interesting. I don't know of any real error, except for two things. One..., you check for the fossil differently than the game does. And two, your check for fossils may leave unexpected results.

With a proper check, if any of the results return false, then it should return 0. Otherwise, it returns 1. Namely, an AND gate. But, because of how it's coded, using LASTRESULT can lead to unexpected results if you use compare statements. Thus, my corrections are as follows:

Code:
//------------
#org @CheckHelix
checkflag 0x2ED
if 0x1 goto @CheckDome
[COLOR=Red]goto @No[/COLOR]

//--------------
#org @CheckDome
checkflag 0x2EC
if 0x1 goto @Yes
[COLOR=Red]goto @No[/COLOR]

//-------------
#org @Yes
setvar LASTRESULT 0x1
return

[COLOR=Red]//-------------
#org @No
setvar LASTRESULT 0x0
return[/COLOR]

//-------------
#org @DomeI
checkitem 0x165 0x1
if 0x1 goto @Yes
[COLOR=Red]goto @No[/COLOR]

//-------------
#org @HelixI
checkitem 0x166 0x1
if 0x1 goto @Yes
[COLOR=Red]goto @No[/COLOR]
This is assuming that the checking for the particular item is correct. There are three reasons off the top of my head that could make it not work. Either the item is no longer in your inventory after you make two of them (Removed by the game), or the command itself is incorrect (Shouldn't be. I checked it.), or, lastly, you have more than 1 Dome or Helix fossil. I'm not sure if checkitem will return true with more than one. Either that, or the command is buggy in your game. Nonetheless, if all else fails, then rather than checking for the item, check for a flag set when you get the item, as is done in the Nintendo scripts.

Note: Yes, I realize some of the "goto @No"'s are unnecessary. But I don't trust LASTRESULT as a variable unless it's just after a compare or other item it affects. You might fix the problem by using a variable other than LASTRESULT. Maybe 0x8000, for example.

The setvar stuff is the result of me using part of someone elses script and my lack of understanding. I'd rather not destroy the Daycare...What I want to do seems simple enough and I feel like I shouldn't have to re-write part of the game just to remove two pokemon from the game.

I haven't tested this, but you could use "comparebanks"

Basically, iterate through all the pokemon in the party, buffer the name of the pokemon in the party with "bufferpartypokemon", and compare it with a buffer of Raticate and Rattata. Something like this:

Code:
#dynamic 0x800000
#org @start
countpokemon
copyvar 0x8000 LASTRESULT
subvar 0x8000 0x1
bufferpokemon 0x1 0x13
bufferpokemon 0x2 0x14
goto @loop

#org @loop
compare 0x8000 0x0 // While loop:
if B_<= goto @end  //while (0x8000 > 0) { 

//This is where we check the names
bufferpartypokemon 0x0 0x8000
comparebanks 0x0 0x1
if 0x1 call @remove
comparebanks 0x0 0x2
if 0x1 call @remove

// The end of the loop
subvar 0x8000 0x1 // 0x8000 = 0x8000 - 1
goto @loop        // }

#org @remove
//Code to remove the party pokemon goes here.
//Best to use "copyvar"
copyvar 0x8004 0x8000
callasm ASM_ROUTINE
return

#org @end
end
As a note, there IS a special that will remove a pokemon (or all Pokemon) from your party, erasing it completely. I don't remember what the special is, but I also figure there would have to be one, cause you can "release" pokemon in the game.

You can also erase it manually. I wouldn't recommend it, but it's still possible. It would require what I call "Scripting in ASM without using ASM."
 
Last edited:

metapod23

Hardened Trainer
673
Posts
15
Years
  • Seen Aug 18, 2016
The setvar stuff is the result of me using part of someone elses script and my lack of understanding. I'd rather not destroy the Daycare...What I want to do seems simple enough and I feel like I shouldn't have to re-write part of the game just to remove two pokemon from the game.

Maybe someone else can help you, then. What you need is a check to make sure the Pokemon being removed from that slot is the Pokemon you want it to be, but I don't know if there's an in-game method to do that, or if someone could write an asm routine for it ... I don't know enough about asm to do it myself, but I suspect it wouldn't be difficult to add that to HackMew's routine and have a special routine to only remove Rattata or Raticate (for someone experienced with asm).
 
9
Posts
13
Years
  • Seen Sep 29, 2016
Hello:) I try to make a hack with Fire red using Advanced map and XSE, however I have for a long time had some problems with the "applymovement" command. What I am trying to achieve is that the player and Oak is moving at the same time (like at the very start of the game), however there is only Proffessor Oak that is moving, and the player only moves like one tile, but then stops.. annyone knows why thios is happening or what I have done wrong? would apreciate some answers, and oh, sorry for kind of bad english..

here is my script:
Spoiler:


I also have to note that when the scrip is finished and I go back to talk to Oak, the player start moving instead of Oak.
 

Tenn Tenki

Awesome Dude
15
Posts
13
Years
I need help with this script. It is a givepokemon script but when I talk to the guy it just game freezes

Code:
'---------------
#org 0x2DD100
lockall
faceplayer
checkflag 0x828
if 0x1 goto 0x82DD134
msgbox 0x82DD13F MSG_NORMAL '"Detictive Obtain Charmander!"
givepokemon 0x4 0x5 0x3F 0x0 0x0 0x0
giveitem 0x32 0x5 MSG_OBTAIN
setflag 0x828
releaseall
end
'---------------
#org 0x2DD134
msgbox 0x82DD15E MSG_NORMAL '"No more!"
release
end

'---------
' Strings
'---------
#org 0x2DD13F
= Detictive Obtain Charmander!
#org 0x2DD15E
= No more!
 
5
Posts
14
Years
  • Seen Dec 4, 2011
Code:
'---------------
#org 0x2DD100
lock
faceplayer
checkflag 0x828
if 0x1 goto 0x82DD134
msgbox 0x82DD13F MSG_NORMAL '"Detictive Obtain Charmander!"
givepokemon 0x4 0x5 0x3F 0x0 0x0 0x0
giveitem 0x32 0x5 MSG_OBTAIN
setflag 0x828
release
end
'---------------
#org 0x2DD134
msgbox 0x82DD15E MSG_NORMAL '"No more!"
release
end

'---------
' Strings
'---------
#org 0x2DD13F
= Detictive Obtain Charmander!
#org 0x2DD15E
= No more!
 

SPG

Pyroblock
88
Posts
13
Years
  • Age 27
  • Seen May 4, 2013
I need help with this script. It is a givepokemon script but when I talk to the guy it just game freezes

Code:
'---------------
#org 0x2DD100
lockall
faceplayer
checkflag 0x828
if 0x1 goto 0x82DD134
msgbox 0x82DD13F MSG_NORMAL '"Detictive Obtain Charmander!"
givepokemon 0x4 0x5 0x3F 0x0 0x0 0x0
giveitem 0x32 0x5 MSG_OBTAIN
setflag 0x828
releaseall
end
'---------------
#org 0x2DD134
msgbox 0x82DD15E MSG_NORMAL '"No more!"
release
end
 
'---------
' Strings
'---------
#org 0x2DD13F
= Detictive Obtain Charmander!
#org 0x2DD15E
= No more!

what game are you using? if you are using fire red its all wrong welll when i do give pokemon its set up diffrently
 

0m3GA ARS3NAL

Im comin' home...
1,816
Posts
16
Years
I need help with this script. It is a givepokemon script but when I talk to the guy it just game freezes

Code:
'---------------
#dynamic 0x800000

#org @start
lockall
faceplayer
checkflag 0x828
if 0x1 goto @NO_MORE
msgbox 0xCHARMANDER_GET MSG_NORMAL
givepokemon 0x4 0x5 0x3F 0x0 0x0 0x0
giveitem 0x32 0x5 MSG_OBTAIN
setflag 0x828
releaseall
end
'---------------
#org @NO_MORE
msgbox NO_MORE_MSG MSG_NORMAL '"No more!"
release
end

'---------
' Strings
'---------
#org @CHARMANDER_GET
= Detictive Obtain Charmander!
#org NO_MORE_MSG
= No more!

Oh good lord the offset.

WHY oh WHY would you ever place a script THERE of all places.
Okay, you'll need a ROM that you HAVE NOT inserted this script already.
If you don't have one, oh well, you'll need to start over.
Okay look at the quote, I edited the offset for you, put the script in XSE and press compile.

Then choose the first offset given in the list, it'll be @start (In the compiler log)

Then go to A-MAP and give the script that offset.
 

naokichi

Dances with Dragonite
3
Posts
14
Years
  • Seen Jul 10, 2013
Infinite Loop

Sorry if I put this in the wrong section, but I'm new on this site and I'm still getting the hang of it.
Anyways, I have a script that continues to loop and I can't figure out why. Now I'm only a novice scripter, so the problem is probably obvious.
Heres my script:
HTML:
#dynamic 0x800035

#org @start
checkflag 0x1
if 0x1 goto @done
msgbox @talk 0x6
applymovement 0xFF @move
waitmovement 0x3
applymovement 0x3 @move1
waitmovement 0x3
applymovement 0x3 @move2
msgbox @talk1 0x6
applymovement 0x3 @move3
waitmovement 0x3
release
end

#org @done
clearflag 0x1
release
end

#org @talk
= Hey you!

#org @move
#raw 0x2
#raw 0xFE

#org @move1
#raw 0x3
#raw 0x62
#raw 0xFE

#org @move2
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0xFE

#org @talk1
= Why are you still in here?\pEverybody has already headed\nout into the town!\lHurry up and you might be able to\lcatch up with them.

#org @move3
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x0
#raw 0xFE

Thanks for the help!
 

destinedjagold

You can contact me in PC's discord server...
8,593
Posts
16
Years
  • Age 33
  • Seen Dec 23, 2023
I'm a total newbie; how do I script at all???
Please post download below?
I hope im not breaking rules there...

First you need your PKMN ROM, Advance Map, and scripting tool.
For the scripting tool, I would like to recommend HackMew's XSE.
You can get that tool in the Toolbox Section, along with the Advance Map.

Then, you need to read tutorials on how to script in the Tutorials section.
Since you are a beginner, you need to first look at the basics of scripting. After that, you can then move on to more advance methods of scripting.

If you want to learn how to script, then you need time and trial and error.
Don't rush on things.
 

SPG

Pyroblock
88
Posts
13
Years
  • Age 27
  • Seen May 4, 2013
how would i make a script for a boat to take me somewhere? like test say from pallet town to vridian city (its just an example) how would i set up the 2 scripts? i have done scripting before and its easy (for me) but i havent found any thing to do with a boat taking me some where! i looked at other scripts in the game and it confused me for the boat to take me somewhere in the game you would need a starter pokemon (in the game im making there is only 1) and the pokedex. first things first... is it even possible to do this (need two items to get on the boat) or can i only just use 1?
 

Nerketur

PokéScripter
104
Posts
13
Years
how would i make a script for a boat to take me somewhere? like test say from pallet town to vridian city (its just an example) how would i set up the 2 scripts? i have done scripting before and its easy (for me) but i havent found any thing to do with a boat taking me some where! i looked at other scripts in the game and it confused me for the boat to take me somewhere in the game you would need a starter pokemon (in the game im making there is only 1) and the pokedex. first things first... is it even possible to do this (need two items to get on the boat) or can i only just use 1?

I'm sure it's possible. Not sure what you mean by "How" you would set it up, but I'm pretty sure there are boat scripts in a few of the GBA games. I'd recommend looking there =)
 

SPG

Pyroblock
88
Posts
13
Years
  • Age 27
  • Seen May 4, 2013
I'm sure it's possible. Not sure what you mean by "How" you would set it up, but I'm pretty sure there are boat scripts in a few of the GBA games. I'd recommend looking there =)
looks like some one didnt read my post completly cuz i said i looked at the game, no im not being rude
 

Nerketur

PokéScripter
104
Posts
13
Years
looks like some one didnt read my post completly cuz i said i looked at the game, no im not being rude

I read the post (Twice, actually), but I don't understand the question. Personally, I haven't looked at the game, nor do I know which game you're speaking of. I don't know what you're looking for. You say "How do I do a boat script?" My response is "Look at the game." You say "I did." Well, since I am not knowledgeable about what you're looking for, I can't be of much (Or any) help, other than to say "Try it out and see. Experiment."

There are multiple types of "boat scripts" you could do, for example. Such as walking inside, as it goes from one place to the other, and opening doors to each "destination" based on a flag set. Or you might be wanting the "Player enters boat, we see boat driving away, and then reach destination where player walks out." type of thing.

So, if you would kindly elaborate, give as much detail as possible, and then I can help you better =)

PS: When I said "Look at the game", I meant explore, find out patterns, see what you know, tinker with it a bit. Not just "look" at it, and then say "This is confusing! D=". Through experimentation, one can learn a LOT faster than being told what to do.
 
9
Posts
13
Years
  • Seen May 23, 2011

I haven't tested this, but you could use "comparebanks"

Basically, iterate through all the pokemon in the party, buffer the name of the pokemon in the party with "bufferpartypokemon", and compare it with a buffer of Raticate and Rattata. Something like this:

Code:
#dynamic 0x800000
#org @start
countpokemon
copyvar 0x8000 LASTRESULT
subvar 0x8000 0x1
bufferpokemon 0x1 0x13
bufferpokemon 0x2 0x14
goto @loop

#org @loop
compare 0x8000 0x0 // While loop:
if B_<= goto @end  //while (0x8000 > 0) { 

//This is where we check the names
bufferpartypokemon 0x0 0x8000
comparebanks 0x0 0x1
if 0x1 call @remove
comparebanks 0x0 0x2
if 0x1 call @remove

// The end of the loop
subvar 0x8000 0x1 // 0x8000 = 0x8000 - 1
goto @loop        // }

#org @remove
//Code to remove the party pokemon goes here.
//Best to use "copyvar"
copyvar 0x8004 0x8000
callasm ASM_ROUTINE
goto @end

#org @end
end
As a note, there IS a special that will remove a pokemon (or all Pokemon) from your party, erasing it completely. I don't remember what the special is, but I also figure there would have to be one, cause you can "release" pokemon in the game.

You can also erase it manually. I wouldn't recommend it, but it's still possible. It would require what I call "Scripting in ASM without using ASM."

Okay I'm very confused...I tried integrating the code you posted but when I test it in game the screen just goes black. This is how I combined it.

Spoiler:


The screen turns black as soon as I hit yes. Sorry but I'm just really inexperienced.
 

SPG

Pyroblock
88
Posts
13
Years
  • Age 27
  • Seen May 4, 2013
I read the post (Twice, actually), but I don't understand the question. Personally, I haven't looked at the game, nor do I know which game you're speaking of. I don't know what you're looking for. You say "How do I do a boat script?" My response is "Look at the game." You say "I did." Well, since I am not knowledgeable about what you're looking for, I can't be of much (Or any) help, other than to say "Try it out and see. Experiment."

There are multiple types of "boat scripts" you could do, for example. Such as walking inside, as it goes from one place to the other, and opening doors to each "destination" based on a flag set. Or you might be wanting the "Player enters boat, we see boat driving away, and then reach destination where player walks out." type of thing.

So, if you would kindly elaborate, give as much detail as possible, and then I can help you better =)

PS: When I said "Look at the game", I meant explore, find out patterns, see what you know, tinker with it a bit. Not just "look" at it, and then say "This is confusing! D=". Through experimentation, one can learn a LOT faster than being told what to do.
oh crap... wow i left out some words XD said it in my mind but didnt come out when i was typing XD but when i read your post you said exactly what i needed!
"Player enters boat, we see boat driving away, and then reach destination where player walks out."
how would i do that? but you would need 2 items (well an item and a pokemon) to board like a pokedex and a mewtwo? (just for example)
 

Nerketur

PokéScripter
104
Posts
13
Years
oh crap... wow i left out some words XD said it in my mind but didnt come out when i was typing XD but when i read your post you said exactly what i needed! how would i do that? but you would need 2 items (well an item and a pokemon) to board like a pokedex and a mewtwo? (just for example)

Now we're getting somewhere. Ok. Basic format would be this (Not real code, here, just example outline):

  1. Hide the player sprite
  2. if the boat is all one tile, then just set it to walk left, (or right), until it goes offscreen (A "Person" event)
  3. Warp the player to the desired map
  4. Have a level script do the "come in" scene (Player arriving)
  5. (Optional) Hide Player again (I don't know if it stays hidden. I suppose it depends on your method.)
  6. show the player sprite, and have him walk out.
As for how to do all of this? I'm sure you can figure it out =P

Okay I'm very confused...I tried integrating the code you posted but when I test it in game the screen just goes black. This is how I combined it.

Spoiler:


The screen turns black as soon as I hit yes. Sorry but I'm just really inexperienced.

Well, in the original, you used "call" without using "return" when you "call" an address, it's like you're saying "Go here, temporarily, until I tell you to return" When you use "goto", you're saying "Go here permanently." It's as if the goto wasn't even there, the code just continues from the specified address. Code change in RED.

Note: I apologize for making that error in my "Something like" code. But I still think explaining the difference is important. =) ::goes back and corrects::
 
Last edited:
Status
Not open for further replies.
Back
Top