• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Forum moderator applications are now open! Click here for details.
  • 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.

Script Help Thread (DO NOT REQUEST SCRIPTS)

Status
Not open for further replies.

droomph

weeb
4,285
Posts
12
Years
That wouldn't work at all, no offense. You created an @beaten 'message' pointer, and then filled it with another message command. Your game would freeze.
Well I took it from the actual ROM (saved it and copied it over) so I don't know what's wrong. Emerald BPEE.Oh heh yeah I wasn't paying attention now was I?

And no, it wouldn't freeze, it would display random characters until it ran across an FF.
 

droomph

weeb
4,285
Posts
12
Years
Can someone help me with this Script?
It is supposto be a regular trainer battle, then you can talk to him after to get an old rod.
What really happens is he spots you and then the game freezes
Code:
#dynamic 0x800000

#org @start
checkflag 0x1057
if 0x1 goto @end
trainerbattle 0x0 0x01F 0x0 @before @after
[COLOR="Red"][B]jump @part2 'you forgot this, put this where you want it to be[/B][/COLOR]
release
end

#org @before
= Hey Trainer!\pHave you ever felt the urge to\nfish?\pDefeat me and you can have one of\nmy RODS!

#org @after
= Good job!\pTalk to me again, and i'll\ngive you a ROD!

#org @part2
checkflag 0x1058
if 0x1 goto @end
msgbox @2 0x6
giveitem 0x106 0x1 0x0
setflag 0x1058
release
end

#org @2
= Since you proved you are a good TRAINER,\ptake this ROD!\pUse it to find POKEMON in the water!

#org @end
msgbox @1 0x6
release
end

#org @1
= How is that OLD ROD I gave you?
PLEASE put it in the [CODE] tags. (It helps me to read, at least.)

The thing should be fine; did you set everything correctly on Advance Map? Go check again, and that's probably the problem.
 

Echidna

i don't care what's in your hair
2,077
Posts
13
Years
Try adding a seperate msgbox after the battle.
Code:
#dynamic 0x800000

#org @start
trainerbattle 0x1 0x01A 0x0 @before @after
[B][I][COLOR="Red"]msgbox @beaten 0x2[/COLOR][/I][/B]
release
end

#org @before
= You can't pass!\pBoss ARIANA said no one can!

#org @after
= Urrf...\pStay out of TEAM ROCKET's way!

[B][I][COLOR="red"]#org @beaten
msgbox @beaten11 0x6
release
end[/COLOR][/I][/B]

#org @beaten11
= I shouldn't worry.\pThe boss will finish you off\nsoon enough.
Here is an example from the actual game for reference:
Code:
#org 0x81EC1CA
'-----------------------------------
trainerbattle 0x0 0x25B 0x0 0x829489E 0x82948F3
[B][I][COLOR="red"]msgbox 0x8294916[/COLOR][/I][/B] ' To keep winning my w...
callstd MSG_LOCK ' Built-in lock command
end


#org 0x829489E
= I'm going to keep winning and aim\nto be the best TRAINER.\pHelp me further my career!

#org 0x82948F3
= I ended up furthering your career[.]

[B][I][COLOR="red"]#org 0x8294916
= To keep winning my way up, I see that\nI have to catch more POK\eMON.[/COLOR][/I][/B]

Well I took it from the actual ROM (saved it and copied it over) so I don't know what's wrong. Emerald BPEE.Oh heh yeah I wasn't paying attention now was I?

And no, it wouldn't freeze, it would display random characters until it ran across an FF.

See the differences in red^^
The games script looped to offset 8294916 which contained a message:
#org 0x8294916
= To keep winning my way up, I see that\nI have to catch more POK\eMON.


You looped to @Beaten which lead to a sub-script naming it as a message script.

Can someone help me with this Script?
It is supposto be a regular trainer battle, then you can talk to him after to get an old rod.
What really happens is he spots you and then the game freezes


#dynamic 0x800000

