The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Fan Games > Binary ROM Hacking
Reload this Page Script Warp after choosing starter Pokémon

Notices
For all updates, view the main page.

Binary ROM Hacking Need a helping hand or just want to talk about binary ROM hacks? Get comments and answers to any ROM Hacking-related problems, questions or thoughts you have here.

Ad Content
Reply
 
Thread Tools
  #1   Link to this post, but load the entire thread.  
Old May 22nd, 2017 (1:38 PM). Edited May 26th, 2017 by Green Jerry.
Green Jerry's Avatar
Green Jerry Green Jerry is offline
 
Join Date: Mar 2017
Location: Brazil
Age: 20
Gender: Male
Posts: 54
I'm trying to make a script where the player gets warped to warp number 1 of Lavender Town upon choosing Charmander, Pikachu or Squirtle (these are the 3 starter Pokémon on one of my hacks), but I can't do it.

Can anyone help me?
Reply With Quote
  #2   Link to this post, but load the entire thread.  
Old May 23rd, 2017 (11:29 AM).
Teh Blazer's Avatar
Teh Blazer Teh Blazer is offline
Divider of Zero
 
Join Date: Feb 2009
Location: 'MERICA
Age: 27
Gender: Male
Nature: Relaxed
Posts: 776
Quote:
Originally Posted by Luansilva12 View Post
I'm trying to make a script where the player gets warped to warp number 1 of Lavender Town upon choosing Charmander, Pikachu or Squirtle (these are the 3 starter Pokémon on one of my hacks), but I can't do it.

Can anyone help me?
Post your original script and anything about that script when you try it in-game that you notice.
__________________
Being a hero is overrated anyways
Reply With Quote
  #3   Link to this post, but load the entire thread.  
Old May 23rd, 2017 (1:29 PM).
Green Jerry's Avatar
Green Jerry Green Jerry is offline
 
Join Date: Mar 2017
Location: Brazil
Age: 20
Gender: Male
Posts: 54
Quote:
Originally Posted by Teh Blazer
Post your original script and anything about that script when you try it in-game that you notice.
Code:
'---------------
#org 0x865000
lock
faceplayer
checkflag 0x999
if 0x1 goto 0x886506C
showpokepic 0x4 0xA 0x3
msgbox 0x8865077 MSG_YESNO '"So you want the fire Pokémon,\nCha..."
compare LASTRESULT 0x1
if 0x1 goto 0x8865027
hidepokepic
release
end

'---------------
#org 0x86506C
msgbox 0x88650F7 MSG_NORMAL '"Are you happy?"
release
end

'---------------
#org 0x865027
givepokemon 0x4 0x5 0x0 0x0 0x0 0x0
hidepokepic
fanfare 0x13E
msgbox 0x88650A3 MSG_KEEPOPEN '"[black_fr]You received Charmander!"
waitfanfare
closeonkeypress
setflag 0x999
msgbox 0x88650C1 MSG_YESNO '"[black_fr]Would you like to give a..."
compare LASTRESULT 0x1
if 0x1 call 0x8865065
msgbox 0x8865108 MSG_NORMAL '"Hope you like"
release
end

'---------------
#org 0x865065
call 0x81A74EB
return

'---------------
#org 0x1A74EB
fadescreen 0x1
special 0x9E
waitstate
return


'---------
' Strings
'---------
#org 0x865077
= So you want the fire Pokémon,\nCharmander?

#org 0x8650F7
= Are you happy?

#org 0x8650A3
= [black_fr]You received Charmander!

#org 0x8650C1
= [black_fr]Would you like to give a\nnickname to Charmander?

#org 0x865108
= Hope you like
And I also need to remove the "Are you happy?" and the "Hope you like" messages and the ball doesn't disappear when I pick the Pokémon.
Reply With Quote
  #4   Link to this post, but load the entire thread.  
Old May 23rd, 2017 (3:23 PM).
Teh Blazer's Avatar
Teh Blazer Teh Blazer is offline
Divider of Zero
 
Join Date: Feb 2009
Location: 'MERICA
Age: 27
Gender: Male
Nature: Relaxed
Posts: 776
Quote:
Originally Posted by Luansilva12 View Post
Code:
'---------------
#org 0x865000
lock
faceplayer
checkflag 0x999
if 0x1 goto 0x886506C
showpokepic 0x4 0xA 0x3
msgbox 0x8865077 MSG_YESNO '"So you want the fire Pokémon,\nCha..."
compare LASTRESULT 0x1
if 0x1 goto 0x8865027
hidepokepic
release
end

'---------------
#org 0x86506C
msgbox 0x88650F7 MSG_NORMAL '"Are you happy?"
release
end

'---------------
#org 0x865027
givepokemon 0x4 0x5 0x0 0x0 0x0 0x0
hidepokepic
fanfare 0x13E
msgbox 0x88650A3 MSG_KEEPOPEN '"[black_fr]You received Charmander!"
waitfanfare
closeonkeypress
setflag 0x999
msgbox 0x88650C1 MSG_YESNO '"[black_fr]Would you like to give a..."
compare LASTRESULT 0x1
if 0x1 call 0x8865065
msgbox 0x8865108 MSG_NORMAL '"Hope you like"
release
end

