The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Fan Games > Binary ROM Hacking
Reload this Page Other Script not working as it should

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 July 18th, 2014 (12:46 PM).
Huy567's Avatar
Huy567 Huy567 is offline
The Shadow Feather
 
Join Date: Jul 2014
Location: Texas, US
Gender: Male
Posts: 20
So I'm writing a script where if the player steps on a green S tile with a script, then a person event rushes up to them, says some stuff, then battles them, and leaves. I wanted the person event to be hidden until the script is activated (to make it seem like they were coming from afar) and I also want the person to be hidden after the script is done. This is what is have and it doesn't work. The script just freezes.

Spoiler:
'---------------
#org 0x800000
checkflag 0x8C3
if 0x1 goto 0x8800041
msgbox 0x8800047 MSG_KEEPOPEN '"Hey, À! Wait up!"
applymovement MOVE_PLAYER 0x8800043
waitmovement 0x0
applymovement 0x3 0x880005A
waitmovement 0x0
msgbox 0x8800066 MSG_NORMAL '"I'm glad I caught up to you!\nSo y..."
trainerbattle 0x1 0x142 0x0 0x8800135 0x8800153 0x8800175
end

'---------------
#org 0x800041
end

'---------------
#org 0x800175
msgbox 0x8800186 MSG_NORMAL '"Well, you are still amazing as\nev..."
applymovement 0x3 0x880022D
end


'---------
' Strings
'---------
#org 0x800047
= Hey, À! Wait up!

#org 0x800066
= I'm glad I caught up to you!\nSo you're this far ahead already?!\pWell, the reason I was behind was\nbecause I wanted to tell Mom bye.\p...You should have done it too.\pHey, is that your Pokémon?\nLet's battle!

#org 0x800135
= You're going down, brother!

#org 0x800153
= Of course, you just had to win.

#org 0x800186
= Well, you are still amazing as\never...\pI'm planning to go to Jikan Town\nnow, but I got to take care of\lsome things back at Yuki Town.\pAlright, well catch you later!


'-----------
' Movements
'-----------
#org 0x800043
#raw 0x4 'Face Down (Faster)
#raw 0x65 'Double Exclamation Mark (!!)
#raw 0xFE 'End of Movements

#org 0x80005A
#raw 0x61 'Show
#raw 0x1E 'Step Up (Fast)
#raw 0x1E 'Step Up (Fast)
#raw 0x1E 'Step Up (Fast)
#raw 0x1E 'Step Up (Fast)
#raw 0x1E 'Step Up (Fast)
#raw 0x1E 'Step Up (Fast)
#raw 0x1E 'Step Up (Fast)
#raw 0x53 'Jump in Place (Facing Up)
#raw 0x66 'Happy (^_^)
#raw 0xFE 'End of Movements

#org 0x80022D
#raw 0x0 'Face Down
#raw 0x17 'Jump2 Right
#raw 0x16 'Jump2 Left
#raw 0x4 'Face Down (Faster)
#raw 0x64 'Cross (X)
#raw 0x52 'Jump in Place (Facing Down)
#raw 0xC 'Step Down (Slow)
#raw 0xC 'Step Down (Slow)
#raw 0xC 'Step Down (Slow)
#raw 0xC 'Step Down (Slow)
#raw 0xC 'Step Down (Slow)
#raw 0xC 'Step Down (Slow)
#raw 0xC 'Step Down (Slow)
#raw 0x60 'Hide
#raw 0xFE 'End of Movements


I also included the pictures of it in advance map, in case there was something wrong there.
Attached Images
File Type: png Untitled.png‎ (21.5 KB, 11 views) (Save to Dropbox)
File Type: png jkjdg.png‎ (18.4 KB, 10 views) (Save to Dropbox)
Reply With Quote
  #2   Link to this post, but load the entire thread.  
Old July 18th, 2014 (3:33 PM).
JosefigGaming's Avatar
JosefigGaming JosefigGaming is offline
 
Join Date: May 2013
Location: Portugal
Age: 23
Gender: Male
Posts: 287
Quote:
Originally Posted by Huy567 View Post
So I'm writing a script where if the player steps on a green S tile with a script, then a person event rushes up to them, says some stuff, then battles them, and leaves. I wanted the person event to be hidden until the script is activated (to make it seem like they were coming from afar) and I also want the person to be hidden after the script is done. This is what is have and it doesn't work. The script just freezes.

