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)

Shadows August 24th, 2008 6:41 PM

Is there anything wrong with this script?
it doesn't work properly for me...
Spoiler:
'-----------------------
#dynamic 0x71A4DC

#org @main
checkflag 0x828
if 0x0 goto @done
message @1
boxset 5
compare LASTRESULT 0x1
if 0x1 goto @take
message @2
boxset 6
release
end

#org @take
givepokemon 0x1 0x5 0x0 0x0 0x0 0x0
fanfare 0x13E
message @3
boxset 0x4
waitfanfare
#raw 0x68
setflag 0x828
message @4
boxset 5
compare LASTRESULT 0x1
if 0x1 goto @name
message @5
boxset 6
release
end

#org @name
call 0x1A74EB
return

#org @done
end

#org @1
= It looks like this pokemon has\nan owner...\pWould you like to Steal it?

#org @2
= You Chicken!

#org @3
$3 1 =\c\h01\h02You stole a Pokemon!

#org @4
= \c\h01\h02Would you like to rename it?

#org @5
= \c\h01\h04Suckers...

Ninja Caterpie August 24th, 2008 11:16 PM

What's wrong with it in-game?

Master_Track August 25th, 2008 1:42 AM

well, if it's written like this, it'll only activate after you already got the pokemon (setflag 0x828).
But you only get the pokemon if it's activated, so...simply nothing happens, right?

the problem is at the beginning:

checkflag 0x828
if 0x0 goto

that means, if it is NOT set, it ends. and if it IS set, it continues. But the flag will be set later in the script.
so use
checkflag 0x828
if 0x1 goto

or

if B_true goto.

that should do it.

Semblance August 25th, 2008 4:35 PM

I was trying to test a flag script,:
Spoiler:
#dynamic 0x2DD100
#org @start
lock
faceplayer
checkflag 0x200
if 0x1 goto @exp1
if 0x0 goto @go
release
end
#org @expl
lock
faceplayer
setflag 0x200
msgbox @exp1
release
end
#org @go
lock
faceplayer
[email protected]
release
end
#org @exp1
= Hi
#org @go1
sup


But when I compile it using XSE it comes up as this:
Spoiler:
'-----------------------
#org 0x2DD101
lock
faceplayer
checkflag 0x200
if 0x1 goto 0x82DD12E
if 0x0 goto 0x82DD123
release
end
'-----------------------
#org 0x2DD12E
updatecoins 0xDD 0xFF
'-----------------------
#org 0x2DD123
lock

Ninja Caterpie August 27th, 2008 2:49 AM

Same problem here! Is it something wrong with XSE or myself?

The Abyss August 28th, 2008 1:26 AM

I don't know what's wrong with this...

Spoiler:
#dynamic 0x3B4D84

#org @start
lock
faceplayer
checkflag 0x200
if 0x0 goto @ask
if 0x1 goto @nope
release
end

#org @ask
lock
faceplayer
msgbox @wantornot
boxset 0x5
if 0x0 goto @here
if 0x1 goto @ok
release
end

#org @nope
lock
faceplayer
msgbox @yougot
boxset 0x6
release
end

#org @here
lock
faceplayer
msgbox @take
boxset 0x6
givepokemon 0x6 50 0x8B 0x0 0x0 0x0
setflag 0x828
setflag 0x200
fanfare 0x13E
waitfanfare
msgbox @gotit
release
end

#org @ok
lock
faceplayer
msgbox @right
boxset 0x6
release
end

#org @wantornot
= Would you like this\nPokemon?

#org @yougot
= Sorry I gave you one\nalready.

#org @take
= Here you go!

#org @gotit
= You recieved a Charizard!

#org @right
= Oh, That's okay.

Master_Track August 28th, 2008 1:33 AM

Quote:

Originally Posted by XDRules (Post 3886164)
I don't know what's wrong with this...

Spoiler:
#dynamic 0x3B4D84

