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)
-   -   Textbox Help (XSE) (https://www.pokecommunity.com/showthread.php?t=410330)

Babyswagmonster July 3rd, 2018 2:00 PM

Textbox Help (XSE)
 
I'm trying to write a code for a battle and for some reason after he says the first text box in the pre battle script it erases the rest of the dialogue and replaces it with the after battle script. If you look below, it changes my script after compiling and when I reopen I see the ........hm added on the end.

'---------------
#org 0x23CA49
trainerbattle 0x0 0x126 0x0 0x823CB14 0x823CB58
msgbox 0x823CB75 MSG_NORMAL '"RED: Wow, you beat me. It seems I\..."
end


'---------
' Strings
'---------
#org 0x23CB14
= RED: Well if it isn't the champ!\pI was on my way to KANTO just now.\n.................. hmmm

#org 0x23CB58
= .................. hmmm

#org 0x23CB75
= RED: Wow, you beat me. It seems I\nneed more training.\pMaybe Mt. Silver?\nHmm.... \p[player]!!!\n Keep training and keep battling. The POKéMON\p world is big and full of challenges!\n BON VOYAGE!

BirdstarCat13 July 3rd, 2018 4:36 PM

You're not using dynamic offsets.

Lazy Catalyst July 3rd, 2018 4:49 PM

Quote:

Originally Posted by Babyswagmonster (Post 9897054)
I'm trying to write a code for a battle and for some reason after he says the first text box in the pre battle script it erases the rest of the dialogue and replaces it with the after battle script. If you look below, it changes my script after compiling and when I reopen I see the ........hm added on the end.

'---------------
#org 0x23CA49
trainerbattle 0x0 0x126 0x0 0x823CB14 0x823CB58
msgbox 0x823CB75 MSG_NORMAL '"RED: Wow, you beat me. It seems I\..."
end


'---------
' Strings
'---------
#org 0x23CB14
= RED: Well if it isn't the champ!\pI was on my way to KANTO just now.\n.................. hmmm

#org 0x23CB58
= .................. hmmm

#org 0x23CB75
= RED: Wow, you beat me. It seems I\nneed more training.\pMaybe Mt. Silver?\nHmm.... \p[player]!!!\n Keep training and keep battling. The POKéMON\p world is big and full of challenges!\n BON VOYAGE!

Here is a demo 0x0 trainer battle script -

#dynamic 0x800000

#org @start
lock
faceplayer
trainerbattle 0x0 0X03B 0x0 @introtext @wintext
msgbox @alreadydefeated 0x6
release
end

#org @alreadydefeated
= Congrats \v\h01 you won,\nNext time when we battle I will\ldefeat you for sure!

#org @wintext
= We will battle again next time\n\v\h01!

#org @introtext
= Get ready to lose \v\h01!!!


Hope it helps!!
-------------------------------------------------------------------------------------------------------------------------------------
My Works
Ash Sprite For You

kalarie July 4th, 2018 2:20 AM

@Alan Flygon

No, that script will crash the game... You shoudn't use the lock and faceplayer commands along with the trainerbattle command. Once the trainer sees you the game will crash.

@babyswagmonster

You should indeed use dynamic offsets, make a script something like this for a trainer:

Spoiler:
#dynamic 0x800000

#org @start
trainerbattle 0x0 0x12B 0x0 @intro @outro
special2 LASTRESULT 0x39
compare LASTRESULT 0x1
if 0x1 goto @rematch
msgbox @message 0x6
end

#org @rematch
trainerbattle 0x5 0x12B 0x0 @intro @outro
msgbox @message 0x6
end

#org @intro
= Enough loafing around, let's\nbattle!

#org @outro
= I should've never started this\nbattle.

#org @message
= It's so warm here, that I need to\ntake a rest very often.\pLuckily the large cacti around\nhere provide some nice shadow.

Babyswagmonster July 4th, 2018 5:16 PM

Quote:

Originally Posted by kalarie (Post 9897185)
@Alan Flygon

No, that script will crash the game... You shoudn't use the lock and faceplayer commands along with the trainerbattle command. Once the trainer sees you the game will crash.

@babyswagmonster

You should indeed use dynamic offsets, make a script something like this for a trainer:

Spoiler:
#dynamic 0x800000

#org @start
trainerbattle 0x0 0x12B 0x0 @intro @outro
special2 LASTRESULT 0x39
compare LASTRESULT 0x1
if 0x1 goto @rematch
msgbox @message 0x6
end

#org @rematch
trainerbattle 0x5 0x12B 0x0 @intro @outro
msgbox @message 0x6
end

#org @intro
= Enough loafing around, let's\nbattle!

#org @outro
= I should've never started this\nbattle.

#org @message
= It's so warm here, that I need to\ntake a rest very often.\pLuckily the large cacti around\nhere provide some nice shadow.

The dynamic still doesn't help. When I compile the script. This.....

#org 0x23CB14
= RED: Well if it isn't the champ!\nI was on my way to KANTO just now.\pLet us fight!

#org 0x23CB58
= How................


Becomes this....

#org 0x23CB14
= RED: Well if it isn't the champ!\nI was on my way to KANTO just now.\pHow................

#org 0x23CB58
= How................


So something is glitching put past the intro text.


All times are GMT -8. The time now is 2:26 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.