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

PI Hudson

Can be random for hugs> PIE!!!
33
Posts
14
Years
QUESTION: Is there a way to check if a pokemon is holding an item?




In fire red, oaks lab has a level script but doesnt activate when you walk in by yourself, only after oak makes you come in. How does this work? Does it have a checkflag or something?
It works like this
-When you enter a map, it looks for level scripts
-In Oaks Lab, the script your looking for is #2
-If it is a #2 or 4 script, it looks at the Variable Flag (for this, it is 4055)
-It checks that this Variable for its Value (set previously, default is 0000) and if it isn't equal to the number given in the Map script, it doesn't activate. But if it is equal, it does activate.
(if MAP-VALUE>VAR-VALUE=not activate, if MAP-VALUE<VAR-VALUE=not activate, if MAP-VALUE=VAR-VALUE=activate)

In the script tile that we step on in Pallet Town to activate the script, we see this.
XSE:|LINE 0045| setvar 0x4055 0x1

This means the next time we enter the Oaks Lab, the script will activate.

But, why doesn't it activate again?
In the Oaks Lab Level script, we observe this
XSE:|LINE 0028| setvar 0x4055 0x2

This make it so you don't see this script again until the Var Value is equal again.

People kind of act the same way, but with flags.




Thanks for explaining that.I looked into it and seen it had something to do with the variable 4055,but i couldnt figure it all out.
Your welcome.
 
Last edited:

Quickster

Dream or Drop?
351
Posts
16
Years
  • Seen Apr 4, 2016
It works like this
-When you enter a map, it looks for level scripts
-In Oaks Lab, the script your looking for is #2
-If it is a #2 or 4 script, it looks at the Variable Flag (for this, it is 4055)
-It checks that this Variable for its Value (set previously, default is 0000) and if it isn't equal to the number given in the Map script, it doesn't activate. But if it is equal, it does activate.
(if MAP-VALUE>VAR-VALUE=not activate, if MAP-VALUE<VAR-VALUE=not activate, if MAP-VALUE=VAR-VALUE=activate)

In the script tile that we step on in Pallet Town to activate the script, we see this.


This means the next time we enter the Oaks Lab, the script will activate.

But, why doesn't it activate again?
In the Oaks Lab Level script, we observe this


This make it so you don't see this script again until the Var Value is equal again.

People kind of act the same way, but with flags.


Thanks for explaining that.I looked into it and seen it had something to do with the variable 4055,but i couldnt figure it all out.
 

Gamer2020

Accept no Imitations!
1,062
Posts
15
Years
Hey guys. I have a problem.
Basically I wrote a script so that when the player steps on a certain spot a sprites goes up to him and battles him.
It works up until after the battle where it just plain goes sour.
Ive attached a small video to show you what happens.

This is the script
Spoiler:



This is the amap stuff for the sprite
wtf1.png


and this is the amap stuff for the script tile.


wtf2.png


I think I am just overlooking something so please if you know what I did wrong please tell me.
 

Quickster

Dream or Drop?
351
Posts
16
Years
  • Seen Apr 4, 2016
Hey guys. I have a problem.
Basically I wrote a script so that when the player steps on a certain spot a sprites goes up to him and battles him.
It works up until after the battle where it just plain goes sour.
Ive attached a small video to show you what happens.

This is the script
Spoiler:



This is the amap stuff for the sprite
wtf1.png


and this is the amap stuff for the script tile.


wtf2.png


I think I am just overlooking something so please if you know what I did wrong please tell me.


Im not sure,but you might need a waitmovment in the #org @pre
also the number should be 0003 and 4050 on a green script tile.
 

Larsie13

Guest
0
Posts
Actually, Larsie, XSE hasn't been recognizing the lastresult keyword for some reason...
That's because XSE's std.rbh isn't in the same folder the .exe is. You need to extract everything from XSE's ZIP file in the same folder-structure as it is in the ZIP.
Okay, I need help with this script. The basic problem is I've got three sprites (event no's 13, 14, and 15) that are supposed to move, but just don't. I've tried to figure out the problem, but haven't been able to. I gave them ID number 270 (the reason for the setflag) and I gave the script var #6042. Now the script works, but first when the 2nd applymovement for MOVEPLAYER goes, the player only steps up one space, and doesn't step right first. Second, the movements for sprites 13, 14, 15 don't work at all. They stay put and it moves onto the next msgbox. Do I need a different var? A different flag? Any help is appreciated. The relevant parts of the script are below:

Spoiler:
0x13 = 19, 0x14 = 20, and 0x15 = 21. Use 19, 20 and 21, or 0xD, 0xF and 0xF. Also, you'll need a waitmovement 0 after the MOVEPLAYER.
Hey guys. I have a problem.
Basically I wrote a script so that when the player steps on a certain spot a sprites goes up to him and battles him.
It works up until after the battle where it just plain goes sour.
Ive attached a small video to show you what happens.