#org @start
lock
faceplayer
checkflag 0x200
if B_true goto @nope
msgbox @wantornot
boxset 0x5
compare lastresult 0x1
if B_true goto @here
msgbox @right
boxset 0x6
release
end

#org @nope
lock
faceplayer
msgbox @yougot
boxset 0x6
release
end

#org @here
lock
faceplayer
msgbox @take
boxset 0x6
givepokemon 0x6 50 0x8B 0x0 0x0 0x0
setflag 0x828
setflag 0x200
fanfare 0x13E
waitfanfare
msgbox @gotit
release
end


#org @wantornot
= Would you like this\nPokemon?

#org @yougot
= Sorry I gave you one\nalready.

#org @take
= Here you go!

#org @gotit
= You recieved a Charizard!

#org @right
= Oh, That's okay.

Try it like this, and take a closer look on the structure. It's much easier like this ;)
Also you missed a compare lastresult line after the boxset 5.

The Abyss August 28th, 2008 1:39 AM

Quote:

Originally Posted by Semblance (Post 3879754)
I was trying to test a flag script,:
Spoiler:
#dynamic 0x2DD100
#org @start
lock
faceplayer
checkflag 0x200
if 0x1 goto @exp1
if 0x0 goto @go
release
end
#org @expl
lock
faceplayer
setflag 0x200
msgbox @exp1
release
end
#org @go
lock
faceplayer
[email protected]
release
end
#org @exp1
= Hi
#org @go1
sup


But when I compile it using XSE it comes up as this:
Spoiler:
'-----------------------
#org 0x2DD101
lock
faceplayer
checkflag 0x200
if 0x1 goto 0x82DD12E
if 0x0 goto 0x82DD123
release
end
'-----------------------
#org 0x2DD12E
updatecoins 0xDD 0xFF
'-----------------------
#org 0x2DD123
lock

Try this
Spoiler:
#dynamic 0xwhateveroffset

#org @start
lock
faceplayer
checkflag 0x202
if 0x0 goto @exp
if 0x1 goto @go
release
end

#org @exp
lock
faceplayer
setflag 0x202
msgbox @msg1
boxset 0x6
release
end

#org @go
lock
faceplayer
msgbox @msg2
boxset 0x6
release
end

#org @msg1
= Hi

#org @msg2
= sup


That works on mine: I think it was the exp1 was written expl the second time.

And thanks M_T that works now :D

Ninja Caterpie August 28th, 2008 1:45 AM

Ok, I made a script, but when I compile it, half of it disappears.
Is it my bad, or is it XSE's problem?

Here's the script, if you need it.
Code:

#dynamic 0x7266CC

#org 0x7266CC
checkflag 0x829
if 0x0 goto @end
message @moveit
boxset 6
playsong 0x112 0x0
applymovement 0xFF @wha
applymovement 0x3 @run
waitmovement 0x0
trainerbattle 0x1 0x1 0x0 @getoutoftheway @after @later
end

#org @later
message @damn
boxset 6
fadescreen 0x1
hidesprite 0x3
setflag 0x200
fadescreen 0x0
fadedefault
applymovement 0x4 @aide
waitmovement 0x0
message @this
boxset 6
message @gotdex
fanfare 0x13E
boxset 4
waitfanfare
closeonkeypress
setflag 0x829
message @bye
boxset 6
applymovement 0x4 @aideback
waitmovement 0x0
hdiesprite 0x4
setflag 0x202
end

#org @end
release
end

#org @moveit
= Move it!

#org @wha
#raw 0x53
#raw 0x00
#raw 0xFE

#org @run
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0xFE

#org @aide
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0xFE

#org @aideback
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0xFE

#org @getoutoftheway
= ???: Get out of my way!\pWhat? But I haven't done anything\nwrong!\pAIDE: Stop that man, v\h01!\nHe stole something!\p???: Ah, damn it!\nI didn't want it to come to this[.]

#org @after
= What in the? \nHow'd I lose?

#org @damn
= Fine, take this useless red box\nthen!\p[green_fr]You received a strange red box!\p[black_fr]I'm going. Don't follow.