#org @start
checkflag 0x1057
if 0x1 goto @end
trainerbattle 0x0 0x01F 0x0 @before @after
release
end

#org @before
= Hey Trainer!\pHave you ever felt the urge to\nfish?\pDefeat me and you can have one of\nmy RODS!

#org @after
= Good job!\pTalk to me again, and i'll\ngive you a ROD!

#org @part2
checkflag 0x1058
if 0x1 goto @end
msgbox @2 0x6
giveitem 0x106 0x1 0x0
setflag 0x1058
release
end

#org @2
= Since you proved you are a good TRAINER,\ptake this ROD!\pUse it to find POKEMON in the water!

#org @end
msgbox @1 0x6
release
end

#org @1
= How is that OLD ROD I gave you?

Ok, first off, you don't need the 'checkflag' command at the beginning of your script. 'Trainerbattle' checks itself, so if you've already battled the trainer, his 'trainer flag' would be set and the game would jump right over the 'trainerbattle' command.

Knowing this, you can bind the '@part2' sub-script along with the original script. (You also checked for flag 0x1057 when you meant to check for flag 0x1058).

You also never looped/pointed to the '@part2' sub-script. I don't know how the game was supposed to know it had to go there and continue the script.

This is how it'll look like debugged:

Code:
#dynamic 0x800000

#org @start
trainerbattle 0x0 0x01F 0x0 @before @after
checkflag 0x1058
if 0x1 goto @end
msgbox @2 0x6
giveitem 0x106 0x1 0x0
setflag 0x1058
release
end

#org @before
= Hey Trainer!\pHave you ever felt the urge to\nfish?\pDefeat me and you can have one of\nmy RODS!

#org @after
= Good job!\pTalk to me again, and i'll\ngive you a ROD!

#org @2
= Since you proved you are a good TRAINER,\ptake this ROD!\pUse it to find POKEMON in the water!

#org @end
msgbox @1 0x6
release
end

#org @1
= How is that OLD ROD I gave you?
 

Crocky

SuperScarlet!
97
Posts
15
Years
  • Seen Jul 23, 2020
@Everyone helping my fisherman script
Thanks it works perfectly now :D

Hello guys, me here again with a new problem. I can't get the movements to work in this script. Everything else works fine.
Code:
#dynamic 0x800000
#org @start
lock
faceplayer
playsong 0x020F 0x0
msgbox @1 0x6
applymovement 0x5 @move1
waitmovement 0x5
setflag 0x1061
playsong 0x020E 0x0
release
end

#org @move1
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0xFE

#org @1
= I have nothing cool to say.
 

DrFuji

[I]Heiki Hecchara‌‌[/I]
1,691
Posts
14
Years
@Everyone helping my fisherman script
Thanks it works perfectly now :D

Hello guys, me here again with a new problem. I can't get the movements to work in this script. Everything else works fine.
Code:
#dynamic 0x800000
#org @start
lock
faceplayer
playsong 0x020F 0x0
msgbox @1 0x6
applymovement 0x5 @move1
waitmovement 0x5
setflag 0x1061
playsong 0x020E 0x0
release
end

#org @move1
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0xFE

#org @1
= I have nothing cool to say.

I can't see anything wrong with it from a scripting perspective, so are you sure that you're using the 'Person Event Number' rather then the regular person number? You could also change the byte after waitmovement to 0x0 if you wanted to.
 

droomph

weeb
4,285
Posts
12
Years
@Everyone helping my fisherman script
Thanks it works perfectly now :D

Hello guys, me here again with a new problem. I can't get the movements to work in this script. Everything else works fine.
Code:
#dynamic 0x800000
#org @start
lock
faceplayer
playsong 0x020F 0x0
msgbox @1 0x6
applymovement 0x5 @move1
waitmovement 0x5
setflag 0x1061
playsong 0x020E 0x0
release
end

#org @move1
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0xFE

#org @1
= I have nothing cool to say.
Use lockall instead of lock and faceplayer. Also, remember to use releaseall instead if you're going to do that.

