• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • 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.
Spoiler:


There we go, that should work fine.

Thank you very much for that. Will the ball disappear after this one time I pick it up? And if I apply the same script, but with certain variables changed for other pokémon would that be okay?
 
Well, first of all, you need to give the sprites of the pokeballs a flag number, I suggest each one have a number from 0x1000 to 0x1002
Then, if you want them to dissapear in the game, you gotta set the flag that corresponds to the correct ball, as well as use a "Hidesprite" command.
 
You would need to hack the way the PC works and make it so you can't deposit anything if you have 2 Pokémon or less. And that requires ASM.
Out of curiosity, why would you need something like that?

Well, my hack consists of the Johto and Orre Regions, so I'm going with an Orre theme in the sense that every Trainer battle will be a 2v2 as oppose to 1v1. I know I could just add a countpokemon or whatever for every script, but I was curious to see if this could work. Thanks for the tip anyways ^_^.
 
Game: Fire Red
Type: Trigger
Editor: XSE
Script: Basicly, this guy stops you leaving the town, and then once you get a pokemon, he lets you leave. BUT, once he's let you leave, I want his script to be disabled, so you can just walk on the trigger without anything happening.
Spoiler:
 
Try this. /guess

Spoiler:


All I did was add another Checkflag and @done. Edit it if you want. Hope it works.
 
Try this. /guess

Spoiler:
#dynamic 0x800000

#org @start
checkflag 0x828
if 0x1 call @OAKD
checkflag 0x1658
if 0x1 goto @done
applymovement 0x03 @move
waitmovement 0x0
msgbox @yeahman 0x2
applymovement 0x03 @move2
waitmovement 0x0
applymovement 0xFF @move3
waitmovement 0x0
release
end

#org @move
#raw 0x62
#raw 0x02
#raw 0xFE

#org @yeahman
= Oh, hello!\pI think Professor Burdock was\nlooking for you.

#org @move2
#raw 0x01
#raw 0xFE

#org @move3
#raw 0x11
#raw 0xFE

#org @OAKD
applymovement 0x03 @move
waitmovement 0x0
msgbox @msg2 0x2
applymovement 0x03 @move2
waitmovement 0x0
setflag 0x1658
end

#org @msg2
= Oh, [PLAYER]!\pProfessor Burdock said I should\nlet you through.

#org @done
end





All I did was add another Checkflag and @done. Edit it if you want. Hope it works.

Nah, after I get the pokemon he just keeps repeating the @msg2. :/
Thanks for trying :D
 
I'm making a little test hack, that demonstrates for me little hacking techniques (Whether it be scripting, sprite editing, ASM, or whatever), and I'm sort of doing one thing of each in the hack, so if I need to, I can look back at it and understand how I did that. Later in my life, I will be making a full hack.

But, this one script has been troubling me. I simply put it on the floor on a tile that is darker than the rest, and whenever I step there, it freezes on me.
I've taken a huge break from scripting, and I forget how to do a lot of it. Can any of you tell me what's wrong with this? It is supposed to say a message, and then give you 10,000 dollars when you step on it. Of course, this can be done multiple times. The message should replay everytime you step on it, and you should get 10,000 dollars every time you step on it. The money doesn't matter, it's just to test a givemoney script.
Spoiler:
 
I'm making a little test hack, that demonstrates for me little hacking techniques (Whether it be scripting, sprite editing, ASM, or whatever), and I'm sort of doing one thing of each in the hack, so if I need to, I can look back at it and understand how I did that. Later in my life, I will be making a full hack.

But, this one script has been troubling me. I simply put it on the floor on a tile that is darker than the rest, and whenever I step there, it freezes on me.
I've taken a huge break from scripting, and I forget how to do a lot of it. Can any of you tell me what's wrong with this? It is supposed to say a message, and then give you 10,000 dollars when you step on it. Of course, this can be done multiple times. The message should replay everytime you step on it, and you should get 10,000 dollars every time you step on it. The money doesn't matter, it's just to test a givemoney script.
Spoiler:
Well, you should have lockall and releaseall in there, I think (someone please correct me if I'm wrong). Also, make sure you have the Unknown set to 0003 or 0030 and the Var Number set to 4050, 5050, or whatever you prefer.
...I would also use the 0x6 boxset instead of 0x3, but that's just me.
 
I'm making a little test hack, that demonstrates for me little hacking techniques (Whether it be scripting, sprite editing, ASM, or whatever), and I'm sort of doing one thing of each in the hack, so if I need to, I can look back at it and understand how I did that. Later in my life, I will be making a full hack.

But, this one script has been troubling me. I simply put it on the floor on a tile that is darker than the rest, and whenever I step there, it freezes on me.
I've taken a huge break from scripting, and I forget how to do a lot of it. Can any of you tell me what's wrong with this? It is supposed to say a message, and then give you 10,000 dollars when you step on it. Of course, this can be done multiple times. The message should replay everytime you step on it, and you should get 10,000 dollars every time you step on it. The money doesn't matter, it's just to test a givemoney script.
Spoiler:

Have "setvar 0x(whatever variable you want to use) 0x0" at the beginning. The 0x0 at the end will make it happen again and again. Having 0x1 will make it happen only once.

Make sure you set that variable number as the var number for the Script in A-Map as well.
 
Ah, okay then. I've seen a few people use 0030, but it was probably for something else. Thanks!

I guess it was just a plain mistake, actually. The game doesn't use such value at all. AFAIK.


What about 0300? I usually do 0300 and 4050 and it works fine :P

The fact it works fine doesn't imply it's right.
 
Why won't this script work?

#org $801409
jingle
message $never
$never 1 = HEY YOU!
showsprite 6
applymovement 6 $saphire
$saphire 1 ; #binary 0x1D 0x1D 0x1D 0x1D 0XFE
applymovement 6 $sol
$sol 1 ; #binary 0x1F 0X1D 0X1D 0X1D 0XFE
pausemove 0x0000
goto $magi

#org $magi
special 0x113
applymovement 0x7F $move1
$move1 ; #binary 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0xFE
goto $pro

#org $pro
message $soul
$soul 1 = ****, he is closer than \nI imagined...
boxset 5
goto $moveit

#org $moveit
applymovement 0x7F $move2
$move2 ; #binary 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0xFE
setvar 0x6000 0x0002
release
end

The character from the first section of the sprite starts running as accordingly but when $sol starts then he shows the "!" sign and starts running forward in the same place.

Also the message hey you is not displayed.

Can you help me out please? :]
 