This is the script
Spoiler:



This is the amap stuff for the sprite
wtf1.png


and this is the amap stuff for the script tile.


wtf2.png


I think I am just overlooking something so please if you know what I did wrong please tell me.
O_O #dynamic 800000? That's the same as #dynamic 0xC3500! You forgot the 0x. Try to remember that it can make quite a big difference forgetting the 0x or not.
 
2
Posts
14
Years
  • Seen Jun 16, 2009
Im Pretty badly stuck here, could someone please help me...allow me to explain my problem...

I am hacking myself a new pokemon game and have just begun, im using my very basic scriting knowledge and using the latest version of xse. i made the player wake up at the start of the game in a cave just above an old lady but am having a few major problems, the first of which comes in advance map..
when i place a sprite of a person into the room it will not appear in the visual boy or have any action within it, even when a script has been applied, please give me some pointers for a possible fix
number 2 comes from xse and advance map i think, i mad a script to stop anyone leaving the room without first choosing 1 of 2 pokemon, you are ment to walk onto the script and be pushed 1 step back, with a message to appear saying , maby i should talk to the old lady first...
so i made a script which i will include...but when i attach to the script to a script tile in advance map and play the game, if i walk on the script tile before it has been bypassed by a flag the game freezes, alough the music still plays on a low quality please help and i hope i have not written waaaay to much


Spoiler:
#Dynamic 0x800000
#org @start
checkflag 0x828
if 0x0 goto @hey!
if 0x1 goto @end
end
#org @hey!
lock
msgbox @icant 0x6
applymovement 0xFF @back
waitmovement 0x0
release
end
#org @icant
= Maby I should talk with/nThe old lady first
#org @back
#raw 0x0D 0xFE
#org @end
release
end

Thanks
 

Gamer2020

Accept no Imitations!
1,062
Posts
15
Years
Hey guys. I have a problem.
Basically I wrote a script so that when the player steps on a certain spot a sprites goes up to him and battles him.
It works up until after the battle where it just plain goes sour.
Ive attached a small video to show you what happens.

This is the script
Spoiler:



This is the amap stuff for the sprite
wtf1.png


and this is the amap stuff for the script tile.


wtf2.png


I think I am just overlooking something so please if you know what I did wrong please tell me.
Someone please help. I know I must be overlooking something.
The problem is just after the battle when the trainer is supossed to walk away. I had it working before but idk what I changed.

Im not sure,but you might need a waitmovment in the #org @pre
also the number should be 0003 and 4050 on a green script tile.
No thats not it...
If I do that then the script tile won't do anything.

O_O #dynamic 800000? That's the same as #dynamic 0xC3500! You forgot the 0x. Try to remember that it can make quite a big difference forgetting the 0x or not.
That's not it either. I tried it just in case but I doubt it would matter where the script is.
 

HackMew

Mewtwo Strikes Back
1,314
Posts
17
Years
  • Seen Oct 26, 2011
Actually, Larsie, XSE hasn't been recognizing the lastresult keyword for some reason...

That's what happens when you don't extract all the files from the zipped archive. LASTRESULT is defined in the std.rbh header.
 

Quickster

Dream or Drop?
351
Posts
16
Years
  • Seen Apr 4, 2016
Im Pretty badly stuck here, could someone please help me...allow me to explain my problem...

I am hacking myself a new pokemon game and have just begun, im using my very basic scriting knowledge and using the latest version of xse. i made the player wake up at the start of the game in a cave just above an old lady but am having a few major problems, the first of which comes in advance map..
when i place a sprite of a person into the room it will not appear in the visual boy or have any action within it, even when a script has been applied, please give me some pointers for a possible fix
number 2 comes from xse and advance map i think, i mad a script to stop anyone leaving the room without first choosing 1 of 2 pokemon, you are ment to walk onto the script and be pushed 1 step back, with a message to appear saying , maby i should talk to the old lady first...
so i made a script which i will include...but when i attach to the script to a script tile in advance map and play the game, if i walk on the script tile before it has been bypassed by a flag the game freezes, alough the music still plays on a low quality please help and i hope i have not written waaaay to much


Spoiler:
#Dynamic 0x800000
#org @start
checkflag 0x828
if 0x0 goto @hey!
if 0x1 goto @end
end
#org @hey!
lock
msgbox @icant 0x6
applymovement 0xFF @back
waitmovement 0x0
release
end
#org @icant
= Maby I should talk with/nThe old lady first
#org @back
#raw 0x0D 0xFE
#org @end
release
end

Thanks


