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

Binary

え?
3,977
Posts
16
Years
  • Age 29
  • Seen Apr 7, 2014
how will i create a script for rival?like,he will walk to you then battle you then he will talk again after the battle then he will walk away??help pls.
Well, first of all, you should read a tutorial. Then, make the script yourself C:
 

Chad -

 
687
Posts
14
Years
  • Seen Aug 27, 2012
how will i create a script for rival?like,he will walk to you then battle you then he will talk again after the battle then he will walk away??help pls.

You can't request scripts here. De-compile your rival script in FR or RSE or read a tutorial.

Chad -
 

Co500

Nostalgia Edition
563
Posts
15
Years
I know this might sound noobis but what is the part of the script that makes it so if you step on the tile again it doesnt activate? BTW this isnt a script request its just asking for the line
 

Chad -

 
687
Posts
14
Years
  • Seen Aug 27, 2012
Co500,

You use checkflag (compare 0x[variable] 0x[value] but instead of flags, you use vars).

An example:
Code:
#dynamic 0x800000

#org @start
checkflag 0x300
if 0x1 goto @done
msgbox @text 0x6
setflag 0x300
end

#org @done
release
end

#org @text
= You stepped on a tile!
Chad -
 

Co500

Nostalgia Edition
563
Posts
15
Years
Co500,

You use checkflag (compare 0x[variable] 0x[value] but instead of flags, you use vars).

An example:
Code:
#dynamic 0x800000

#org @start
checkflag 0x300
if 0x1 goto @done
msgbox @text 0x6
setflag 0x300
end

#org @done
release
end

#org @text
= You stepped on a tile!
Chad -
ok thanks for that but once ived use setflag/checkflag 300 can I use it again?
 

Chad -

 
687
Posts
14
Years
  • Seen Aug 27, 2012
If you clear it or something, yes. But no. There are many free flags. You can see them in XSE's guide. Be sure to write down the flags you used.

Chad -
 

FireFox

Dialga Fangirl
58
Posts
19
Years
  • Age 37
  • UK
  • Seen Feb 24, 2018
FireFox,

Is this in Ruby/Sapphire/Emerald? If it is, your problem is that you forgot waitmovement 0x7 under your applymovement command.


An easy way to do this is to replace the applymovement command with spriteface 0x7 0x1. 0x7 being the person event number and 0x1 meaning 'face down'.

What's with the two checkflags? I don't know if you can check TWO flags this way. If not, remove the one you don't need.

To hide a sprite, you need to set a flag first and put that flag in the Person ID of the sprite. When you want it to reappear, you clear the flag in a clear flag command (clearflag 0x[flag]) and use showsprite 0x[event number]. Check a tutorial in the Tutorials section for more detailed info.

Chad -

Sorry Chad, I forgot to say, it's for FireRed.
Also, those 2 checkflags work perfectly togeather. checkflag 0x237 is the flag to say "You've got CUT!" To be honest I wasn't sure if it was gonna work, but I tried it and it worked 1st time without fail!

I'll try the spriteface command later, assuming FireRed can use it.
 

Chad -

 
687
Posts
14
Years
  • Seen Aug 27, 2012
Oh ok. It does not matter since waitmovement 0x7 is for both FR and RSE. And yes, FR uses spriteface.

Good luck.

Chad -
 

Binary

え?
3,977
Posts
16
Years
  • Age 29
  • Seen Apr 7, 2014
Sorry Chad, I forgot to say, it's for FireRed.
Also, those 2 checkflags work perfectly togeather. checkflag 0x237 is the flag to say "You've got CUT!" To be honest I wasn't sure if it was gonna work, but I tried it and it worked 1st time without fail!

I'll try the spriteface command later, assuming FireRed can use it.
Checkflag 0x237 works only because it has the if 0x1 goto @..... underneath it. Checkflag 0x202 won't work in your script. Also use waitmovement 0x0 after every movement command. You could use waitmovement 0x7 but you'll have to count all the movements making it less convenient.
Also, I'd just use the face down movement if I were you. You can use Spriteface, but bleh....
 

FireFox

Dialga Fangirl
58
Posts
19
Years
  • Age 37
  • UK
  • Seen Feb 24, 2018
Thanks for your help Chad and Binrary :)

I'm still having issue with hiding sprites. Here's the scoop:
I'm trying to create a rival battle and when the player walks over a specific spot, the rival pops on from the side of the screen. But I don't know how to hide him since you walk past his "spawn point" as it were. I've tried adding a hidesprite in both the header script and new "walkover" scripts but he won't vanish. I have confirmed the person ID is correct.
 

Teh Newbeh

Yellow Gold™
29
Posts
13
Years
  • Seen Oct 27, 2023
how will i creta a rival batlle,like,he will walk to you then he will battle you then he will walk away and disappear?please help!

You script! :O