Rule 33: Lurk Moar
 

wierddude22

New hacker
24
Posts
12
Years
Me again, I have adjusted my script again and it is almost working

Spoiler:


It makes you step back but the message box doesn't even appear, do i have to use a different type of message box?

Guys, I have tried everything with this script but the message box doesn't appear at all
 

wierddude22

New hacker
24
Posts
12
Years
There is nothing in the script that should stop it from displaying. Are you sure you're using XSE version 1.1.1?

I have the oldest version, i can't download a newer one as the main link is broken. So unless you can send me the file I'll have to stick with it
 
Last edited:
2
Posts
12
Years
  • Seen Feb 18, 2012
Why wont the re battle work?
I made it so after you beat him it clears his trainer flag so you can battle him forever and ever
Whats wrong?
#dynamic 0x600000

#org @start
trainerbattle 0x0 0x039 0x0 @before @after
msgbox @beaten 0x6
cleartrainerflag 0x039
release
end

#org @before
= I never get tired of battling!\pLets battle!

#org @after
= That was fun!\pWant to battle again?

#org @beaten
= Your good!\pWant to battle again?
 

DrFuji

[I]Heiki Hecchara‌‌[/I]
1,691
Posts
14
Years
I have the oldest version, i can't download a newer one as the main link is broken. So unless you can send me the file I'll have to stick with it

Yeah, if you're not using 1.1.1 that's the most likely reason why your scripts aren't working as intended. Doing a quick search for the 1.1.1 version on Google brought up several thousand results so you could try downloading it from one of those.

Why wont the re battle work?
I made it so after you beat him it clears his trainer flag so you can battle him forever and ever
Whats wrong?
#dynamic 0x600000

#org @start
trainerbattle 0x0 0x039 0x0 @before @after
msgbox @beaten 0x6
cleartrainerflag 0x039
release
end

#org @before
= I never get tired of battling!\pLets battle!

#org @after
= That was fun!\pWant to battle again?

#org @beaten
= Your good!\pWant to battle again?

This is happening because you're using the 0x0 type trainer battle, which immediately ends the script once the battle is over. Try using this script which makes use of the 0x1 trainerbattle type:

Code:
#dynamic 0x800000

#org @start
trainerbattle 0x1 0x39 0x0 @before @after @later

#org @later
msgbox @beaten 0x2
cleartrainerflag 0x39
release
end

#org @before
= I never get tired of battling!\pLets battle!

#org @after
= That was fun!\pWant to battle again?

#org @beaten
= You're good!\pWant to battle again?
 
1
Posts
12
Years
  • Seen Oct 1, 2012
oh boy, this question has probably been asked like, 48572345 times, but I'm really trying to figure out how to script... I've used the basic talking code, like this:

#dynamic 0x800000

#org @start
lock
faceplayer
message @1 0x6
release
end

#org @1
= I woke up at noon today...

But always, it says "Unknown keyword "lock" at line 4"

I didnt search through the 100+ pages of the thread. Also dont be harsh, this is literally my first post here :T
 

Echidna

i don't care what's in your hair
2,077
Posts
13
Years
oh boy, this question has probably been asked like, 48572345 times, but I'm really trying to figure out how to script... I've used the basic talking code, like this:

#dynamic 0x800000

#org @start
lock
faceplayer
message @1 0x6
release
end

#org @1
= I woke up at noon today...

But always, it says "Unknown keyword "lock" at line 4"

I didnt search through the 100+ pages of the thread. Also dont be harsh, this is literally my first post here :T

Don't worry, everyone's nice around these parts.

Anyway, if you're using a newer version of XSE, that 'message' command should be changed to 'msgbox', otherwise you'd have to split that message command and add a 'boxset'.

And I don't see why XSE sees 'lock' as an unknown keyword.
eek.gif


Are you sure you're using XSE? And if you are, what version?
 
2
Posts
12
Years
  • Seen Feb 18, 2012
