• 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?".
  • 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.
17
Posts
13
Years
  • Seen Apr 15, 2011
i have a problem compiling

i got a problem, please help, this is the script(using pksv with ruby)
Spoiler:




when the player steps on the square with the script, the player is suposed to walk 3 squares to the right, next to a person who is facing up , the person then turns and sasy somthing,a battl insuse, and when you win he runs away to the right, but it just freezes when i step on the square
anyone know whats wrong?
 
Last edited:

destinedjagold

You can contact me in PC's discord server...
8,593
Posts
16
Years
  • Age 33
  • Seen Dec 23, 2023
i got a problem, please help, this is the script(using pksv with ruby)
Spoiler:




when the player steps on the square with the script, the player is suposed to walk 3 squares to the right, next to a person who is facing up , the person then turns and sasy somthing,a battl insuse, and when you win he runs away to the right, but it just freezes when i step on the square
anyone know whats wrong?

Maybe you forgot to set the right values of the script tile through A-Map...
mappy2.png

Look at other already-made scripts on the ROM and try to use those values for your script tile.
 
17
Posts
13
Years
  • Seen Apr 15, 2011


Maybe you forgot to set the right values of the script tile through A-Map...
Look at other already-made scripts on the ROM and try to use those values for your script tile.

Do you mean copy the numbers from another event, or base them off the other numbers, if you mean the second could you help me understand how to do that?
 

Pogeygothaxed

Pokémon exDeltaSpecies Creator
231
Posts
14
Years
Wasn't sure if it belonged here or in the Hacked FireRed engine thread, but...
Game: FireRed Type: BPRE Editor: XSE/A-Map? Script: Trainer/Wild Battle?
Spoiler:


So, it's basicly supposed to check if the special is active (lvl balance in this case) and then start the battle if it is.
I'm trying to utilize the "Run Trainer Script" routine and the Wild Battle data switch.

It works, only it starts the battle with an uneven lvl. Like it's not using the Special.
Plus, it's supposed to -act- like a trainer, correct? After I activate a GivePokemon script, it just walks around until I "speak" to it...
however, without the GivePokemon script, it -sees- me, and contiunes a trainer-like script, but with the Wild Battle data.
The problem is obviously your Pokemon is the ???? and it still doesn't seem to set the lvl...maybe I set the variables incorrectly?

Any help would be much appreciated.

P.s. the reason I didn't add a flag was because it's supposed to be included in the sub-routine for the Run Trainer Script. Although I doubt that this would effect the script very much, besides the obvious removal of the sprite afterwards. =|
 
Last edited:

metapod23

Hardened Trainer
673
Posts
15
Years
  • Seen Aug 18, 2016
Wasn't sure if it belonged here or in the Hacked FireRed engine thread, but...
Game: FireRed Type: BPRE Editor: XSE/A-Map? Script: Trainer/Wild Battle?
Spoiler:


So, it's basicly supposed to check if the special is active (lvl balance in this case) and then start the battle if it is.
I'm trying to utilize the "Run Trainer Script" routine and the Wild Battle data switch.

It works, only it starts the battle with an uneven lvl. Like it's not using the Special.
Plus, it's supposed to -act- like a trainer, correct? After I activate a GivePokemon script, it just walks around until I "speak" to it...
however, without the GivePokemon script, it -sees- me, and contiunes a trainer-like script, but with the Wild Battle data.
The problem is obviously your Pokemon is the ???? and it still doesn't seem to set the lvl...maybe I set the variables incorrectly?

Any help would be much appreciated.

P.s. the reason I didn't add a flag was because it's supposed to be included in the sub-routine for the Run Trainer Script. Although I doubt that this would effect the script very much, besides the obvious removal of the sprite afterwards. =|

There seems to be a few problems with the script. I haven't used special 0x58 from JPAN's engine, but reading the manual, I think the first thing you must do is use a hex editor to write out a table of the Pokemon you want to appear.

The data at the pointer would have to be something like:

Code:
0A 14 00 010
The first byte would be the minimum level of the first Pokemon you want to appear (0A = 10), the second would be the highest level (14 = 20) and the last two bytes would be the Pokemon # (10 = Pidgey). You would do this a total of 12 times if it were for walking in the grass (12 Pokemon total included in the table).

If this table was located at offset 812345, you would then write:

Code:
setvar 0x8004 0x0881
setvar 0x8005 0x2345
setvar 0x8005 0x0
setvar 0x8006 0x0
special 0x58