#org @this
= Great job v\h01!\nI watched the battler from here!\pAnyway, that thing there is a\nPokedex! It records data on Pokemon\ponce you've caught them! You're\nbecoming a trainer, right?\pI'll give this one to you so you\ncan help us get information on the\pdifferent Pokemon in Rolok!

#org @gotdex
= [green_fr]You got the Pokedex!

#org @bye
= See you later, v\h01! \nI'm going back to the lab!


But it becomes
Code:

'-----------------------
#org 0x7266CC
checkflag 0xF
hidesprite2 0x7268 0x8 0x9
if 0x97 goto 0x8035301
setflag 0x200
fadescreen 0x0
fadedefault
applymovement 0x4 0x872676C
waitmovement 0x0
msgbox 0x87268CB '"Great job [player]!\nI watched the ..."
callstd 0x6
msgbox 0x87269E3 '"[green_fr]You got the Pokedex!"
fanfare 0x13E
callstd 0x6
setflag 0x829
msgbox 0x8726A03 '"See you later, [player]. \nI'm goin..."
callstd 0x6
applymovement 0x4 0x8726780
waitmovement 0x0
hidesprite 0x4
setflag 0x202
end

'-----------------------
#org 0x35301
comparefarbytetofarbyte 0x28004008 0x2053D102
setmapfooter 0x59F1

'-----------
' Movements
'-----------
#org 0x72676C
#raw 12 'Step Left (Normal)
#raw 12 'Step Left (Normal)
#raw 12 'Step Left (Normal)
#raw 12 'Step Left (Normal)
#raw 12 'Step Left (Normal)
#raw 11 'Step Up (Normal)
#raw 11 'Step Up (Normal)
#raw 11 'Step Up (Normal)
#raw 11 'Step Up (Normal)
#raw 11 'Step Up (Normal)
#raw 11 'Step Up (Normal)



Semblance August 28th, 2008 8:35 AM

Quote:

Originally Posted by XDRules (Post 3886176)
Try this
Spoiler:
#dynamic 0xwhateveroffset

#org @start
lock
faceplayer
checkflag 0x202
if 0x0 goto @exp
if 0x1 goto @go
release
end

#org @exp
lock
faceplayer
setflag 0x202
msgbox @msg1
boxset 0x6
release
end

#org @go
lock
faceplayer
msgbox @msg2
boxset 0x6
release
end

#org @msg1
= Hi

#org @msg2
= sup


That works on mine: I think it was the exp1 was written expl the second time.

And thanks M_T that works now :D

Thanks, that made me really confused:tired:

Shadows August 28th, 2008 3:38 PM

Yet another script...
This one freezes when it starts
Its pretty complicated,and Huge, but I would appreciate Help
Spoiler:
'-----------------------
#dynamic 0x71A4B8

#ORG @Main
message @DJ1
nop
message @ANN
applymovement 0xFF @move
waitmovement 0x1
message @DJ2
applymovement 0x3 @move1
waitmovement 0x1
hidesprite 0x3
release
end

#ORG @DJ1
= DJ: Hey!Yo, the world's smartest roomate!Check out the TV!\pDude,the news says that there was\na plane that fell over the Missouri River\llast night.\pThey can't find it, it's just gone!\nThere have been so many disasters lately.\lIt looks like it just might be the end of the\n world as we know it, and I feel fine.\pHowever, I'm worried about the World Cup coming up,\nI've been so excited to see it.\lWhat if the world's in ashes by then?\pAll this disaster on the news lately.\nIt's just, strange.Bah,\lit doesn't matter.I got up at six this morning.\pIt was by my battery watch, though,not the alarm clock.\nIt didn't go off.It's like, 8:30 now, school's\l half over by now.The lights went back on,\pthough, so I'm just waiting for the announcements.\nThey shoul-