Why won't this script work?

#org $801409
jingle
message $never
$never 1 = HEY YOU!
showsprite 6
applymovement 6 $saphire
$saphire 1 ; #binary 0x1D 0x1D 0x1D 0x1D 0XFE
applymovement 6 $sol
$sol 1 ; #binary 0x1F 0X1D 0X1D 0X1D 0XFE
pausemove 0x0000
goto $magi

#org $magi
special 0x113
applymovement 0x7F $move1
$move1 ; #binary 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0xFE
goto $pro

#org $pro
message $soul
$soul 1 = ****, he is closer than \nI imagined...
boxset 5
goto $moveit

#org $moveit
applymovement 0x7F $move2
$move2 ; #binary 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0x11 0xFE
setvar 0x6000 0x0002
release
end

The character from the first section of the sprite starts running as accordingly but when $sol starts then he shows the "!" sign and starts running forward in the same place.

Also the message hey you is not displayed.

Can you help me out please? :]

You might want to stop using poke script and switch to XSE, simply because you WON'T get help here if you use poke script, or 80% of the time you won't. Plus, there are alot more people you know how to use XSE rather than poke script. So, just translate that into XSE and edit your post, that's the only advice I can give you right now to fix it.
 
Is there something I can do to disable a trigger script after it's been used once?
I'm using XSE.
 
Last edited:
Is there something I can do to disable a trigger script after it's been used once?
I'm using XSE.

Yes. When you set a flag, check the flag at the beginning of the script.
Example:
Code:
#org @1
[B]checkflag 0x1000
if 0x1 goto @done[/B]
...
...
...
[B]setflag 0x1000[/B]
end

[B] #org @done
release
end[/B]

...
...
When you set the flag, the script will then check the flag and go to @done. I hope you understand this.
 
Last edited:
@Hiche..

Eh, yes that works but it's not a very good method. The script will still actually activate (though the only commands that will run are release and end) which, though it seems harmless, can cause problems. For example, if the player triggers the script while the box that displays the current location is still showing, it will very suddenly disappear or, if the script is right on the edge of the map, effectively stop it from showing up altogether.

The way I would recommend doing it would be the following:

Code:
#org @yourscript
...
... // this is your script here
...
setflag 0x1000 // or setvar if it's a multiple part script
end

Then, in AdvanceMap, click on the little green S box that your script is assigned to and put '1000' in the Var Number box and '0000' in the Var Value box. What this does is it makes the script check the value of the flag/variable in the Var Number box (0x1000) and compare it with the number in the Var Value box (0x0000). If they are equal, then the script will run. If not, then it won't. The first time the player steps on that trigger script, the flag 0x1000 will not be set. However, at the end of the script, 0x1000 is set. The next time the player steps on that tile, the script will not run because the flag has been set and, therefore, is not equal to 0x0000.
 
@Hiche..

Eh, yes that works but it's not a very good method. The script will still actually activate (though the only commands that will run are release and end) which, though it seems harmless, can cause problems. For example, if the player triggers the script while the box that displays the current location is still showing, it will very suddenly disappear or, if the script is right on the edge of the map, effectively stop it from showing up altogether.

The way I would recommend doing it would be the following:

Code:
#org @yourscript
...
... // this is your script here
...
setflag 0x1000 // or setvar if it's a multiple part script
end
Then, in AdvanceMap, click on the little green S box that your script is assigned to and put '1000' in the Var Number box and '0000' in the Var Value box. What this does is it makes the script check the value of the flag/variable in the Var Number box (0x1000) and compare it with the number in the Var Value box (0x0000). If they are equal, then the script will run. If not, then it won't. The first time the player steps on that trigger script, the flag 0x1000 will not be set. However, at the end of the script, 0x1000 is set. The next time the player steps on that tile, the script will not run because the flag has been set and, therefore, is not equal to 0x0000.

Well, this is surely better than check flag. I thought the Var number can only be the common values everybody uses (4050, 5040, etc..), but it seems I missed this. Thanks for the info, colcolstyles.
 
Status
Not open for further replies.
Back
Top