The PokéCommunity Forums

The PokéCommunity Forums (https://www.pokecommunity.com/index.php)
-   Binary Hack Tutorials (https://www.pokecommunity.com/forumdisplay.php?f=66)
-   -   Sierra's MEGA-HUGE XSE Scripting Tutorial (https://www.pokecommunity.com/showthread.php?t=164276)

indohekrz July 26th, 2009 11:54 PM

Wow! This tutorial is answer my problem on scripting. Thank you.

boytjuh July 27th, 2009 3:52 PM

I saw someone asking a question so:
I started working on my own hack today. I never made any scripts for anything before but managed to make a give pokémon script, and made the character dissapear, but the only thing is that i needed a pokédex. Now i did a setflag 829 to obtain the pokédex but the pokémon giving character also tells my nationaldex data in a bugged way. Is there anyway to solve that?
Well here's the script, maybe some corrections possible? (should be :3) OR maybe another way to add pokédex?
Spoiler:
#dynamic 0x800000

#org @start
lock
faceplayer
checkflag 0x828
checkflag 0x829
msgbox @1 0x4
goto @take
release
end

#org @take
givepokemon 0x83 0x5 0x0 0x0 0x0 0x0
msgbox @2 0x4
waitfanfare
closeonkeypress
setflag 0x828
msgbox @3 0x6
compare LASTRESULT 0x1
setflag 0x829
call 0x1A743B
fadescreen 0x1
fadescreen 0x0
hidesprite 0x800F
setflag 0x200
release
end

#org @done
msgbox @4 0x6

#org @1
= Hi!\pYou should take this\nLAPRAS.\p It's dangerous out there\pwithout a Pokémon!

#org @2
= You obtained an LAPRAS!

#org @3
= You also need a Pokédex!\pYou received Pokédex!

#org @4
= I have to go now,\p See you around?

Dragonmaster91 July 27th, 2009 7:43 PM

Quote:

Originally Posted by boytjuh (Post 4909718)
I saw someone asking a question so:
I started working on my own hack today. I never made any scripts for anything before but managed to make a give pokémon script, and made the character dissapear, but the only thing is that i needed a pokédex. Now i did a setflag 829 to obtain the pokédex but the pokémon giving character also tells my nationaldex data in a bugged way. Is there anyway to solve that?
Well here's the script, maybe some corrections possible? (should be :3) OR maybe another way to add pokédex?
Spoiler:
#dynamic 0x800000

#org @start
lock
faceplayer
checkflag 0x828
checkflag 0x829
msgbox @1 0x4
goto @take
release
end

#org @take
givepokemon 0x83 0x5 0x0 0x0 0x0 0x0
msgbox @2 0x4
waitfanfare
closeonkeypress
setflag 0x828
msgbox @3 0x6
compare LASTRESULT 0x1
setflag 0x829
call 0x1A743B
fadescreen 0x1
fadescreen 0x0
hidesprite 0x800F
setflag 0x200
release
end

#org @done
msgbox @4 0x6

#org @1
= Hi!\pYou should take this\nLAPRAS.\p It's dangerous out there\pwithout a Pokémon!

#org @2
= You obtained an LAPRAS!

#org @3
= You also need a Pokédex!\pYou received Pokédex!

#org @4
= I have to go now,\p See you around?

You screwed it up bad... Let me fix it, hang on.

Edit: I'm not even going to boldificate the changes, thats how much I changed.

Code:

#dynamic 0x800000

#org @start
lock
faceplayer
checkflag 0x828
if 0x0 goto @take
release
end

#org @take
msgbox @1 0x6
givepokemon 0x83 0x5 0x0 0x0 0x0 0x0
fanfare 0x13E
msgbox @2 0x4
waitfanfare
closeonkeypress
setflag 0x828
msgbox @3 0x6
setflag 0x829
msgbox @4 0x6
fadescreen 0x1
fadescreen 0x0
hidesprite 0x800F
setflag 0x200
release
end

#org @1
= Hi!\pYou should take this\nLAPRAS.\p It's dangerous out there\pwithout a Pokémon!

#org @2
= You obtained an LAPRAS!

#org @3
= You also need a Pokédex!\pYou received Pokédex!

#org @4
= I have to go now,\p See you around?


Quote:

#org @done
msgbox @4 0x6
You did not even have anything pointing at that. So, that became "loose" data.

Quote:

#org @start
lock
faceplayer
checkflag 0x828
checkflag 0x829
msgbox @1 0x4
goto @take
release
end
Here is all you needed:

#org @start
lock
faceplayer
checkflag 0x828
if 0x1 goto @end
______________
and then put @take here without the #org @take.

I put the script in the simplest way I could, 'cause I felt lazy.

Or, simply:

Code:

#org @start
lock
faceplayer
checkflag 0x828
if 0x1 goto @end
msgbox @1 0x6
givepokemon 0x83 0x5 0x0 0x0 0x0 0x0
fanfare 0x13E
msgbox @2 0x4
waitfanfare
closeonkeypress
setflag 0x828
msgbox @3 0x6
setflag 0x829
msgbox @4 0x6
fadescreen 0x1
fadescreen 0x0
hidesprite 0x800F (This should actually be the sprite you are talking to, I recommend against 0x800F)
setflag 0x200
release
end


And #org @end would be like this:

#org @end
release
end

And your whole script:

Code:

#dynamic 0x800000

#org @start
lock
faceplayer
checkflag 0x828
if 0x1 goto @end
msgbox @1 0x6
givepokemon 0x83 0x5 0x0 0x0 0x0 0x0
fanfare 0x13E
msgbox @2 0x4
waitfanfare
closeonkeypress
setflag 0x828
msgbox @3 0x6
setflag 0x829
msgbox @4 0x6
fadescreen 0x1
fadescreen 0x0
hidesprite 0x800F
setflag 0x200
release
end

#org @end
release
end

#org @1
= Hi!\pYou should take this\nLAPRAS.\p It's dangerous out there\pwithout a Pokémon!

#org @2
= You obtained an LAPRAS!

#org @3
= You also need a Pokédex!\pYou received Pokédex!

#org @4
= I have to go now,\p See you around?


That is how I am used to doing it.

Does this help?

It should, because now, even I know what I am doing.

boytjuh July 28th, 2009 1:54 AM

Thanks ALOT! I've been looking what i had to do for a while lol, since I'm new at scripting. ;) EDIT: It works :D

Dragonmaster91 July 28th, 2009 5:53 AM

Quote:

Originally Posted by boytjuh (Post 4911188)
Thanks ALOT! I've been looking what i had to do for a while lol, since I'm new at scripting. ;) EDIT: It works :D

