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

karatekid552

What happens if I push it?....
1,771
Posts
11
Years
Hey! I recently repointed the "OW-Sprite-pointer-table" using Hex Workshop to get more OWSprites. As default in A-map there's only 150 sprites, and as default in OWE-RE there's 153 OWSprites?! When I repoint the sprite-tabel, add a new sprite and then go to A-map my new OWSprite shows up as no. 151 as it should, but in OWE-RE I still only have 153 sprites and can't go any further. I think it's because OWE-RE only checks the spritetable at 0x0039FDB0 and not the actuall pointer, just a theory though. Another notice I've made's that the sprites in OWE-RE seems to have another order than the one's in A-Map btw... The last sprite in A-Map is a deoxys and the last one in OWE-RE is a messed up boat.

My question is, how comes there's only 150 sprites in A-Map but 153 in OWE-RE?

And why can't i see my new added sprite in OWE-RE but in A-Map?

Btw, I'm using FireRed if it matters...

OWERE reads not from the pointer bank you repointed, but from the bank that the repointed bank points to. I know, it's confusing. So, to avoid this, go download NSE Classic (not 2.X, CLASSIC) Very similar interface, but it reads from the same bank as A-map and has many more features. It can edit any in game sprite like Unlz can, but better if you know how to use it, but its default is Overworlds.

By the way, this belongs in simple questions, not the script help thread:D.
 
15
Posts
11
Years
  • Seen Mar 19, 2016
OWERE reads not from the pointer bank you repointed, but from the bank that the repointed bank points to. I know, it's confusing. So, to avoid this, go download NSE Classic (not 2.X, CLASSIC) Very similar interface, but it reads from the same bank as A-map and has many more features. It can edit any in game sprite like Unlz can, but better if you know how to use it, but its default is Overworlds.

By the way, this belongs in simple questions, not the script help thread:D.

Thx! I did search for other OWE's but didn't find any but now i have one! gonna try it out.
Why won't 2.X work btw?
 
241
Posts
11
Years
I'm trying to create a simple yes/no trainer battle. Here is what I have:

Spoiler:


It's close to working. The problem is, the trainer only asks if you want to battle once, so if you say no you can't change your mind and say yes until you enter another battle and come back to him. Conversely, if you say yes, the battle commences, but if you come back to him after another battle, he asks if you want to battle again, even though you already won...not sure why...
 

karatekid552

What happens if I push it?....
1,771
Posts
11
Years
I'm trying to create a simple yes/no trainer battle. Here is what I have:

Spoiler:


It's close to working. The problem is, the trainer only asks if you want to battle once, so if you say no you can't change your mind and say yes until you enter another battle and come back to him. Conversely, if you say yes, the battle commences, but if you come back to him after another battle, he asks if you want to battle again, even though you already won...not sure why...

Well, the first problem is there is no "end" at the end of @begin. This can cause bytes to run together if you have, let's say another script in that same area, and it might just keep going onto the next script.

There is no need to set the trainers flag if you say no, it was already set from the start.

Lastly, play with the type of trainer battle. I think your problem lies in using the wrong type. The types range from 0-3 so give them all a try.
 

Blah

Free supporter
1,924
Posts
11
Years
I'm trying to create a simple yes/no trainer battle. Here is what I have:

Spoiler:


It's close to working. The problem is, the trainer only asks if you want to battle once, so if you say no you can't change your mind and say yes until you enter another battle and come back to him. Conversely, if you say yes, the battle commences, but if you come back to him after another battle, he asks if you want to battle again, even though you already won...not sure why...

Lets see here.
checktrainerflag 0x66 'Set when trainer is battled
compare lastresult 0x0 'Check if flag is not set (i.e not battled)
if 0x1 goto @finished 'If it's not battled goto @finish

