• 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.

metapod23

Hardened Trainer
673
Posts
15
Years
  • Seen Aug 18, 2016
Okay, I took 5000, that's working. Now I've got the same problem as mentioned already:
I have a script one step away from the entrance to a town, so hwne I now walk from the route into the town, the towns name appears. But as I make two steps forward, I walk over the script. At that moment, the towns name just didappears immediately, instead of remaining there for a few seconds. Why is this and how can I fix it?

Just to explain the variable thing, if a variable is set to 0000, then it is always going to activate (all variables are initially set to 0 when the game starts). If a script activates when you step on it, and you don't change the variable to a different value in the script, the game will freeze because it becomes an endless loop, trying to repeat the script over and over again. You would need to deactivate the script by setting its value to something other than 0.

As for the town's name disappearing, it probably has to do with the fact that the script is active and running when you step on it. If you don't want the script to activate until a certain time, set the script's var value to 0001 instead. Then when you want that script to activate, use another script (dialogue, variable script, etc.) and use setvar to change the variable's value to 0x1.
 
5
Posts
12
Years
  • Seen Nov 20, 2012
I had a question about events...like the one in Pallet Town when you step on a certain tile near the grass and Oak comes over and stops you. What is it that causes that and what type of script to you use? From what I'm reading, it looks like Variables? I've been looking at tutorials or videos and there's really no definitive answers on what exactly is used and what it would look like

For example....walking on the event, Oak appears and walks up to you. That's the sort of thing I'm looking to be able to create. Up until now I've been using PKSV, but if this isn't the recommended program for this I can switch. I just want to know how to do things like this so I can edit or create some new events to spice the game up a bit for friends etc. Not really getting into the making an entirely new game scene, but I would like to know how to do small things like this. Doing well up until this. Thanks for any help.
 

metapod23

Hardened Trainer
673
Posts
15
Years
  • Seen Aug 18, 2016
I had a question about events...like the one in Pallet Town when you step on a certain tile near the grass and Oak comes over and stops you. What is it that causes that and what type of script to you use? From what I'm reading, it looks like Variables? I've been looking at tutorials or videos and there's really no definitive answers on what exactly is used and what it would look like

For example....walking on the event, Oak appears and walks up to you. That's the sort of thing I'm looking to be able to create. Up until now I've been using PKSV, but if this isn't the recommended program for this I can switch. I just want to know how to do things like this so I can edit or create some new events to spice the game up a bit for friends etc. Not really getting into the making an entirely new game scene, but I would like to know how to do small things like this. Doing well up until this. Thanks for any help.

XSE (Extreme Script Editor) is recommended over PKSV.

In A-Map, the script you step on will have a Var number and a Var value. The Variable # is the number of the variable, and the value is what the value of that number is set to.

So if you look at Oak's script, you see that it is activated when Var # 4050 is set to 0000. By default, all variables are set to the value of 0, which means that script will activate the first time you step on it no matter what, because the value of that script is 0 when the game begins.

Now, in order to prevent the script from glitching once you step on it, you must do one of two things - either move the player off the script tile in the script, or deactivate the script by setting its var value to something other than 0 (because that is the value it is set to in A-Map for it to be activated).

There are some scripts that are blocks, and don't deactivate, but only move the player back so they can't leave the town. Likely this script will be deactivated by changing the variable's value later in a future script.

If you want to deactivate the script as soon as you step on it, though, you can simply change the variable's value. To do this, you would use this command setvar.

Take a look at Oak's script. There are a few setvar commands used:

Code:
'---------------
#org 0x1655F9
lockall
setvar 0x4001 0x1
goto 0x8165605