#ORG @ANN
= Announcements:Anyway, today, the Triathalon Team will meet\nat the field after classes, and the photo\lclub will meet in the library.Let's see,\poh! I see we have some trainers that are getting\n their first Pokemon today.We have... Beau Bellum, Steven Sandler,\pand Cassidy...Hitler? Like? Never mind.And (Name) (Rival).So these four,\lplease report to the Starter Garden instead of first and second period,\ntoday. That will be all.

#ORG @DJ2
= DJ:Alright, well, I've got to go to class, now.\nGood luck on your starter.

#ORG @move
#raw 0x65 0xFE

#ORG @Move1
#raw 0x0E 0x10 0x10 0x10 0x13 0x13 0x13 0x13 0x13 0xFE

The Abyss August 28th, 2008 10:22 PM

Possibly because there are no boxset or callstd or whatever you use.

Master_Track August 29th, 2008 5:05 AM

That's exactly the problem, no callstd or boxset there :\
also, you may need "lock" before the message. dunno if you want it or not.

Shadows August 29th, 2008 1:09 PM

NVM My old post, can someone re-order the \n,\p, and \l's in these text boxes to fit?
Spoiler:
#org 0x71ABF2
= DJ: Hey!Yo, the world's smartest roomate!\pCheck out the TV!Dude,the news says that\nthere was a plane that fell over the Missouri River\llast night.\pThey can't find it, it's just gone!\nThere have been so many disasters lately.\lIt looks like it just might be the end of the\n world as we know it, and I feel fine.\pHowever, I'm worried about the World Cup coming up,\nI've been so excited to see it.\lWhat if the world's in ashes by then?\pAll this disaster on the news lately.\nIt's just, strange.Bah,\lit doesn't matter.I got up at six this morning.\pIt was by my battery watch, though,not the alarm clock.\nIt didn't go off.It's like, 8:30 now, school's\l half over by now.The lights went back on,\pthough, so I'm just waiting for the announcements.\nThey shoul-\p

#org 0x71BDD4
= Announcements:Anyway, today, the Triathalon Team will meet\nat the field after classes, and the photo\lclub will meet in the library.Let's see,\poh! I see we have some trainers that are getting\n their first Pokemon today.We have... Beau Bellum, Steven Sandler,\pand Cassidy...Hitler? Like? Never mind.And [PLAYER] [Rival].So these four,\lplease report to the Starter Garden instead of first and second period,\ntoday. That will be all.

#org 0x71BF88
= DJ:Alright, well, I've got to go to class, now.\nGood luck on your starter.

Ninja Caterpie August 29th, 2008 3:11 PM

Press Ctrl and T in XSE to open the Text fixer. Then, type in the text you need and yeah, it'll make it fit.

Zephiel August 29th, 2008 3:25 PM

I'm gald I found this thread. There's one thing and one thing only I need help with, and I know I've been asking around but I would like a specific answer and not a general one. In Pokemon Fire Red, after battling Giovanni, the screen fades to black and when it comes back, he's not there. How do I code this for other trainers? I sincerely thank anyone who helps me with this. I'm using pokescript, btw.

Chimchar 9 August 29th, 2008 3:39 PM

hey can anyone help or fix it please its a give pokemon script im using XSE
here it it :

'-----------------------
#org 0x800000
lock
faceplayer
checkflag 0x828
if 0x0 goto 0x8800014
if 0x1 goto 0x8800035
release
end
'-----------------------
#org 0x800014
givepokemon 0x37 0x5 0x4 0x0 0x0 0x0
fanfare 0x13E
waitfanfare
setflag 0x828
msgbox 0x880003F '"You got vulpix!"
callstd 0x6
release
end
'-----------------------
#org 0x800035
msgbox 0x8800050 '"well you only get one for\nfor a st..."
callstd 0x6
end

'---------
' Strings
'---------
#org 0x80003F
= You got vulpix!
#org 0x800050
= well you only get one for\nfor a starter

TB Pro August 29th, 2008 10:27 PM

I'm having trouble with an XSE script. It does fine until it gets to the giveitem part. It deos a screen of weird symbols ect. Is something wrong or what?
Spoiler:
Code:

