• 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!
  • 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.
Hey, Im pretty sure this script is correct, but when I try to compile it, this pops up,
"Run-time Error '457'
This key is already associated with an element of this collection."

This is my Script.
Code:
#org $start
checkflag 0x828
if b_true goto $bye
message $1
boxset 6
applymovement 0x01 $move
pause 0x0
applymovement 0x01 $move1
pause 0x30
applymovement 0xFF $move2
message $2
boxset 6
release
end

#org $bye
$bye 1 =Bye, and Happy Birthday.
release
end

#org $move
#raw 0x10 0x10 0x12 0x12 0x12 0xFE

#org $move1
#raw 0x12 0x10 0x10 0xFE

#org $move
#raw 0x30 0xFE

#org $1
$1 1 =Hey!

#org $2
$2 1 =Its your Birthday.Don't Leave\nwithout your Present.

This script is to prevent you from leaving your house without a Pokemon. Whats Wrong???
 
Hey, Im pretty sure this script is correct, but when I try to compile it, this pops up,
"Run-time Error '457'
This key is already associated with an element of this collection."

This is my Script.
Code:
#org $start
checkflag 0x828
if b_true goto $bye
message $1
boxset 6
applymovement 0x01 $move
pause 0x0
applymovement 0x01 $move1
pause 0x30
applymovement 0xFF $move2
message $2
boxset 6
release
end

#org $bye
$bye 1 = Bye, and Happy Birthday.
release
end

#org $move
#raw 0x10 0x10 0x12 0x12 0x12 0xFE

#org $move1
#raw 0x12 0x10 0x10 0xFE

#org $move[U][B]2[/B][/U]
#raw 0x30 0xFE

#org $1
$1 1 = Hey!

#org $2
$2 1 = Its your Birthday.Don't Leave\nwithout your Present.
This script is to prevent you from leaving your house without a Pokemon. Whats Wrong???
here, you wrote move a second time instead of move2. It should work now ;)
and don't forget to put a space after the equal sign of your messages.

how do i make this script happen only once

#org $begin
checkflag 0x200
if B_true goto $done

lock
faceplayer
message $lost
$lost 1 =i wonder where i am
boxset 6
setflag 0x200
release

#org $done
release
end


i placed one of those green squares with the yellow S on one of the map of advance map
and put in the offset
and when i play the game and walk over where the script is and it says i wonder where i am
when i walk over i aginit says the same thing
how do i make this only happen once

PLIZ HELP!!
you have to make an if-line, so that if its true (it has been activated before) it goes to $done (and $done just releases, so nothing happens a second time).
 
Last edited:
Okay, I have a script that I need to change the text for later, but right now I'm worried about the functionality of it.

It's not working right, You get the POKéMON, get to name it, and then it ends. The $done thing doesnt work, either... you can repeatedly do that.

Here's the code:
Code:
#org $GiveDex
lock
faceplayer
setflag 0x800
setflag 0x801
checkflag 0x203
if b_True gosub $Move1
checkflag 0x204
if b_True gosub $Move2
checkflag 0x205
if b_True gosub $Move3
checkflag 0x200
if B_true goto $done
message $Pokedex
$Pokedex 1 = I hope You like your new pokemon.\pWhile your on your journeys 

I have\la favour to ask you.\pProf OAK and I are trying to make an\lindex 

of everything pokemon.\pTake this pokedex with you and it\lwill log all the 

pokemon you see and catch.\pIt would greatly help our studies!
boxset 6
jingle
givepokemon 132 5 0
namepokemon
message $GotDex
$Gotdex 1 = You got the Pokedex!
setflag0x200
boxset 6
end

#org $Move1
applymovement 0xFF $Ball1Move
pausemove 0
return
#org $Move2
applymovement 0xFF $Ball2Move
pausemove 0
return
#org $Move3
applymovement 0xFF $Ball3Move
pausemove 0
return

#org $done
message $person2
boxset 6
release
end

#org $person2
$person2 = How's your POKéDEX?

#org $Ball3Move
#Binary 0x06
#org $Ball2Move
#Binary 0x06
#org $Ball1Move
#Binary 0x06 0x06 0x06 0x01 0xFE


Any suggestions?
 
try this then... :\
Code:
#org $GiveDex
lock
faceplayer
[COLOR="Red"]checkflag 0x200
if B_true goto $done[/COLOR]
setflag 0x800
setflag 0x801
checkflag 0x203
if b_True gosub $Move1
checkflag 0x204
if b_True gosub $Move2
checkflag 0x205
if b_True gosub $Move3
message $Pokedex
$Pokedex 1 = I hope You like your new pokemon.\pWhile your on your journeys 

I have\la favour to ask you.\pProf OAK and I are trying to make an\lindex 

of everything pokemon.\pTake this pokedex with you and it\lwill log all the 

pokemon you see and catch.\pIt would greatly help our studies!
boxset 6
jingle
givepokemon 132 5 0
namepokemon
message $GotDex
$Gotdex 1 = You got the Pokedex!
setflag 0x200
boxset 6
end

#org $Move1
applymovement 0xFF $Ball1Move
pausemove 0
return

#org $Move2
applymovement 0xFF $Ball2Move
pausemove 0
return

#org $Move3
applymovement 0xFF $Ball3Move
pausemove 0
return

#org $done
message $person2
boxset 6
release
end

#org $person2
$person2 = How's your POKéDEX?

#org $Ball3Move
[COLOR="red"]$Ball3Move 1 ;[/COLOR] #Binary 0x06 [COLOR="red"]0xFE[/COLOR]

