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

adamb241

Pokémon Raging Fury
656
Posts
16
Years
Well I have a few questions about this script. Hopefully someone here can help me.

Spoiler:


1. After the 2nd trainer battle, the two guys are suppose to walk away but halfway through their movements they stop and the script ends (player can move around). I've tried a lot of different fixes but I can't seem to solve this problem.

Pokemon-FireRed-1.png


2. I want to make the guy pause in the script. ex. Walks (stops) looks left (pauses) looks right (pauses). How would I go about making that happen? I've tried experimenting with the "delay" commands but to no avail.
3. Finally, if the player gets defeated by blither trainer, if he goes back to the script start again, it goes up to the part right before the battle and releases the player. How can I fix this?

Thanks for any help.
 
9
Posts
13
Years
  • Seen Sep 29, 2016
Hi! I wondered if it was any possible script/command to either trade pokémons, or sort of "get rid of them". What I want is to remove a certain pokémon (from the player) for a period and then give it back again, the player will also recieve a temporarily pokémon. What I first thought of was to use the givepokemon command, and by some sort of way removing an other pokemon from the party(however I didn't find such a command). But then I thought of that it may would have been possible to use a command to trade with the computer.

So what I am asking is: is there any commands as the two described above("takepokemon" or "trade with CPU"- sort of)?

And I am using XSE in a fire red hack:)
 

destinedjagold

You can contact me in PC's discord server...
8,593
Posts
16
Years
  • Age 33
  • Seen Dec 23, 2023
Well I have a few questions about this script. Hopefully someone here can help me.

Spoiler:


1. After the 2nd trainer battle, the two guys are suppose to walk away but halfway through their movements they stop and the script ends (player can move around). I've tried a lot of different fixes but I can't seem to solve this problem.

Pokemon-FireRed-1.png


2. I want to make the guy pause in the script. ex. Walks (stops) looks left (pauses) looks right (pauses). How would I go about making that happen? I've tried experimenting with the "delay" commands but to no avail.
3. Finally, if the player gets defeated by blither trainer, if he goes back to the script start again, it goes up to the part right before the battle and releases the player. How can I fix this?

Thanks for any help.

