• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Our weekly protagonist poll is now up! Vote for your favorite Conquest protagonist in the poll by clicking here.
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Archive] Script help thread

Status
Not open for further replies.
OK I kinda get it a little better now.... I can post images too, so here is what happens when I click Open Script in Events:

[PokeCommunity.com] [Archive] Script help thread





And here is what happens when I manually put in a Trainer's offset... it shows 3 lines, but they are all the same thing:

[PokeCommunity.com] [Archive] Script help thread
 
"Programmers start counting at 0. The rest of the world starts counting at 1."

When comparing the result of a yes/no message, you can either get 0x0 or 0x1, where 0x0 is the "NO" answer and 0x1 is the "YES" one.
Except that, when there are only 2 type of choices (like in your case), it doesn't make a lot of sense checking the answer two times. If it's yes, it can't be no and vice-versa.
For more details, see the fixed and optimized script below:

Spoiler:


[/code]
Uhh, it still doesnt work. How does a multi command script look like?
 
What's wrong with this script? I haven't been able to get it to work..... all the person does is just stand there, and nothing happens. Also, no other script works either :( One other thing..... is it normal that when you start the game after scripting, that the game is a little.... "laggy" I guess you'd say? Like, I can press Left and my character goes Left twice or all the way, even if I let go. Just an example. Anyway, here's the script:


#dynamic 0x71B69C

#org @start
lock
faceplayer
message @1
boxset 0x6
givepokemon 0x6 0x5 0x0 0x0 0x0 0x0
message @2
boxset 0x6
release
end

#org @1
= Have a Charizard\n, on the house :)

#org @2
= You got Charizard!\nWhat a nice guy.
 
Uhh, it still doesnt work. How does a multi command script look like?

Did you actually try it? Because I did, and it was working fine.
I'm wondering what were you expecting the script to do...
Sure, a multichoice could be better in this case, just decompile an in-game script.