Im not sure of your first problem but your second problem sound like you forgot to put the unknown numbers in.They're 0003 and 4050.They go in the first two boxes under the people number i think.
And If you only want the script to check if you got a pokemon or not, i think the one below is a litlle less complicated.But you need to make sure the numbers are in on the script tile.
Also,or you using xse?If not i suggest to switch to it,its very easy to pick up on and theres a great tutorial by diegoisawesome.
The script below is for xse.
Spoiler:
 
29
Posts
16
Years
  • Seen Oct 1, 2010
Spoiler:

This all works.. with a couple exceptions. Even without a pokeball, the checkitem doesn't seem to switch to "jerk". It does take a pokeball if you have one but if you don't it still continues without switching.

Also hidesprite works, but when you move just one step, the sprite returns. Could someone help me with these?
 

HackMew

Mewtwo Strikes Back
1,314
Posts
17
Years
  • Seen Oct 26, 2011
QUESTION: Is there a way to check if a pokemon is holding an item?

Not with scripting. You need ASM.

Hey guys. I have a problem.
Basically I wrote a script so that when the player steps on a certain spot a sprites goes up to him and battles him.
It works up until after the battle where it just plain goes sour.
Ive attached a small video to show you what happens.

This is the script
Spoiler:

Fixed (mostly optimized) script is below. Anyway, the script isn't the root of the problem at all. Do not follow the suggestion to set "No movements" because then applymovement will not work. Also, "Look down" isn't glitchy at all. It's just you need to set the Movement to 11.

Spoiler:



Spoiler:

This all works.. with a couple exceptions. Even without a pokeball, the checkitem doesn't seem to switch to "jerk". It does take a pokeball if you have one but if you don't it still continues without switching.

Also hidesprite works, but when you move just one step, the sprite returns. Could someone help me with these?

That's not the way checkitem works.
You do something like this:

Code:
checkitem 0x172 0x1
compare LASTRESULT 0x1
if 0x0 goto @donthave

About the "sprite returning"... that's normal. Hidesprite will hide the sprite only temporarily.
Before the hidesprite command you need to use a setflag, which value is the Person ID you set.
 

XD003

The Silver Rose of Chaos
116
Posts
18
Years
I have a question - I just hope I'm asking the right place for this. If not, please tell me where I should go to ask and all.

Anyways, my question is:
How do you make a script which makes a person have a Dropdown mutlichoice box list of Pokemon for sale. I have no clue how to script at all, and my friend who can script has no clue how. If you're wondering what I mean..:

Person: Oh, hello there! I'm a grass pokemon trainer and I came to this island to train up my pokemon and catch some new ones. However I got swept away and caught too many of the same in the process. Would you like to buy some form me?
[Dropdown box here]
Sunflora $500
Vileplume $500
Venusaur $1000
...
Etc etc. That's what I'm trying to do. I'm probably asking the wrong place, but it'd be really appreciated if you could help. Thanks in advance.
 

metapod23

Hardened Trainer
673
Posts
15
Years
  • Seen Aug 18, 2016
0x13 = 19, 0x14 = 20, and 0x15 = 21. Use 19, 20 and 21, or 0xD, 0xF and 0xF. Also, you'll need a waitmovement 0 after the MOVEPLAYER.

It didn't really work, so I just changed them to IDs 1, 2, and 3 and changed the script accordingly and it worked perfectly. Thanks.
 

PlatniumPiano

You are now breathing manually
479
Posts
15
Years
I have a question - I just hope I'm asking the right place for this. If not, please tell me where I should go to ask and all.

Anyways, my question is:
How do you make a script which makes a person have a Dropdown mutlichoice box list of Pokemon for sale. I have no clue how to script at all, and my friend who can script has no clue how. If you're wondering what I mean..:

Person: Oh, hello there! I'm a grass pokemon trainer and I came to this island to train up my pokemon and catch some new ones. However I got swept away and caught too many of the same in the process. Would you like to buy some form me?
[Dropdown box here]
Sunflora $500
Vileplume $500
Venusaur $1000
...
Etc etc. That's what I'm trying to do. I'm probably asking the wrong place, but it'd be really appreciated if you could help. Thanks in advance.


ASM would be the only way to my knowledge, but I could be wrong.
 

HackMew

Mewtwo Strikes Back
1,314
Posts
17
Years
  • Seen Oct 26, 2011
ASM would be the only way to my knowledge, but I could be wrong.

Yes, you're wrong. The multichoice command is all that's needed basically, plus a bit of text editing.


Oh, I was wondering because the Battle Pyramid can check for hold items, since it doesn't allow them.

Did you check the scripts there? I'm pretty sure some specials are used.
 

Teh_PingasYTP

PINGAS!
3
Posts
14
Years
givepokemon

i made a givepokemon script and it works, but after i get it and talk to him again, he gives it to me again, and again and i can't get it to work! i want him to say something else after i get it and talk to him again.

Script:
Spoiler:


I am using XSE.
 
Status
Not open for further replies.
Back
Top