'---------------
#org 0x865065
call 0x81A74EB
return

'---------------
#org 0x1A74EB
fadescreen 0x1
special 0x9E
waitstate
return


'---------
' Strings
'---------
#org 0x865077
= So you want the fire Pokémon,\nCharmander?

#org 0x8650F7
= Are you happy?

#org 0x8650A3
= [black_fr]You received Charmander!

#org 0x8650C1
= [black_fr]Would you like to give a\nnickname to Charmander?

#org 0x865108
= Hope you like
And I also need to remove the "Are you happy?" and the "Hope you like" messages and the ball doesn't disappear when I pick the Pokémon.
That's a pretty good script so far, I'd just say that in Fire Red the only "safe" flags to use are between 200-2FF and anything like the 999 you used could already be used in the game for something else.

If you want the pokeball to disappear, you'll have to put in "hidesprite 0x[whatever the ID is of the pokeball]" and "setflag 0x[whatever flag you want to give the pokeball]" right before the fanfare 0x13E you play. If you're unsure why, look at the pokeballs in the vanilla Fire Red ROM and copy how gamefreak does it there.

Warping at the end is really easy, just put "warp 0x3 0x4 0x1 0x0 0x0" at the end of your script before the "release" and "end". It'll warp the player at the end of the script but without proper context it'll probably look a little weird. I'm not sure what you're planning but adding that will make the script act like normal and just teleport the player.
__________________
Being a hero is overrated anyways
Reply With Quote
  #5   Link to this post, but load the entire thread.  
Old May 24th, 2017 (10:20 AM).
Green Jerry's Avatar
Green Jerry Green Jerry is offline
 
Join Date: Mar 2017
Location: Brazil
Age: 20
Gender: Male
Posts: 54
I got the warping and the ball disappear to work, but the player gets warped to this instead:


The edited script:
Code:
'---------------
#org 0x880000
lock
faceplayer
checkflag 0x999
if 0x1 goto 0x888006C
showpokepic 0x4 0xA 0x3
msgbox 0x8880077 MSG_YESNO '"So you want the fire Pokémon,\nCha..."
compare LASTRESULT 0x1
if 0x1 goto 0x8880027
hidepokepic
release
end

'---------------
#org 0x880027
givepokemon 0x4 0x5 0x0 0x0 0x0 0x0
hidepokepic
hidesprite LASTTALKED
setflag 0x828
setflag 0x291
fanfare 0x13E
msgbox 0x88800A3 MSG_KEEPOPEN '"[black_fr]You received Charmander!"
waitfanfare
closeonkeypress
setflag 0x999
msgbox 0x88800C1 MSG_YESNO '"[black_fr]Would you like to give a..."
compare LASTRESULT 0x1
if 0x1 call 0x8880065
warp 0x3 0x4 0xFF 0x6 0x7
release
end

'---------------
#org 0x880065
call 0x81A74EB
return

'---------------
#org 0x1A74EB
fadescreen 0x1
special 0x9E
waitstate
return

'---------
' Strings
'---------
#org 0x880077
= So you want the fire Pokémon,\nCharmander?

#org 0x8800A3
= [black_fr]You received Charmander!

#org 0x8800C1
= [black_fr]Would you like to give a\nnickname to Charmander?
And if I compile the script, "warp 0x3 0x4 0xFF 0x6 0x7" changes into "warp 0x3 0x4 0xEB 0x1A74 0x308"!
Reply With Quote
  #6   Link to this post, but load the entire thread.  
Old May 25th, 2017 (4:11 PM).
Green Jerry's Avatar
Green Jerry Green Jerry is offline
 
Join Date: Mar 2017
Location: Brazil
Age: 20
Gender: Male
Posts: 54
Anyone?
Reply With Quote
  #7   Link to this post, but load the entire thread.  
Old May 26th, 2017 (8:57 AM).
Spherical Ice's Avatar
Spherical Ice Spherical Ice is online now
 
Join Date: Nov 2007
Location: Leicester, UK
Age: 25
Posts: 5,251
Your script is overwriting itself. You just need to refactor it, and then recompile: XSE has a built-in function for this, which you can access using Ctrl + D and checking Apply refactoring.
__________________
Reply With Quote
  #8   Link to this post, but load the entire thread.  
Old May 26th, 2017 (9:25 AM).
Green Jerry's Avatar
Green Jerry Green Jerry is offline
 
Join Date: Mar 2017
Location: Brazil
Age: 20
Gender: Male
Posts: 54
Quote:
Originally Posted by Spherical Ice View Post
Your script is overwriting itself. You just need to refactor it, and then recompile: XSE has a built-in function for this, which you can access using Ctrl + D and checking Apply refactoring.
I refactored and compiled the script but it's still warping to the wrong location.
I refactored to $900000.
Reply With Quote
  #9   Link to this post, but load the entire thread.  