What's wrong with this script? I haven't been able to get it to work..... all the person does is just stand there, and nothing happens. Also, no other script works either :( One other thing..... is it normal that when you start the game after scripting, that the game is a little.... "laggy" I guess you'd say? Like, I can press Left and my character goes Left twice or all the way, even if I let go. Just an example. Anyway, here's the script:


Spoiler:

There's nothing wrong with the script...
Note: even if there's not free space available on that offset you used for the #dynamic, XSE is smart enough to scan the ROM anyway, looking for free space.
Try compiling the same script on a clean ROM.
 
OK, so why won't XSE decompile a script? I posted a screenshot already of what happens when I manually put in an offset, and if I just click Open Script.
 
OK, so why won't XSE decompile a script? I posted a screenshot already of what happens when I manually put in an offset, and if I just click Open Script.

Are you sure your ROM is clean? Check that.

If not, reinstalling XSE, and choose it as a script editor again on Advance map.
If this doesn't work, then your ROM is probably corrupted.
 
Yea, it was just the ROM FireRed, cause I just tried on LeafGreen and it worked. Still trying to figure out why my script isn't working, but on LeafGreen Advance Map isn't finding any free space for some reason
 
Yea, it was just the ROM FireRed, cause I just tried on LeafGreen and it worked. Still trying to figure out why my script isn't working, but on LeafGreen Advance Map isn't finding any free space for some reason

What do you man Advance map is not finding free space? Do you mean free space for the scripts?

If so, then I advise you to use a HEX editor to find the free space, or download Free Space Finder, and put it in the same folder as XSE, and when you want to find free space, open XSE, and go to Tool>Free Space Finder.
 
Ok, this script is supposed to have a person give me 6 Lucky Eggs, and I put them in my bag. It will, of course check if my bag is full or not. But when he goes to give me the item, the message runs over into the one he's supposed to say after I get the items, and the screen goes black with some red. What'd I do wrong? Script:


'-----------------------
#org 0x167EDA
lock
faceplayer
checkflag 0x230
if 0x1 goto 0x8167F24
msgbox 0x8183279 '"Hi!\nI fought a CHANSEY, and got this item.\pI..."
callstd 0x4
textcolor 0x3
checkitemamount 0xD 0x1
compare LASTRESULT 0x0
if 0x1 goto 0x81A6BD5
bufferitem 0x6 0xC5
fanfare 0x101
msgbox2 0x81A51D2 '"Obtained the [buffer2]!"
waitmsgbox
waitfanfare
additem 0xD 0x1
msgbox 0x8183363 '"[player] put the LUCKY EGG(S) away in\nth..."
callstd 0x4
call 0x81A6651
setflag 0x230
release
end

'-----------------------
#org 0x167F24
msgbox 0x8183323 '"Please visit the POKé MART if you need\nPOK..."
callstd 0x4
release
end

'-----------------------
#org 0x1A6BD5
textcolor 0x3
msgbox 0x81A521E '"Too bad!\nThe BAG is full[.]"
callstd 0x4
release
end

'-----------------------
#org 0x1A6651
copyvar 0x8012 0x8013
return


'---------
' Strings
'---------
#org 0x183279
= Hi!\nI fought a CHANSEY, and got this item.\pI really don't need it, so\nI suppose you can have it.\pPlease, no thanks is necessary.\pHere, I'll even give you 6.\nHave fun with them!

#org 0x1A51D2
= Obtained the [buffer2]!

#org 0x183363
= [player] put the LUCKY EGG(S) away in\nthe BAG's ITEMS POCKET.

#org 0x183323
= Please visit the POKé MART if you need\nany POKé BALLS for catching POKéMON.

#org 0x1A521E
= Too bad!\nThe BAG is full[.]





EDIT: Nevermind, I got that script working properly. Except, instead of saying "[player] put the [item] in BAG", it just says "ON." Anyone know why? Here is the fixed script:





'-----------------------
#org 0x167EDA
lock
faceplayer
checkflag 0x230
if 0x1 goto 0x8167F24
msgbox 0x8183279 '"Hi! I fought\na CHANSEY, and got this item.\pI..."
callstd 0x4
textcolor 0x3
checkitemamount 0xC5 0x1
compare LASTRESULT 0x0
if 0x1 goto 0x81A6BD5
bufferitem 0x1 0xC5
fanfare 0x101
msgbox2 0x81A51D2 '"Obtained the [buffer2]!"
waitmsgbox
waitfanfare
additem 0xC5 0x6
msgbox 0x8183363 '"[player] put the LUCKY EGG(S) away in\nth..."
callstd 0x4
call 0x81A6651
setflag 0x230
release
end

'-----------------------
#org 0x167F24
msgbox 0x8183323 '"Please visit the POKé MART if you need\nPOK..."
callstd 0x4
release
end

'-----------------------
#org 0x1A6BD5
textcolor 0x3
msgbox 0x81A521E '"Too bad!\nThe BAG is full[.]"
callstd 0x4
release
end

'-----------------------
#org 0x1A6651
copyvar 0x8012 0x8013
return


'---------
' Strings
'---------
#org 0x183279
= Hi! I fought\na CHANSEY, and got this item.\pI really don't need it, so\nI suppose you can have it.\pPlease, no thanks is necessary.\pHere, you can have 6.\nHave fun with it!

#org 0x1A51D2
= Obtained the [buffer2]!

#org 0x183363
= [player] put the LUCKY EGG away in\nthe BAG's ITEMS POCKET.

#org 0x183323
= Please visit POKé MART if you need\nPOKé BALLS for catching POKéMON.

#org 0x1A521E
= Too bad!\nThe BAG is full[.]
 
Last edited:
Okay I need a script that does this:
When you walk downstairs from your room in FR, your mom gets this ! sign on top of her head and walks over to you. she says:

Hey Honey, Happy Birthday! Guess what, we got a call about dad!... We'll talk about that later.. Nows the time for celebration! Anyways, I'll be out on the beach catching some fish. Bye!

and then she walks out. Thanks guys =]
 
Ok, this script is supposed to have a person give me 6 Lucky Eggs, and I put them in my bag. It will, of course check if my bag is full or not. But when he goes to give me the item, the message runs over into the one he's supposed to say after I get the items, and the screen goes black with some red. What'd I do wrong? Script:


'-----------------------
#org 0x167EDA
lock
faceplayer
checkflag 0x230
if 0x1 goto 0x8167F24
msgbox 0x8183279 '"Hi!\nI fought a CHANSEY, and got this item.\pI..."
callstd 0x4
textcolor 0x3
checkitemamount 0xD 0x1
compare LASTRESULT 0x0
if 0x1 goto 0x81A6BD5
bufferitem 0x6 0xC5
fanfare 0x101
msgbox2 0x81A51D2 '"Obtained the [buffer2]!"
waitmsgbox
waitfanfare
additem 0xD 0x1
msgbox 0x8183363 '"[player] put the LUCKY EGG(S) away in\nth..."
callstd 0x4
call 0x81A6651
setflag 0x230
release
end

'-----------------------
#org 0x167F24
msgbox 0x8183323 '"Please visit the POKé MART if you need\nPOK..."
callstd 0x4
release
end

'-----------------------
#org 0x1A6BD5
textcolor 0x3
msgbox 0x81A521E '"Too bad!\nThe BAG is full[.]"
callstd 0x4
release
end

'-----------------------
#org 0x1A6651
copyvar 0x8012 0x8013
return


'---------
' Strings
'---------
#org 0x183279
= Hi!\nI fought a CHANSEY, and got this item.\pI really don't need it, so\nI suppose you can have it.\pPlease, no thanks is necessary.\pHere, I'll even give you 6.\nHave fun with them!

#org 0x1A51D2
= Obtained the [buffer2]!

#org 0x183363
= [player] put the LUCKY EGG(S) away in\nthe BAG's ITEMS POCKET.

#org 0x183323
= Please visit the POKé MART if you need\nany POKé BALLS for catching POKéMON.

#org 0x1A521E
= Too bad!\nThe BAG is full[.]





EDIT: Nevermind, I got that script working properly. Except, instead of saying "[player] put the [item] in BAG", it just says "ON." Anyone know why? Here is the fixed script:





'-----------------------
#org 0x167EDA
lock
faceplayer
checkflag 0x230
if 0x1 goto 0x8167F24
msgbox 0x8183279 '"Hi! I fought\na CHANSEY, and got this item.\pI..."
callstd 0x4
textcolor 0x3
checkitemamount 0xC5 0x1
compare LASTRESULT 0x0
if 0x1 goto 0x81A6BD5
bufferitem 0x1 0xC5
fanfare 0x101
msgbox2 0x81A51D2 '"Obtained the [buffer2]!"
waitmsgbox
waitfanfare
additem 0xC5 0x6
msgbox 0x8183363 '"[player] put the LUCKY EGG(S) away in\nth..."
callstd 0x4
call 0x81A6651
setflag 0x230
release
end

'-----------------------
#org 0x167F24
msgbox 0x8183323 '"Please visit the POKé MART if you need\nPOK..."
callstd 0x4
release
end

'-----------------------
#org 0x1A6BD5
textcolor 0x3
msgbox 0x81A521E '"Too bad!\nThe BAG is full[.]"
callstd 0x4
release
end

'-----------------------
#org 0x1A6651
copyvar 0x8012 0x8013
return


'---------
' Strings
'---------
#org 0x183279
= Hi! I fought\na CHANSEY, and got this item.\pI really don't need it, so\nI suppose you can have it.\pPlease, no thanks is necessary.\pHere, you can have 6.\nHave fun with it!

#org 0x1A51D2
= Obtained the [buffer2]!

#org 0x183363
= [player] put the LUCKY EGG away in\nthe BAG's ITEMS POCKET.

#org 0x183323
= Please visit POKé MART if you need\nPOKé BALLS for catching POKéMON.

#org 0x1A521E
= Too bad!\nThe BAG is full[.]

Which Fire Red rom are you using, the name of it, what is it :D
 
Which Fire Red rom are you using, the name of it, what is it :D

Actually I switched to LeafGreen because FireRed was corrupted :p But I actually fixed that script, there are no errors anymore :) I'm trying to make a dynamic one for some people to use, if they want, but so far I keep getting stuck, because it keeps acting like the event already happened.
 
