• 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.
33
Posts
13
Years
  • Seen Dec 12, 2020
hello, I'm trying to understand scripts in XSE and so far it's going quite well, but I've come accross a command that I can't find in any scripting tutorial: "spritebehave"
XSE's Help says that there are two parameters, one for the charachter's ID, which I understand, and one for behavior number, and I'd like to know what this actually does.
Thanks for your help :)
 
10,078
Posts
15
Years
  • Age 32
  • UK
  • Seen Oct 17, 2023
Hello there! I don't know what went wrong with my script, but when I step on the place where I placed the script box.. nothing happens..

I don't know how to use spoilers.. so I'll post my script normally..

Spoiler:


Thank you.

I use XSE script editor, Firered Rom.
My boxes I filled in the advance map...
Var number-7000
Var value-0001
Unknown(4digit)-0003
Unknown(2digit)-00

If you don't know what unknown(2digit) means, you'll have to have the latest version of advancemap.

A few things:

Movement strings need to end in #raw 0xFE.

The reason your script isn't working at all, however, is the fact you have put Var Value = 0001 in Advance Map.

Since your script sets the Variable to 1, I am assuming it is 0 to start with, so you need:

Var number-7000
Var value-0000


I just used the number recommended in a script.
Anyway, I did write the script again, even before you mentioned that. That's what caused the raw/org mistake. It hasn't solved anything.

Ergh I'm sorry! I know why now :P Since I saw the #raws I didn't look at your actual script.

When you use compare, you have your '@yes' string going directly to a line of speech. Unfortunately you can't do that, what you need to do is change @yes to look like this:

#org @Yes
msgbox @TalkYes 0x6
release
end

#raw @TalkYes
= They're pretty powerful, aren't\nthey?

Also you seem to be using msgbox 0x8 for your no o.O I'm not sure what you're trying to achieve with that, but 0x6 is probably the best for the job.

I have two scripts that both freeze upon activating them, one is a regular script event, the other is a level script. Both on FireRed.

For the event:
Spoiler:

With this one the cause is probably your A-Map data, rather than the script. Edit the Var Number to '4050' and the Unknown to '03'

The level script (this one is rather long; longer than I intended):
Spoiler:


Help please?

For your level script - firstly it doesn't matter where the setvar goes, as long as you definitely hit it - otherwise the script repeats. Since your first section has no 'lock' values it might not be a problem.

Second, 4033 is very close to some special vars, if I recall correctly, so you might want to bump that up to 5000 instead. Just so it doesn't accidentally get changed.

Third problem I see is that your movements don't end in #raw 0xFE! Which is quite a common problem in scripting, add those on and it should be fine. :)

hello, I'm trying to understand scripts in XSE and so far it's going quite well, but I've come accross a command that I can't find in any scripting tutorial: "spritebehave"
XSE's Help says that there are two parameters, one for the charachter's ID, which I understand, and one for behavior number, and I'd like to know what this actually does.
Thanks for your help :)

I've never used this command, but the only thing I can think off is behaviour as in 'look left' 'walk around' 'walk up and down' etc, which are listed on A-Map when you make a person event. I believe the list also has the hex values of the behaviours - give it a go and see!
 
Last edited:
7
Posts
11
Years
  • Seen Jul 16, 2012
So... My script won't run properly.
It freezes right before warping. Help?
Spoiler:
 

tajaros

Hi I'm dawg
855
Posts
11
Years
So... My script won't run properly.
It freezes right before warping. Help?
Spoiler:

I believe you have to replace those I highlighted red with "END" and all the blue higlighted parts are the ones that I added to the script, And also is this a script box script?

Because I don't see any setvar anywhere on the script try setting one to see if it solves the problems or maybe you just inputed the setvar in A-map and just did a checkflag here to make the script work...

Hope this helps... :)
 

Shaf

Lonely MadNooB Trainer
16
Posts
11
Years
Help Please!

Can anyone help me with this script cuz everytime i recieve the master ball it reappers after i take a step.

#dynamic 0x291439
#org @start
lock
giveitem 0x1 0x1 0x1
message @remball 0x6
release
end

