The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Fan Games > Binary ROM Hacking
Reload this Page Other Scripting goes wrong(?)

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 16th, 2016 (6:46 AM). Edited June 19th, 2016 by Scarlet D..
Scarlet D.'s Avatar
Scarlet D. Scarlet D. is offline
The Eternal
 
Join Date: Dec 2015
Location: Greece
Gender: Male
Nature: Adamant
Posts: 66
Hello again guys.

I have no idea why but for some reason some of the last scripts I did, went completely wrong. For some reason when i play the game some of the npcs and tiles positions changes completely. Some of the scripts I try, freeze midway, i tried to change variables but everything had the same outcome...I can't find out why this occurs
Reply With Quote
  #2   Link to this post, but load the entire thread.  
Old May 17th, 2016 (8:05 AM).
0's Avatar
0 0 is offline
Happy and at peace. :)
 
Join Date: May 2016
Location: Pallet Town
Gender: Male
Nature: Calm
Posts: 556
If you want, post the script you're working with as well as the general idea behind it and I'll look over them. For example, the script + "I'm trying to remove the Pokemon center in Viridian City when you talk to a character."
__________________

Just dance with me!!!!!!!

Reply With Quote
  #3   Link to this post, but load the entire thread.  
Old May 17th, 2016 (1:59 PM).
Scarlet D.'s Avatar
Scarlet D. Scarlet D. is offline
The Eternal
 
Join Date: Dec 2015
Location: Greece
Gender: Male
Nature: Adamant
Posts: 66
well look, both scripts involving movement>>msgbox>>battles>>movement>>more messagebox and so on. Nothing so special in particular, this is the first script:

Code:
#org @start 
lock 
checkflag 0x457 
if 0x1 goto @go
release 
end

#org @go
pause 0x30 
applymovement 5 @discussright
waitmovement 5 
msgbox @rich1 0x6  
closeonkeypress 
applymovement 3 @discussleft 
waitmovement 3 
msgbox @sec1 0x6  
closeonkeypress 
pause 0x30
sound 0x000E 
applymovement 5 @tinagma 
waitmovement 5 
applymovement 4 @discussright 
waitmovement 4 
applymovement 3 @gotocenter 
waitmovement 3 
msgbox @lumos1 0x6 
closeonkeypress 
applymovement 4 @discussright 
waitmovement 4 
msgbox @lumos2 0x6 
closeonkeypress 
applymovement 3 @discussleft
waitmovement 3 
msgbox @sec2 0x6 
closeonkeypress 
applymovement 0xFF @discussright
waitmovement 0xFF 
msgbox @hero1 0x6 
closeonkeypress
applymovement 3 @discussleft
waitmovement 3 
msgbox @sec3 0x6 
closeonkeypress 
applymovement 0xFF @gotosec
waitmovement 0xFF 
trainerbattle 0x1 0x76 0x0 @begin @defeat @later 

