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)
-   -   Script I am tying to script, am I doing it wrong? (https://www.pokecommunity.com/showthread.php?t=431361)

McPaul February 22nd, 2020 6:43 AM

I am tying to script, am I doing it wrong?
 
I'm using Fire Red.

The first script I want to change is the Rival's one. It is like this:

Quote:

'---------------
#org 0x16955F
lock
faceplayer
compare 0x4055 0x3
if 0x1 goto 0x816958B
compare 0x4055 0x2
if 0x1 goto 0x8169581
msgbox 0x818DC67 MSG_KEEPOPEN '"[rival]: What, it's only [player]?..."
release
end

'---------------
#org 0x16958B
msgbox 0x818DD75 MSG_KEEPOPEN '"[rival]: My POKéMON looks a lot\nt..."
release
end

'---------------
#org 0x169581
msgbox 0x818DCE2 MSG_KEEPOPEN '"[rival]: Heh, I don't need to be\n..."
release
end


'---------
' Strings
'---------
#org 0x18DC67
= [rival]: What, it's only [player]?\nGramps isn't around.

#org 0x18DD75
= [rival]: My POKéMON looks a lot\ntougher than yours.

#org 0x18DCE2
= [rival]: Heh, I don't need to be\ngreedy like you. I'm mature!\pGo ahead and choose, [player]!

And what I did is this:

Quote:

'---------------
#dynamic 0x800000
#org @main
lock
faceplayer
compare 0x4055 0x3
if 0x1 goto 0x816958B
compare 0x4055 0x2
if 0x1 goto 0x8169581
msgbox @text1 0x6
release
end

'---------------
msgbox @text2 0x6
release
end

'---------------
msgbox @text3 0x6
release
end


'---------
' Strings
'---------
#org @text1
= [rival]: What, it's only [player]?\nGramps isn't around.

#org @text2
= [rival]: My POKéMON's indeed a lot\ntougher than yours.

#org @text3
= [rival]: Heh, I already have one,\nand it's the best of all!\pGo ahead and choose, [player]!
I compiled everything and changed the script offset in Advance Map to correspond the one it gave me in XSE and saved everything. But when I play the ROM or try to reopen the script, it's still the old one! So I don't understand anything anymore. What did I do wrong and how do I do for this not to happen anymore? Could someone help me please? Thanks!

__fred__40 February 22nd, 2020 10:10 AM

It doesnt work like that,you cant script with static offsets(0x800000) you have to use dynamic offsets(@msg,@move,etc)
for instance for the rival

#dynamic 0x1695D7
#org @start
lock
faceplayer
compare 0x4055 0x3
if 0x1 goto @goto
compare 0x4055 0x2
if 0x1 goto @goto2
msgbox @msg1 0x4
release
end

#org @goto
msgbox @msg2 0x4
release
end

#org @goto2
msgbox @msg3 0x4
release
end

#org @msg1
= [rival]: What, it's only [player]?\nGramps isn't around.

#org @msg2
= [rival]: My POKéMON looks a lot\ntougher than yours.

#org @msg3
= [rival]: Heh, I don't need to be\ngreedy like you. I'm mature!\pGo ahead and choose, [player]!

Dr. Seuss February 22nd, 2020 11:29 AM

Quote:

Originally Posted by __fred__40 (Post 10128406)
>Sniff<

Actually no. Dynamic indicates where to start looking for free space. Op's script seems to be correct.

I can see the issue is that you're still indicating the main script to jump to the original script when you type the if 0x1 goto... and you indicate the vanilla offsets

It could also be you're not pasting the @main offset generated when you hit compile.

In addition, Labels @text2 and @text3 are never called and ignored when you compile it therefore.

McPaul February 22nd, 2020 12:37 PM

Thanks a lot for your answers.
What should I type in "goto" then?

Sorry I'm still a noob.

Dr. Seuss February 22nd, 2020 1:23 PM

Quote:

Originally Posted by McPaul (Post 10128449)
Thanks a lot for your answers.
What should I type in "goto" then?

Sorry I'm still a noob.

change them to whatever script you would like to get executed when jumped. SOmething like this:

Code:

'---------------
#dynamic 0x800000
#org @main
lock
faceplayer
compare 0x4055 0x3
if 0x1 goto @script1
compare 0x4055 0x2
if 0x1 goto @script2
msgbox @text1 0x6
release
end

'---------------
#org @script1
msgbox @text2 0x6
release
end

'---------------
#org @script2
msgbox @text3 0x6
release
end

'---------
' Strings
'---------
#org @text1
= [rival]: What, it's only [player]?\nGramps isn't around.

#org @text2
= [rival]: My POKéMON's indeed a lot\ntougher than yours.

#org @text3
= [rival]: Heh, I already have one,\nand it's the best of all!\pGo ahead and choose, [player]!


This will make your script completely different form the original one.

McPaul February 22nd, 2020 1:46 PM

Oh like this, okay I understand. Thank you!

McPaul February 23rd, 2020 5:32 AM

It worked pretty well. The last thing I want to ask is how do you know when the text line should end in XSE and when you have to make a new paragraph ?

MrMuggles February 23rd, 2020 6:25 AM

Quote:

Originally Posted by McPaul (Post 10128633)
It worked pretty well. The last thing I want to ask is how do you know when the text line should end in XSE and when you have to make a new paragraph ?

There's a "Text Adjuster" tool in XSE which helps with that. It'll let you type out what you want, convert it to the appropriate format and then insert it into the selected line in the script

Dr. Seuss February 23rd, 2020 10:31 AM

Quote:

Originally Posted by McPaul (Post 10128633)
It worked pretty well. The last thing I want to ask is how do you know when the text line should end in XSE and when you have to make a new paragraph ?

Press Ctrl + T and this will show the text adjuster where you can type without worrying of writing too many characters that may overflow the textbox

McPaul February 23rd, 2020 10:39 AM

Oh yeah thanks!


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