if it was for switching the appearance of grass Pokemon (for surfing you would set variable 0x8005 to 0x1, fishing to 0x3 ...)

I think that would get the special to work properly. I think you can also use writebytetooffset and change the value of 0x0203f488 with it, and write out the same table without writing it permanently in with a hex editor (and, thus make it setvar 0x8006 0x2 instead), but I'm not sure.

As for the problems I see with your script in general, it seems you're inverting the setvars (it should be setvar 0x4051 0x1; not setvar 0x1 0x4051), as well as the compare command; and you can't really check whether a special is activated with the compare commands, anyway.

I'm not sure why you would need to use special 0x58 for this script as well, since it seems unnecessarily complicated. Are you just trying to make the Pidgey's level random? If you use the wildbattle command, it's going to go off the data you put in to that command, making the special moot anyway. The special only works for random encounters in grass or surfing, etc, not when using the wildbattle command.

Maybe you can explain more exactly what you're trying to do ... I think i understand that you have a sprite that is supposed to walk up to you when it sees you and start a wild Pokemon battle with a Pidgey, but not sure what else you're after exactly, except that you don't want Pidgey's level to be static (I think).
 
23
Posts
16
Years
I'm trying to make a script that shows a pokemon's sprite (showpokepic) but if the player says no to a question and the yes/no part works fine but when you say no it just shows a small box with no pokemon in it. What could be causing this. Script is below.
Code:
#org $script
lock
faceplayer
message $haveyou
$haveyou 1 = Have you seen SNORLAX?
boxset 5
compare 0x800D 0x0001
if 0x01 goto $yesseen
message $havent
$havent 1 = Oh!\nYou haven't?\pLet me show you!
boxset 6
showpokepic 0x8F 0xA 0x3
release
end

#org $yesseen
message $thatsgreat
$thatsgreat 1 = Isn't he cute!
boxset 6
release
end
 
4
Posts
13
Years
  • Seen Apr 3, 2011
I'm trying to make a script where you battle your rival at the town school after receiving your first pokemon. But everytime I burn it it asks for the offset for pointer h0

The only thing close to h0 I have is \v\h01 for trainer's name.

Spoiler:
 

Pogeygothaxed

Pokémon exDeltaSpecies Creator
231
Posts
14
Years
There seems to be a few problems with the script. I haven't used special 0x58 from JPAN's engine, but reading the manual, I think the first thing you must do is use a hex editor to write out a table of the Pokemon you want to appear.

The data at the pointer would have to be something like:

Code:
0A 14 00 010
The first byte would be the minimum level of the first Pokemon you want to appear (0A = 10), the second would be the highest level (14 = 20) and the last two bytes would be the Pokemon # (10 = Pidgey). You would do this a total of 12 times if it were for walking in the grass (12 Pokemon total included in the table).

If this table was located at offset 812345, you would then write:

Code:
setvar 0x8004 0x0881
setvar 0x8005 0x2345
setvar 0x8005 0x0
setvar 0x8006 0x0
special 0x58
if it was for switching the appearance of grass Pokemon (for surfing you would set variable 0x8005 to 0x1, fishing to 0x3 ...)

I think that would get the special to work properly. I think you can also use writebytetooffset and change the value of 0x0203f488 with it, and write out the same table without writing it permanently in with a hex editor (and, thus make it setvar 0x8006 0x2 instead), but I'm not sure.

As for the problems I see with your script in general, it seems you're inverting the setvars (it should be setvar 0x4051 0x1; not setvar 0x1 0x4051), as well as the compare command; and you can't really check whether a special is activated with the compare commands, anyway.

I'm not sure why you would need to use special 0x58 for this script as well, since it seems unnecessarily complicated. Are you just trying to make the Pidgey's level random? If you use the wildbattle command, it's going to go off the data you put in to that command, making the special moot anyway. The special only works for random encounters in grass or surfing, etc, not when using the wildbattle command.

Maybe you can explain more exactly what you're trying to do ... I think i understand that you have a sprite that is supposed to walk up to you when it sees you and start a wild Pokemon battle with a Pidgey, but not sure what else you're after exactly, except that you don't want Pidgey's level to be static (I think).

Well, from what I gathered was that the Run Trainer Script just allows the execution of a script without calling the trainer command. (i.e. trainerbattle 0x0) It's supposed to "activate" based on the flag in your A-Map, because there seems to be a check somewhere in there, and after that it runs the sub-routine for the trainerbattle-like command, which means it does the !box, and calls the battle.

