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)
-   -   [Archive] Script help thread (https://www.pokecommunity.com/showthread.php?t=120081)

Gold Tom September 8th, 2008 1:25 AM

Hey. I need to know if there is a way to prompt for the rival's name? I'd like to have a way to set his name outside of the introduction .

Thrace September 8th, 2008 2:31 AM

Quote:

Originally Posted by Gold Tom (Post 3922223)
Hey. I need to know if there is a way to prompt for the rival's name? I'd like to have a way to set his name outside of the introduction .

Theres definitely no easy way through scripting. As a rule of thumb, if it doesn't occur in the original games then there won't be a way to do it via scripting. What I mean is that there is no event to rename the rival in FR/LG/R/S/E so why would Nintendo make it possible?

Gold Tom September 8th, 2008 2:38 AM

Okay, thanks (again) for at least answering.

~SogeKing September 8th, 2008 5:03 AM

This script on works which the problem?

#include stdpoke.rbh

#org 0xABCDEF
lock
faceplayer
message 0xABBCDE
boxset 6
showpokepic PKMN_CELEBI 0xA 0x3
hidepokepic
release
end
#org 0xABBCDE
= uhm...c'e qualcosa sulla\nroccia\pShaymin Dio Della Natura

Quote:

Originally Posted by ~SogeKing (Post 3922442)
This script on works which the problem?

#include stdpoke.rbh

#org 0xABCDEF
lock
faceplayer
message 0xABBCDE
boxset 6
showpokepic PKMN_CELEBI 0xA 0x3
hidepokepic
release
end
#org 0xABBCDE
= uhm...c'e qualcosa sulla\nroccia\pShaymin Dio Della Natura

Hep pls And urgent T_T
It serves to me for mine hack

Sgt. Custard September 8th, 2008 11:21 AM

I have a question about scripting multichoice. So far I've got this (It's a long script, so I've left out the rest).

Code:

msgbox mainbankspeech 'Hello and welcome to SafeCash Bank...
callstd MSG_STANDARD
multichoice 0x0 0x0 0x1 0x1
CopyVar 0x1001 LASTRESULT
Compare 0x1001 0x0
If 0x1 Call @Withdraw
Compare 0x1001 0x1
If 0x2 Call @Deposit
Compare 0x1001 0x2
If 0x3 Call @Exit


But how do you change what displays as the choices in the multichoice box? That is the box actually has Withdraw, Deposit and Exit written out as choices.

Thanks

Thrace September 8th, 2008 11:45 AM

Quote:

Originally Posted by alexllew (Post 3922914)
I have a question about scripting multichoice. So far I've got this (It's a long script, so I've left out the rest).

Code:

msgbox mainbankspeech 'Hello and welcome to SafeCash Bank...
callstd MSG_STANDARD
multichoice 0x0 0x0 0x1 0x1
CopyVar 0x1001 LASTRESULT
Compare 0x1001 0x0
If 0x1 Call @Withdraw
Compare 0x1001 0x1
If 0x2 Call @Deposit
Compare 0x1001 0x2
If 0x3 Call @Exit


But how do you change what displays as the choices in the multichoice box? That is the box actually has Withdraw, Deposit and Exit written out as choices.

Thanks

Search for it with A-Text and edit it there.

Sgt. Custard September 8th, 2008 10:33 PM

Is there a particular offset multichoice options are stored at for a specific ID #?

Thrace September 9th, 2008 1:09 AM

Quote:

Originally Posted by alexllew (Post 3924686)
Is there a particular offset multichoice options are stored at for a specific ID #?

Probably, it would make sense that they are located in the same place. Just search for one of them to get the offset (it'll say in A-Text) and then using a GBA Pokemon table you can see if they are.

Sgt. Custard September 9th, 2008 1:39 PM

Thanks. Sorry if I'm being stupid, but whats a GBA Pokemon table? Is it like a hex editor or script editor or something?

destinedjagold September 9th, 2008 2:04 PM

elow...
since my question's related to scripting, I better post my question here. :P

In POKéMON Ruby, after we became 'champions' in the League, Latios will start flying around, right?
Is there a flag for Latios to appear? If so, then what is it? :\

Thankies in advance~

Thrace September 9th, 2008 7:09 PM

Quote:

Originally Posted by alexllew (Post 3926019)
Thanks. Sorry if I'm being stupid, but whats a GBA Pokemon table? Is it like a hex editor or script editor or something?

It just gives a hex value another value. Such as 0xCD is "A" in table 1 but in table 2 0xCD is "G". Its easier not to deal with those, just use A-Text.

Quote:

Originally Posted by Time (Post 3926082)
elow...
since my question's related to scripting, I better post my question here. :P

In POKéMON Ruby, after we became 'champions' in the League, Latios will start flying around, right?
Is there a flag for Latios to appear? If so, then what is it? :\

Thankies in advance~

Probably, either that or its a special. Just decompile the champion's script (its probably actually in the level script of the room where you register) using XSE or PKSV.

thethethethe September 9th, 2008 11:12 PM

Quote:

Originally Posted by Time (Post 3926082)
elow...
since my question's related to scripting, I better post my question here. :P

In POKéMON Ruby, after we became 'champions' in the League, Latios will start flying around, right?
Is there a flag for Latios to appear? If so, then what is it? :\

Thankies in advance~

Well, the Ruby TV script behaviour script is found at 0x1A6E72. There is this special, "special 0x129" but the problem with this is that you need to walk around for a long to actually know if that is the right thing.

Quote:

Originally Posted by alexllew (Post 3926019)
Thanks. Sorry if I'm being stupid, but whats a GBA Pokemon table? Is it like a hex editor or script editor or something?

A table file allows for easier text editing in a hex editor.

destinedjagold September 10th, 2008 12:39 AM

Quote:

Originally Posted by thethethethe (Post 3927245)
Well, the Ruby TV script behaviour script is found at 0x1A6E72. There is this special, "special 0x129" but the problem with this is that you need to walk around for a long to actually know if that is the right thing.

so it's a special...? :\
if so, then how can I deactivate it?

if it's a flag, the clearflag, right?
but special?
clearspecial?

thethethethe September 10th, 2008 2:18 AM

Quote:

Originally Posted by Time (Post 3927331)


so it's a special...? :\
if so, then how can I deactivate it?

if it's a flag, the clearflag, right?
but special?
clearspecial?

Well, sometimes there's an "off" special, but wouldn't it just be easier to just remove the special preventing it from occuring?

Sgt. Custard September 11th, 2008 7:40 AM

Thanks for the help dshayabusa and thex4, just one more (unrelated) question: is there a scripting command for getting the in-game clock time in ruby?

destinedjagold September 11th, 2008 8:03 AM

Quote:

Originally Posted by alexllew (Post 3930355)
Thanks for the help dshayabusa and thex4, just one more (unrelated) question: is there a scripting command for getting the in-game clock time in ruby?

here's a script example of the clock. ;)
thethethethe helped me make it. :)

Code:

#org $start
checkflag 0x29E
if 0x1 goto $done
message $fix
boxset 6
call 0x1B6A9B
pause 0x1E
setflag 0x29E
release
end

#org $done
message $sun
boxset 6
call 0x1B6A91
end

#org $sun
$sun 1 = \v\h01: It's a sundial...

#org $fix
$fix 1 = \v\h01: Oh... It's a sundial...\p\v\h01: I wonder what's the\ntime today...


dunno if this is the right code. :\

Shadows September 11th, 2008 5:01 PM

Compiled, this script changes...
And if I change the script so It doesn't change, it freezes...
Spoiler:
'-----------------------
#dynamic 0x71D028

#org @main
checkflag 0x200
if 0x0 goto @yes
if 0x1 goto @end

#ORG @end
release
end

#ORG @yes
lock
applymovement 0x3 @brocket
waitmovement 0x0
callstd 0x6
trainerbattle 1 0x1 0x1 @before @after
message @1
applymovement 0x3 @brocket2
release
end

#org @brocket
#raw 0x10 0x10 0x10 0x10 0x10 0x10

#org @before
= Hand over that POKEMON!\nIt belongs to Team BLIZZARD!

#org @after
= How could you beat me!

#org @1
= Team Blizzard will blacklist you!

#ORG @brocket2
#raw 0x11 0x11 0x11 0x11 0x11 0x11 0x11

Surf September 13th, 2008 2:45 PM

I need some help with this script i compile it and it goes like this

Spoiler:
#Dynamic 0x2DE517

#org @start
checkflag 0x828
if 0x0 goto @hey!
if 0x1 goto @end
end

#org @hey!
lock
msgbox @icant
boxset 0x6
applymovement 0xFF @back
waitmovement 0x0
release
end

#org @icant
= I can't leave without a\n pokedex.

#org @back
#raw 0x00 0xFE

#org @end
release
end


but when opened it just goes like this:
'-----------------------
#org 0x2DE517
Please help

Shadows September 13th, 2008 4:14 PM

Quote:

Originally Posted by Hackimon12 (Post 3936372)
I need some help with this script i compile it and it goes like this

Spoiler:
#Dynamic 0x2DE517

#org @start
checkflag 0x828
if 0x0 goto @hey!
if 0x1 goto @end
end

#org @hey!
lock
msgbox @icant
boxset 0x6
applymovement 0xFF @back
waitmovement 0x0
release
end

#org @icant
= I can't leave without a\n pokedex.

#org @back
#raw 0x00 0xFE

#org @end
release
end


but when opened it just goes like this:
'-----------------------
#org 0x2DE517
Please help

Get an offset with more bytes and try again.

Eletj September 15th, 2008 12:46 AM

Can someone help me with this? If I
Sorry bout it being compiled.
Spoiler:
'-----------------------
#org 0x71D3A8
lock
faceplayer
givepokemon 0x7 0x5 0x139 0x0 0x0 0x0
msgbox 0x871D3DC '" [player]: Whats all this?\nThe pro..."
setflag 0x829
special 0x181
setvar 0x407C 0x1
giveitem2 0x4 0x5 0x101
release
nop----Every time I compile, End becomes this.


'---------
' Strings
'---------
#org 0x71D3DC
= [player]: Whats all this?\nThe professor is always\lleaving stuff around.\pThis must be the\lPokemon he was going to\lgive me!! And some Pokeball\l too!!\l Is this a Pokedex?\p\v\hFDho1 recived a Squirtle\l 5 pokeballs and a \lPokedex!!

Help much appreciated.

Surf September 15th, 2008 12:48 AM

i don't get what our saying

Quote:

Originally Posted by T (Post 3931515)
Compiled, this script changes...
And if I change the script so It doesn't change, it freezes...
Spoiler:
'-----------------------
#dynamic 0x71D028

#org @main
checkflag 0x200
if 0x0 goto @yes
if 0x1 goto @end

#ORG @end
release
end


#ORG @yes
lock
applymovement 0x3 @brocket
waitmovement 0x0
callstd 0x6
trainerbattle 1 0x1 0x1 @before @after
message @1
applymovement 0x3 @brocket2
release
end

#org @brocket
#raw 0x10 0x10 0x10 0x10 0x10 0x10

#org @before
= Hand over that POKEMON!\nIt belongs to Team BLIZZARD!

#org @after
= How could you beat me!

#org @1
= Team Blizzard will blacklist you!

#ORG @brocket2
#raw 0x11 0x11 0x11 0x11 0x11 0x11 0x11

I think you need a sprite to do the walking so just make a person event with no offset

HackMew September 15th, 2008 1:20 AM

Quote:

Originally Posted by T (Post 3931515)
Compiled, this script changes...
And if I change the script so It doesn't change, it freezes...
Spoiler:
'-----------------------
#dynamic 0x71D028

#org @main
checkflag 0x200
if 0x0 goto @yes
if 0x1 goto @end

#ORG @end
release
end

#ORG @yes
lock
applymovement 0x3 @brocket
waitmovement 0x0
callstd 0x6
trainerbattle 1 0x1 0x1 @before @after
message @1
applymovement 0x3 @brocket2
release
end

#org @brocket
#raw 0x10 0x10 0x10 0x10 0x10 0x10

#org @before
= Hand over that POKEMON!\nIt belongs to Team BLIZZARD!

#org @after
= How could you beat me!

#org @1
= Team Blizzard will blacklist you!

#ORG @brocket2
#raw 0x11 0x11 0x11 0x11 0x11 0x11 0x11

Remember you should always put an end.
Also, avoid using flag 0x200 over and over again. Safer flags are those ranging from 0x1000 to 0xFFFF. A lot more than you'll ever need.
When using an if for checking flags, there's no need to put two ifs. In fact, if the first if is not executed, the rest of the script would be executed instead.
Checking flags, however, doesn't make sense if you don't set them.
After each applymovement command you should put a waitmovement 0x0 too.
And don't forget to put callstd/boxset in the right place. That is, right after the message/msgbox command.

This is the fixed script. It should work fine even if I haven't tested it.

Spoiler:
#dynamic 0x71D028

#org @main
checkflag 0x1002
if 0x0 goto @yes
release
end

#ORG @yes
lock
setflag 0x1002
applymovement 0x3 @brocket
waitmovement 0x0
trainerbattle 1 0x1 0x1 @before @after
message @1
callstd 0x6
applymovement 0x3 @brocket2
waitmovement 0x0
release
end

#org @brocket
#raw 0x10 0x10 0x10 0x10 0x10 0x10

#org @before
= Hand over that POKEMON!\nIt belongs to Team BLIZZARD!

#org @after
= How could you beat me!

#org @1
= Team Blizzard will blacklist you!

#ORG @brocket2
#raw 0x11 0x11 0x11 0x11 0x11 0x11 0x11



Quote:

Originally Posted by Hackimon12 (Post 3936372)
I need some help with this script i compile it and it goes like this

Spoiler:
#Dynamic 0x2DE517

#org @start
checkflag 0x828
if 0x0 goto @hey!
if 0x1 goto @end
end

#org @hey!
lock
msgbox @icant
boxset 0x6
applymovement 0xFF @back
waitmovement 0x0
release
end

#org @icant
= I can't leave without a\n pokedex.

#org @back
#raw 0x00 0xFE

#org @end
release
end


but when opened it just goes like this:
'-----------------------
#org 0x2DE517
Please help

When compiling a dynamic script, the offset you specify in the #dynamic part isn't going to be the exact same offset where the script will be actually compiled. This happen in most case since that offset (in your case 0x2DE517) is what XSE uses to search free space from.
Once compiled, the compiler log will show you the actual offset where the script got compiled.
As I said earlier, remember to use setflag after checking it.


Quote:

Originally Posted by Eletj (Post 3941098)
Can someone help me with this? If I
Sorry bout it being compiled.
Spoiler:
'-----------------------
#org 0x71D3A8
lock
faceplayer
givepokemon 0x7 0x5 0x139 0x0 0x0 0x0
msgbox 0x871D3DC '" [player]: Whats all this?\nThe pro..."
setflag 0x829
special 0x181
setvar 0x407C 0x1
giveitem2 0x4 0x5 0x101
release
nop----Every time I compile, End becomes this.


'---------
' Strings
'---------
#org 0x71D3DC
= [player]: Whats all this?\nThe professor is always\lleaving stuff around.\pThis must be the\lPokemon he was going to\lgive me!! And some Pokeball\l too!!\l Is this a Pokedex?\p\v\hFDho1 recived a Squirtle\l 5 pokeballs and a \lPokedex!!

Help much appreciated.

I guess you recompiled the script after compiling it. Well, you should know that if you don't pay attention, scripts may get ovewritten themselves, and that explains why you're getting a nop instead of end.
Don't forget to put callstd/boxset right after the message/msgbox command, anyway.

Try using this:

Spoiler:
#dynamic 0x71D3A8

#org @start
lock
faceplayer
givepokemon 0x7 0x5 0x139 0x0 0x0 0x0
msgbox @what
callstd 0x6
setflag 0x829
special 0x181
setvar 0x407C 0x1
giveitem2 0x4 0x5 0x101
release
end

#org @what
= [player]: Whats all this?\nThe professor is always\lleaving stuff around.\pThis must be the\lPokemon he was going to\lgive me!! And some Pokeball\l too!!\l Is this a Pokedex?\p\v\hFDho1 recived a Squirtle\l 5 pokeballs and a \lPokedex!!

Eletj September 15th, 2008 1:49 AM

Hackmew, I tried the script, but the game still just freezes. I also tried compiling at a different offset. Didn't work either.

The Abyss September 15th, 2008 1:53 AM

There was no setflag 0x828 there. I doubt that helps but I noticed it.

HackMew September 15th, 2008 2:23 AM

Quote:

Originally Posted by Eletj (Post 3941144)
Hackmew, I tried the script, but the game still just freezes. I also tried compiling at a different offset. Didn't work either.

The offset isn't the problem, obviously. The thing is you shouldn't use random setvar/special when you don't know what they do. Hence the freeze.
Also, if you give the player his/her fist Pokémon, you should enable the POKéMON menu flag as well. In FireRed it's 0x828. I did other few adjustments here and there.

Here's the fixed and working script. Simply compile it.

Spoiler:

#dynamic 0x71D3A8

#org @start
lock
faceplayer
givepokemon 0x7 0x5 0x139 0x0 0x0 0x0
msgbox @what
callstd 0x4
setflag 0x828
setflag 0x829
additem 0x4 0x5
loadpointer 0x0 @received
giveitem2 0x4 0x5 0x101
release
end

#org @what
= [player]: Whats all this?\nThe professor is always\lleaving stuff around.\pThis must be the\lPokemon he was going to\lgive me!! And some Pokeball\l too!!\l Is this a Pokedex?

#org @received
= [player] recived a Squirtle\n 5 pokeballs and a \lPokedex!!


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