The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Fan Games > Binary ROM Hacking
Reload this Page Script Need help with understanding some scripts configuration

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 June 2nd, 2019 (10:25 AM).
KradTaiyoo KradTaiyoo is offline
 
Join Date: Nov 2017
Posts: 2
Well, I'm starting to get used to scripts. I'm reading diegoisawesome's MEGA-HUGE XSE Scripting Tutorial and even though it helped me so much, some thing i can't figure out.

I wrote this script for the starting town, so i had to settle this battle to happen after MC got his pokemon.
But, after battle ends, the text
Quote:
You have a pokemon i can steal? No? Get out of here!
appears again, before the give item text.
So, what i'm doing wrong here?
Or what i should do to skip this message after battle won?

Here's the script:
Spoiler:
'---------------
#dynamic 0x234C47
#org 0x71CD70
lock
faceplayer
if 0x1 goto 0x8234C1A
msgbox 0x8234A6C MSG_NORMAL '"You have a pokemon i can steal? \n..."
countpokemon
compare LASTRESULT 0x0
if 0x1 goto 0x8234AF0
trainerbattle 0x0 0x4D 0x0 0x8234B34 0x8234B64
msgbox 0x8234BA4 MSG_NORMAL '"Take this and leave me alone! See ..."
release
end

'---------
#org 0x234A6C
= You have a pokemon i can steal? \nNo? Get out of here!

#org 0x234B34
= You have? Let's fight!

#org 0x234B64
= You'll pay for this kiddo!

#org 0x234BA4
= Take this and leave me alone! See ya!
giveitem 0xC5 0x1 MSG_OBTAIN
msgbox @item 0x6
hidesprite 0x800F
release
end

#org @item
=\v\h01 received a Lucky Egg!
Reply With Quote
  #2   Link to this post, but load the entire thread.  
Old June 2nd, 2019 (4:32 PM).
DrFuji's Avatar
DrFuji DrFuji is offline
Heiki Hecchara‌‌
 
Join Date: Sep 2009
Location: Aussie
Age: 30
Gender: Male
Nature: Jolly
Posts: 1,693
There are quite a few issues with your script that either double up or just won't work properly. Here's a version that should work correctly with some comments on why things were changed:

Spoiler:
#dynamic 0x800000 // You didn't say whether you were using FR or Emerald, but I assume its FR due to your compiled script starting at 0x71CD70. Your other offsets seem pretty dangerous, so always use #dynamic 0x800000 or 0x720000 when hacking FR. If you're using Emerald, check out this link to learn the best places to start looking for dynamic offsets

#org @start
lock
faceplayer
countpokemon
compare 0x800D 0x0
if 0x1 goto @skip // Your script doesn't go anywhere if the player has zero Pokemon and the @Steal text would play even if the player has Pokemon, which doesn't make sense
trainerbattle 0x1 0x4D 0x0 @YouHave @Pay @Continue // Type 0x1 trainer battles will continue the script after you win, going to the command's third pointer (@Continue in this case)
// Don't need to add anything after the battle as you'll never be able to talk to the OW again once you beat them

#org @skip
msgbox @Steal 0x6
release
end

#org @Continue
msgbox @TakeThis 0x6
giveitem 0xC5 0x1 0x0 // The giveitem command already tells the player that they received an item, you don't need to include another msgbox like @item in your version
fadescreen 0x1 // If you're making an OW disappear, its best to either fade the screen to black or have them walk offscreen so they don't suddenly vanish in full view of the player
setflag 0x200 // You need to set a flag whenever you make an OW disappear and put the flag's number in their 'Person ID' slot in A-Map, otherwise they will reappear whenever you take a step
hidesprite 0x800F
fadescreen 0x0
release
end

#org @Steal
= Do you have a Pokemon?\nNo? Get out of here!

#org @YouHave
= You have a Pokemon? Let's fight!

#org @Pay
= You'll pay for this, kiddo!

#org @TakeThis
= Take this and leave me alone!\nSee ya!


Hopefully this helps~
__________________
Reply With Quote
  #3   Link to this post, but load the entire thread.  
Old June 2nd, 2019 (5:18 PM).
KradTaiyoo KradTaiyoo is offline
 
Join Date: Nov 2017
Posts: 2
Thanks! That was very enlightening.
Really think i'm understanding better.
I'll try a few more scripts to practice, but for now I understand some of my mistakes.
Thank you!
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:19 AM.