#dynamic 0x71A24C

#ORG @begin
lock
faceplayer
checkflag 0x200
message @talk
boxset 6
applymovement 0x05 @move
waitmovement 0
message @talk1
boxset 6
applymovement 0x05 @move1
waitmovement 0
message @talk2
boxset 6
giveitem 0x109 0x1 0x6
setflag 0x829
special 0x16F
applymovement 0xFF @move2
waitmovement 0
setflag 0x200
warp 0x5 0x2 0x1 0x9 0xB
release
end

#ORG @talk
= \c\h01\h08Hello, I am \c\h01\h07Mr.Bill \c\h01\h08, to do\nbuisness with my you need a password.\p\c\h01\h06\v\h01: The password is \c\h01\h07"Noobcake".

#ORG @move
#RAW 0x62 0xFE

#ORG @talk1
= \c\h01\h08Oh! You must be \v\h01! I wanted\nto speak with you. As you\pknow your brother is a Gym\nLeader in the Orogon region. he sent\pa message via Staravia telling me\nhe discovered a new species of\pPok\h1Bmon. I want you to go on a ship\nto see your brother and bring\pme back a specimen \c\h01\h06\v\h01: Where is\nthe ticket?

#ORG @move1
#RAW 0x65 0xFE

#ORG @talk3
= \c\h01\h08Here take this \c\h01\h07Pok\h1Bdex. \c\h01\h08I want\nyou to come back here if you record\panything interesting on that device.\nYour brother has a Pok\h1Bmon for you\pto take on your journey. Now go!\nYou don't want to miss the\p\c\h01\h09ship!

#ORG @move2
#RAW 0x13 0x13 0x13 0x13 0x13 0x13 0x11 0x11 0x11 0x11 0xFE



El Moss August 30th, 2008 10:50 AM

I have a few scripty questions,

How do you make a script affect another event/person.

What do you write for it to show you or your rival's name.

(How) Can I change/add moves/abilities/TMs/HMs.

I am using Fire Red, thanks.

Thrace August 30th, 2008 6:13 PM

Quote:

Originally Posted by Zephiel (Post 3891138)
I'm gald I found this thread. There's one thing and one thing only I need help with, and I know I've been asking around but I would like a specific answer and not a general one. In Pokemon Fire Red, after battling Giovanni, the screen fades to black and when it comes back, he's not there. How do I code this for other trainers? I sincerely thank anyone who helps me with this. I'm using pokescript, btw.

Code:

#raw 53
#raw [peopleNumber]
#raw 00
setflag 0x[peopleID]
fadescreen 0


That should do it.

Quote:

Originally Posted by riolu 9 (Post 3891192)
hey can anyone help or fix it please its a give pokemon script im using XSE
here it it :

'-----------------------
#org 0x800000
lock
faceplayer
checkflag 0x828
if 0x0 goto 0x8800014
if 0x1 goto 0x8800035
release
end
'-----------------------
#org 0x800014
givepokemon 0x37 0x5 0x4 0x0 0x0 0x0
fanfare 0x13E
waitfanfare
setflag 0x828
msgbox 0x880003F '"You got vulpix!"
callstd 0x6
release
end
'-----------------------
#org 0x800035
msgbox 0x8800050 '"well you only get one for\nfor a st..."
callstd 0x6
end

'---------
' Strings
'---------
#org 0x80003F
= You got vulpix!
#org 0x800050
= well you only get one for\nfor a starter

Uhh... what happens? OR what is supposed to happen?

Quote:

Originally Posted by ¿TB Pro™ (Post 3892209)
I'm having trouble with an XSE script. It does fine until it gets to the giveitem part. It deos a screen of weird symbols ect. Is something wrong or what?
Spoiler:
Code:

#dynamic 0x71A24C