Now, there's also supposed to be a Wild-data switch, which as you mentioned works for the grass, and there's supposed to be a trainer switch, which would work on trainer battles. I guess I figured that I'd try to mimic a trainerbattle using the Run Trainer Script so that an OW (Pokemon) would force a battle in the wild, instead of you having to randomly generate it with x% chance in grass.

However, I'm not so sure that this method would work because as it's been stated by both of us: the wild data switch is for the grass, and I don't think the wild battle data can be brought over to the WildBattle command? Since it's a pre-determined script(as you mentioned). I'm still some-what intermediate when it comes to scripting. If you can then it's probably way over my head. Second, the trainer switch wouldn't work either because then it'd also be able to control the level via vars, but then it'd be a trainer battle...

Thanks for clearing up some of the functions, though. I have a hard time understanding some parts of JPAN's manual. xd

edit: I had another thought. If I remember correctly, there's a "Wild Battle Generator." It was meant to be used for background byte behavior, but maybe I could convert it to generate a "Wild Battle" instead of using the WildBattle command?

edit 2:
Spoiler:

I added the generator, but it doesn't seem to activate the special. I'm guessing I messed up the writebyte again? I couldn't find very much detail that went into that command...I tried writing it, but the offset must still be off? I didn't create the hex table, because I want it dynamic. I may have inverted it again, but I'm not sure...=\ It looks like the only part of the script not executing is the generator, because it still shows the msgbox and plays the cry?

Again, any help would be much appreciated. -.-'

