Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
Our weekly protagonist poll is now up! Vote for your favorite Trading Card Game 2 protagonist in the poll by clicking here.
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.
If this script is only meant to run once, you don't need the countpokemon/compare bits. Once the variable is set that part won't run at all anyway (the variable should be 0x4050 by the way, not 4050).
In terms of actual commands - lock/lockall should come first in your script, before the applymovements. You don't need faceplayer as this is a script tile, not a person event. Your msgbox @talk2 should be box 0x4 not 0x6 - as that one stays open until closeonkeypress.
Oh and your givepokemon says lv 8 rather than lv 9 - guess that's a typo!
So I'm trying to make a warp script that makes you use an item when warped, but I really have no idea how.. I want it to use a key item. Here is my working warp script so far (using XSE) :
Spoiler:
#dynamic 0x800000
#org @start
warp 0x4 0x0 0xFF 0x2 0x3
end
Yeah, its a super simple script so far. So, is there any way I can make it to where a key item (bike for example) is activated after being warped? Please help! :(
Well, I realized I don't need any of that.. All I need to do is call the bikes routine in my script, right? I checked 2 different item editors for its routine location, which is at 0x0A122D. And I know it has to be it because if you call an offset with no routine it just freezes. I didn't add a one on the end cause I didn't think you would have to since thats the offset it gave me. I called it in a script, and when I activated it in game, the screen just fades to black (doesnt freeze, music still plays, just fades black). My guess is because I didn't put the other required commands in the script that I would probably need (like vars or flags or something) but I don't know what :(
Could someone please tell me what I might be doing wrong, or what to add to my script? Its urgent! ;'( My script so far is literally just:
Well, I realized I don't need any of that.. All I need to do is call the bikes routine in my script, right? I checked 2 different item editors for its routine location, which is at 0x0A122D. And I know it has to be it because if you call an offset with no routine it just freezes. I didn't add a one on the end cause I didn't think you would have to since thats the offset it gave me. I called it in a script, and when I activated it in game, the screen just fades to black (doesnt freeze, music still plays, just fades black). My guess is because I didn't put the other required commands in the script that I would probably need (like vars or flags or something) but I don't know what :(
Could someone please tell me what I might be doing wrong, or what to add to my script? Its urgent! ;'( My script so far is literally just:
It depends on what item you want to activate and what it's supposed to do. If you wanted the player to appear on his bike after the warp, you would use a header script with special 0x157 (for Fire Red). Is that what you want? For the player to appear on his bike after he is warped?
Edit: To do that, you would need to make a script that sets a variable before the warp. Say, setvar 0x5000 0x1.
Be sure to save a backup of your rom before you do any of this.
or something like that (don't forget the waitstate).
Then you will need a seperate header script in the map you are warping the player to. In the header of the map, go to Map Script and add 02 Validates values ...
Flag is your var #, in my example 5000 and value is 0001 in my example. You would need a second script like:
Code:
lock
special 0x157
setvar 0x5000 0x2
release
end
And you would put the offset to that script in the section that says Script Offset 2.
Lastly you need to fix the script's first offset, because A-Map has a glitch with headers when it compiles them. I use a Hex Editor because my XSE doesn't decompile the script right for me. In a Hex Editor navigate to the script offset 1 for your header.
Your data should be about 28 #'s long if I'm not mistaken and at the end you should see some F's. Change the first four F's you see to 0's. Save and test your script.
I have used a bunch of different vars/flags that the document says are unsafe, and they seem to usually end up with creation of bad eggs, which isn't ideal, but I haven't found anything game breaking. I didn't remember which ones I used (I only documented using various ones through 6000 -7100 so far), and I don't recall what happens when you use 0x5000, so I can't say if you're exaggerating when you say it should be avoided at all costs.
Edit: Actually, I have used var 5000 in my game, early on in Viridian City. I have not really found any ill effects from using it. Maybe the creation of a bad egg, idk, but I wouldn't say avoid it all costs. From what I've seen, it hasn't caused any real damage to the game.
It depends on what item you want to activate and what it's supposed to do. If you wanted the player to appear on his bike after the warp, you would use a header script with special 0x157 (for Fire Red). Is that what you want? For the player to appear on his bike after he is warped?
Edit: To do that, you would need to make a script that sets a variable before the warp. Say, setvar 0x5000 0x1.
Be sure to save a backup of your rom before you do any of this.
or something like that (don't forget the waitstate).
Then you will need a seperate header script in the map you are warping the player to. In the header of the map, go to Map Script and add 02 Validates values ...
Flag is your var #, in my example 5000 and value is 0001 in my example. You would need a second script like:
Code:
lock
special 0x157
setvar 0x5000 0x2
release
end
And you would put the offset to that script in the section that says Script Offset 2.
Lastly you need to fix the script's first offset, because A-Map has a glitch with headers when it compiles them. I use a Hex Editor because my XSE doesn't decompile the script right for me. In a Hex Editor navigate to the script offset 1 for your header.
Your data should be about 28 #'s long if I'm not mistaken and at the end you should see some F's. Change the first four F's you see to 0's. Save and test your script.
After quite a long process... I got it to work! There is only one problem I'm wondering if you know the answer to. When I warp, I appear as my normal overworld for about half a second THEN hop on the bike. I'm trying to make it so that when you appear in the new location, you're there on your bike. How could I do this? Would I have to change the order of the scripts or something to make the bike come first? I used the exact same scripts you used, by the way. Only thing I changed was the var 5001, since it wouldn't work unless both scripts were the same var (I used 5000 on both).
For this script, the issue is that the nicknaming portion (#org @name) just brings up a bunch of weird text that doesn't make any sense. If you avoid nicknaming the Pokemon, the script will continue on with the professor and Milton going through the door and hiding away to give off the illusion that they went into the lab. This is the huge issue I am having. Rather than having the main character walk to the doors and warp inside the lab, he instantly warps to the map location and appears on the outside of the building, not even the inside. Does anyone know how to fix this? (Also, I tried to make a script happen off of interacting with a Poke-Ball instead of stepping on a script tile. If that is the issue, than how do I make long scripts like this happen off of interacting with a Poke-Ball?)
Spoiler:
#dynamic 0x801F3E
#org @start
checkflag 0x203
if 0x1 goto @done
msgbox @1 0x5
compare 0x800D 0x1
if 0x1 goto @take
msgbox @2 0x6
release
end
#org @1
= Prof. Karri: Oh, you would like to\npick the grass Pokemon,\p[lightgreen_fr]Bulbasaur?
#org @2
release
end
#org @3
= [lightgreen_fr]You received a Bulbasaur!
#org @4
= [lightgreen_fr]Would you like to give a\nnickname to Bulbasaur?
#org @5
= Prof. Karri: Make sure you take\ngood care of that [lightgreen_fr]Bulbasaur.\pNow that you have chosen your\nPokemon, let's go inside so that\pI can show you around.
After quite a long process... I got it to work! There is only one problem I'm wondering if you know the answer to. When I warp, I appear as my normal overworld for about half a second THEN hop on the bike. I'm trying to make it so that when you appear in the new location, you're there on your bike. How could I do this? Would I have to change the order of the scripts or something to make the bike come first? I used the exact same scripts you used, by the way. Only thing I changed was the var 5001, since it wouldn't work unless both scripts were the same var (I used 5000 on both).
I would actually maybe try changing it to 04 validates values ... in the header first. I think 04 does things more instantly, but doesn't execute full scripts or something, so this one should work with it. Let me know if that works.
I would actually maybe try changing it to 04 validates values ... in the header first. I think 04 does things more instantly, but doesn't execute full scripts or something, so this one should work with it. Let me know if that works.
Hmm... When changing the 02 to 04 setting, when I go on the warp it just gives me a black sceeen when warping into the house. But the palette town music still plays... Any idea?
Hmm... When changing the 02 to 04 setting, when I go on the warp it just gives me a black sceeen when warping into the house. But the palette town music still plays... Any idea?
It should work. It's basically the same thing it does in Fire Red to put you on the bike automatically when you are on the bike path. I'd make sure the FF's at the end of the line of data didn't make a re-appearance for Script offset 1, and make sure it ends with four 0's.
Edit:
And to make sure everything is correct, if you open the offset for script offset 1 in XSE and go to Tools > Hex Viewer, it should look like this if you are using 0x5001 ...
Code:
01 50 00 00 XX XX XX 08 00 00
With the X's being numbers that equate (reversed) to the offset for your script.
It should work. It's basically the same thing it does in Fire Red to put you on the bike automatically when you are on the bike path. I'd make sure the FF's at the end of the line of data didn't make a re-appearance for Script offset 1, and make sure it ends with four 0's.
Edit:
And to make sure everything is correct, if you open the offset for script offset 1 in XSE and go to Tools > Hex Viewer, it should look like this if you are using 0x5001 ...
Code:
01 50 00 00 XX XX XX 08 00 00
With the X's being numbers that equate (reversed) to the offset for your script.
Well I checked script 1's offset in a hex editor, and the 0's were still there. So then I checked it in XSE, and the hex was all correct, except instead of: 01 50 00 00 at the beginning like you said, it was 01 50 01 00. There was an 01 after the 50. But im guessing its because 50+01= 5001, my var #. Idk what could be the problem..
Well I checked script 1's offset in a hex editor, and the 0's were still there. So then I checked it in XSE, and the hex was all correct, except instead of: 01 50 00 00 at the beginning like you said, it was 01 50 01 00. There was an 01 after the 50. But im guessing its because 50+01= 5001, my var #. Idk what could be the problem..
Actually, that 01 is for the variable's value, which is correct, since we want it to only activate when variable 0x5001 is set to 0001. I had just forgotten. Honestly I'm not sure what could be causing it to not work. Try to recompile the script without the lock and release commands. That could be screwing it up and probably isn't necessary for the 04 script.
Actually, that 01 is for the variable's value, which is correct, since we want it to only activate when variable 0x5001 is set to 0001. I had just forgotten. Honestly I'm not sure what could be causing it to not work. Try to recompile the script without the lock and release commands. That could be screwing it up and probably isn't necessary for the 04 script.
Oh my gosh! This did it, it was because of those two commands! The script works perfectly now, the bike appears instantly after the warp is done! All I need to fix is the fact that the overworld faces forward down when warped, but of course he needs to be facing up (this could easily be done with applymovement though).
Again, thank you soo much for your help!
Oh my gosh! This did it, it was because of those two commands! The script works perfectly now, the bike appears instantly after the warp is done! All I need to fix is the fact that the overworld faces forward down when warped, but of course he needs to be facing up (this could easily be done with applymovement though).
Again, thank you soo much for your help!
If this script is only meant to run once, you don't need the countpokemon/compare bits. Once the variable is set that part won't run at all anyway (the variable should be 0x4050 by the way, not 4050).
The flag you're setting for your hidesprite command is way too high.
In terms of actual commands - lock/lockall should come first in your script, before the applymovements. You don't need faceplayer as this is a script tile, not a person event. Your msgbox @talk2 should be box 0x4 not 0x6 - as that one stays open until closeonkeypress.
Oh and your givepokemon says lv 8 rather than lv 9 - guess that's a typo!
I am using Jpan's Hacked Engine, I used the IPS instead of the tool so I should have everything, if that matters. I was attempting to add the regular Oak's Lab starter scripts in, nearly the same as they are in the original game. But I'm running into a problem where after you look at your Pokemon's stats/after you battle Gary, the game glitches up. Your sprite can't move, but the camera can pan one spot left and one spot right. Furthermore, the sprites get all messed up. Oak's sprite changes into one of his aides, gary becomes the pokedex, the pokedexes get hair on their top, weird image stuff like that.
I tested out taking away the script where Gary battles you so I can leave the lab. Once I'm out of the lab, I can look at my Pokemon's stats and battle wild Pokemon without anything happening. But even without that battle trap script in the lab, if I look at Pokemon while in Oak's lab, the game does that glitch. This leads me to believe it has something to do with the level scripts triggered on entering the lab, but those are almost copied directly from the original game as well.
Anyhow, here are the scripts on Pksv:
Spoiler:
Script 0:
Type: On entering map/not on menu close
#org 0x8750820
'-----------------------------------
setflag 0x2CF 'Flag for entering lab, coded into original game
compare 0x4055 0x1 'var set to 1 when oak stops you from entering grass, moves to 2 when have to choose a starter, 3 for battle, etc. Same as original game
if == call 0x875082F
end
#org 0x875082F
'-----------------------------------
movesprite2 0x4 0x6 0xB 'sprite 0x4 is Oak
spritebehave 0x4 0x7
playsong 0x12E
return
#org 0x87508B1
= \v\h06: Gramps!\nI'm fed up with waiting!
#org 0x87508D6
= Oak: \v\h06?\nLet me think[.]\pOh, that's right, I told you to\ncome! Just wait!\pHere, \v\h01.\pThere are three Pok\emon here.\pHaha!\pThe Pok\emon are held inside\nthese Pok\e Balls.\pWhen I was young, I was a serious\nPok\emon Trainer.\pBut now, in my old age, I have\nonly these three left.\pYou can have one.\nGo on, choose!
#org 0x8750A04
= \v\h06: Hey! Gramps! No fair!\nWhat about me?
#org 0x8750A2D
= Oak: Be patient, \v\h06.\nYou can have one, too!
#org 0x8750A59
M walk_up walk_up walk_up walk_up walk_up walk_up end
#org 0x8750A60
M walk_up walk_up walk_up walk_up walk_up walk_up walk_up walk_up end
#org 0x8750A69
M look_up_delayed end
#org 0x8750A6B
M onspot_up onspot_up end
And that's it. Any idea of what could be wrong?
Also, I used professional header view to get the map script offset, decompile it, and change the 0xFFFF to 0x0. So it isn't that. Thanks in advance!
Sorry guys I'm back again. I scripted my first trainer battle this evening, and for some reason, XSE keeps adding the number '8' on to the beginning of my offsets.
I am using Jpan's Hacked Engine, I used the IPS instead of the tool so I should have everything, if that matters. I was attempting to add the regular Oak's Lab starter scripts in, nearly the same as they are in the original game. But I'm running into a problem where after you look at your Pokemon's stats/after you battle Gary, the game glitches up. Your sprite can't move, but the camera can pan one spot left and one spot right. Furthermore, the sprites get all messed up. Oak's sprite changes into one of his aides, gary becomes the pokedex, the pokedexes get hair on their top, weird image stuff like that.
I tested out taking away the script where Gary battles you so I can leave the lab. Once I'm out of the lab, I can look at my Pokemon's stats and battle wild Pokemon without anything happening. But even without that battle trap script in the lab, if I look at Pokemon while in Oak's lab, the game does that glitch. This leads me to believe it has something to do with the level scripts triggered on entering the lab, but those are almost copied directly from the original game as well.
Anyhow, here are the scripts on Pksv:
Spoiler:
Script 0:
Type: On entering map/not on menu close
#org 0x8750820
'-----------------------------------
setflag 0x2CF 'Flag for entering lab, coded into original game
compare 0x4055 0x1 'var set to 1 when oak stops you from entering grass, moves to 2 when have to choose a starter, 3 for battle, etc. Same as original game
if == call 0x875082F
end
#org 0x875082F
'-----------------------------------
movesprite2 0x4 0x6 0xB 'sprite 0x4 is Oak
spritebehave 0x4 0x7
playsong 0x12E
return
#org 0x87508B1
= \v\h06: Gramps!\nI'm fed up with waiting!
#org 0x87508D6
= Oak: \v\h06?\nLet me think[.]\pOh, that's right, I told you to\ncome! Just wait!\pHere, \v\h01.\pThere are three Pok\emon here.\pHaha!\pThe Pok\emon are held inside\nthese Pok\e Balls.\pWhen I was young, I was a serious\nPok\emon Trainer.\pBut now, in my old age, I have\nonly these three left.\pYou can have one.\nGo on, choose!
#org 0x8750A04
= \v\h06: Hey! Gramps! No fair!\nWhat about me?
#org 0x8750A2D
= Oak: Be patient, \v\h06.\nYou can have one, too!
#org 0x8750A59
M walk_up walk_up walk_up walk_up walk_up walk_up end
#org 0x8750A60
M walk_up walk_up walk_up walk_up walk_up walk_up walk_up walk_up end
#org 0x8750A69
M look_up_delayed end
#org 0x8750A6B
M onspot_up onspot_up end
And that's it. Any idea of what could be wrong?
Also, I used professional header view to get the map script offset, decompile it, and change the 0xFFFF to 0x0. So it isn't that. Thanks in advance!
Sorry guys I'm back again. I scripted my first trainer battle this evening, and for some reason, XSE keeps adding the number '8' on to the beginning of my offsets.
It's not something wrong. "0x8" signifies that the offset is in the ROM. XSE, when it's decompiling scripts, doesn't check and remove the starting "08" prefix (and it really shouldn't anyways).
EDIT: Also you cannot use trainer battles in the way you are using it. Try trainerbattle 0x1 0xE 0x0 instead. Also, if you're using that:
Code:
trainerbattle 0x1 0xID 0x0 @begin @lost @after
release
end
Where @after will be a script that is run after the battle (rather than a string). Look at Gym leader's scripts and you'll see what I mean.