Actually I switched to LeafGreen because FireRed was corrupted :p But I actually fixed that script, there are no errors anymore :) I'm trying to make a dynamic one for some people to use, if they want, but so far I keep getting stuck, because it keeps acting like the event already happened.

Make sure you're using proper flags and restart the game so all the flags are cleared.


Hey, one question:

Is it possible to create a wild battle where you can't run away from?

Anything is possible, but unless that's a coded feature built-in original games (through some particular special, for example) you will need ASM.
 
Hey, one question:

Is it possible to create a wild battle where you can't run away from?

It's possible, although I don't believe there are any battles that disable it. You could use the standard overworld encounter script though, to make the battle loop if you run.
 
It's possible, although I don't believe there are any battles that disable it. You could use the standard overworld encounter script though, to make the battle loop if you run.

Some pokemon don't let you run away (special effects) so could always make it with one of those pokemon, or edit the pokemon you wish to fight's effects etc.

As for me, i'm getting back into scripting, using xse but haven't got alot of examples to work with, can somebody please make me a script that does....

Well basicly as you go to leave the 1st town in my hack i would like the proffessor to show an exclamation mark over his head as you go to talk to him, i wan't him to say (i can script these bits sorta)

"oh hey [playername] i was meant to give you your pokemon today right?
Sorry i completely forgot, prof elm called me to johto so i'm leaving right away...
Theres really no time to run back to the lab or i'l miss my plane....
I tell ya what, here take this one -proffesor gives a lvl 5 bagon-

And then i would like him to never return to this map, im sure its possible just requirs setting flags im just not really great at it and need to see some examples, anyway ty in advance - zak
 
Some pokemon don't let you run away (special effects) so could always make it with one of those pokemon, or edit the pokemon you wish to fight's effects etc.

As for me, i'm getting back into scripting, using xse but haven't got alot of examples to work with, can somebody please make me a script that does....

Well basicly as you go to leave the 1st town in my hack i would like the proffessor to show an exclamation mark over his head as you go to talk to him, i wan't him to say (i can script these bits sorta)

"oh hey [playername] i was meant to give you your pokemon today right?
Sorry i completely forgot, prof elm called me to johto so i'm leaving right away...
Theres really no time to run back to the lab or i'l miss my plane....
I tell ya what, here take this one -proffesor gives a lvl 5 bagon-

And then i would like him to never return to this map, im sure its possible just requirs setting flags im just not really great at it and need to see some examples, anyway ty in advance - zak

Did you try decompiling the Oak script on FR/LG? That acts pretty much the same as you want. If you want the player to never return to that map you should remove any map connection and flight position.
 
Help

I dont know if this Thread does pokescrript scripts anymore but:

#org $start
checkflag 0x828
if b_true goto $done
message $1
boxset 6
applymovement 0x04 $move
pausemove 0x0
pause 0x30
message $Hello
boxset 6
playsound 0x13E
nop
applymovement 0x04 $move2
message $Hello
boxset 6
pausemove 0
fadesound 0x12C
nop
release
end
#org $done
release
end
#org $move
#raw 0x10 0x10 0x10 0x10 0x10 0x10 0x12 0x12 0x12 0x12 0x12 0x12 0x12 0xFE
#org $move2
#raw 0x13 0x13 0x13 0x13 0x13 0x13 0x11 0x11 0x11 0x11 0x11 0x11 0xFE
#org $hello
$1 1 =Hello,Whats your name\n\v\h01:My name is \v\h01.\lOh hello. im \v\h06\nI heard about the new\lType discoverie. Then when\nI got here i heard he\lwas Obbducted.\n\v\h01: I know, i have to find\lhim. hes my-\n\v\h06: Here have this\lI wont be needing that..
#org $2
$2 1 =Im going back to HOENN.

#org $start
lock
faceplayer
checkflag 0x829
message $1
boxset 6

setflag 0x829
release
end

#org $done

message $2
boxset 6
special 0x16F

release
end


#org $3
$3 1 =You Received Pokedex.

He is supposed to give you a pokedex and walk off. but insted it glitches like hell and makes my emulator close. im new to scripting so dont Curse me or make bad comments.
(You can laugh tho..:laugh:)
 
Last edited:
Status
Not open for further replies.
Back
Top