edit 3: After further testing it seems that the battle actually DOES generate, only not the first time you "speak" to it(it still doesn't do the trainer thing). It also doesn't make it only Pidgey, it also gave a Ratatta. Which would mean that the pointer isn't functioning. Because it's not pointing to the new data like it's supposed to...it's using the old table. Or, because the script only writes the byte for one block, it's not using the others...but that's debatable because then it should be ????...it could also be the daa switch again, I'm not sure...the actual grass, that the switch controls, works perfectly. All the Pokemon in the wild are the same lvl, which is how it's supposed to work. But then again, it's using the old table, so Ratatta appears.

Another thing is that the encounter ratio is off, so it's only generating with a x(?)%. thus resulting in multiple re-tries in order to complete the script process. That's all I could come up with...I'll try to add the table in hex and point to it, as suggested before. But I'm not sure if that would fix the encounter glitch. Any other suggestions?

edit 4(wow this is a lot of editting): I've uploaded a video that may be more helpful.

You can find the updated script in the summary, beneath the video. I had a flag in there, but I quickly found out that it would cause an infinite loop, because I also got the Run Trainer Script to function properly. Basiclly, I just need help with the whole "table" thing - I got the pointer, and I believe I set it correctly, but it's still not using it in the switch...everything else, besides the encounter ratio is working fine. Hopefully the video makes it easier to understand.
 
Last edited:
17
Posts
13
Years
  • Seen Apr 15, 2011
Steven's offset

Anybody know the offset for the champion battle in ruby, along with how to make the end credits roll?
No matter what I can't find the champion(steven)'s offset in the elite four, everything has $000000 in a-map and there are no scripts
 

metapod23

Hardened Trainer
673
Posts
15
Years
  • Seen Aug 18, 2016
Well, from what I gathered was that the Run Trainer Script just allows the execution of a script without calling the trainer command. (i.e. trainerbattle 0x0) It's supposed to "activate" based on the flag in your A-Map, because there seems to be a check somewhere in there, and after that it runs the sub-routine for the trainerbattle-like command, which means it does the !box, and calls the battle.

Now, there's also supposed to be a Wild-data switch, which as you mentioned works for the grass, and there's supposed to be a trainer switch, which would work on trainer battles. I guess I figured that I'd try to mimic a trainerbattle using the Run Trainer Script so that an OW (Pokemon) would force a battle in the wild, instead of you having to randomly generate it with x% chance in grass.

However, I'm not so sure that this method would work because as it's been stated by both of us: the wild data switch is for the grass, and I don't think the wild battle data can be brought over to the WildBattle command? Since it's a pre-determined script(as you mentioned). I'm still some-what intermediate when it comes to scripting. If you can then it's probably way over my head. Second, the trainer switch wouldn't work either because then it'd also be able to control the level via vars, but then it'd be a trainer battle...

Thanks for clearing up some of the functions, though. I have a hard time understanding some parts of JPAN's manual. xd

edit: I had another thought. If I remember correctly, there's a "Wild Battle Generator." It was meant to be used for background byte behavior, but maybe I could convert it to generate a "Wild Battle" instead of using the WildBattle command?

edit 2:
Spoiler:

I added the generator, but it doesn't seem to activate the special. I'm guessing I messed up the writebyte again? I couldn't find very much detail that went into that command...I tried writing it, but the offset must still be off? I didn't create the hex table, because I want it dynamic. I may have inverted it again, but I'm not sure...=\ It looks like the only part of the script not executing is the generator, because it still shows the msgbox and plays the cry?

Again, any help would be much appreciated. -.-'

edit 3: After further testing it seems that the battle actually DOES generate, only not the first time you "speak" to it(it still doesn't do the trainer thing). It also doesn't make it only Pidgey, it also gave a Ratatta. Which would mean that the pointer isn't functioning. Because it's not pointing to the new data like it's supposed to...it's using the old table. Or, because the script only writes the byte for one block, it's not using the others...but that's debatable because then it should be ????...it could also be the daa switch again, I'm not sure...the actual grass, that the switch controls, works perfectly. All the Pokemon in the wild are the same lvl, which is how it's supposed to work. But then again, it's using the old table, so Ratatta appears.

Another thing is that the encounter ratio is off, so it's only generating with a x(?)%. thus resulting in multiple re-tries in order to complete the script process. That's all I could come up with...I'll try to add the table in hex and point to it, as suggested before. But I'm not sure if that would fix the encounter glitch. Any other suggestions?

edit 4(wow this is a lot of editting): I've uploaded a video that may be more helpful.

You can find the updated script in the summary, beneath the video. I had a flag in there, but I quickly found out that it would cause an infinite loop, because I also got the Run Trainer Script to function properly. Basiclly, I just need help with the whole "table" thing - I got the pointer, and I believe I set it correctly, but it's still not using it in the switch...everything else, besides the encounter ratio is working fine. Hopefully the video makes it easier to understand.

I think I may have misunderstood something about the special before. I don't think (from my understanding of the manual) that you can dynamically load a set of Pokemon to battle with. 0x8006 in this special is used to set the "pointer location" - which should mean that it has to be a pointer. I think JPAN just allowed you three different ways of loading the pointer to the Pokemon data.

That being said, if I'm right about this, you would have to add the data in a hex editor manually and keep the offset. (If I'm not right, I have no idea how to to the switch dynamically, sorry.)

You should have to have a set of data consisting of 4 repeating bytes. Since it's a grass battle, you need a total of twelve slots, so if you wanted a random Rattata of various levels (let's say each one range from level 1-5 in the first slot, 6-10 in the second, 11-15 in the third, etc.) the hex data you would insert would be:

Code:
01 05 00 13 06 0A 00 13 0B 0F 00 13 10 14 00 13 15 19 00 13 1A 1E 00 13 1F 24 00
13 25 29 00 13 2A 2E 00 13 2F 33 00 13 34 38 00 13 39 3D 00 13

Every four bytes would indicate a new Pokemon. You have to list all twelve, or else you'll get question-mark Pokemon instead.

I may try this special out and report back to you to see if I can get it to work.

EDIT: Reading up on it, it doesn't appear that special 0x97 actually generates an instant battle - rather, it seems to just allow random battles to take place at the current map.

Also, I tried the special but haven't gotten it to work properly - I get question mark Pokemon appearing.

I wonder, though, why can't you use the random command to generate you random wild battles. Like, if you wanted a random battle with, say, Pikachu, Rattata, Pidgey, and Spearow of the same level, you could do:

Code:
random 0x4
compare lastresult 0x0
if 0x1 call @pikachu
compare lastresult 0x1
if 0x1 call @rattata
compare lastresult 0x2
if 0x1 call @pidgey
compare lastresult 0x3
if 0x1 call @spearow
msgbox @Cry 0x2
release
end

#org @pikachu
wildbattle 0x19 0xa 0x0
return

#org @rattata
wildbattle 0x13 0xa 0x0
return

#org @pidgey
wildbattle 0x10 0xa 0x0
return

#org @spearow
wildbattle 0x15 0xa 0x0
return

?
 
Last edited:

Pogeygothaxed