'---------------
#org 0x165605
setvar 0x8004 0x0
setvar 0x8005 0x2
special 0x174
textcolor 0x0
pause 0x1E
playsong 0x12E 0x0
preparemsg 0x817D72C '"OAK: Hey! Wait!\nDon't go out!"
waitmsg
pause 0x55
closeonkeypress
applymovement MOVE_PLAYER 0x81A75ED
waitmovement 0x0
sound 0x15
applymovement MOVE_PLAYER 0x81A75DB
waitmovement 0x0
pause 0x1E
showsprite 0x3
compare 0x4001 0x0
if 0x1 call 0x81656B8
compare 0x4001 0x1
if 0x1 call 0x81656C3
pause 0x1E
msgbox 0x817D74A MSG_KEEPOPEN '"OAK: It's unsafe!\nWild POKéMON li..."
closeonkeypress
pause 0x1E
compare 0x4001 0x0
if 0x1 call 0x81656CE
compare 0x4001 0x1
if 0x1 call 0x81656E0
setdooropened 0x10 0xD
doorchange
applymovement 0x3 0x816572E
applymovement MOVE_PLAYER 0x8165758
waitmovement 0x0
setdoorclosed 0x10 0xD
doorchange
setvar 0x4055 0x1
clearflag 0x2B
[b]setvar 0x4050 0x1[/b]
setflag 0x2C
setflag 0x4001
warp 0x4 0x3 0xFF 0x6 0xC
waitstate
releaseall
end

^ I bolded the one that actually deactivated the script, though. By using setvar, the script has changed the value of variable 4050 to 0001. Now that it is changed to 1 instead of 0, that script will not activate again, unless you were to change the value of 4050 back to 0 in a separate script.

