The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Fan Games > Binary ROM Hacking
Reload this Page Other Error when using XSE and giving Pokeballs

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 August 8th, 2014 (11:31 AM).
CJBlazer's Avatar
CJBlazer CJBlazer is offline
Rogon, the Ninja Pokemon
 
Join Date: Nov 2011
Location: Underworld
Gender: Male
Nature: Serious
Posts: 72
I don't get what I am doing wrong. I am editing this one trainer in Viridian Forest (the first one you see.). I want him to give you 5 Pokeballs when you talk to him and this is the script I used

Spoiler:

'---------------
#org 0x160529
lock
faceplayer
checkflag 0x25E
if 0x1 goto 0x816A4FF
msgbox 0x8190717 MSG_KEEPOPEN '"You don't have any Pokeballs?\nWel..."
checkitemroom 0x160 0x1
compare LASTRESULT 0x0
if 0x1 goto 0x816A4F5
setflag 0x25E
hidesprite 0x4
additem 0x4 0x5
loadpointer 0x0 0x8190866 '"[player] received five Pokeballs\n..."
giveitem2 0x4 0x5 0x13E
release
end

'---------------
#org 0x16A4FF
msgbox 0x819088E MSG_KEEPOPEN '"You don't have any Pokeballs?\nWeY..."
release
end

'---------------
#org 0x16A4F5
msgbox 0x81908AE MSG_KEEPOPEN '"You don't have room for these."
release
end


'---------
' Strings
'---------
#org 0x190717
= You don't have any Pokeballs?\nWell, here are a few of mine.

#org 0x190866
= [player] received five Pokeballs\nfrom the BOY

#org 0x19088E
= Weaken a Pokemon First!

#org 0x1908AE
= You don't have room for these.


and this somehow becomes the result
Spoiler:

'---------------
#org 0x160529
lock
faceplayer
checkflag 0x25E
if 0x1 goto 0x816A4FF
msgbox 0x8190717 MSG_KEEPOPEN '"You don't have any Pokeballs?\nWel..."
checkitemroom 0x160 0x1
compare LASTRESULT 0x0
if 0x1 goto 0x816A4F5
setflag 0x25E
hidesprite 0x4
additem 0x4 0x5
loadpointer 0x0 0x8190866 '"[player] received five Pokeballs\n..."
giveitem2 0x4 0x5 0x13E
release
end

'---------------
#org 0x16A4FF
msgbox 0x819088E MSG_KEEPOPEN '"You don't have any Pokeballs?\nWeY..."
release
end

'---------------
#org 0x16A4F5
msgbox 0x81908AE MSG_KEEPOPEN '"You don't have room for these."
release
end


'---------
' Strings
'---------
#org 0x190717
= You don't have any Pokeballs?\nWell, here are a few of mine.

#org 0x190866
= [player] received five Pokeballs\nfrom the BOY

#org 0x19088E
= You don't have any Pokeballs?\nWeYou don't have room for these.

#org 0x1908AE
= You don't have room for these.


The last two lines glitch up for some reason. Is there a reason why they always combine? Am I doing something wrong?
__________________


From left to right, Rogetta, Rogon, Rogastar.
Reply With Quote
  #2   Link to this post, but load the entire thread.  
Old August 9th, 2014 (9:59 AM).
Le pug's Avatar
Le pug Le pug is offline
Creator of Pokémon: Discovery / Fat Kid
 
Join Date: Aug 2013
Location: Le bed
Age: 30
Gender: Male
Nature: Bold
Posts: 870
Don't see the error, try changing where the error is to a different color

Also it's a lot easier if you post the original script.. All the numbers and stuff just annoying added text
__________________
Retired. Thank you guys for a wonderful five years.
Reply With Quote
  #3   Link to this post, but load the entire thread.  
Old August 9th, 2014 (10:02 AM).
Mana's Avatar
Mana Mana is offline
 
Join Date: Jan 2009
Location: UK
Age: 31
Gender: Male
Posts: 10,075
#org 0x160529 :(

Why is the script inserted there? If the script is glitching it might be because it is overlapping/colliding with other information.

Wait// Did you open this viridian forest trainer and just edit straight in? That'll be your problem.

What you need to do is point new scripts at empty/available space - even if its an edit, as if you extend the script it'll overwrite the next one.

Write your scripts like this:

Quote:
#dynamic 0x740000

#org @start
lock
faceplayer
checkflag 0x25E
if 0x1 goto @flagisset
msgbox 0x8190717 MSG_KEEPOPEN '"You don't have any Pokeballs?\nWel..."
checkitemroom 0x160 0x1
compare LASTRESULT 0x0
if 0x1 goto @next
...etc...
By using the dynamic command at the top you're asking XSE to find free space for each of your @pointers. If you do this any time you change/make an addition to a script (or making a brand new one) you shouldn't have problems with the script changing or deforming.

Here is a useful scripting tutorial: http://www.pokecommunity.com/showthread.php?t=164276
__________________
Reply With Quote
  #4   Link to this post, but load the entire thread.  
Old August 14th, 2014 (7:28 AM).
CJBlazer's Avatar
CJBlazer CJBlazer is offline
Rogon, the Ninja Pokemon
 
Join Date: Nov 2011
Location: Underworld
Gender: Male
Nature: Serious
Posts: 72
Sorry, been out most of the week.

I tried dynamic offset and it wont compile it. The error is at the end. The two strings collide with one another.

this is another example. The same thing keeps happening

Spoiler:

'---------------
#org 0x1689BB
trainerbattle 0x0 0x239 0x0 0x818ADC6 0x818ADFB
msgbox 0x818AE16 MSG_NORMAL '"Kenji is a really strong\nfighting..."
end


'---------
' Strings
'---------
#org 0x18ADC6
= Are you trying to get\nto Rogueport?

#org 0x18ADFB
= Huh...I lost.\nGood luck witKenji is a really strong\nfighting type gym leader.

#org 0x18AE16
= Kenji is a really strong\nfighting type gym leader.



The last two lines keep colliding with one another.
__________________


From left to right, Rogetta, Rogon, Rogastar.
Reply With Quote
  #5   Link to this post, but load the entire thread.  
Old August 14th, 2014 (7:38 AM). Edited August 14th, 2014 by Mana.
Mana's Avatar
Mana Mana is offline
 
Join Date: Jan 2009
Location: UK
Age: 31
Gender: Male
Posts: 10,075
Have you decompiled and changed them at all after the first compiling? Using a dynamic offset won't cause these problems unless you make a mistake afterwards. I find it curious that your main branch is at 0x1689BB though, doesn't look you used dynamic offset there? :(

>>> Anyway, to fix this you need to either repoint the texts or delve in with a hex-editor and look where the actual problem lies. First is probably easiest, especially if you haven't used hex before.
__________________
Reply With Quote
  #6   Link to this post, but load the entire thread.  
Old August 14th, 2014 (7:40 AM).
CJBlazer's Avatar
CJBlazer CJBlazer is offline
Rogon, the Ninja Pokemon
 
Join Date: Nov 2011
Location: Underworld
Gender: Male
Nature: Serious
Posts: 72
0x1689BB is the trainer's script offset that I am editing. Thats why I am using that script.
__________________


From left to right, Rogetta, Rogon, Rogastar.
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:21 AM.