Pokémon exDeltaSpecies Creator
231
Posts
14
Years
I think I may have misunderstood something about the special before. I don't think (from my understanding of the manual) that you can dynamically load a set of Pokemon to battle with. 0x8006 in this special is used to set the "pointer location" - which should mean that it has to be a pointer. I think JPAN just allowed you three different ways of loading the pointer to the Pokemon data.

That being said, if I'm right about this, you would have to add the data in a hex editor manually and keep the offset. (If I'm not right, I have no idea how to to the switch dynamically, sorry.)

You should have to have a set of data consisting of 4 repeating bytes. Since it's a grass battle, you need a total of twelve slots, so if you wanted a random Rattata of various levels (let's say each one range from level 1-5 in the first slot, 6-10 in the second, 11-15 in the third, etc.) the hex data you would insert would be:

Code:
01 05 00 13 06 0A 00 13 0B 0F 00 13 10 14 00 13 15 19 00 13 1A 1E 00 13 1F 24 00
13 25 29 00 13 2A 2E 00 13 2F 33 00 13 34 38 00 13 39 3D 00 13
Every four bytes would indicate a new Pokemon. You have to list all twelve, or else you'll get question-mark Pokemon instead.

I may try this special out and report back to you to see if I can get it to work.

EDIT: Reading up on it, it doesn't appear that special 0x97 actually generates an instant battle - rather, it seems to just allow random battles to take place at the current map.

Also, I tried the special but haven't gotten it to work properly - I get question mark Pokemon appearing.

I wonder, though, why can't you use the random command to generate you random wild battles. Like, if you wanted a random battle with, say, Pikachu, Rattata, Pidgey, and Spearow of the same level, you could do:

Code:
random 0x4
compare lastresult 0x0
if 0x1 call @pikachu
compare lastresult 0x1
if 0x1 call @rattata
compare lastresult 0x2
if 0x1 call @pidgey
compare lastresult 0x3
if 0x1 call @spearow
msgbox @Cry 0x2
release
end

#org @pikachu
wildbattle 0x19 0xa 0x0
return

#org @rattata
wildbattle 0x13 0xa 0x0
return

#org @pidgey
wildbattle 0x10 0xa 0x0
return

#org @spearow
wildbattle 0x15 0xa 0x0
return
?

Well, that's the thing...I didn't want random Pokemon. I wanted to make it like a WildBattle command would be; where it calls that Pokemon. I also wanted to set the level with this variable: setvar 0x4051 0x0a51 'sets the battle level wild Pokemon :I commented in that it sets the battle level, but the actual value of 0xayy (yy being the switch number, i.e. 4051 = Wild, 4052 = Trainer. However, I don't think this particular value would work with 4052?) is supposed to get the party's high and lowest levels, then set the level between that randomly. That way, instead of having the lvl be set, it'd change with your Party.

I also included the Run Trainer Script so that it'd act like a trainer, as shown in the video. But the way I'd have to set it up, from what you told me, is to make a table for each Pokemon in the area, consisting of 12 slots for each, and then point towards that; changing the pointer with the Pokemon OW/Script. That's how it gets complicated, because it needs to be set to that Pokemon as the OW. Then there's the wild generation part, like in the video...as you said: it only makes a chance of encounter(like walking in grass) so it won't force the battle, like in the video. You'd have to "speak" to it, re-executing the script, perhaps several times, until you got the correct percentage. True, with more slots you add more chance, however like in grass, it still won't produce a battle every step.

So at the moment I'm not sure how I could work around it, or if it's even possible to get the desired results. Even if I could find a way to force a battle, there would still need to be those tables, which would take up a decent amount of space for 356 Pokemon...
 
Last edited:

metapod23

Hardened Trainer
673
Posts
15
Years
  • Seen Aug 18, 2016
Well, that's the thing...I didn't want random Pokemon. I wanted to make it like a WildBattle command would be; where it calls that Pokemon. I also wanted to set the level with this variable: setvar 0x4051 0x0a51 'sets the battle level wild Pokemon :I commented in that it sets the battle level, but the actual value of 0xayy (yy being the switch number, i.e. 4051 = Wild, 4052 = Trainer. However, I don't think this particular value would work with 4052?) is supposed to get the party's high and lowest levels, then set the level between that randomly. That way, instead of having the lvl be set, it'd change with your Party.