#org @later 
applymovement 3 @discussleft
waitmovement 3 
msgbox @sec4 0x6 
closeonkeypress 
applymovement 0xFF @discussright
waitmovement 0xFF 
msgbox @hero3 0x6 
closeonkeypress
applymovement 3 @discussleft
waitmovement 3 
msgbox @sec5 0x6 
closeonkeypress
pause 0x30 
fadescreen 0x1
hidesprite 3 
pause 0x20 
fadescreen 0x0
applymovement 2 @faceup 
waitmovement 2 
msgbox @rival 0x6 
closeonkeypress 
applymovement 4 @discussright 
waitmovement 4 
msgbox @lumos3 0x6 
closeonkeypress 
applymovement 4 @leavelumos 
waitmovement 4
hidesprite 4
applymovement 2 @gotosec
waitmovement 2 
pause 0x40
showsprite 6
showsprite 7
showsprite 8
showsprite 9
showsprite 10
showsprite 11
applymovement 6 @comeright  
applymovement 7 @comeright 
applymovement 8 @comeright 
applymovement 9 @comeleft
applymovement 10 @comeleft
applymovement 11 @comeleft 
applymovement 0xFF @surprised1
applymovement 2 @surprised2 
waitmovement 11 
applymovement 7 @discussright 
waitmovement 7
msgbox @com1 0x6 
closeonkeypress 
applymovement 2 @faceup 
waitmovement 2 
applymovement 0xFF @discussleft 
waitmovement 0xFF 
msgbox @hero4 0x6 
closeonkeypress 
applymovement 7 @discussright 
waitmovement 7
msgbox @com2 0x6 
closeonkeypress 
applymovement 0xFF @facedown 
waitmovement 0xFF 
applymovement 2 @discussleft 
waitmovement 2 
msgbox @rival2 0x6 
closeonkeypress 
applymovement 7 @discussright 
waitmovement 7
msgbox @com3 0x6 
closeonkeypress 
applymovement 7 @discussright 
waitmovement 7
msgbox @com4 0x6 
closeonkeypress 
applymovement 6 @gotoplayerleft 
applymovement 7 @gotoplayerleft
applymovement 9 @gogethim  
applymovement 10 @gogethim
applymovement 11 @gogethim
waitmovement 11 
fadescreen 0x1
hidesprite 2 
hidesprite 5 
hidesprite 6  
hidesprite 7 
hidesprite 8 
hidesprite 9 
hidesprite 10
hidesprite 11
pause 0x20 
setvar 6049 0x0 
setflag 0x458 
warp 0x1 0x10 0x0 0x6 0x6 

#org @gogethim 
#raw 0x12
#raw 0xFE

#org @gotoplayerleft
#raw 0x13
#raw 0xFE

#org @surprised1 
#raw 0x1C
#raw 0x1C
#raw 0x1C
#raw 0x1C
#raw 0x65
#raw 0x7
#raw 0x6
#raw 0x7
#raw 0x6
#raw 0xFE

#org @surprised2 
#raw 0x1C
#raw 0x1C
#raw 0x1C
#raw 0x1C
#raw 0x65
#raw 0x6
#raw 0x7
#raw 0x6
#raw 0x7
#raw 0xFE

#org @comeright 
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0xFE

#org @comeleft 
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0xFE

#org @leavelumos 
#raw 0x1F
#raw 0x1F
#raw 0x1E
#raw 0x1E
#raw 0x1E
#raw 0xFE

#org @gotocenter
#raw 0x10
#raw 0x12
#raw 0xFE

#org @gotosec
#raw 0x13
#raw 0xFE

#org @tinagma
#raw 0x4C
#raw 0x3B
#raw 0x4D
#raw 0xFE

#org @discussleft 
#raw 0x23
#raw 0xFE

#org @discussright
#raw 0x24
#raw 0xFE

#org @faceup 
#raw 0x1
#raw 0xFE

#org @facedown 
#raw 0x0
#raw 0xFE
if you see nothing strange for this script, then you won't see any problem to the second script. I did like 20 scripts like it and every single one of them was working perfectly, only the two last scripts had the problem
Reply With Quote
  #4   Link to this post, but load the entire thread.  
Old May 17th, 2016 (2:13 PM).
Vendily's Avatar
Vendily Vendily is offline
 
Join Date: Aug 2015
Nature: Calm
Posts: 1,604
Quote:
Originally Posted by Aenaos View Post
well look, both scripts involving movement>>msgbox>>battles>>movement>>more messagebox and so on. Nothing so special in particular, this is the first script:

Code:
#org @start 
lock 
checkflag 0x457 
if 0x1 goto @go
release 
end