Old May 26th, 2017 (9:52 AM).
Spherical Ice's Avatar
Spherical Ice Spherical Ice is online now
 
Join Date: Nov 2007
Location: Leicester, UK
Age: 25
Posts: 5,251
Quote:
Originally Posted by Luansilva12 View Post
I refactored and compiled the script but it's still warping to the wrong location.
I refactored to $900000.
Post the refactored script?
__________________
Reply With Quote
  #10   Link to this post, but load the entire thread.  
Old May 26th, 2017 (10:01 AM).
Green Jerry's Avatar
Green Jerry Green Jerry is offline
 
Join Date: Mar 2017
Location: Brazil
Age: 20
Gender: Male
Posts: 54
Code:
#dynamic 0x900000

'---------------
#org @start
lock
faceplayer
checkflag 0x999
if 0x1 goto @snippet1
showpokepic 0x4 0xA 0x3
msgbox @string1 MSG_YESNO '"So you want the fire Pokémon,\nCha..."
compare LASTRESULT 0x1
if 0x1 goto @snippet2
hidepokepic
release
end

'---------------
#org @snippet1
end

'---------------
#org @snippet2
givepokemon 0x4 0x5 0x0 0x0 0x0 0x0
hidepokepic
hidesprite LASTTALKED
setflag 0x828
setflag 0x291
fanfare 0x13E
msgbox @string2 MSG_KEEPOPEN '"[black_fr]You received Charmander!"
waitfanfare
closeonkeypress
setflag 0x999
msgbox @string3 MSG_YESNO '"[black_fr]Would you like to give a..."
compare LASTRESULT 0x1
if 0x1 call @snippet3
warp 0x3 0x4 0xEB 0x1A74 0x308
release
end

'---------------
#org @snippet3
call @snippet4
return

'---------------
#org @snippet4
fadescreen 0x1
special 0x9E
waitstate
return


'---------
' Strings
'---------
#org @string1
= So you want the fire Pokémon,\nCharmander?

#org @string2
= [black_fr]You received Charmander!

#org @string3
= [black_fr]Would you like to give a\nnickname to Charmander?
Reply With Quote
  #11   Link to this post, but load the entire thread.  
Old May 26th, 2017 (11:03 AM).
Trev's Avatar
Trev Trev is offline
i gave you everything...
 
Join Date: May 2012
Age: 26
Gender: Male
Nature: Sassy
Posts: 1,505
Quote:
Originally Posted by Luansilva12 View Post
Code:
#dynamic 0x900000

'---------------
#org @start
lock
faceplayer
checkflag 0x999
if 0x1 goto @snippet1
showpokepic 0x4 0xA 0x3
msgbox @string1 MSG_YESNO '"So you want the fire Pokémon,\nCha..."
compare LASTRESULT 0x1
if 0x1 goto @snippet2
hidepokepic
release
end

'---------------
#org @snippet1
end

'---------------
#org @snippet2
givepokemon 0x4 0x5 0x0 0x0 0x0 0x0
hidepokepic
hidesprite LASTTALKED
setflag 0x828
setflag 0x291
fanfare 0x13E
msgbox @string2 MSG_KEEPOPEN '"[black_fr]You received Charmander!"
waitfanfare
closeonkeypress
setflag 0x999
msgbox @string3 MSG_YESNO '"[black_fr]Would you like to give a..."
compare LASTRESULT 0x1
if 0x1 call @snippet3
warp 0x3 0x4 0xEB 0x1A74 0x308
release
end

'---------------
#org @snippet3
call @snippet4
return

'---------------
#org @snippet4
fadescreen 0x1
special 0x9E
waitstate
return


'---------
' Strings
'---------
#org @string1
= So you want the fire Pokémon,\nCharmander?

#org @string2
= [black_fr]You received Charmander!

#org @string3
= [black_fr]Would you like to give a\nnickname to Charmander?
Your warp command is all kinds of wrong. Here's your's:

Code:
warp 0x3 0x4 0xEB 0x1A74 0x308
Here's mine:

Code:
warp 0x3 0x4 0x1 0x6 0x5
I don't know where the hell you were warping to on that map or how big it is, but this command should take you to warp 1 regardless. You might need to change the two coordinates to match up with your warp 1 (which shouldn't be 0x1A74 and 0x308).

Also, you have setflag 0x999 in you script still. You need to be using a flag from the range 200 - 2FF. Flag 999 will not work under any circumstance because it's outside of the usable range of flags and will accessed data that shouldn't be accessed in scripts. Change it immediately.
Reply With Quote
  #12   Link to this post, but load the entire thread.  
Old May 26th, 2017 (11:14 AM).
Green Jerry's Avatar
Green Jerry Green Jerry is offline
 
Join Date: Mar 2017
Location: Brazil
Age: 20
Gender: Male
Posts: 54
I've deleted that flag 999 from the script and it's solved now.
Reply With Quote
Reply

Quick Reply

Join the conversation!

Create an account to post a reply in this thread, participate in other discussions, and more!

Create a PokéCommunity Account
Ad Content
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 9:14 AM.