• 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.
202
Posts
14
Years
  • Seen Jan 6, 2017
Where can I edit what Oak says at the start in the lab? In his script in the lab I can only edit some of it, and not all. It's not in any of the other scripts/person events on that map either?

To be more exact; the first few lines he and Gary is saying ("Gramps, I'm fed up with waiting","Be patient [insert rival name]" ++) aren't showing in his person-event-script-thingy..

The whole Oak-script seems kinda complicated (with level scripting and all)..

That's because that text is part of the level script. To edit that you would open up Oak's Lab in Advance Map, scroll down to "Scripts" and click "Open Script" (I think that's the only level script in there).

Level scripts are just like normal scripts really.
 

Darksun

triple rainbow, yo
123
Posts
15
Years
That's because that text is part of the level script. To edit that you would open up Oak's Lab in Advance Map, scroll down to "Scripts" and click "Open Script" (I think that's the only level script in there).

Level scripts are just like normal scripts really.
Do you mean; Oak's Lab map --> Header --> Scroll down to 'Map script --> Open script?

When I do that, the script that comes up is this one:

Code:
'---------------
#org 0x168F8E
setflag 0x2CF
compare 0x4055 0x1
if 0x1 call 0x8168FC6
compare 0x4055 0x7
if 0x1 call 0x8168FD5
compare 0x4055 0x8
if 0x1 call 0x8168FC0
checkflag 0x247
if 0x1 call 0x8168FBC
end

'---------------
#org 0x168FC6
movesprite2 0x4 0x6 0xB
spritebehave 0x4 0x7
playsong2 0x12E
return

'---------------
#org 0x168FD5
movesprite2 0x4 0x6 0xB
spritebehave 0x4 0x7
return

'---------------
#org 0x168FC0
setvar 0x4055 0x9
return

'---------------
#org 0x168FBC
setflag 0x24F
return

I'm confused. :(

EDIT:

OMG, I FOUND IT. AFTER A LOT OF FREAKIN' HOURS OF BOREDOM. YES. :D

I just had to scroll the script number (script no.)! I had tried every possible way except that. Searcing all maps, all events. But finally. Yes. :D
 
54
Posts
15
Years
  • Seen May 21, 2011
Alright, so I have a working script box that stops the player from leaving Oak's lab while picking their starters. It works fine, and is supposed to deactivate after picking a Pokemon. However, after the starter is picked and I walk back over the tile, my player freezes.

Here's the script
Spoiler:
 

altariaking

Needs NO VMs...
1,087
Posts
14
Years
Spoiler:
the rest isn't important

nothing happens. it's for firered.
 
202
Posts
14
Years
  • Seen Jan 6, 2017
Alright, so I have a working script box that stops the player from leaving Oak's lab while picking their starters. It works fine, and is supposed to deactivate after picking a Pokemon. However, after the starter is picked and I walk back over the tile, my player freezes.

Here's the script
Spoiler:

There. I just stuck "release" before end in the "nul" script. That should do it.

By the way I reccomend you make a script with nothing but

#dynamic 0xOFFSET
#org @start
lock
release
end

Make sure to save the dynamic offset that is produced into a text document, and whenever you want a script to end, replace:

if 0x1
goto @script end

with

if 0x1
call 0xOFFSET (The offset that was produced from the dynamic offset earlier)

This just saves a lot of otherwise wasted offsets.
 

metapod23

Hardened Trainer
673
Posts
15
Years
  • Seen Aug 18, 2016
Alright, so I have a working script box that stops the player from leaving Oak's lab while picking their starters. It works fine, and is supposed to deactivate after picking a Pokemon. However, after the starter is picked and I walk back over the tile, my player freezes.

Here's the script
Spoiler:

What's with "setvar 0x200 0xD101"?

That can't be right, so it would make sense for the game to freeze there. I'm guessing the script you were compiling didn't say that, which probably means you don't have enough space at that offset for your script to fit.

When writing new scripts, just start it like this:

Code:
#dynamic 0x800000

#org @start
[insert script here]

XSE will find an offset with enough room, and all you have to do is copy it when it shows it to you. Try that with the original script you've written.
 
202
Posts
14
Years
  • Seen Jan 6, 2017
Okay I'm experiencing quite an annoying error on my script.

Spoiler:


The error is right near the end:
'---------------
#org 0x1616C4
checkflag 0x829
if 0x1 goto 0x81616EF
msgbox 0x8161DB3 MSG_NORMAL '"Oak: Ah, welcome back--\p[player]:..."
fanfare 0x13E
preparemsg 0x8162147 '"[black_fr]You received the "
lock
faceplayer
waitmsg
waitfanfare
setflag 0x829
special 0x16F
msgbox 0x816218B MSG_NORMAL '"Oak: Now go and find your mother.\..."
msgbox 0x81621C9 MSG_NORMAL '"Oak: Goodbye [player], and good lu..."
release
end

'---------------
#org 0x1616EF
msgbox 0x81621C9 MSG_NORMAL '"Oak: Goodbye [player], and good lu..."
release
end

It displays that second message box there, with two msgboxes in a row. I didn't tell it to do this, and I don't want it to do this.

U tried removing the line "msgbox 0x81621C9 MSG_NORMAL '"Oak: Goodbye [player], and good lu..."" but when I compile it, it just sticks it back in there. I even tried replacing it entirely with a "call 0xoffset", with the offset being a script which is just "release end". It even just replaced this with the messagebox again. =s

EDIT: I fixed it by making a new script with

msgbox 0x816218B 0x6
release
end

And replacing
msgbox 0x816218B MSG_NORMAL '"Oak: Now go and find your mother.\..."
msgbox 0x81621C9 MSG_NORMAL '"Oak: Goodbye [player], and good lu..."
release
end

with

call 0xoffset (offset being the new script i made)

It fixed it but how bizaare to have to do to such extremes :s
 
Last edited:
23
Posts
13
Years
  • Seen Jun 30, 2010
The Emerald Blues

Well, I'm very green to hacking and scripting, and so I'm having a lot of trouble with this concept. I'm hacking Emerald, and I'd like to add more legendary Pokemon encounters on the map. I hate it when legendary Pokemon are encountered multiple times in the wild.

So, this is a person event on the map, or should be, but the script won't compile. This is a script generated by PKSVUI, but it won't compile in that program or any other. I'd like to make a script that works in XSE, as I'll be using that when my knowledge about scripting grows.

Spoiler:
 
202
Posts
14
Years
  • Seen Jan 6, 2017
Well, I'm very green to hacking and scripting, and so I'm having a lot of trouble with this concept. I'm hacking Emerald, and I'd like to add more legendary Pokemon encounters on the map. I hate it when legendary Pokemon are encountered multiple times in the wild.

So, this is a person event on the map, or should be, but the script won't compile. This is a script generated by PKSVUI, but it won't compile in that program or any other. I'd like to make a script that works in XSE, as I'll be using that when my knowledge about scripting grows.

Spoiler:

Show me that script in XSE and I may be able to help you.
 
23
Posts
13
Years
  • Seen Jun 30, 2010
In XSE

Here's one that should work in XSE, as I've been following multiple tutorials:

Spoiler:


Here's the error message:
Error 13 'Type mismatch' on line 7.
Missing #define or parameter

Line: wildbattle 0x96 0x1E 0x214
 

Zeffy

g'day
6,402
Posts
14
Years
  • Age 27
  • Seen Feb 7, 2024
Here's one that should work in XSE, as I've been following multiple tutorials:

Spoiler:


Here's the error message:

Err, there is no #214 item. That's why its been saying that error.

Turn this line:
wildbattle 0x96 0x1E 0x214

To this line:
wildbattle 0x96 0x1E 0x0

...and it'll be OK now.
 
202
Posts
14
Years
  • Seen Jan 6, 2017


Err, there is no #214 item. That's why its been saying that error.

Turn this line:
wildbattle 0x96 0x1E 0x214

To this line:
wildbattle 0x96 0x1E 0x0

...and it'll be OK now.

To add to that.

If you intended to have a Pokémon hold an item, it must have the correct item ID, and must be in hex.

Here's a list of the item codes in hex for Fire Red and Leaf Green:

Spoiler:


Quoted from SilverKadabra of GameFaqs http://www.gamefaqs.com/gba/918915-pokemon-firered-version/faqs/32496
That specific list is for the gain any item cheat, but those item IDs work when scripting, as they are the actual item IDs. (Don't go on that website, it is just to give credit for the list)
 

Binary

え?
3,977
Posts
16
Years
  • Age 29
  • Seen Apr 7, 2014
You don't need to credit. Lists of pokemon, items, flags etc. can be found in the XSE guide if you care to look. It's really convenient.
 
23
Posts
13
Years
  • Seen Jun 30, 2010
Frozen

Thanks for the information about items, but now I'm having a different issue.

I've edited the script a bit.

Spoiler:


When coming in contact with the sprite, the message box appears splendidly, but the sprite disappears without starting a battle. When walking away, the sprite reappears, but pressing A just repeats the problem.
 
5
Posts
15
Years
  • Seen Apr 19, 2011
Hey Guys ^^
My Script:

#org $start
Trainerbattle 0 0x007 $before $after
Message $beaten
boxset 6
release
end

#org $before
$before 1 = So! You are \v\h01. Hehe\nI have heard much from you!\pI'm Giovanni. Team Rocket's Leader!\nI have the strongest Pokemon\pof the World!\nGood luck for you!

#org $after
$after 1 = You Win? WTF???\nThats Impossible!\pMy Pokemon was defeat?\nYour good!\pYour beat the starter from\nthe Hoenn Region!

#org $beaten
$beaten 1 = So you have defeat me.\nBut the another two will you lose!\pMuhahahahaha!


I will have in Fire Red from the (Fire Red Battle Sound [Battle 4] to Emerald Battle Sound [Battle 2])?
 
54
Posts
15
Years
  • Seen May 21, 2011
Ok, so after the @play3 offset, the script stops working. However, my player is able to move, so the game isn't frozen. Did I miss a command?

Spoiler:
 

vietazn654

A sound soul dwells within me
371
Posts
14
Years
Alright, I decompiled a script, and I compiled it. But it turns out the same =\ I'm using XSE. Anyone know how to resave it? Or do I have to decompile it, copy and paste it on a new fresh script <.<
 
202
Posts
14
Years
  • Seen Jan 6, 2017
Ooft busy day.

@melosfox
1. Remove the nops.
2. Make sure the overworld's Person ID is set to 1000 (same as the flag you set)
2.5. A little tip. Underneath the "wildpokémonbattle" part, put in "playsong 0xXXX". Replace XXX with any song (there is a list of them in any header in Advance Map). This will make the battle theme when fighting the Pokémon whatever you want.

@smashking
What are you asking smashking? Be a little clearer.

@metroid die
The "waitmovement 0x0" part is supposed to be the same as the applymovement.

So for move player it's
applymovement 0xFF
waitmovement 0xFF

And you can still move about because you didn't use the "lock" command at the start of your script.

@viet
Decompile isn't the opposite of compile in this case. Decompile simply translates the script into something that is more readable (if it is already readable, then nothing happens).

So yeah, you need to make the script in a new offset.
 
Status
Not open for further replies.
Back
Top