Be cautious of the variable you use. There's a supposed safe range. Refer to XSE's guide to know which ones are best to use (I don't recall at the moment), or just use variables already used by the game, if you do not need those scripts that the game uses.
 
11
Posts
12
Years
  • Seen Apr 14, 2012
Regarding Scizz's Advance Text for Pokémon Fire Red...

By using the "add new offset button" I'm able to add 1 new offset (line of text) at a time to the program to be edited, which is very tedious. Does anyone know if there's a way to add an entire block of text rather than adding each individual line of a block one by one by one?

Under "Tools" there's an "Insert Dialog-script" option which I think is what I'm looking for, but I can't figure out how to use it. If I try to insert the start address of a pointer table, I get a message saying:

Code:
Saved script to offset 71A249(Hex).
Use this option in the 'Script' box of your Map-Editor in order to use the script.
Uhhh, my Map-Editor? What??? Help!
 
6
Posts
12
Years
  • Seen Mar 18, 2012
Automatic scripts?

How do i activate a script as i enter a house or something like that, or teleport somewhere and a script starts. For example: in Emerald, as you walk off the truck at the beginning of the game and your mum comes out of the house. How is that script activated (as you obviously don't walk up to her and press 'a')?
 
10,078
Posts
15
Years
  • Age 32
  • UK
  • Seen Oct 17, 2023
How do i activate a script as i enter a house or something like that, or teleport somewhere and a script starts. For example: in Emerald, as you walk off the truck at the beginning of the game and your mum comes out of the house. How is that script activated (as you obviously don't walk up to her and press 'a')?

You need to use a level script, there is a tutorial by diegoisawesome here.
 

droomph

weeb
4,285
Posts
12
Years
Regarding Scizz's Advance Text for Pokémon Fire Red...

By using the "add new offset button" I'm able to add 1 new offset (line of text) at a time to the program to be edited, which is very tedious. Does anyone know if there's a way to add an entire block of text rather than adding each individual line of a block one by one by one?

Under "Tools" there's an "Insert Dialog-script" option which I think is what I'm looking for, but I can't figure out how to use it. If I try to insert the start address of a pointer table, I get a message saying:

Code:
Saved script to offset 71A249(Hex).
Use this option in the 'Script' box of your Map-Editor in order to use the script.
Uhhh, my Map-Editor? What??? Help!
Well...in Advance-Map...
screenshot20120225at412.png

In your case, enter $0071A249 into that entry box I circled.
Rule 33: Lurk Moar
 
11
Posts
12
Years
  • Seen Apr 14, 2012
Well...in Advance-Map...

In your case, enter $0071A249 into that entry box I circled.
Rule 33: Lurk Moar

But wouldn't this just change what part of the game dialogue it is that is used for a given map? I don't see how doing this would allow me to actually edit the text in question.
 

droomph

weeb
4,285
Posts
12
Years
But wouldn't this just change what part of the game dialogue it is that is used for a given map? I don't see how doing this would allow me to actually edit the text in question.
No, it compiled to that offset; it created a new script.

If you want to edit the script, open up your scripter and decompile the script whose location is marked in that box.

Then you edit the text, repointing if necessary.

Of course, you could always use Advance Text.
 

metapod23

Hardened Trainer
673
Posts
15
Years
  • Seen Aug 18, 2016
Regarding Scizz's Advance Text for Pokémon Fire Red...

By using the "add new offset button" I'm able to add 1 new offset (line of text) at a time to the program to be edited, which is very tedious. Does anyone know if there's a way to add an entire block of text rather than adding each individual line of a block one by one by one?

Under "Tools" there's an "Insert Dialog-script" option which I think is what I'm looking for, but I can't figure out how to use it. If I try to insert the start address of a pointer table, I get a message saying:

Code:
Saved script to offset 71A249(Hex).
Use this option in the 'Script' box of your Map-Editor in order to use the script.
Uhhh, my Map-Editor? What??? Help!

The best solution is to not use A-Text, but to simply write your own dialogue w/ XSE (that way there are no letter limitations). A basic dialogue script written in XSE would look like this:

Code:
#dynamic 0x800000
#org @start
msgbox @talk msg_face
end

#org @talk
= Your dialogue here.

XSE will automatically compile the script to any free space available after offset 0x800000 (in this case, b/c that's the dynamic offset we chose).
 
11
Posts
12
Years
  • Seen Apr 14, 2012
The best solution is to not use A-Text, but to simply write your own dialogue w/ XSE (that way there are no letter limitations). A basic dialogue script written in XSE would look like this:

Code:
#dynamic 0x800000
#org @start
msgbox @talk msg_face
end

#org @talk
= Your dialogue here.
XSE will automatically compile the script to any free space available after offset 0x800000 (in this case, b/c that's the dynamic offset we chose).

Hmm but if I understand correctly, XSE has to be used in conjuct with Advance Map, right? For actually inserting the text. But with A-Map I don't think you can edit anything other than the dialogue. What would you suggest I do for editing for example the text in the battle screen, as well as menu text, map text etc?
 

droomph

weeb
4,285
Posts
12
Years
Hmm but if I understand correctly, XSE has to be used in conjuct with Advance Map, right? For actually inserting the text. But with A-Map I don't think you can edit anything other than the dialogue. What would you suggest I do for editing for example the text in the battle screen, as well as menu text, map text etc?
No, you INSERT the text by making a NEW script, because that way you can write a whole paragraph of text without worrying about repointing.

Then you take the offset it compiled to, and then you stick it in
screenshot20120225at412.png

that box, in which you now link the script to a OW so you can actually use the script.

And if you want to edit any other kind of text you use a hex editor and this handy little chart:
Spoiler:
 
Last edited:
6
Posts
12
Years
  • Seen Mar 18, 2012
Warp problem

Hey everyone, i have been tackling this problem for a while now, and have found no solutions. I have a level script (which involves movement and works fine up to there). Near the end of the script i have put in 'warphole 0x1 0x0 0x0'. However, i am warped to the correct map but i land on this certain tile, just a random tile with no warp or script or anything on it. I don't and on my warp tile (which is warp number 0) I have tried putting in multiple warp tiles to land on and changing the last 0x to 0x1 in case the warp was the problem. How can i fix this? Thanks :)
 

Lyzo

Back from vacation
261
Posts
17
Years
Hey everyone, i have been tackling this problem for a while now, and have found no solutions. I have a level script (which involves movement and works fine up to there). Near the end of the script i have put in 'warphole 0x1 0x0 0x0'. However, i am warped to the correct map but i land on this certain tile, just a random tile with no warp or script or anything on it. I don't and on my warp tile (which is warp number 0) I have tried putting in multiple warp tiles to land on and changing the last 0x to 0x1 in case the warp was the problem. How can i fix this? Thanks :)
Have you added the last '0x0 0x0'? I think the warp command needs 5 variables to function, so you would need:
Code:
warp 0x1 0x0 0x0 0x0 0x0

The last two variables are for warping to a position on the map if needed. If you fill in 0xFF as the warp number you can use the last two variables as coordinates of where you want to warp to on the map. But seeing as you only want to warp to warp number 0, just use the code above.
 
6
Posts
12
Years
  • Seen Mar 18, 2012
Thanks Lyzo. I could not get it to warp to 'warp 0' but i just used the coordinates of the map. When i tried to warp to a specific warp it just ignored this and went to the 'default warp tile'. Thanks a lot as i managed to solve the problem the other way :)

I've added the warp (from the previous post to my script) but i was not aware of another problem...This is my script:

#dynamic 0x6B61EC

#org @start
lock
faceplayer
msgbox @pause
boxset 6
applymovement 0x1 @mark
waitmovement 0x1
msgbox @pause
boxset 6
applymovement 0x1 @move
waitmovement 0x1
msgbox @oi
boxset 6
applymovement 0x1 @move2
waitmovement 0x1
msgbox @now
boxset 6
applymovement 0xFF @moveplayer
waitmovement 0xFF
msgbox @haiya
boxset 6
fadescreen 2
warp 0x1 0x0 0xFF 0x07 0x04
setvar 0x5000 0x0001
release
end

#org @pause
= ...

#org @oi
= Oi, you! Who are you? What are you\ndoing here? Oh, I see... You are\lthe kid... Follow me...

#org @now
= NOW!

#org @haiya
= I don't know why you bothered to\nget yourslef into this, did\lProfessor WOOD really think you\lcould stop me in my plans to\lharness the ultimate power and take\lover the world? How silly of him...\lYou are going to regret getting\linvolved in all of this... HAIYAAA!!!

#org @mark
#raw 0x56 0xFE

#org @move
#raw 0x00 0x08 0x02 0x0A 0x0A 0xFE

#org @move2
#raw 0x03 0x0B 0x0B 0x09 0xFE

#org @moveplayer
#raw 0x07 0x07 0x01 0x05 0xFE




However, after the script i get loads of random symbols across a text-box, i click 'a' and they reappear again... I get stuck as i can't get them off the screen. I have tried shortening the script (by testing different parts to find the solution) but have not found the answer. I have even taken the warp away completely. Can anyone help?
 
Last edited:

metapod23

Hardened Trainer
673
Posts
15
Years
  • Seen Aug 18, 2016
Hmm but if I understand correctly, XSE has to be used in conjuct with Advance Map, right? For actually inserting the text. But with A-Map I don't think you can edit anything other than the dialogue. What would you suggest I do for editing for example the text in the battle screen, as well as menu text, map text etc?

You can just replace the dialogue w/ A-Text, or even re-point it. I think A-Text gives you the option to re-point it automatically, but I've never used it. But you could try it.

Otherwise, you would have to re-point it yourself using a hex editor. If you did that, you could locate the offset of the text by using A-Text, then search for the reversed pointer in a Hex editor (if the offset was 654321 for instance, you would need to search for 21 43 65 08 in a hex editor - 08 always gets added to the end of the pointer). If you find that data in hex, you can just replace it w/ the offset to your new dialogue that you want displayed. But using A-Text to re-point would be a lot easier, I'm just not sure how reliable it is.
 
6
Posts
12
Years
  • Seen Mar 18, 2012
Hey everyone, i have a small problem. I am using a script with a flag in it. All is ok until i leave a house and the re-enter, the flag is cleared. And i have to activate the script to set the flag again. How can i make it so when the flag is set, it is set permanently (unless i use another script with a clearflag in it). Thanks.
 

Echidna

i don't care what's in your hair
2,077
Posts
13
Years
Hey everyone, i have a small problem. I am using a script with a flag in it. All is ok until i leave a house and the re-enter, the flag is cleared. And i have to activate the script to set the flag again. How can i make it so when the flag is set, it is set permanently (unless i use another script with a clearflag in it). Thanks.

When you set a flag, it is, by default permanently set. I think the problem is that you're using a flag that is either map specific, or one that the game is already using. So I think your problem should be solved if you use a flag above 1000. :)
 
Status
Not open for further replies.
Back
Top