#org $Ball2Move
[COLOR="red"]$Ball2Move 1 ;[/COLOR] #Binary 0x06 [COLOR="red"]0xFE[/COLOR]

#org $Ball1Move
[COLOR="red"]$Ball1Move 1 ;[/COLOR] #Binary 0x06 0x06 0x06 0x01 [COLOR="red"]0xFE[/COLOR]
 
Can anyone tell me whats wrong with this script???
Code:
#org $start
checkflag 0x828
if b_true goto $bye
message $1
boxset 6
applymovement 0x01 $move
pausemove 0x0
applymovement 0xFF $move3
pausemove 0x0
message $2
boxset 6
release
end

#org $bye
message $birthday
$birthday 1 = Bye, and Happy Birthday.
boxset 6
release
end

#org $move
#raw 0x10 0x12 0x12 0x12 0xFE

#org $move3
#raw 0x30 0xFE

#org $1
$1 1 = Hey!

#org $2
$2 1 = Its your Birthday.Don't leave\nwithout your present.
Also does anyone know how to take out the Prof. Oak intro.
 
Can you check this script I do not think it is correct.

#org $begin
lock
faceplayer
message $talk
Boxset 5
if B_true goto $answer
if B_false goto $noway
end

#org $answer
message $cool
Boxset 6
giveitem 0x1 1
If B_True goto $done
release
end

#org $noway
message $noway
boxset 6
if B_true goto $done 2
release
end

#org $done
message $done
boxset 6
release
end

#org $done2
message $done2
boxset 6
release
end

$cool = Awesome let me give you an item!!
$talk = hello, How are you? Would you like to join team rocket?
$noway = uh, How dare you!! GET AWAY!!!
$done = Thanks for Joining!! Giovanni Will be proud!!
$done2 = Get out of this town
 
But wait… if PokeScript isn't for dealing with the actual code that makes up the game… what IS it for?

Screw that… I'm gonna find scriptdec or XSE. (what's xse, is that the name of the program?)
 
Code:
#org $begin
lock
faceplayer
message $talk
Boxset 5
if B_true goto $answer
if B_false goto $noway
release
end

#org $answer
message $cool
Boxset 6
giveitem 0x1 1
If B_True goto $done
release
end

#org $noway
message $noway
boxset 6
if B_true goto $done 2
release
end

#org $done
message $done
boxset 6
release
end

#org $done2
message $done2
boxset 6
release
end

#org $cool
$cool = Awesome let me give you an item!!

#org $talk
$talk = hello, How are you? Would you like to join team rocket?

#org $noway
$noway = uh, How dare you!! GET AWAY!!!

#org $done
$done = Thanks for Joining!! Giovanni Will be proud!!

#org $done2
$done2 = Get out of this town!

I corrected the Script. Next time put it in Script help thread located in the scrapbox.
 
Hey guys, I need a bit of help. Does anyone know of a way to edit scripts in the game? Or at least have a look at them? I want to edit the Viridian City Mart script so it sets a certain falg, but if I could just have a look at the flag it already sets it would be fine. Otherwise, what script would I use if I just wanted to set a flag once someone walks upon a certain tile? Thanks guys!
 
I just need a small script guys. I want to make it so when a spot is stepped upon it sets a flag. I wasn't sure if how to do it. Thanks!
 
And you would just stick it as a 'script' on Advance Map?

EDIT: Just tried that script and it doesn't work. I got a 'run-time error 5' for an 'invalid procedure call or argument'.
 
Last edited:
I used exactly what you put.

#org $start
setflag 0x200
release
end

Should I not of?
 
Well, that's interesting, it started working this morning... Thanks for the help guys! Crazy...

Just one more question, what do all the nuimbers mean?

I'm talking about the ones on AMap.

Unknown
Var Number
Var Value
Unknown (Again..?)

Thanks!
 
I can honestly say I did everything exactly the same. I tested multiple times too...

I need some help with two things. Firstly... What's wrong with this script?

Code:
#ORG $ShowText
Lock
Faceplayer
checkflag 0x200
if B_TRUE goto $Rival2
message $AskMe
$AskMe 1 = [\v\h06\]: Hey \v\h06\!
boxset 6
compare LASTRESUILT B_TRUE
if B_False goto $Rival1
setflag 0x201
Release
end

message $Rival1
$NoCookie 1 = What took you so long? Did you sleep\nin? I'm not quite ready to go see\pthe Professor yet, how about you go\npick something up for me?\pThe MART clerc has a parcel of mine.\nDo you think you could go get it?
boxset 6
release
end

#ORG $Rival2
Lock
Faceplayer
checkflag 0x201
if B_TRUE goto $MeetYou
message $NoCookie
$NoCookie 1 = [\v\h06\]: Oh Hey!
boxset 6
if B_False goto $Thanks
Release
end

#ORG $MeetYou
Lock
Faceplayer
message $NoCookie
$NoCookie 1 = I'll meet you at PROF. IVY's soon.
boxset 6
release
end

message $Thanks
$NoCookie 1 = \v\h01\ gave \v\h06\ the PARCEL.\p[\v\h06\]: Wow, that was quick! Thanks for getting\nthis for me.\pI'm almost ready to go see PROF. IVY now, I just\nneed to get a few things.\pHow about I meet you there? 
boxset 6
release
end

Second, when plugging in that script (Compile) I get the error 457 (The key is already associated with an element of this collection). Does anyone know what causes this?

Thanks guys :)
 
Status
Not open for further replies.
Back
Top