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

forestw785

I divide by 0.
60
Posts
14
Years
  • Seen Dec 8, 2010
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?
 

0m3GA ARS3NAL

Im comin' home...
1,816
Posts
16
Years
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.
 

Xatoku

Game Developer
451
Posts
15
Years
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 ^_^.
 

KotovSyndrome_

Consumer of many asparagus.
57
Posts
15
Years
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:
 

Flandre Scarlet

Free your mind.
356
Posts
16
Years
Try this. /guess

Spoiler:


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

KotovSyndrome_

Consumer of many asparagus.
57
Posts
15
Years
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
 
74
Posts
14
Years
  • Age 29
  • USA
  • Seen Aug 22, 2010
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:
 

trebornosliw

Learning
516
Posts
14
Years
  • Age 31
  • Seen Jul 22, 2012
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.
 

metapod23

Hardened Trainer
673
Posts
15
Years
  • Seen Aug 18, 2016
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.
 

HackMew

Mewtwo Strikes Back
1,314
Posts
17
Years
  • Seen Oct 26, 2011
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.

It's not 0003 or 0030. It's 0003. Period.
 

TacomenX

Beginner Taco
1
Posts
14
Years
  • Seen Feb 3, 2010
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? :]
 

BlitŻ1

guahh my dog is so cute
472
Posts
15
Years
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.
 

KotovSyndrome_

Consumer of many asparagus.
57
Posts
15
Years
Is there something I can do to disable a trigger script after it's been used once?
I'm using XSE.
 
Last edited:

Hiche..

 
979
Posts
15
Years
  • Seen Dec 27, 2014
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:

colcolstyles

Yours truly
1,588
Posts
15
Years
@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..

 
979
Posts
15
Years
  • Seen Dec 27, 2014
@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.
 

0m3GA ARS3NAL

Im comin' home...
1,816
Posts
16
Years
Nope, 4050 is just a variable that isn't changed at any specific point in the game, therefore any scripts with that var number are pretty safe from being disabled on accident.
 
Status
Not open for further replies.
Back
Top