Told you, I know what I'm doing... Funny, a month ago, I would have had no clue...

justdieplz July 28th, 2009 10:07 AM

This thread is not for fixing scripts, please move to the script help thread by HackMew to continue

Dragonmaster91 July 28th, 2009 12:00 PM

Quote:

Originally Posted by justdieplz (Post 4912786)
This thread is not for fixing scripts, please move to the script help thread by HackMew to continue

Wow, that's nice of you. You won't help someone on a script that was obviously one of their first, instead you refer them over there. Next time, make sure at the very least, that no one has already helped them, AT THE VERY LEAST.

Gold Man July 28th, 2009 1:46 PM

Umm angian why dose the talking part dosn't come up?

Dragonmaster91 July 28th, 2009 2:32 PM

Quote:

Originally Posted by Gold Man (Post 4913619)
Umm angian why dose the talking part dosn't come up?

That's because it has loadpointer. Replace that with msgbox. Is it a question, or statement? If it is a statement, try msgbox @(pointer) 0x6. If it is a question, try msgbox @(pointer) 0x5.

All loadpointer does is.. load... Not necessarily load a text box, especially if it does not know which kind.

Pokepal17 July 29th, 2009 6:41 AM

Quote:

Originally Posted by Dragonmaster91 (Post 4913802)
That's because it has loadpointer. Replace that with msgbox. Is it a question, or statement? If it is a statement, try msgbox @(pointer) 0x6. If it is a question, try msgbox @(pointer) 0x5.

All loadpointer does is.. load... Not necessarily load a text box, especially if it does not know which kind.

Msgbox will work.
Loadpointer is a command used in the msgbox construct (loadpointer & callstd) and it works differently on it's own, if not used in that construct.

icyace July 29th, 2009 6:47 AM

This tutorial helped me a lot, tnx.

Dragonmaster91 July 29th, 2009 7:11 AM

Quote:

Originally Posted by Pokepal17 (Post 4916453)
Msgbox will work.
Loadpointer is a command used in the msgbox construct (loadpointer & callstd) and it works differently on it's own, if not used in that construct.

Thank you, I did not know that.

joshay July 29th, 2009 10:48 AM

Cheers for the tutorial, I've bookmarked it and use it for reference loads.
cheers :)

ruby July 31st, 2009 4:33 AM

Say I have the offset for some text, is there any way for me to find out the offset of the script which calls that text?

A search function would be handy, of course I haven't a clue whether that's possible though.

indohekrz July 31st, 2009 10:27 PM

How do I can activate national dex on Ruby/Sapphire???

Using flag or special?
What's the hex?

0m3GA ARS3NAL July 31st, 2009 10:36 PM

Quote:

Originally Posted by Counterfeit (Post 4925573)
Say I have the offset for some text, is there any way for me to find out the offset of the script which calls that text?

A search function would be handy, of course I haven't a clue whether that's possible though.

Yeah, lets sat the offset of the text is 0x823131, you would do a search (In a hex editor) for 31318208 (Because we use Hex reversal)

AaBbCcDd
would become
DdCcBbAa

Pokepal17 August 1st, 2009 5:00 AM

Quote:

Originally Posted by indohekrz (Post 4930052)
How do I can activate national dex on Ruby/Sapphire???

Using flag or special?
What's the hex?

No flag or special, I think it's ASM or editing something in the RAM.

0m3GA ARS3NAL August 1st, 2009 7:01 AM

Quote:

Originally Posted by Dragonmaster91 (Post 4931361)
To activate the Nat. Dex? No, that is a special, just which one. Here's a tip, look at the script that gives you the Nat. Dex, and use that.

Very Wrong.
There is no script in R/S that gives you the National Pokedex.
There is an ASM code / Action Replay code that does that.

HackinJohn August 1st, 2009 12:49 PM

Another quick question.
 
I've tried everything, so I need help.
I'm trying to make my Oak overworld (Person Event No.: 3) to disappear completely once I talk to him, and he does, but as soon as I come back to the map, he's back. o.O;

Spoiler:
#dynamic 0x71A36B

#org @start
lock
faceplayer
msgbox @1 0x4
closeonkeypress
fanfare 0x100
special 0x16F
waitfanfare
fadescreen 0x0
msgbox @2 0x6
applymovement 0x3 @oak
waitmovement 0x0
setflag 0x2000
release
end

#org @1
= Oh, [PLAYER], I'm glad I caught you!\pI forgot to give you your upgrade!

#org @2
= With that upgrade, you will be\nable to keep account of more than\ljust the Kanto Pokemon!\pIsn't it fantastic!?\pWell, I must be going. Don't let\nme down!

#org @oak
#raw 0x01
#raw 0x11
#raw 0x60
#raw 0x11
#raw 0xFE