#org @go
pause 0x30 
applymovement 5 @discussright
waitmovement 5 
msgbox @rich1 0x6  
closeonkeypress 
applymovement 3 @discussleft 
waitmovement 3 
msgbox @sec1 0x6  
closeonkeypress 
pause 0x30
sound 0x000E 
applymovement 5 @tinagma 
waitmovement 5 
applymovement 4 @discussright 
waitmovement 4 
applymovement 3 @gotocenter 
waitmovement 3 
msgbox @lumos1 0x6 
closeonkeypress 
applymovement 4 @discussright 
waitmovement 4 
msgbox @lumos2 0x6 
closeonkeypress 
applymovement 3 @discussleft
waitmovement 3 
msgbox @sec2 0x6 
closeonkeypress 
applymovement 0xFF @discussright
waitmovement 0xFF 
msgbox @hero1 0x6 
closeonkeypress
applymovement 3 @discussleft
waitmovement 3 
msgbox @sec3 0x6 
closeonkeypress 
applymovement 0xFF @gotosec
waitmovement 0xFF 
trainerbattle 0x1 0x76 0x0 @begin @defeat @later 

#org @later 
applymovement 3 @discussleft
waitmovement 3 
msgbox @sec4 0x6 
closeonkeypress 
applymovement 0xFF @discussright
waitmovement 0xFF 
msgbox @hero3 0x6 
closeonkeypress
applymovement 3 @discussleft
waitmovement 3 
msgbox @sec5 0x6 
closeonkeypress
pause 0x30 
fadescreen 0x1
hidesprite 3 
pause 0x20 
fadescreen 0x0
applymovement 2 @faceup 
waitmovement 2 
msgbox @rival 0x6 
closeonkeypress 
applymovement 4 @discussright 
waitmovement 4 
msgbox @lumos3 0x6 
closeonkeypress 
applymovement 4 @leavelumos 
waitmovement 4
hidesprite 4
applymovement 2 @gotosec
waitmovement 2 
pause 0x40
showsprite 6
showsprite 7
showsprite 8
showsprite 9
showsprite 10
showsprite 11
applymovement 6 @comeright  
applymovement 7 @comeright 
applymovement 8 @comeright 
applymovement 9 @comeleft
applymovement 10 @comeleft
applymovement 11 @comeleft 
applymovement 0xFF @surprised1
applymovement 2 @surprised2 
waitmovement 11 
applymovement 7 @discussright 
waitmovement 7
msgbox @com1 0x6 
closeonkeypress 
applymovement 2 @faceup 
waitmovement 2 
applymovement 0xFF @discussleft 
waitmovement 0xFF 
msgbox @hero4 0x6 
closeonkeypress 
applymovement 7 @discussright 
waitmovement 7
msgbox @com2 0x6 
closeonkeypress 
applymovement 0xFF @facedown 
waitmovement 0xFF 
applymovement 2 @discussleft 
waitmovement 2 
msgbox @rival2 0x6 
closeonkeypress 
applymovement 7 @discussright 
waitmovement 7
msgbox @com3 0x6 
closeonkeypress 
applymovement 7 @discussright 
waitmovement 7
msgbox @com4 0x6 
closeonkeypress 
applymovement 6 @gotoplayerleft 
applymovement 7 @gotoplayerleft
applymovement 9 @gogethim  
applymovement 10 @gogethim
applymovement 11 @gogethim
waitmovement 11 
fadescreen 0x1
hidesprite 2 
hidesprite 5 
hidesprite 6  
hidesprite 7 
hidesprite 8 
hidesprite 9 
hidesprite 10
hidesprite 11
pause 0x20 
setvar 6049 0x0 
setflag 0x458 
warp 0x1 0x10 0x0 0x6 0x6 

#org @gogethim 
#raw 0x12
#raw 0xFE

#org @gotoplayerleft
#raw 0x13
#raw 0xFE

#org @surprised1 
#raw 0x1C
#raw 0x1C
#raw 0x1C
#raw 0x1C
#raw 0x65
#raw 0x7
#raw 0x6
#raw 0x7
#raw 0x6
#raw 0xFE