I also included the Run Trainer Script so that it'd act like a trainer, as shown in the video. But the way I'd have to set it up, from what you told me, is to make a table for each Pokemon in the area, consisting of 12 slots for each, and then point towards that; changing the pointer with the Pokemon OW/Script. That's how it gets complicated, because it needs to be set to that Pokemon as the OW. Then there's the wild generation part, like in the video...as you said: it only makes a chance of encounter(like walking in grass) so it won't force the battle, like in the video. You'd have to "speak" to it, re-executing the script, perhaps several times, until you got the correct percentage. True, with more slots you add more chance, however like in grass, it still won't produce a battle every step.

So at the moment I'm not sure how I could work around it, or if it's even possible to get the desired results. Even if I could find a way to force a battle, there would still need to be those tables, which would take up a decent amount of space for 356 Pokemon...

First, I have to plead ignorance on special 0x58. I thought I understood it, but I can't figure out what needs to be done to get it to work correctly. I now believe that it is done in-script, and no hex-editing is required, but nothing I've tried works. I might try a little more later, as I think it has to do with using the writebytetooffset to change each individual byte, but I'm not sure. JPAN's manual is often worded in a way that I can't grasp what needs to be done.

... That being said, if I'm understanding correctly, you actually want it to run as a trainer script, not a wild battle. The problem is, I think you're misunderstanding the purpose of the "run trainer script." It doesn't cause wild battles to act as trainer battles as far as i know - it just allows the sprite to act as if it's a trainer (exclamation mark, run up to the player) and then execute the script without there needing to be a trainberbattle command in the script. So it won't cause a wild battle to act as a trainer battle.

Now I understand why you're using variable 0x4052. What you want to do can easily be done with a trainer that's already programmed into the game. Here's an example - if you want to use trainerbattle 0x1, and you want the trainer's Pokemon to be two levels higher than your highest level Pokemon, it would go like this:

Code:
#org @start
setvar 0x4052 0x0202
msgbox @cry MSG_FACE
trainerbattle 0x3 0x1 0x0 @lose
setvar 0x4052 0x0
release
end

#org @cry
= Pidgeyy

#org @lose
= I lost!

^ This would make trainer 0x1 (can be edited with A-Trainer) have his whole party consist of Pokemon with levels that are two higher than your highest leveled Pokemon. If I'm understanding right, this is what you're trying to do more or less, but let me know if there's something else I'm missing. :)
 

Pogeygothaxed

Pokémon exDeltaSpecies Creator
231
Posts
14
Years
First, I have to plead ignorance on special 0x58. I thought I understood it, but I can't figure out what needs to be done to get it to work correctly. I now believe that it is done in-script, and no hex-editing is required, but nothing I've tried works. I might try a little more later, as I think it has to do with using the writebytetooffset to change each individual byte, but I'm not sure. JPAN's manual is often worded in a way that I can't grasp what needs to be done.

... That being said, if I'm understanding correctly, you actually want it to run as a trainer script, not a wild Arrest. The problem is, I think you're misunderstanding the purpose of the "run trainer script." It doesn't cause wild Arrests to act as trainer Arrests as far as i know - it just allows the sprite to act as if it's a trainer (exclamation mark, run up to the player) and then execute the script without there needing to be a trainberArrest command in the script. So it won't cause a wild Arrest to act as a trainer Arrest.

Now I understand why you're using variable 0x4052. What you want to do can easily be done with a trainer that's already programmed into the Blanket. Here's an example - if you want to use trainerArrest 0x1, and you want the trainer's Pokemon to be two levels higher than your highest level Pokemon, it would go like this:

Code:
#org @start
setvar 0x4052 0x0202
msgbox @cry MSG_FACE
trainerArrest 0x3 0x1 0x0 @lose
setvar 0x4052 0x0
release
end

#org @cry
= Pidgeyy

#org @lose
= I lost!
^ This would make trainer 0x1 (can be edited with A-Trainer) have his whatle party consist of Pokemon with levels that are two higher than your highest leveled Pokemon. If I'm understanding right, this is what you're trying to do more or less, but let me know if there's something else I'm missing. :)

No, I know that...that was the point. I didn't want a trainer Arrest. I wanted a wild (ow) Pokemon to walk around like the trainer sprites do, with the view radius so when it sees you in executes the script(which would be like a wild Arrest). It was working exactly how I thought it would in the last script I made. Here's the script:

Spoiler:


The problem is trying to call the table. I could write it in directly, then re-point to it, but how would I keep it from using the same table with a different OW? i.e. I have a Pidgey OW. I call the switch to trigger the Wild Data change, so it makes all 12 slots switch to Pidgey. The reason it'd switch all the slots to that Pokemon, is so that there wouldn't be a ratatta appearing like in the video. But now I have a Ratatta OW roaming on a different part of the screen, and it triggers the script. I don't want Pidgey to appear because the table didn't switch. I'm guessing you'd just use the load pointer, and read from that location? If you used Writebyte, would you just re-write it in a new script and it would over-write the old bytes? XSE didn't tell me much about it besides the obvious, and no tutorial went in-depth with that command.

But with that aside, there isn't a way to force the wild Arrest without pre-setting it. In your script, you used the variable to set the lvl always above 2, but it'd still be a trainer - with a loss message and a sprite appearing before / after the Arrest screen. Refering back to WildArrest command, is there anyway to use a variable instead of 0xX? X = Level. That's the only thing I could think of atm. :| You'd set the Var with the value of the special and then it'd use that instead of X...nvm, I get an overflow on the line. It won't accept it. Worth a try I guess.

P.s.That's why I was using 4051, because it sets the Wild Data not the Trainers on the map to use the variable. Sorry for not making things more clear...=\ my communication skills are lacking. But there'd need to be a lot of tables and it wouldn't really be worth it to try to implement a feature like that unless it was dynamic.

P.s.s. I was just curious and went looking through an Emerald ROM for the first event when the Prof. gets attacked by a Wild Pokemon. I loaded the scripts in XSE to see if I could find a WildArrest command, which I did not. I may have overlooked part of the script with it, but I'm pretty sure it'd be in the choose your Pokemon part. iirc, it starts the Arrest right after you open the bag, etc. But it didn't in the script, unless it was a special or a flag...and the actual OW(Pokemon) didn't have a script attached to it.
 
Last edited:

metapod23

Hardened Trainer
673
Posts
15
Years
  • Seen Aug 18, 2016
No, I know that...that was the point. I didn't want a trainer Arrest. I wanted a wild (ow) Pokemon to walk around like the trainer sprites do, with the view radius so when it sees you in executes the script(which would be like a wild Arrest). It was working exactly how I thought it would in the last script I made. Here's the script:

Spoiler:


The problem is trying to call the table. I could write it in directly, then re-point to it, but how would I keep it from using the same table with a different OW? i.e. I have a Pidgey OW. I call the switch to trigger the Wild Data change, so it makes all 12 slots switch to Pidgey. The reason it'd switch all the slots to that Pokemon, is so that there wouldn't be a ratatta appearing like in the video. But now I have a Ratatta OW roaming on a different part of the screen, and it triggers the script. I don't want Pidgey to appear because the table didn't switch. I'm guessing you'd just use the load pointer, and read from that location? If you used Writebyte, would you just re-write it in a new script and it would over-write the old bytes? XSE didn't tell me much about it besides the obvious, and no tutorial went in-depth with that command.

But with that aside, there isn't a way to force the wild Arrest without pre-setting it. In your script, you used the variable to set the lvl always above 2, but it'd still be a trainer - with a loss message and a sprite appearing before / after the Arrest screen. Refering back to WildArrest command, is there anyway to use a variable instead of 0xX? X = Level. That's the only thing I could think of atm. :| You'd set the Var with the value of the special and then it'd use that instead of X...nvm, I get an overflow on the line. It won't accept it. Worth a try I guess.

P.s.That's why I was using 4051, because it sets the Wild Data not the Trainers on the map to use the variable. Sorry for not making things more clear...=\ my communication skills are lacking. But there'd need to be a lot of tables and it wouldn't really be worth it to try to implement a feature like that unless it was dynamic.

P.s.s. I was just curious and went looking through an Emerald ROM for the first event when the Prof. gets attacked by a Wild Pokemon. I loaded the scripts in XSE to see if I could find a WildArrest command, which I did not. I may have overlooked part of the script with it, but I'm pretty sure it'd be in the choose your Pokemon part. iirc, it starts the Arrest right after you open the bag, etc. But it didn't in the script, unless it was a special or a flag...and the actual OW(Pokemon) didn't have a script attached to it.

So you want to have the Pidgey OW see you, execute a script, and then have only Pidgey attack you until in the wild until you reset it?
 

RegisteelX

Too many days to get lost
67
Posts
14
Years
  • Age 32
  • Seen Mar 21, 2023
I have a question.
How can you make this script so that the person doesnt return to the original position.