Thanks ahead of time [:

hygz1223 August 3rd, 2009 9:00 AM

i need help in the giveitem script. i type it in and it says #define on line 21 with hs the msg_obtain

indohekrz August 4th, 2009 11:50 PM

Quote:

Originally Posted by HackinJohn (Post 4932576)
I've tried everything, so I need help.
I'm trying to make my Oak overworld (Person Event No.: 3) to disappear completely once I talk to him, and he does, but as soon as I come back to the map, he's back. o.O;

Spoiler:
#dynamic 0x71A36B

#org @start
lock
faceplayer
msgbox @1 0x4
closeonkeypress
fanfare 0x100
special 0x16F
waitfanfare
fadescreen 0x0
msgbox @2 0x6
applymovement 0x3 @oak
waitmovement 0x0
hidesprite 0x3
setflag 0x2000
release
end

#org @1
= Oh, [PLAYER], I'm glad I caught you!\pI forgot to give you your upgrade!

#org @2
= With that upgrade, you will be\nable to keep account of more than\ljust the Kanto Pokemon!\pIsn't it fantastic!?\pWell, I must be going. Don't let\nme down!

#org @oak
#raw 0x01
#raw 0x11
#raw 0x60
#raw 0x11
#raw 0xFE


Thanks ahead of time [:

Do you put the flag on Oak's overworld???

You must put:
People ID: 2000

Or maybe, you must use hidesprite (the red text).

NintendoWalkthrudude August 5th, 2009 11:53 PM

I find this tutorial very useful diego, but I have a question.

I want it so when you talk to Professor Oak he says, "Want a pokemon?" and if you say yes he gives you a totodile, but if you say no he gives you a cyndaquil anyways. How can I get this to happen? I tried combining both the YES/NO script with the give pokemon script and it didn't work..

indohekrz August 6th, 2009 12:36 AM

Quote:

Originally Posted by NintendoWalkthrudude (Post 4951010)
I find this tutorial very useful diego, but I have a question.

I want it so when you talk to Professor Oak he says, "Want a pokemon?" and if you say yes he gives you a totodile, but if you say no he gives you a cyndaquil anyways. How can I get this to happen? I tried combining both the YES/NO script with the give pokemon script and it didn't work..

Try this script:
Spoiler:

#dynamic 0x800000

#org @start

checkflag 0x828
if 0x1 goto @done
checkflag 0x828
if 0x0 goto @willgive
end

#org @done
lock
faceplayer
msgbox @already 0x6
release
end

#org @willgive
lock
faceplayer
msgbox @ask 0x5
compare LASTRESULT 0x0
if 0x1 goto @cyndaquil
compare LASTRESULT 0x1
if 0x1 goto @totodile
end

#org @cyndaquil
msgbox @givecynda 0x4
givepokemon 0x9B 0x5 0x0 0x0 0x0 0x0
fanfare 0x13E
msgbox @get 0x4
waitfanfare
msgbox @takecare 0x6
setflag 0x828
release
end

#org @totodile
msgbox @givetoto 0x4
givepokemon 0x9E 0x5 0x0 0x0 0x0 0x0
fanfare 0x13E
msgbox @get2 0x4
waitfanfare
msgbox @takecare 0x6
setflag 0x828
release
end

#org @already
= That is Johto pokemon.

#org @ask
= Want a pokemon?

#org @get
= [player] received Cyndaquil from Oak.

#org @get2
= [player] received Totodile from Oak.

#org @givecynda
= But, you need a pokemon.\pThis pokemon for you.

#org @givetoto
= Okay, this is for you.

#org @takecare
= Please take care of your\npokemon.



Attention: This only work if you don't have a pokemon.

If you have a pokemon, change the flag to other flag.
Example: ... 0x828 change to ... 0x900 (... = setflag or checkflag.)

NintendoWalkthrudude August 6th, 2009 10:07 AM

Quote:

Originally Posted by indohekrz (Post 4951106)
Try this script:
Spoiler:

#dynamic 0x800000

#org @start

checkflag 0x828
if 0x1 goto @done
checkflag 0x828
if 0x0 goto @willgive
end

#org @done
lock
faceplayer
msgbox @already 0x6
release
end

#org @willgive
lock
faceplayer
msgbox @ask 0x5
compare LASTRESULT 0x0
if 0x0 goto @cyndaquil
compare LASTRESULT 0x1
if 0x1 goto @totodile
end

#org @cyndaquil
msgbox @givecynda 0x4
givepokemon 0x9B 0x5 0x0 0x0 0x0 0x0
fanfare 0x13E
msgbox @get 0x4
waitfanfare
msgbox @takecare 0x6
setflag 0x828
release
end

#org @totodile
msgbox @givetoto 0x4
givepokemon 0x9E 0x5 0x0 0x0 0x0 0x0
fanfare 0x13E
msgbox @get2 0x4
waitfanfare
msgbox @takecare 0x6
setflag 0x828
release
end

#org @already
= That is Johto pokemon.

#org @ask
= Want a pokemon?

#org @get
= [player] received Cyndaquil from Oak.

#org @get2
= [player] received Totodile from Oak.

#org @givecynda
= But, you need a pokemon.\pThis pokemon for you.

#org @givetoto
= Okay, this is for you.

#org @takecare
= Please take care of your\npokemon.



Attention: This only work if you don't have a pokemon.

If you have a pokemon, change the flag to other flag.
Example: ... 0x828 change to ... 0x900 (... = setflag or checkflag.)

Thank you, but when I click NO, it just he just repeats the question!

Sierraffinity August 6th, 2009 10:25 AM

Quote:

Originally Posted by NintendoWalkthrudude (Post 4952628)
Thank you, but when I click NO, it just he just repeats the question!

Code:

#dynamic 0x800000

#org @start
checkflag 0x828
if 0x1 goto @done
checkflag 0x828
if 0x0 goto @willgive
end

#org @done
lock
faceplayer
msgbox @already 0x6
release
end

#org @willgive
lock
faceplayer
msgbox @ask 0x5
compare LASTRESULT 0x0
if 0x1 goto @cyndaquil
compare LASTRESULT 0x1
if 0x1 goto @totodile
end

#org @cyndaquil
msgbox @givecynda 0x4
givepokemon 0x9B 0x5 0x0 0x0 0x0 0x0
fanfare 0x13E
msgbox @get 0x4
waitfanfare
msgbox @takecare 0x6
setflag 0x828
release
end

#org @totodile
msgbox @givetoto 0x4
givepokemon 0x9E 0x5 0x0 0x0 0x0 0x0
fanfare 0x13E
msgbox @get2 0x4
waitfanfare
msgbox @takecare 0x6
setflag 0x828
release
end

#org @already
= That is Johto pokemon.

#org @ask
= Want a pokemon?

#org @get
= [player] received Cyndaquil from Oak.

#org @get2
= [player] received Totodile from Oak.

#org @givecynda
= But, you need a pokemon.\pThis pokemon for you.

#org @givetoto
= Okay, this is for you.

#org @takecare
= Please take care of your\npokemon.


Before, the script was checking for "if not no, goto @cyndaquil" and "if yes, it's yes, then go to @totodile", but I fixed it.


All times are GMT -8. The time now is 8:11 PM.


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.