Spoiler:
'---------------
#org 0x800000
checkflag 0x8C3
if 0x1 goto 0x8800041
msgbox 0x8800047 MSG_KEEPOPEN '"Hey, À! Wait up!"
applymovement MOVE_PLAYER 0x8800043
waitmovement 0x0
applymovement 0x3 0x880005A
waitmovement 0x0
msgbox 0x8800066 MSG_NORMAL '"I'm glad I caught up to you!\nSo y..."
trainerbattle 0x1 0x142 0x0 0x8800135 0x8800153 0x8800175
end

'---------------
#org 0x800041
end

'---------------
#org 0x800175
msgbox 0x8800186 MSG_NORMAL '"Well, you are still amazing as\nev..."
applymovement 0x3 0x880022D
end


'---------
' Strings
'---------
#org 0x800047
= Hey, À! Wait up!

#org 0x800066
= I'm glad I caught up to you!\nSo you're this far ahead already?!\pWell, the reason I was behind was\nbecause I wanted to tell Mom bye.\p...You should have done it too.\pHey, is that your Pokémon?\nLet's battle!

#org 0x800135
= You're going down, brother!

#org 0x800153
= Of course, you just had to win.

#org 0x800186
= Well, you are still amazing as\never...\pI'm planning to go to Jikan Town\nnow, but I got to take care of\lsome things back at Yuki Town.\pAlright, well catch you later!


'-----------
' Movements
'-----------
#org 0x800043
#raw 0x4 'Face Down (Faster)
#raw 0x65 'Double Exclamation Mark (!!)
#raw 0xFE 'End of Movements

#org 0x80005A
#raw 0x61 'Show
#raw 0x1E 'Step Up (Fast)
#raw 0x1E 'Step Up (Fast)
#raw 0x1E 'Step Up (Fast)
#raw 0x1E 'Step Up (Fast)
#raw 0x1E 'Step Up (Fast)
#raw 0x1E 'Step Up (Fast)
#raw 0x1E 'Step Up (Fast)
#raw 0x53 'Jump in Place (Facing Up)
#raw 0x66 'Happy (^_^)
#raw 0xFE 'End of Movements

#org 0x80022D
#raw 0x0 'Face Down
#raw 0x17 'Jump2 Right
#raw 0x16 'Jump2 Left
#raw 0x4 'Face Down (Faster)
#raw 0x64 'Cross (X)
#raw 0x52 'Jump in Place (Facing Down)
#raw 0xC 'Step Down (Slow)
#raw 0xC 'Step Down (Slow)
#raw 0xC 'Step Down (Slow)
#raw 0xC 'Step Down (Slow)
#raw 0xC 'Step Down (Slow)
#raw 0xC 'Step Down (Slow)
#raw 0xC 'Step Down (Slow)
#raw 0x60 'Hide
#raw 0xFE 'End of Movements


I also included the pictures of it in advance map, in case there was something wrong there.
I'm not sure about Emerald flags, but 8c3 may not be a safe flag
Even if it is, has it been set before on some script? If so, the script will go to a string that only has end, and not release, so that may be it
Also, if you wanted for the script to only happen once, at the end you should put setflag 0x8c3
That way next time the hero steps on the script tile, the script wouldnt occur (or just use setvar 0x4050 0x1)
Now for the sprite staying beggining and finishing the script hidden
Well, in the person ID box on A-Map, you put the number of a flag that's alreadt set
You could use:
A. a flag you set before on the game
B. a flag set by the game engine (I have a list for fire red, but not for emerald, sorry)
That way the sprite doesn't show up
If you wanted to make it appear you'd use the command "showsprite" and to re-disappear "hidesprite"
Let me know if my comment helped you on any way :)
__________________
Working on:


#fasterSneasel :D (nohomo)

Coolest IRC with the coolest people in the coolest rooms:
http://chat.linkandzelda.com:9090/?channels=romhacking,gogo,discovery,fluorite
Reply With Quote
  #3   Link to this post, but load the entire thread.  
Old July 18th, 2014 (3:56 PM).
Huy567's Avatar
Huy567 Huy567 is offline
The Shadow Feather
 
Join Date: Jul 2014
Location: Texas, US
Gender: Male
Posts: 20
Quote:
Originally Posted by JosefigGaming View Post
I'm not sure about Emerald flags, but 8c3 may not be a safe flag
Even if it is, has it been set before on some script? If so, the script will go to a string that only has end, and not release, so that may be it
Also, if you wanted for the script to only happen once, at the end you should put setflag 0x8c3
That way next time the hero steps on the script tile, the script wouldnt occur (or just use setvar 0x4050 0x1)
Now for the sprite staying beggining and finishing the script hidden
Well, in the person ID box on A-Map, you put the number of a flag that's alreadt set
You could use:
A. a flag you set before on the game
B. a flag set by the game engine (I have a list for fire red, but not for emerald, sorry)
That way the sprite doesn't show up
If you wanted to make it appear you'd use the command "showsprite" and to re-disappear "hidesprite"
Let me know if my comment helped you on any way :)
lol thanks and btw this is firered XD sorry for not mentioning it so that list would help a lot
Reply With Quote
  #4   Link to this post, but load the entire thread.  