It's only working because you can't do that, and it runs anyways (Atleast not in PKSV's new version. Just do checkflag, if true.) :P

What you should do is:
checktrainerflag 0x66
if 0x1 goto @finished

Also, logically you're setting the trainerflag if you haven't battled (which is wrong). Here's a PKSV representation of what it should look like.

Spoiler:


Try that PKSV version, you can convert it to XSE easily, if you wish.
 

karatekid552

What happens if I push it?....
1,771
Posts
11
Years
Lets see here.
checktrainerflag 0x66 'Set when trainer is battled
compare lastresult 0x0 'Check if flag is not set (i.e not battled)
if 0x1 goto @finished 'If it's not battled goto @finish

It's only working because you can't do that, and it runs anyways (Atleast not in PKSV's new version. Just do checkflag, if true.) :P

What you should do is:
checktrainerflag 0x66
if 0x1 goto @finished

Also, logically you're setting the trainerflag if you haven't battled (which is wrong). Here's a PKSV representation of what it should look like.

Spoiler:


Try that PKSV version, you can convert it to XSE easily, if you wish.

Umm FBI, trainer flags work backwards. They are cleared when you beat them. Another name for settrainerflag is enabletrainer. They are interchangeable names for the same command. Same goes for cleartrainerflag, its other optional name is disabletrainer.

I know that the commands themselves work that way, but the settrainerflag 0x0 command may be equivalent to a standard clearflag 0x500 (trainer flags are just regular flags starting at 500 if I remember correctly) so there is a chance that the main names for the commands are misleading. The only way to really tell would be to take a clean rom and right off the bat, checkflag 0x500 and see what it holds.

Proof- I wrote a working script to make every trainer in the game ready to battle again. It didn't work when I logically used cleartrainerflag, so when I switched to setrainerflag, everybody wanted to battle again.


Edit: Comrade likes your Signiture.
 

Blah

Free supporter
1,924
Posts
11
Years
Umm FBI, trainer flags work backwards. They are cleared when you beat them. Another name for settrainerflag is enabletrainer. They are interchangeable names for the same command. Same goes for cleartrainerflag, its other optional name is disabletrainer.

I know that the commands themselves work that way, but the settrainerflag 0x0 command may be equivalent to a standard clearflag 0x500 (trainer flags are just regular flags starting at 500 if I remember correctly) so there is a chance that the main names for the commands are misleading. The only way to really tell would be to take a clean rom and right off the bat, checkflag 0x500 and see what it holds.

Proof- I wrote a working script to make every trainer in the game ready to battle again. It didn't work when I logically used cleartrainerflag, so when I switched to setrainerflag, everybody wanted to battle again.


Edit: Comrade likes your Signiture.

Derp, I always forget some detail. :D
You are right about the trainer flags, they do work differently (and in my opinion they should be named in script editors more consistently with other flags). The script should still work if you remove settrainerflag (you don't have to remove settrainerflag but it's a pointless command using up space, where it is right now) and change this part:

checktrainerflag 0x66
if FALSE jump @done

It's often easy to confuse/generalize on commands that appear to work in the same fashion. Sorry for any confusion last post caused.

I'm glad comrade likes my signature, I was originally going to leave it under maintenance forever :P
 

karatekid552

What happens if I push it?....
1,771
Posts
11
Years
what is var numbers? where will i get it....

For which game?

Vars are variables that are used to prevent scripts and such from happening again. Except for temporary ones like LASTRESULT, 90% of the time, they are used for map scripts amd scripttiles as a simple way of making them never happen again, but they can also be set to specific values to show your progress in a specific event.

For FR, here is a very complete list of used flags and vars: http://www.pokecommunity.com/showthread.php?p=6829256#post6829256

And an extension of that post dealing specfically with safe vars: http://www.pokecommunity.com/showpost.php?p=6902344&postcount=183
 
416
Posts
11
Years
  • Age 34
  • Seen Feb 10, 2024
ok... so basically I am going to give the player the opportunity to catch Latias... and if they catch Latias they will step on a script tile (a little later) and Latios will fly in and attack them... but only if they catch latias... not faint or run from or whatever...

how can I check if they have caught a specific pokemon... like check that pokedex number or soemthing...

i guess in the end I could have latias set different flags for caught and fainted but id rather be able to check the pokedex...
 

karatekid552

What happens if I push it?....
1,771
Posts
11
Years
ok... so basically I am going to give the player the opportunity to catch Latias... and if they catch Latias they will step on a script tile (a little later) and Latios will fly in and attack them... but only if they catch latias... not faint or run from or whatever...

how can I check if they have caught a specific pokemon... like check that pokedex number or soemthing...

i guess in the end I could have latias set different flags for caught and fainted but id rather be able to check the pokedex...

See JPAN's study on the Sepecial and Special2 commands. I beleive I saw a special that does just that.


Edit: I think this might help: Special 0D4 seems to place on 0x8005 the seen pokemon and on 0x8006 the caught ones. Also places on 0x800c a number that might be pokemon the pokedex doesn't detect but were caught. if 0x8004 = 0, print kanto's values, 0x8004 != 0x0, national dex values
 

ep!c

Banned
124
Posts
11
Years
  • Seen Jan 4, 2015
Hey, to check if a Pokémon is caught or not, you need a special.

Special 0xB4.

*key 0x1 = fainted, 0x7 = captured, 0x4 = escaped*

So you make your wildbattle and after it you compare.

Example:
wildbattle blabla
waitstate (only for XSE 1.0)
special2 LASTRESULT 0xB4
compare LASTRESULT 0x7
if 0x1 call @caught


Hope it helps :)

@up
Darn, you were a bit faster xD
 

karatekid552

What happens if I push it?....
1,771
Posts
11
Years
Hey, to check if a Pokémon is caught or not, you need a special.

Special 0xB4.

*key 0x1 = fainted, 0x7 = captured, 0x4 = escaped*

So you make your wildbattle and after it you compare.

Example:
wildbattle blabla
waitstate (only for XSE 1.0)
special2 LASTRESULT 0xB4
compare LASTRESULT 0x7
if 0x1 call @caught


Hope it helps :)