#org @surprised2 
#raw 0x1C
#raw 0x1C
#raw 0x1C
#raw 0x1C
#raw 0x65
#raw 0x6
#raw 0x7
#raw 0x6
#raw 0x7
#raw 0xFE

#org @comeright 
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0xFE

#org @comeleft 
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0xFE

#org @leavelumos 
#raw 0x1F
#raw 0x1F
#raw 0x1E
#raw 0x1E
#raw 0x1E
#raw 0xFE

#org @gotocenter
#raw 0x10
#raw 0x12
#raw 0xFE

#org @gotosec
#raw 0x13
#raw 0xFE

#org @tinagma
#raw 0x4C
#raw 0x3B
#raw 0x4D
#raw 0xFE

#org @discussleft 
#raw 0x23
#raw 0xFE

#org @discussright
#raw 0x24
#raw 0xFE

#org @faceup 
#raw 0x1
#raw 0xFE

#org @facedown 
#raw 0x0
#raw 0xFE
if you see nothing strange for this script, then you won't see any problem to the second script. I did like 20 scripts like it and every single one of them was working perfectly, only the two last scripts had the problem
I just want to bring to your attention to the @go and @later sections.
Code:
#org @go
pause 0x30 
applymovement 5 @discussright
waitmovement 5 
msgbox @rich1 0x6  
closeonkeypress 
applymovement 3 @discussleft 
waitmovement 3 
msgbox @sec1 0x6  
closeonkeypress 
pause 0x30
sound 0x000E 
applymovement 5 @tinagma 
waitmovement 5 
applymovement 4 @discussright 
waitmovement 4 
applymovement 3 @gotocenter 
waitmovement 3 
msgbox @lumos1 0x6 
closeonkeypress 
applymovement 4 @discussright 
waitmovement 4 
msgbox @lumos2 0x6 
closeonkeypress 
applymovement 3 @discussleft
waitmovement 3 
msgbox @sec2 0x6 
closeonkeypress 
applymovement 0xFF @discussright
waitmovement 0xFF 
msgbox @hero1 0x6 
closeonkeypress
applymovement 3 @discussleft
waitmovement 3 
msgbox @sec3 0x6 
closeonkeypress 
applymovement 0xFF @gotosec
waitmovement 0xFF 
trainerbattle 0x1 0x76 0x0 @begin @defeat @later 

#org @later 
applymovement 3 @discussleft
waitmovement 3 
msgbox @sec4 0x6 
closeonkeypress 
applymovement 0xFF @discussright
waitmovement 0xFF 
msgbox @hero3 0x6 
closeonkeypress
applymovement 3 @discussleft
waitmovement 3 
msgbox @sec5 0x6 
closeonkeypress
pause 0x30 
fadescreen 0x1
hidesprite 3 
pause 0x20 
fadescreen 0x0
applymovement 2 @faceup 
waitmovement 2 
msgbox @rival 0x6 
closeonkeypress 
applymovement 4 @discussright 
waitmovement 4 
msgbox @lumos3 0x6 
closeonkeypress 
applymovement 4 @leavelumos 
waitmovement 4
hidesprite 4
applymovement 2 @gotosec
waitmovement 2 
pause 0x40
showsprite 6
showsprite 7
showsprite 8
showsprite 9
showsprite 10
showsprite 11
applymovement 6 @comeright  
applymovement 7 @comeright 
applymovement 8 @comeright 
applymovement 9 @comeleft
applymovement 10 @comeleft
applymovement 11 @comeleft 
applymovement 0xFF @surprised1
applymovement 2 @surprised2 
waitmovement 11 
applymovement 7 @discussright 
waitmovement 7
msgbox @com1 0x6 
closeonkeypress 
applymovement 2 @faceup 
waitmovement 2 
applymovement 0xFF @discussleft 
waitmovement 0xFF 
msgbox @hero4 0x6 
closeonkeypress 
applymovement 7 @discussright 
waitmovement 7
msgbox @com2 0x6 
closeonkeypress 
applymovement 0xFF @facedown 
waitmovement 0xFF 
applymovement 2 @discussleft 
waitmovement 2 
msgbox @rival2 0x6 
closeonkeypress 
applymovement 7 @discussright 
waitmovement 7
msgbox @com3 0x6 
closeonkeypress 
applymovement 7 @discussright 
waitmovement 7
msgbox @com4 0x6 
closeonkeypress 
applymovement 6 @gotoplayerleft 
applymovement 7 @gotoplayerleft
applymovement 9 @gogethim  
applymovement 10 @gogethim
applymovement 11 @gogethim
waitmovement 11 
fadescreen 0x1
hidesprite 2 
hidesprite 5 
hidesprite 6  
hidesprite 7 
hidesprite 8 
hidesprite 9 
hidesprite 10
hidesprite 11
pause 0x20 
setvar 6049 0x0 
setflag 0x458 
warp 0x1 0x10 0x0 0x6 0x6
Like for example, you have a hidesprite 10. Did you mean Hide sprite 0x10, or hide sprite 0xA? Because those are different. You are also missing a lot of 0xs.
Also this var, setvar 6049 0x0, is too high. Rule of thumb is between 0x4000 to 0x40FF.
This section here
Code:
applymovement 6 @gotoplayerleft 
applymovement 7 @gotoplayerleft
applymovement 9 @gogethim  
applymovement 10 @gogethim
applymovement 11 @gogethim
waitmovement 11
If you want them to move at the same time, you need a waitmovement 0x0
There may be more, this is just what I noticed.
__________________
| VPP Stats