You need a green script tile in A-Map. You open your rom in XSE. Write the script to a new offset, probably around 0x800000. You will need applymovements, trainerbattles, hidesprite, and flags among other things. Look at diegoisawesome's tutorial, it will help a lot. Heres a nice and shiny link. http://www.pokecommunity.com/showthread.php?t=164276
 

0m3GA ARS3NAL

Im comin' home...
1,816
Posts
16
Years
Thanks for your help Chad and Binrary :)

I'm still having issue with hiding sprites. Here's the scoop:
I'm trying to create a rival battle and when the player walks over a specific spot, the rival pops on from the side of the screen. But I don't know how to hide him since you walk past his "spawn point" as it were. I've tried adding a hidesprite in both the header script and new "walkover" scripts but he won't vanish. I have confirmed the person ID is correct.

Use a setflag that is the same number as his ID, as well as a hidesprite in the Map Script, then on the green script tile, use a clearflag on his ID number, then a showsprite, when you are done with him, just set the flag and use a hidesprite again.
 

metapod23

Hardened Trainer
673
Posts
15
Years
  • Seen Aug 18, 2016
I know this might sound noobis but what is the part of the script that makes it so if you step on the tile again it doesnt activate? BTW this isnt a script request its just asking for the line

When you have a script, on A-Map you will have it set to a number, say 4050. Each script should have its own number (they all shouldn't be 4050, for example). The Var Value will likely be 0000.

All this tells that game that when variable 4050 is set to 0, the script will activate when it's stepped on. So all you have to do to make the script only activate once is put "setvar 0x4050 0x1" at the end of it.

If variable 4050 is set to 1, the script will never activate again, because in A-Map you told it to only activate when 4050 is set to 0 (that's what the "Var number" and "Var Value" boxes are for). The same would be true if you set it to 0x2, 0x3, etc. Keep track of your vars and don't reuse them.

Forget the checkflags or compares - that's not a good way to do it, imho.
 

Flandre Scarlet

Free your mind.
356
Posts
16
Years
This may have already been answered, but if I wanted to make a script that would be different if the player would talk to the person from another side, which commands should I use? I forgot them... u_u
 
712
Posts
16
Years
  • Age 31
  • Seen Apr 8, 2024
This may have already been answered, but if I wanted to make a script that would be different if the player would talk to the person from another side, which commands should I use? I forgot them... u_u
here yah go..

Code:
...
compare 0x800C 0x1
if 0x1 goto @down
compare 0x800C 0x2
if 0x1 goto @up
compare 0x800C 0x3
if 0x1 goto @left
compare 0x800C 0x4
if 0x1 goto @right
...
 
7
Posts
13
Years
Hey wasup everyone?!

Just got a quick question....

When I create the inside of a new house using a new map( using the correct tiles of course) on advance map, I can't seem to enter the house when I test it. The screen goes black and the game freezes... All warps are correctly inserted and I've checked it so many times. Any ideas on what I'm doin worng?

:)
 

Jonny Buuz

La di da di do di da di dum...
56
Posts
18
Years
Okay. Advanced scripters (read: people who know how to write a level script), I need your help.

Code:
#dynamic 0x800000

#org @start
#raw 02
#raw pointer @nextpart
#raw 00

#org @nextpart
#raw word 0x4033
#raw 0x0
#raw pointer @script
#raw 00

#org @script
playsong 0x112 0x0
msgbox @1 0x6
applymovement 0xFF @move
applymovement 0x1 @move1
waitmovement 0x0
msgbox @2 0x6
applymovement 0x1 @move2
waitmovement 0x0
fadesong 0x12C
msgbox @3 0x6
givepokemon 0x85 0x9 0xBD 0x0 0x0 0x0
fanfare 0x13E
msgbox @4 0x4
waitfanfare
closeonkeypress
setflag 0x828
msgbox @5 0x6
setvar 0x4033 0x1
release
end

#org @1
= [red_fr]AAAHHH!\nHEELLLP MEEE!\l[player]! MOM! HEEEELLLPPP!!!

#org @2
= [red_fr]What's going on out there?!\nRACHEL, are you okay?!

#org @3
= [red_fr]Here, [player].\nTake your sister's EEVEE with you.\nFind out what's going on\lout there!

#org @4
= [player] received RACHEL's EEVEE!

#org @5
= Be careful out there, [player].

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

#org @move1
#raw 0x1D 0x1D 0x2 0x1B 0x1B 0x1B 0x3 0x1B 0x1B 0x1B 0x0 0xFE

#org @move2
#raw 0x20 0x20 0x1E 0x1E 0xFE

What am I doing wrong in this level script? The script freezes as soon as I enter that particular map... and when I decompile the script, it just gives me the offset (which would imply that there is no script there). However, upon opening the rom with Translhextion, I see that plenty of bytes have been used up by this script (and thus, the script was compiled). So uh, any ideas? I've been stuck on this for a few days now, can't seem to make my way around it.

Thanks in advance!
 
Status
Not open for further replies.
Back
Top