This is happening because you're using the 0x0 type trainer battle, which immediately ends the script once the battle is over. Try using this script which makes use of the 0x1 trainerbattle type:

Code:
#dynamic 0x800000

#org @start
trainerbattle 0x1 0x39 0x0 @before @after @later

#org @later
msgbox @beaten 0x2
cleartrainerflag 0x39
release
end

#org @before
= I never get tired of battling!\pLets battle!

#org @after
= That was fun!\pWant to battle again?

#org @beaten
= You're good!\pWant to battle again?
I tried this script, and when i talk to him again he gives me a safari ball and the screen goes red :O
 

Echidna

i don't care what's in your hair
2,077
Posts
13
Years
I tried this script, and when i talk to him again he gives me a safari ball and the screen goes red :O

-________________________________________-
There's no mention of any giveitem command in there. He couldn't possibly give you a safari ball. Unless the script is for some reason running over the trainerbattle command into other offsets. Try changing the script's offset.
And add 'release' and 'end' to the main script. They're not necessary, but better safe than sorry.
 

wierddude22

New hacker
24
Posts
12
Years
Yeah, if you're not using 1.1.1 that's the most likely reason why your scripts aren't working as intended. Doing a quick search for the 1.1.1 version on Google brought up several thousand results so you could try downloading it from one of those.

Thanks, I finally found one, and yes, it does work
 
20
Posts
14
Years
Script Tile Problems

Ok I've been around the block a few times when it comes to scripting, but for some reason latley I would make a script tile and write the script for it, using flags, and they seem to not work.

I step on them and just walk over like they don't exist! Here is an example I was testing out to rule out reasons why it won't work, but the sad thing is I could not even get this to work:disappoin.

Spoiler:
 

Echidna

i don't care what's in your hair
2,077
Posts
13
Years
Ok I've been around the block a few times when it comes to scripting, but for some reason latley I would make a script tile and write the script for it, using flags, and they seem to not work.

I step on them and just walk over like they don't exist! Here is an example I was testing out to rule out reasons why it won't work, but the sad thing is I could not even get this to work:disappoin.

Spoiler:

Okay, first, don't use:
message @lmao
boxset 0x6

Use:
msgbox @lmao 0x6
It's more functional if you're using a newer version of XSE. (It also might not work like that in the newer version)
Then, there is no use whatsoever for this:
#org @done
release
end

I'm going to suppose you have use for the setvar somewhere else, otherwise you'd use setflag.

Now, for the script you've set to a script tile in A-Map to work, you must set the 'VarNumber' area to 4051 (Or 4050 depending on what you're hacking), and the 'Unknown' area to 0003 (Or 0300 depending on what you're hacking). Do that, and it should work fine. If you're hacking Firered, 4051 and 0003 should work.

Where to set these? When you click on the script tile in A-Map, you'll find these areas in the event menu on the right.
 
30
Posts
18
Years
  • Seen May 26, 2022
Okay me again. Finally got my script working the way I wanted it to, but now I encountered a new problem:

Game: Fire Red
Type: Trigger
Editor: PKSV
Script:
Spoiler:


I want it to change music at the beginning of the event, but when I compile it the music doesn't play. When I check the compiled script at the offset, however, I see that playsound's parameters have somehow changed to 0x0 and 0x9 instead of 0x112 and 0x0 respectively. Recompiling the script in a new offset does nothing.
 

Reygok

Beginning Hacker
60
Posts
14
Years
  • Seen Jan 22, 2016
Hi, I got a litte problem with ALL my scripts... they dont work any more.
I hacked a German FireRed, and had done a bit, when I realized many things would be easier on a US FireRed. SO I switched, but now I freeze on EVERY script I made. Here's one of them:

#dynamic 0x800000

#org @start
checkflag 0x100
if 0x0 goto @1
release
end

#org @1
setflag 0x100
spriteinvisible 0x3 0x3 0x0
setflag 0x200
release
end

What could be the problem? Do I have to change anything due to the ROM change?
 
Status
Not open for further replies.
Back
Top