Old July 18th, 2014 (4:07 PM).
JosefigGaming's Avatar
JosefigGaming JosefigGaming is offline
 
Join Date: May 2013
Location: Portugal
Age: 23
Gender: Male
Posts: 287
Quote:
Originally Posted by Huy567 View Post
lol thanks and btw this is firered XD sorry for not mentioning it so that list would help a lot
Nah, it's my bad, I should have known by the tiles xD (where was my mind I wonder :))
List of pre-set flags:
Spoiler:
02b
02c
033
035
036
037
03c
03d
03f
062
06b
06c
06d
06e
06f
074
075
076
07b
07c
07d
08c
090
091
092
094
095
096
097
099
09d
09e
09f
0a0
0a1
0a2
0a3
0a4
0a5
0a6
0a7
0a8
0a9
0aa
0ab
0ac
0ae


Note: These were found by karatekid552, I just put this list together
__________________
Working on:


#fasterSneasel :D (nohomo)

Coolest IRC with the coolest people in the coolest rooms:
http://chat.linkandzelda.com:9090/?channels=romhacking,gogo,discovery,fluorite
Reply With Quote
  #5   Link to this post, but load the entire thread.  
Old July 18th, 2014 (4:43 PM). Edited July 18th, 2014 by Huy567.
Huy567's Avatar
Huy567 Huy567 is offline
The Shadow Feather
 
Join Date: Jul 2014
Location: Texas, US
Gender: Male
Posts: 20
Quote:
Originally Posted by JosefigGaming View Post
Nah, it's my bad, I should have known by the tiles xD (where was my mind I wonder :))
List of pre-set flags:
Spoiler:
02b
02c
033
035
036
037
03c
03d
03f
062
06b
06c
06d
06e
06f
074
075
076
07b
07c
07d
08c
090
091
092
094
095
096
097
099
09d
09e
09f
0a0
0a1
0a2
0a3
0a4
0a5
0a6
0a7
0a8
0a9
0aa
0ab
0ac
0ae


Note: These were found by karatekid552, I just put this list together
So all I have to do is add the release command if the flag is set, then change the people id of the sprite to one of the flags in the list and the rest should work?
BTW is the sprites in a-map properly placed? Like is the fields on the right hand pane properly filled out with the "unknown"s and "var number or value" and all that?
Reply With Quote
  #6   Link to this post, but load the entire thread.  
Old July 19th, 2014 (3:45 AM).
JosefigGaming's Avatar
JosefigGaming JosefigGaming is offline
 
Join Date: May 2013
Location: Portugal
Age: 23
Gender: Male
Posts: 287
Quote:
Originally Posted by Huy567 View Post
So all I have to do is add the release command if the flag is set, then change the people id of the sprite to one of the flags in the list and the rest should work?
BTW is the sprites in a-map properly placed? Like is the fields on the right hand pane properly filled out with the "unknown"s and "var number or value" and all that?
Ok, first of all, in A-Map, no need to put 3 on the unnown slot for the woman and no need to put 300 in the unknow script tile box
As for the script:´
Spoiler:
#dynamic 0x800000

#org @start
lock
checkflag 0x8C3
if 0x1 goto @release
msgbox @1 0x4
applymovement 0xff @move1
sound 0x15
waitmovement 0x0
showsprite 0x3
applymovement 0x3 @move2
waitmovement 0x0
msgbox @2 0x6
trainerbattle 0x1 0x142 @before @defeat @string1
setflag 0x8C3
release
end

#org @release
release
end

#org @string1
msgbox @3 0x6
applymovement 0x3 @move3
hidesprite 0x3
release
end

#org @1
= Hey, À! Wait up!

#org @2
= I'm glad I caught up to you!\nSo you're this far ahead already?!\pWell, the reason I was behind was\nbecause I wanted to tell Mom bye.\p...You should have done it too.\pHey, is that your Pokémon?\nLet's battle!

#org @before
= You're going down, brother!

#org @defeat
= Of course, you just had to win.

#org @3
= Well, you are still amazing as\never...\pI'm planning to go to Jikan Town\nnow, but I got to take care of\lsome things back at Yuki Town.\pAlright, well catch you later!

#org @move1
#raw 0x4 'Face Down (Faster)
#raw 0x65 'Double Exclamation Mark (!!)
#raw 0xFE 'End of Movements