#org @remball
= Hey..Guess what my lucky day \pits a master ball.

Please Help!
 

thanethane98

Self Proclaimed Expert
82
Posts
11
Years
  • Seen Nov 16, 2013
Can anyone help me with this script cuz everytime i recieve the master ball it reappers after i take a step.

#dynamic 0x291439
#org @start
lock
giveitem 0x1 0x1 0x1
message @remball 0x6
release
end

#org @remball
= Hey..Guess what my lucky day \pits a master ball.

Please Help!

You forgot to set a flag, and you also forgot to use the hidesprite command. Don't worry, it's solved easily. :)

Here's the fixed script:
Spoiler:


Make sure to change the event number on hidesprite to whatever the event number is for the pokeball the player sees on the ground. You'll also need to set the person ID of that to the flag used in setflag (which you can change if you want to). Hope this helps!
 
7
Posts
11
Years
  • Seen Jul 16, 2012


I believe you have to replace those I highlighted red with "END" and all the blue higlighted parts are the ones that I added to the script, And also is this a script box script?

Because I don't see any setvar anywhere on the script try setting one to see if it solves the problems or maybe you just inputed the setvar in A-map and just did a checkflag here to make the script work...

Hope this helps... :)

Sorry I got back to this so late. So I tried setting the end on both parts of the script. Still freezes. I did set the Var number in A-map and did a checkflag. Should I do a setvar?

EDIT: And can someone explain to me what setvar does? I read the tutorial and still can't figure it out...
Spoiler:


My newest fix: I got it to go through the warp. But it doesn't put the player into the next area. It freezes and stops playing the music. Help!
 
Last edited:

thanethane98

Self Proclaimed Expert
82
Posts
11
Years
  • Seen Nov 16, 2013
Hey everyone, I'm back with another script issue. So I tried using Shinyzer so that I could cause a wild battle with a shiny through a script, but so far all that happens when you talk to the Pokemon is that the game freezes. I tested it without the lines that are supposed to be used for the shiny Pokemon (callasm and setvar), and it worked, but obviously it doesn't otherwise. Does anyone know what I've done wrong?

Game: Pokemon Firered
Type: Person Event
Editor: XSE
Script:
Spoiler:
 

miksy91

Dark Energy is back in action! ;)
1,480
Posts
15
Years
Hey everyone, I'm back with another script issue. So I tried using Shinyzer so that I could cause a wild battle with a shiny through a script, but so far all that happens when you talk to the Pokemon is that the game freezes. I tested it without the lines that are supposed to be used for the shiny Pokemon (callasm and setvar), and it worked, but obviously it doesn't otherwise. Does anyone know what I've done wrong?

Game: Pokemon Firered
Type: Person Event
Editor: XSE
Script:
Spoiler:
First of all, have you tried whether the script runs properly without calling the assembly code like you've done? If so, I'd advise you to remove the assembly code it calls as of now and re-write it (not sure what Shinyzer does exactly but feel free to try with it again if it serves the needed purpose).

Another way would be by writing it in assembly which really isn't that hard because I remember Hackmew posting a specific step-by-step tutorial how to do it (correct me if I'm wrong here). Only thing you need to do is to download an assembly editor that supports GBA games (that use this kind of assembly system) and write the code like he explained.
 

thanethane98

Self Proclaimed Expert
82
Posts
11
Years
  • Seen Nov 16, 2013
First of all, have you tried whether the script runs properly without calling the assembly code like you've done? If so, I'd advise you to remove the assembly code it calls as of now and re-write it (not sure what Shinyzer does exactly but feel free to try with it again if it serves the needed purpose).

Another way would be by writing it in assembly which really isn't that hard because I remember Hackmew posting a specific step-by-step tutorial how to do it (correct me if I'm wrong here). Only thing you need to do is to download an assembly editor that supports GBA games (that use this kind of assembly system) and write the code like he explained.

Yeah, as I said, I removed the assembly code and ran the script without any issues. Shinyzer basically puts the assembly code in the gba rom for you (at least, that's what I'm assuming it does). I'll try adding it manually and see if that fixes it (unless somebody else knows what I did wrong with my script).
 
Last edited:

Sierraffinity

Desperately trying to retire from ROM hacking
1,069
Posts
16
Years
Yeah, as I said, I removed the assembly code and ran the script without any issues. Shinyzer basically puts the assembly code in the gba rom for you (at least, that's what I'm assuming it does). I'll try adding it manually and see if that fixes it (unless somebody else knows what I did wrong with my script).
Shinyzer doesn't require a callasm. The ASM is called in the ROM once var 0x8003 is set. Keep the setvar, remove the callasm and it should work.
 

thanethane98

Self Proclaimed Expert
82
Posts
11
Years
  • Seen Nov 16, 2013
Shinyzer doesn't require a callasm. The ASM is called in the ROM once var 0x8003 is set. Keep the setvar, remove the callasm and it should work.

Thanks, I'll try it tomorrow. Unfortunately, I managed to screw up all the tiles on the ROM I was working on by hardly paying attention while hex editing (this was at about 12:30 A.M.), and then overwrote my backup. Yeah, not my best moment... Luckily all the scripts are backed up, and that's most of my progress right now.
 

Shaf

Lonely MadNooB Trainer
16
Posts
11
Years
RE:On script help

Here i have made one script its for making a person to give me a pokemon.
I dunno how to make the girl stop giving me pokemon even after i have
took pokemon once from her!
#dynamic 0x6B3552
#org @start
lock
faceplayer
msgbox 0x86B2BB8 '"Want this pokemon?"
callstd 0x5
checkflag 0x828
compare LASTRESULT 0x0
if 0x1 goto 0x86B2989
countpokemon
compare LASTRESULT 0x6
if 0x1 goto @htfsd
msgbox @pkmndk

callstd 0x4
setflag 0x10A
fanfare 0x172
msgbox2 @rcvebkpk '"[player] received the PKMN."
waitfanfare
waitmsgbox
givepokemon 0x198 0x64 0x1 0x0 0xE9E3D3 0xDB
release

#org 0x6B2989
msgbox 0x86B29C8 '"As Your Wsh :D."
boxset 0x4
release
end

#org @htfsd
msgbox 0x86B3515 '"Oh? You've too many POKéMON.\nThere..."
callstd 0x4
release
end

'---------
' Strings
'---------
#org 0x6B2BB8
= Want this pokemon?

#org 0x6B29C8
= I can't give you anymore.

#org 0x6B3515
= Oh? You've too many POKéMON.\nThere's no room for this pkmn...

#org @rcvebkpk
= [player] received the PKMN.

#org @pkmndk
= Take Care!Sanoyara!
Thanks and please help
 

+N30N_J3ST3R+

Pokemon Black Chasm Director
11
Posts
11
Years
  • Age 23
  • Seen Jul 17, 2012
Hey guys I need some help.....

I cant figure out what is wrong with this script, any help is appreciated!
Spoiler:
 

thanethane98

Self Proclaimed Expert
82
Posts
11
Years
  • Seen Nov 16, 2013
I cant figure out what is wrong with this script, any help is appreciated!
Spoiler:

Which script editor are you using? You need to specify these things. ;)
 

+N30N_J3ST3R+

Pokemon Black Chasm Director
11
Posts
11
Years
  • Age 23
  • Seen Jul 17, 2012
Theanethane98 Im using script editior XSE 1.11, and it says theres something wrong with line 6.
 

Renegade

Time for real life...
995
Posts
12
Years
Theanethane98 Im using script editior XSE 1.11, and it says theres something wrong with line 6.

Are you really using XSE? Your whole script is in Pokescript format...
XSE has a different format for scripting. That whole script is wrong for XSE, but is good for Pokescript. If you don't know the format for XSE, there are plenty tutorials on it.
 

Pinta77

Guest
0
Posts
I'm using Pksv-ui. For some reason, I cant get the basic wild pokemon battle script to work. I haven't changed it at all, this is the one generates for me.

Spoiler:


That's just the regular old one it generates. Any suggestions? Am I maybe putting it in the game wrong? I put it as the script offset for a person event. Any help would be greatly appreciated.
 
Last edited:
Status
Not open for further replies.
Back
Top