Code:
#dynamic 0x800727

#org @start
checkflag 0x808
if 0x1 call @next
msgbox @talk 0x6
applymovement 0x09 @move1
waitmovement 0x2
waitmovement 0x0
msgbox @next 0x6
setflag 0x808
release
end

#org @move1
#raw 0x06
#raw 0xFE

#org @talk
= You have collected all badges!\n you may pass.

#org @next
= good luck, your gonna need it.

If sombody can help me.
 

Pogeygothaxed

Pokémon exDeltaSpecies Creator
231
Posts
14
Years
So you want to have the Pidgey OW see you, execute a script, and then have only Pidgey attack you until in the wild until you reset it?

Pretty much. I could do that easily, if I didn't need the variables to change the level accordingly. x.x I also wanted to see if I could make it check the level, then change the OW with dynamic OWs. (Maybe activated with a walk-script on the first tiles in the map, or a level map. But from what I read the level maps are limited? I haven't got the first part to work, so I won't bcrazy with that right now.)So if it would call you battling a Pidgey at lvl 18, it'd be a Pidgeotto instead.

I was looking for a way to replace the "randomly generate Arrests in grass" I don't know, I was just experimenting with the new code available. I wasn't too big on scripting up 'til now, so I had no idea what anything meant when it was released. But now I'm trying to get my hands more dirty because I couldn't achieve what I wanted in my crazy hacks.

I have a question.
How can you make this script so that the person doesnt return to the original position.

Code:
#dynamic 0x800727

#org @start
checkflag 0x808
if 0x1 call @next
msgbox @talk 0x6
applymovement 0x09 @move1
waitmovement 0x2
waitmovement 0x0
msgbox @next 0x6
setflag 0x808
release
end

#org @move1
#raw 0x06
#raw 0xFE

#org @talk
= You have collected all plasplasbadges!\n you may pass.

#org @next
= good luck, your gonna need it.
If sombody can help me.

I haven't script much movement, but I believe you need to use the command "waitmovement" and then set the amount of time to wait.

i.e.
applymovement 0xX @movelist 'X = Person number
waitmovement 0x0
Hopefully this helps.
 
Last edited:

imaier

Pro Hacker
2
Posts
13
Years
I'm trying to make a script that shows a pokemon's sprite (showpokepic) but if the player says no to a question and the yes/no part works fine but when you say no it just shows a small box with no pokemon in it. What could be causing this. Script is below.
Code:
#org $script
lock
faceplayer
message $haveyou
$haveyou 1 = Have you seen SNORLAX?
boxset 5
compare 0x800D 0x0001
if 0x01 goto $yesseen
message $havent
$havent 1 = Oh!\nYou haven't?\pLet me show you!
boxset 6
showpokepic 0x8F 0xA 0x3
release
end
 
#org $yesseen
message $thatsgreat
$thatsgreat 1 = Isn't he cute!
boxset 6
release
end


Well First of all. After you do:
Code:
showpokepic 0x8F 0xA 0x3
you are going to have to do:
Code:
hidepokepic 0x8F 0xA 0x3
or the picture will just site there forever.

Unfortunatly thats all I can see wrong...are you using PokeScript or
XSE because XSE is much better.
 

RegisteelX

Too many days to get lost
67
Posts
14
Years
  • Age 32
  • Seen Mar 21, 2023
Pretty much. I could do that easily, if I didn't need the variables to change the level accordingly. x.x I also wanted to see if I could make it check the level, then change the OW with dynamic OWs. (Maybe activated with a walk-script on the first tiles in the map, or a level map. But from what I read the level maps are limited? I haven't got the first part to work, so I won't bcrazy with that right now.)So if it would call you battling a Pidgey at lvl 18, it'd be a Pidgeotto instead.

I was looking for a way to replace the "randomly generate Arrests in grass" I don't know, I was just experimenting with the new code available. I wasn't too big on scripting up 'til now, so I had no idea what anything meant when it was released. But now I'm trying to get my hands more dirty because I couldn't achieve what I wanted in my crazy hacks.



I haven't script much movement, but I believe you need to use the command "waitmovement" and then set the amount of time to wait.

i.e.
applymovement 0xX @movelist 'X = Person number
waitmovement 0x0
Hopefully this helps.

Thanks, but that didn't help. As soon as he gets out of view, he returns to its original place and does nothing anymore.
 
Status
Not open for further replies.
Back
Top