1. What exactly does 0x60 do? Maybe that's causing your problem.
(I'm a Ruby hacker, so I have no idea what 0x60 does)...

2. Increase the number of your delays in your movement command to make a nice pause. Example...
Code:
#org @move
#raw 0xleft 0xdelay 0xdelay 0xdelay 0xdelay 0xright etc...

3. Use a checktrainerflag command. If it was my script, I would probably do this...
Code:
...

#org @later
msgbox @3 0x6
msgbox @4 0x6
[COLOR="Red"]checktrainerflag 0x005
if 0x1 call @cleartrainer[/COLOR]
applymovement 0xB @move10
waitmovement 0x0
applymovement 0xFF @move11
waitmovement 0x0
trainerbattle 0x1 0x005 0x0 @before1 @after1 @later1
end

[COLOR="Red"]#org @cleartrainer
cleartrainerflag 0x005
return[/COLOR]

...
 

adamb241

Pokémon Raging Fury
656
Posts
16
Years


1. What exactly does 0x60 do? Maybe that's causing your problem.
(I'm a Ruby hacker, so I have no idea what 0x60 does)...

2. Increase the number of your delays in your movement command to make a nice pause. Example...
Code:
#org @move
#raw 0xleft 0xdelay 0xdelay 0xdelay 0xdelay 0xright etc...
3. Use a checktrainerflag command. If it was my script, I would probably do this...
Code:
...

#org @later
msgbox @3 0x6
msgbox @4 0x6
[COLOR=Red]checktrainerflag 0x005
if 0x1 call @cleartrainer[/COLOR]
applymovement 0xB @move10
waitmovement 0x0
applymovement 0xFF @move11
waitmovement 0x0
trainerbattle 0x1 0x005 0x0 @before1 @after1 @later1
end

[COLOR=Red]#org @cleartrainer
cleartrainerflag 0x005
return[/COLOR]

...


Thanks for the quick response, the command 0x60 is a "hidesprite" raw command. I don't think that's the issue becuase I've used it numerous times before. I've never heard of the "cleartrainerflag" command before? What exactly does it do?
 

Nerketur

PokéScripter
104
Posts
13
Years
Thanks for the quick response, the command 0x60 is a "hidesprite" raw command. I don't think that's the issue because I've used it numerous times before. I've never heard of the "cleartrainerflag" command before? What exactly does it do?

"cleartrainerflag" allows you to battle the trainer again. As for your issue, it could be the special 114. As far as I know, you're supposed to use it after each movement, once the camera is back where it was. That or you may be separating it improperly. And why do you have two message boxes one after the other? You can combine them into one. =)
 

destinedjagold

You can contact me in PC's discord server...
8,593
Posts
16
Years
  • Age 33
  • Seen Dec 23, 2023
Thanks for the quick response, the command 0x60 is a "hidesprite" raw command. I don't think that's the issue becuase I've used it numerous times before.

Maybe this is causing your problem...?
Code:
#org @move14
#raw 0x18 0x62 [COLOR="Red"]0x0 [/COLOR]0xFE

If not, then I don't no what's causing the problem...
 

metapod23

Hardened Trainer
673
Posts
15
Years
  • Seen Aug 18, 2016
Hi! I wondered if it was any possible script/command to either trade pokémons, or sort of "get rid of them". What I want is to remove a certain pokémon (from the player) for a period and then give it back again, the player will also recieve a temporarily pokémon. What I first thought of was to use the givepokemon command, and by some sort of way removing an other pokemon from the party(however I didn't find such a command). But then I thought of that it may would have been possible to use a command to trade with the computer.

So what I am asking is: is there any commands as the two described above("takepokemon" or "trade with CPU"- sort of)?

And I am using XSE in a fire red hack:)

There is no takepokemon command. You can add an asm command, such as this designed by HackMew:

http://www.pokecommunity.com/showthread.php?t=206138

But you can't return the Pokemon once it's gone.

Or you can use the built-in Daycare system, using this tutorial:

http://www.pokecommunity.com/showthread.php?t=210016

But then you can't really use the Daycare in-game, or at least have access to it while Pokemon are used to store it as a non-daycare. But that will at least allow you to return the Pokemon once it's taken away, and to choose the specific Pokemon the player gives away.
 
9
Posts
13
Years
  • Seen May 23, 2011
Nerketur;6411382[B said:
][/B]


Well, in the original, you used "call" without using "return" when you "call" an address, it's like you're saying "Go here, temporarily, until I tell you to return" When you use "goto", you're saying "Go here permanently." It's as if the goto wasn't even there, the code just continues from the specified address. Code change in RED.

Note: I apologize for making that error in my "Something like" code. But I still think explaining the difference is important. =) ::goes back and corrects::
Okay obviously The script wasn't written to be compiled immediately into the game because I did that and it still goes black when I hit yes. I'm still quite confused. I apologize for my stupidity.
 

adamb241

Pokémon Raging Fury
656
Posts
16
Years
Thanks for the quick response, the command 0x60 is a "hidesprite" raw command. I don't think that's the issue becuase I've used it numerous times before. I've never heard of the "cleartrainerflag" command before? What exactly does it do?



Maybe this is causing your problem...?
Code:
#org @move14
#raw 0x18 0x62 [COLOR=Red]0x0 [/COLOR]0xFE
If not, then I don't no what's causing the problem...

That is the look up command if I remember properly. I don't think that is the issue.




"cleartrainerflag" allows you to battle the trainer again. As for your issue, it could be the special 114. As far as I know, you're supposed to use it after each movement, once the camera is back where it was. That or you may be separating it improperly. And why do you have two message boxes one after the other? You can combine them into one. =)

I have two message boxes becuase it helps me stay organized, I like to separate the player speaking and everyone else, I don't know why. As the for the special 0x114, I moved the camera in the beginning of the script (it moved up) but I never moved it back because the player moves up with the camera. I don't think thats the error becuase the error occurs during movements @move12 and @move13. The script just stops halfway through their movement and releases the player. So it basically skips the end of the script.

Final question, for this script, if the player loses to ether of the trainers I want the player to have to battle them both again, so if I was going to the the "checktrainerflag" command, where would I put it and would I link it to the 0x006 trainer instead of the 0x005 trainer?

Thanks for all of your help guys, I know I'm probably becoming a bother by now but thanks for standing by with me.
 

destinedjagold

You can contact me in PC's discord server...
8,593
Posts
16
Years
  • Age 33
  • Seen Dec 23, 2023
Final question, for this script, if the player loses to ether of the trainers I want the player to have to battle them both again, so if I was going to the the "checktrainerflag" command, where would I put it and would I link it to the 0x006 trainer instead of the 0x005 trainer?

Thanks for all of your help guys, I know I'm probably becoming a bother by now but thanks for standing by with me.

I posted this before, haven't I?
Here's the post I made...


3. Use a checktrainerflag command. If it was my script, I would probably do this...
Code:
...

#org @later
msgbox @3 0x6
msgbox @4 0x6
[COLOR="Red"]checktrainerflag 0x005
if 0x1 call @cleartrainer[/COLOR]
applymovement 0xB @move10
waitmovement 0x0
applymovement 0xFF @move11
waitmovement 0x0
trainerbattle 0x1 0x005 0x0 @before1 @after1 @later1
end

[COLOR="Red"]#org @cleartrainer
cleartrainerflag 0x005
return[/COLOR]

...

Also... I think I know the problem now...
In your script, instead of this...
Code:
#org @later1
msgbox @5 0x6
msgbox @6 0x6
[COLOR="Blue"]applymovement 0xA @move12
applymovement 0xB @move13
applymovement 0xFF @move14[/COLOR]
waitmovement 0x0
special 0x114
setflag 0x205
releaseall
end
Try making it look like this...
Code:
#org @later1
msgbox @5 0x6
msgbox @6 0x6
[COLOR="Red"]applymovement 0xFF @move14
applymovement 0xA @move12
applymovement 0xB @move13[/COLOR]
waitmovement 0x0
special 0x114
setflag 0x205
releaseall
end
 
20
Posts
16
Years
  • Seen Jul 30, 2012
Spoiler:

Thank you for your help. Unfortunately, that didn't fix it, in fact, it broke the Helix Fossil. My next idea is to try to use a series of yes/no boxes. I hoped I would be able to leave most of the code intact, but it seems that I can't do that.
 

adamb241

Pokémon Raging Fury
656
Posts
16
Years


I posted this before, haven't I?
Here's the post I made...



Also... I think I know the problem now...
In your script, instead of this...
Code:
#org @later1
msgbox @5 0x6
msgbox @6 0x6
[COLOR=Blue]applymovement 0xA @move12
applymovement 0xB @move13
applymovement 0xFF @move14[/COLOR]
waitmovement 0x0
special 0x114
setflag 0x205
releaseall
end
Try making it look like this...
Code:
#org @later1
msgbox @5 0x6
msgbox @6 0x6
[COLOR=Red]applymovement 0xFF @move14
applymovement 0xA @move12
applymovement 0xB @move13[/COLOR]
waitmovement 0x0
special 0x114
setflag 0x205
releaseall
end

Yep, that was it. I also got it to work by placing a "pause 0x0" command in between the movements.

I have another quick question, I've looked around and can't seem to find an answer.


Spoiler:


With this I make an earthquake occur but it doesn't end. Is there a way to time the quake' so I can end it after the "fadescreen 0x0" command?
 

Perri Lightfoot

Let's give it a go!
173
Posts
16
Years
  • Age 38
  • Seen Apr 17, 2022
I'm having an issue with this script - mainly, the PLAYERFACING commands within it. The script is supposed to make you take a step backwards depending on the direction you're facing if you choose "no," but what the script actually does is that it always makes you step to the right, no matter what. I tried the "setvar PLAYERFACING 0x0000/copybyte 0x020370D4 0x02036E58" technique recommended earlier in this thread; but all that did is make it so the player never moved at all - it didn't solve the problem. I've written scripts with PLAYERFACING commands that worked just fine; it puzzles me why this one wants to give me trouble :( Any help is greatly appreciated!

Spoiler:
 
Last edited:

Alignment

Revered with the stars
308
Posts
14
Years
  • Seen Dec 25, 2016
I'm having an issue with this script - mainly, the PLAYERFACING commands within it. The script is supposed to make you take a step backwards depending on the direction you're facing if you choose "no," but what the script actually does is that it always makes you step to the right, no matter what. I tried the "setvar PLAYERFACING 0x0000/copybyte 0x020370D4 0x02036E58" technique recommended earlier in this thread; but all that did is make it so the player never moved at all - it didn't solve the problem. I've written scripts with PLAYERFACING commands that worked just fine; it puzzles me why this one wants to give me trouble :( Any help is greatly appreciated!

Spoiler:

I can't spot anything wrong with that script, but I re-wrote the same script on PKSV with small variations, and it works as you described it to work. Here it is if you're interested:
Spoiler:


You really don't have to check if the lastresult is == no in the begining because if it's not equal to yes, than you can assume that it's gonna be no. I don't know the command for "closeonkeypress" in PKSV, so I used the waitbutton as well as the closemsg command, which is the same result (as far as I can tell). Anyways, as I said, I tested it out and it works, so I don't know what's up with your ROM :S
 

DrFuji

[I]Heiki Hecchara‌‌[/I]
1,691
Posts
14
Years
this is real embarrassing

i was able to compile my prof script (give pokemon,item etc), and it work perfectly

now im having trouble with a basic talk script
#Dynamic 0x800000

#org @start
Lock
FacePlayer
msgbox @talk
BoxSet 0x6
release
end

#org @talk
= This small house is actually a\ngenerator it supplies electricity\lto the whole town.

everytime i compile it an error pops out saying too less parameters on line 6 (msgbox line) the correct number is 2.

makes no sense could it be my XSE thats causing the problem?

You're not putting it in the correct format for XSE. The command msgbox is comprised of the command 'msgbox', a pointer to the text and an indication of which boxset to use. You only had one parameter (the pointer) so that is why XSE was asking for the boxset on the same line.

Changes in red.

Code:
#dynamic 0x800000
 
#org @start
lock
faceplayer
msgbox @talk [COLOR=red]0x6[/COLOR]
release
end
 
#org @talk
= This small house is actually a\ngenerator it supplies electricity\lto the whole town.
 
20
Posts
16
Years
  • Seen Jul 30, 2012
Thank you for your help. Unfortunately, that didn't fix it, in fact, it broke the Helix Fossil. My next idea is to try to use a series of yes/no boxes. I hoped I would be able to leave most of the code intact, but it seems that I can't do that.

I was hoping that I wouldn't have to hack it apart like this, but I finally got it to work by doing this. Hooray for checkitem, boo for pokemon script language.

Code:
//---------------
#org @Start
lock
faceplayer
setvar LASTRESULT 0x0    //clear last result
checkflag 0x2EE        //check if Aerodactyl has been revived
if 0x1 call @CheckHelix
compare LASTRESULT 0x1
if 0x1 goto 0x816E873    //if a story fossil and Aerodactyl were revived, end script
compare 0x406A 0x2
if 0x1 goto 0x816E712
compare 0x406A 0x1
if 0x1 goto 0x816E708

checkitem 0x165 0x1
compare LASTRESULT 0x1
if 0x1 goto 0x816E644
checkitem 0x166 0x1
compare LASTRESULT 0x1
if 0x1 goto 0x816E682
checkitem 0x162 0x1
compare LASTRESULT 0x1
if 0x1 goto 0x816E6C0
msgbox 0x819A25E MSG_KEEPOPEN //"Hiya!\pI am important doctor.\nYes..."
goto 0x816E516
 
4
Posts
14
Years
  • Seen Dec 10, 2023
I've been trying to modify the opening script after the player exits the moving truck, using XSE. I'm using a correctly found offset from FSF, accurate script info according to the other NPC's I've been looking at and comparing to, and I've even gone so far as to flat out delete both the player's mom and the truck events themselves with no alteration.

The door still opens, mom still trots out and spews the usual welcoming text. Is it just hardcoded into the game or am I fishing around the wrong script data?

Spoiler:


That's one format of the script I've tried. The other is here:
Spoiler:


Is it the 0x16A8FD that's just screwing this whole thing up? Been at this for over an hour, still new to the entire process, any help very welcome.
 

metapod23

Hardened Trainer
673
Posts
15
Years
  • Seen Aug 18, 2016
I've been trying to modify the opening script after the player exits the moving truck, using XSE. I'm using a correctly found offset from FSF, accurate script info according to the other NPC's I've been looking at and comparing to, and I've even gone so far as to flat out delete both the player's mom and the truck events themselves with no alteration.

The door still opens, mom still trots out and spews the usual welcoming text. Is it just hardcoded into the game or am I fishing around the wrong script data?

Spoiler:


That's one format of the script I've tried. The other is here:
Spoiler:


Is it the 0x16A8FD that's just screwing this whole thing up? Been at this for over an hour, still new to the entire process, any help very welcome.

You shouldn't use 0x16A8FD as an offset for a new script. Start at around 0x800000 and use #dynamic 0x800000 and something like #org @start - XSE will find free space for you at or after 0x800000 - you don't have to find it yourself.

As for your problem, I believe that would most likely be a script in the header. I'm not sure if you looked there? You have to go to the Header section in A-Map and look under Map Script. I think it's probably an 02 Script Type (or 04 - I forget which one). Anyway, that's probably the script you have to replace. I'm not looking at it myself right now, but I think that would be the case.

If you need help with generating your script and making it work, look here:

http://www.pokecommunity.com/showthread.php?t=191500
 

SPG

Pyroblock
88
Posts
13
Years
  • Age 27
  • Seen May 4, 2013
can some one tell me what is wrong with this script?
Spoiler:
 
1
Posts
13
Years
  • Seen Sep 15, 2011
hi there im having trouble doing a script like when you first meet processor oak i wanna do something like that can you please help
 
Status
Not open for further replies.
Back
Top