Common Errors (and How to Fix Them) in Essentials
Reply With Quote
  #5   Link to this post, but load the entire thread.  
Old May 17th, 2016 (2:39 PM).
Scarlet D.'s Avatar
Scarlet D. Scarlet D. is offline
The Eternal
 
Join Date: Dec 2015
Location: Greece
Gender: Male
Nature: Adamant
Posts: 66
Quote:
Originally Posted by Vendily View Post
I just want to bring to your attention to the @go and @later sections.
Like for example, you have a hidesprite 10. Did you mean Hide sprite 0x10, or hide sprite 0xA? Because those are different. You are also missing a lot of 0xs.
Also this var, setvar 6049 0x0, is too high. Rule of thumb is between 0x4000 to 0x40FF.
This section here
Code:
applymovement 6 @gotoplayerleft 
applymovement 7 @gotoplayerleft
applymovement 9 @gogethim  
applymovement 10 @gogethim
applymovement 11 @gogethim
waitmovement 11
If you want them to move at the same time, you need a waitmovement 0x0
There may be more, this is just what I noticed.
Well, with hidesprite 10 i meant "Hide the person with person event number 10", i thought it was working without 0x

About the var. I am so glad you noticed it is wrong because i kept telling that to my partner and he kept telling me "No it is certainly right!", but previously i changed the var to 0x20FF and still didn't work

also thanks for waitmovement 0x0 , I kinda completed forgot it existed XD
Reply With Quote
  #6   Link to this post, but load the entire thread.  
Old May 17th, 2016 (4:18 PM).
0's Avatar
0 0 is offline
Happy and at peace. :)
 
Join Date: May 2016
Location: Pallet Town
Gender: Male
Nature: Calm
Posts: 556
One thing I've noticed but was unable to post at the time, was that you keep adding closeonkeypress. This doesn't need to be used on messages with 0x6, as it waits for user input automatically.
__________________

Just dance with me!!!!!!!

Reply With Quote
  #7   Link to this post, but load the entire thread.  
Old May 18th, 2016 (3:25 AM).
Scarlet D.'s Avatar
Scarlet D. Scarlet D. is offline
The Eternal
 
Join Date: Dec 2015
Location: Greece
Gender: Male
Nature: Adamant
Posts: 66
so, in conclusion, every number on the xse scripts (applymovement xx , setflag, setvar , hidesprite and so on) must be on hex?
Reply With Quote
  #8   Link to this post, but load the entire thread.  