@up
Darn, you were a bit faster xD

He knows how to do that, I taught him it personally.:) He said he would rather not have to set a flag depending upon certain conditions, being fainted or caught.


But now that I think about it, a var has to be set either way to prevent the script from happening again. Why not use special B4 and set a var to a specific number based upon the outcome like 1 for ran, 2 for fainted, and 3 for caught, and then only have the second script for Latios run if that var equals 3 (in the script tile settings in A-map) then at the end, just set that var to 4, and the events will never happen again.
 
416
Posts
11
Years
  • Age 34
  • Seen Feb 10, 2024
He knows how to do that, I taught him it personally.:) He said he would rather not have to set a flag depending upon certain conditions, being fainted or caught.


But now that I think about it, a var has to be set either way to prevent the script from happening again. Why not use special B4 and set a var to a specific number based upon the outcome like 1 for ran, 2 for fainted, and 3 for caught, and then only have the second script for Latios run if that var equals 3 (in the script tile settings in A-map) then at the end, just set that var to 4, and the events will never happen again.

yeah that seems like the most logical way to do it...
 

karatekid552

What happens if I push it?....
1,771
Posts
11
Years
Err what am I doing wrong? http://prntscr.com/v32c9

I have actually heard of bugs in XSE where if you use @1, it writes it to offset 000001. This goes for any script editor and is one of the first thing most tutorials say never to do.

So, if you rom crashes like that on opening, that is what happened. If when you talked to the npc, then I have no clue.
 
215
Posts
11
Years
  • Seen Jul 14, 2020
I have 2 questions to ask TPC.

Problem numbers one: I created a level script. Yes I did it the proper way by getting the map offset and such. It is an [2] level script where you walk into the room for the first time and the mom gives you your shoes. It works perfectly fine but everytime I enter the room, the script activates again. I have the right variable under the flags section. Anyone know what the problem might be? Here is the script for you to look at.

Spoiler:


Note I created another level script the same way and that one works perfectly fine, it's just this one that keeps repeating.

Problem numbers two: I wrote a script where you pick up a pokeball containing a Pokemon (It's a long script) and the Pokeball is gone (which is suppose to happen) but when you leave the room and come back, the Pokeball reappears. I don't know what I am doing wrong! I these comands

hidesprite 0x1
setflag 0x7

and I also made the person ID 7. That should work, shouldn't it?

Please PC help me!
 
Status
Not open for further replies.
Back
Top