The PokéCommunity Forums

The PokéCommunity Forums (https://www.pokecommunity.com/index.php)
-   Binary ROM Hacking (https://www.pokecommunity.com/forumdisplay.php?f=284)
-   -   Other XSE Problem [ANSWERED] (https://www.pokecommunity.com/showthread.php?t=325519)

AstralComet May 5th, 2014 8:39 AM

XSE Problem [ANSWERED]
 
As the Script Help Thread was closed for whatever reason, my only choice is to make a thread. Well, then let's go...

I'm working on a hack called FairyBlue, which is an emerald hack, and I've already made alot of progress. However, this script is not really working and I don't know why.

Spoiler:

#dynamic 0x800000

#org @start
checkflag 0x205
if 0x1 goto @nope
lock
applymovement 0x8 @1
waitmovement 0x0
showpokepic 0xFE 0x0 0x3
msgbox @one 0x6
callstd 0x4
closeonkeypress
hidepokepic
trainerbattle 0x3 0xA 0x0 @ze
showpokepic 0xFE 0x0 0x3
msgbox @two 0x6
callstd 0x4
closeonkeypress
hidepokepic
applymovement 0x8 @2
hidesprite 0x8
waitmovement 0x0
setflag 0x205
release
end

#org @nope
release
end

#org @one
= ???: Hey!\pGet out of my way!

#org @ze
= How...

#org @two
= My name is Max.\pMy parents were kidnapped a few\nyears ago, and now I am on a\ljourney to find the persons which\lkidnapped my parents. We'll meet\lagain.

#org @1
#raw 0xA 0xA 0xA 0xA 0xA 0xA 0xA 0xA 0x8 0x8 0xFE

#org @2
#raw 0xB 0x8 0x8 0xA 0xA 0xA 0xA 0xA 0xA 0xA 0xFE


Problems:
-Once a text is closed, it repeats one time. After that, the script continues. (this applies for both texts)
-The second applymovement doesn't works, it just skips to the hidesprite command.

I'd be happy if somebody could help me. Please, I really need help with it.

-AstralComet

P.S.: The showpokepic command is used to show a mugshot of the character.

Orifiel May 5th, 2014 9:20 AM

Code:

#dynamic 0x800000

#org @start
checkflag 0x205
if 0x1 goto @nope
lock
applymovement 0x8 @1
waitmovement 0x0
showpokepic 0xFE 0x0 0x3
msgbox @one 0x6
closeonkeypress
hidepokepic
trainerbattle 0x3 0xA 0x0 @before @ze
showpokepic 0xFE 0x0 0x3
msgbox @two 0x6
closeonkeypress
hidepokepic
applymovement 0x8 @2
waitmovement 0x0
hidesprite 0x8
setflag 0x205
release
end

#org @nope
release
end

#org @one
= ???: Hey!\pGet out of my way!

#org @before
= Let's battle!

#org @ze
= How...

#org @two
= My name is Max.\pMy parents were kidnapped a few\nyears ago, and now I  am on a\ljourney to find the persons which\lkidnapped my parents. We'll  meet\lagain.

#org @1
#raw 0xA
#raw 0xA
#raw 0xA
#raw 0xA
#raw 0xA
#raw 0xA
#raw 0xA
#raw 0xA
#raw 0x8
#raw 0x8
#raw 0xFE

#org @2
#raw 0xB
#raw 0x8
#raw 0x8
#raw 0xA
#raw 0xA
#raw 0xA
#raw 0xA
#raw 0xA
#raw 0xA
#raw 0xA
#raw 0xFE




I tried to fix your script, and this what happened. Your movements (#raw) were typed wrongly. I don't know where you got that idea (#raw 0xB 0x8...) And the trainer battle read this from diegoisawesome's tut under spoiler on how it works.
Spoiler:

Trainerbattle 0x0

Just a simple trainerbattle script:
Code:

#dynamic 0x800000 

#org @start
trainerbattle 0x0 0x001 0x0 @before @after
msgbox @beaten 0x6
release
end 

#org @before
= Go, all my PIKACHUs!

#org @after
= Nooo! My PIKACHUs!!!!! 

#org @beaten
= My PIKACHUs can be used to\ncharge my Nintendo DS Lite.




trainerbattle
is a battle with a trainer. trainerbattle is great because the game keeps track of whether you have beaten a trainer or not. In this script, we have no need for a checkflag/setflag situation.
Now to explaining these values after the trainerbattle. These are:
trainerbattle 0x0 [Type of battle] 0x001 [Trainer ID] 0x0 [Reserved Byte (normally 0x0)] @before [Pointer to Message When Seen] @after [Pointer to Winning Message]
I guess I'll explain the type of battle. This byte determines whether it's a double battle, Gym Leader Battle, or another type. A normal trainerbattle is 0x0. The trainer will "see you", then go to the beginning message, then the battle, and then goes to the message when you win.
Now we'll move onto the Trainer ID. This is the ID of a trainer that's found in PET. For example, Brock can be found with with a Trainer ID of 0x19E, and Blaine can be found with 0x1A3.
Now, there are two pointers, @before & @after. I've labeled these to help display what they are used for. The first pointer, @before, shows the pointer to the message displayed before the battle.
Now onto @after. It's the pointer to the message after the battle, obviously! This message appears while we are still in the battle itself. Remember the colors that were mentioned towards the beginning of this tutorial? Well, we can use colors with this too! They're different, though. Sadly, I don't have a list for those values.

Now, if I were to test it in a ROM, what would happen after the trainerbattle? Nothing. The script ends. So why do I have a msgbox after it?
Remember how I talked about trainerbattle keeping track of whether you have beaten them or not? Well, once you beat the trainer, the trainerbattle will be skipped, so when you speak to them after beating them in a battle, it'll be treated like a normal message script.
Wait! Why don't I have a lock and faceplayer after the trainerbattle? The reason is that once you have beaten that trainer, trainerbattle will also act as the lock/faceplayer combo, and you don't have to worry about them in this script.
That's the scripting side of this command done. Now the A-Map side. Now compile this script, and test it in a ROM. Did it work like a normal in-game trainer battle? I bet your answer is no.
You'll need to fill in these boxes:
http://o15.com/files/trainerbattle.jpg


Also the @ze, I assumed it's the after battle message so I added the @before message it's like when someone spots you like a normal trainer or talks before battle starts. It was just an example, you can change it.

Spherical Ice May 5th, 2014 9:58 AM

Actually, it is perfectly fine to write all of the movements on one line. The rest of your amendments fix it though, regardless.

AstralComet May 6th, 2014 8:10 AM

Well, the applymovement error was pretty stupid, and it is now fixed. However, I do not want that extra message to show up. Is there a way to avoid that message? This is really confusing as it worked several times for me with other scripts without having to use that ugly extra message. =\

Christos May 6th, 2014 8:33 AM

Quote:

Originally Posted by AstralComet (Post 8233751)
Well, the applymovement error was pretty stupid, and it is now fixed. However, I do not want that extra message to show up. Is there a way to avoid that message? This is really confusing as it worked several times for me with other scripts without having to use that ugly extra message. =\

Do you mean each text is repeated twice? Did you see Orifiel's corrections?

msgbox @one 0x6
callstd 0x4


This is what you're doing wrong. The text box's type is defined by the 0x6, and by writing callstd 0x4, it's like you're using the same text again with a text box type #4 after the #6 one. You should use closeonkeypress instead, if you actually want to hide the text box after the text shows up.

AstralComet May 6th, 2014 9:20 AM

Quote:

Originally Posted by Spheal (Post 8233774)
Do you mean each text is repeated twice? Did you see Orifiel's corrections?

msgbox @one 0x6
callstd 0x4


This is what you're doing wrong. The text box's type is defined by the 0x6, and by writing callstd 0x4, it's like you're using the same text again with a text box type #4 after the #6 one. You should use closeonkeypress instead, if you actually want to hide the text box after the text shows up.

Thank you for the great help. Sadly, the closeonkeypress command screwed up the script as it was used twice in a row (as it is also used for the showpokepic command). However, I used callstd 0x6 and everything worked perfectly. I just used the wrong callstd. I feel stupid xD

Whatever, thank you for the help!


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


Like our Facebook Page Follow us on Twitter © 2002 - 2018 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2016 The PokéCommunity / PokéCommunity.com.
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator.

Acknowledgements
Use of PokéCommunity Assets
vB Optimise by DragonByte Technologies Ltd © 2023.