Old May 18th, 2016 (3:59 AM).
Squeetz's Avatar
Squeetz Squeetz is offline
ROM Hacker
 
Join Date: Jun 2013
Location: Norway
Age: 25
Gender: Male
Nature: Quiet
Posts: 236
Quote:
Originally Posted by Aenaos View Post
so, in conclusion, every number on the xse scripts (applymovement xx , setflag, setvar , hidesprite and so on) must be on hex?
No, they don't.
You can use 0x which denotes hex, but you can also write just the number, which denotes decimal.
The compiler takes care of this and makes all numbers hex.
Reply With Quote
  #9   Link to this post, but load the entire thread.  
Old May 18th, 2016 (8:37 AM).
Scarlet D.'s Avatar
Scarlet D. Scarlet D. is offline
The Eternal
 
Join Date: Dec 2015
Location: Greece
Gender: Male
Nature: Adamant
Posts: 66
Nice, I should no that, by the way guys, i got a problem with npc trainerbattles too.

Code:
#dynamic 0x802AF0 
#org @start 
lock 
trainerbattle 0x0 053 0x0 @begin @defeat
msgbox @beaten 0x6 

#org @begin 
= Gueeeh!!

#org @defeat 
= The infected trainer fell on his\nknees and he is unable to move

#org @beaten 
= gah...
the script works just fine when the npc is stationary, but if it is moving, then the script crushes and instead of the normal message box a messagebox full of "EOOOOOOEEOEOOEOEEE" appears
Reply With Quote
  #10   Link to this post, but load the entire thread.  
Old May 18th, 2016 (11:08 AM).
thebrawler56's Avatar
thebrawler56 thebrawler56 is offline
 
Join Date: Sep 2014
Location: Who knows~
Gender: Male
Nature: Naive
Posts: 57
I'm quite sure you don't need lock to do trainer battles.
__________________
Zelos was here, Lloyd is a loser.
Reply With Quote
  #11   Link to this post, but load the entire thread.  
Old May 18th, 2016 (11:37 AM).
Scarlet D.'s Avatar
Scarlet D. Scarlet D. is offline
The Eternal
 
Join Date: Dec 2015
Location: Greece
Gender: Male
Nature: Adamant
Posts: 66
Quote:
Originally Posted by thebrawler56 View Post
I'm quite sure you don't need lock to do trainer battles.
yeah maybe you are right but i always lock when i start an event clearly out of habit, I know it's kind of redundancy
Reply With Quote
  #12   Link to this post, but load the entire thread.  
Old May 18th, 2016 (12:16 PM).
thebrawler56's Avatar
thebrawler56 thebrawler56 is offline
 
Join Date: Sep 2014
Location: Who knows~
Gender: Male
Nature: Naive
Posts: 57
Quote:
Originally Posted by Aenaos View Post
yeah maybe you are right but i always lock when i start an event clearly out of habit, I know it's kind of redundancy
I know I had a similar problem, and once I got rid of the lock, it worked.
__________________
Zelos was here, Lloyd is a loser.
Reply With Quote
  #13   Link to this post, but load the entire thread.  
Old May 21st, 2016 (5:54 AM). Edited May 21st, 2016 by Scarlet D..
Scarlet D.'s Avatar
Scarlet D. Scarlet D. is offline
The Eternal
 
Join Date: Dec 2015
Location: Greece
Gender: Male
Nature: Adamant
Posts: 66
Quote:
Originally Posted by thebrawler56 View Post
I know I had a similar problem, and once I got rid of the lock, it worked.
wow thanks it worked! Guys i got another problem finding and using a command. There is a command on the XSE scripting that allows you to go on a different pointer depending the player's facing, all i could find was the command on the pallet town's TV on fire-red that goes like this :

Code:
compare PLAYERFACING 0x3
anyone would like to enlighten me?
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:08 AM.