#org @move2
#raw 0x1E 'Step Up (Fast)
#raw 0x1E 'Step Up (Fast)
#raw 0x1E 'Step Up (Fast)
#raw 0x1E 'Step Up (Fast)
#raw 0x1E 'Step Up (Fast)
#raw 0x1E 'Step Up (Fast)
#raw 0x1E 'Step Up (Fast)
#raw 0x53 'Jump in Place (Facing Up)
#raw 0x66 'Happy ()
#raw 0xFE 'End of Movements

#org @move3
#raw 0x0 'Face Down
#raw 0x17 'Jump2 Right
#raw 0x16 'Jump2 Left
#raw 0x4 'Face Down (Faster)
#raw 0x64 'Cross (X)
#raw 0x52 'Jump in Place (Facing Down)
#raw 0xC 'Step Down (Slow)
#raw 0xC 'Step Down (Slow)
#raw 0xC 'Step Down (Slow)
#raw 0xC 'Step Down (Slow)
#raw 0xC 'Step Down (Slow)
#raw 0xC 'Step Down (Slow)
#raw 0xC 'Step Down (Slow)
#raw 0x60 'Hide
#raw 0xFE 'End of Movements


Also, don't forget to put the Person Id one of those flags in the list I gave you
__________________
Working on:


#fasterSneasel :D (nohomo)

Coolest IRC with the coolest people in the coolest rooms:
http://chat.linkandzelda.com:9090/?channels=romhacking,gogo,discovery,fluorite
Reply With Quote
  #7   Link to this post, but load the entire thread.  
Old July 19th, 2014 (8:30 AM).
Huy567's Avatar
Huy567 Huy567 is offline
The Shadow Feather
 
Join Date: Jul 2014
Location: Texas, US
Gender: Male
Posts: 20
Quote:
Originally Posted by JosefigGaming View Post
Ok, first of all, in A-Map, no need to put 3 on the unnown slot for the woman and no need to put 300 in the unknow script tile box
As for the script:´
Spoiler:
#dynamic 0x800000

#org @start
lock
checkflag 0x8C3
if 0x1 goto @release
msgbox @1 0x4
applymovement 0xff @move1
sound 0x15
waitmovement 0x0
showsprite 0x3
applymovement 0x3 @move2
waitmovement 0x0
msgbox @2 0x6
trainerbattle 0x1 0x142 @before @defeat @string1
setflag 0x8C3
release
end

#org @release
release
end

#org @string1
msgbox @3 0x6
applymovement 0x3 @move3
hidesprite 0x3
release
end

#org @1
= Hey, À! Wait up!

#org @2
= I'm glad I caught up to you!\nSo you're this far ahead already?!\pWell, the reason I was behind was\nbecause I wanted to tell Mom bye.\p...You should have done it too.\pHey, is that your Pokémon?\nLet's battle!

#org @before
= You're going down, brother!

#org @defeat
= Of course, you just had to win.

#org @3
= Well, you are still amazing as\never...\pI'm planning to go to Jikan Town\nnow, but I got to take care of\lsome things back at Yuki Town.\pAlright, well catch you later!

#org @move1
#raw 0x4 'Face Down (Faster)
#raw 0x65 'Double Exclamation Mark (!!)
#raw 0xFE 'End of Movements

#org @move2
#raw 0x1E 'Step Up (Fast)
#raw 0x1E 'Step Up (Fast)
#raw 0x1E 'Step Up (Fast)
#raw 0x1E 'Step Up (Fast)
#raw 0x1E 'Step Up (Fast)
#raw 0x1E 'Step Up (Fast)
#raw 0x1E 'Step Up (Fast)
#raw 0x53 'Jump in Place (Facing Up)
#raw 0x66 'Happy ()
#raw 0xFE 'End of Movements

#org @move3
#raw 0x0 'Face Down
#raw 0x17 'Jump2 Right
#raw 0x16 'Jump2 Left
#raw 0x4 'Face Down (Faster)
#raw 0x64 'Cross (X)
#raw 0x52 'Jump in Place (Facing Down)
#raw 0xC 'Step Down (Slow)
#raw 0xC 'Step Down (Slow)
#raw 0xC 'Step Down (Slow)
#raw 0xC 'Step Down (Slow)
#raw 0xC 'Step Down (Slow)
#raw 0xC 'Step Down (Slow)
#raw 0xC 'Step Down (Slow)
#raw 0x60 'Hide
#raw 0xFE 'End of Movements


Also, don't forget to put the Person Id one of those flags in the list I gave you
Thanks!
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

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:11 AM.