#ORG @begin
lock
faceplayer
checkflag 0x200
message @talk
boxset 6
applymovement 0x05 @move
waitmovement 0
message @talk1
boxset 6
applymovement 0x05 @move1
waitmovement 0
message @talk2
boxset 6
giveitem 0x109 0x1 0x6
setflag 0x829
special 0x16F
applymovement 0xFF @move2
waitmovement 0
setflag 0x200
warp 0x5 0x2 0x1 0x9 0xB
release
end

#ORG @talk
= \c\h01\h08Hello, I am \c\h01\h07Mr.Bill \c\h01\h08, to do\nbuisness with my you need a password.\p\c\h01\h06\v\h01: The password is \c\h01\h07"Noobcake".

#ORG @move
#RAW 0x62 0xFE

#ORG @talk1
= \c\h01\h08Oh! You must be \v\h01! I wanted\nto speak with you. As you\pknow your brother is a Gym\nLeader in the Orogon region. he sent\pa message via Staravia telling me\nhe discovered a new species of\pPok\h1Bmon. I want you to go on a ship\nto see your brother and bring\pme back a specimen \c\h01\h06\v\h01: Where is\nthe ticket?

#ORG @move1
#RAW 0x65 0xFE

#ORG @talk3
= \c\h01\h08Here take this \c\h01\h07Pok\h1Bdex. \c\h01\h08I want\nyou to come back here if you record\panything interesting on that device.\nYour brother has a Pok\h1Bmon for you\pto take on your journey. Now go!\nYou don't want to miss the\p\c\h01\h09ship!

#ORG @move2
#RAW 0x13 0x13 0x13 0x13 0x13 0x13 0x11 0x11 0x11 0x11 0xFE



You have an incorrect pointer, @talk2 isn't included in your script.

Quote:

Originally Posted by El_Moss (Post 3893894)
I have a few scripty questions,

How do you make a script affect another event/person.

What do you write for it to show you or your rival's name.

(How) Can I change/add moves/abilities/TMs/HMs.

I am using Fire Red, thanks.

1) The only thing you can really effect is their movements. That is done using:
Code:

applymovement 0x[peopleNumber] @moveOffset

#org @moveOffset
#raw[list of movements] 0xFE


2) \v\h06 or [rival]
3) That isn't a scripting question. You must either use hex or programs to edit them. Look in the toolbox there are a lot of them.

Please take the time to read some tutorials first. You are wasting everyones time.

Master_Track August 30th, 2008 10:36 PM

er..wasn't the rival \v\h06? ( and the hero is \v\h01, he asked that as well ^^)
I may be wrong cause I hardly ever use it, but I think it was \v\h06, or [PLAYER] if he's using XSE.

The Abyss August 30th, 2008 10:49 PM

Yea Rival is \v\h06 and Player is \v\h01. But in XSE it's easier to do [player] or [rival].

Thrace August 30th, 2008 10:50 PM

Quote:

Originally Posted by Master_Track (Post 3895726)
er..wasn't the rival \v\h06? ( and the hero is \v\h01, he asked that as well ^^)
I may be wrong cause I hardly ever use it, but I think it was \v\h06, or [PLAYER] if he's using XSE.

Oh lol, yeah. xD
I always use [player] and [rival] too.

Chimchar 9 August 31st, 2008 5:06 AM

@dshayabusa- my script is a give pokemon script so its supposed to give you a pokemon. but when i speak to him he doesnt speak or do nothing.
so do you know anything that could fix it

Master_Track August 31st, 2008 6:02 AM

Code:

#dynamic 0x[offset]

#org @begin
lock
faceplayer
checkflag 0x828
if B_true goto @done
givepokemon 0x37 0x5 0x4 0x0 0x0 0x0
fanfare 0x13E
msgbox @got
callstd 0x6
waitfanfare
closeonkeypress
setflag 0x828
release
end

#org @done
lock
msgbox @onlyone
callstd 0x6
release
end

#org @got
= You got [red_fr]VULPIX!

#org @onlyone
= Well, you only get one for\na starter.


Try it like this.

I just tried fixing it like it was and I hope it works.


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