• 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
I made a movecamera script but when I step on the event the script skips over the move camera and goes strait to the end of the script. Did i have a problem in there or is it simply a compiling error?
Spoiler:
Have you omitted the code in the @done, @move, @move2 and @move3 pointers? And what do you mean by the script going to the end? Does it only display the msgbox @2 or go straight to @done?
 

AustinWolff

has left
100
Posts
12
Years

Have you omitted the code in the @done, @move, @move2 and @move3 pointers? And what do you mean by the script going to the end? Does it only display the msgbox @2 or go straight to @done?

for the first question: yes
for the second: it displays msgbox @1 then goes straight to msgbox @2, which means the move camera never happens. anyway, is there any problems with the script or do you think I messed it up with compiling?
 

Quickster

Dream or Drop?
351
Posts
16
Years
  • Seen Apr 4, 2016
Can someone explain how buffernumber or any buffer in general works? I would like to be able to place a found byte to a number so I can use it in a msgbox as a [buffer].

EDIT: Can you copy a byte to a variable?
 
Last edited:

Darthatron

巨大なトロール。
1,152
Posts
18
Years
Can someone explain how buffernumber or any buffer in general works? I would like to be able to place a found byte to a number so I can use it in a msgbox as a [buffer].

EDIT: Can you copy a byte to a variable?

Code:
setvar 0x8000 0x0000
copybyte 0x020370B8 [S-HIGHLIGHT]0x02036E12[/S-HIGHLIGHT]

That copys the byte at 0x02036E12 to Variable 0x8000. Change the [S-HIGHLIGHT]high-lighted[/S-HIGHLIGHT] value to where ever the byte you want to copy is.
 

Quickster

Dream or Drop?
351
Posts
16
Years
  • Seen Apr 4, 2016
Code:
setvar 0x8000 0x0000
copybyte 0x020370B8 [S-HIGHLIGHT]0x02036E12[/S-HIGHLIGHT]

That copys the byte at 0x02036E12 to Variable 0x8000. Change the [S-HIGHLIGHT]high-lighted[/S-HIGHLIGHT] value to where ever the byte you want to copy is.

Thanks very much. And where can you find the values to copy to a variable?
 

masterquestmq

Enthusiastic Rom Hacker
194
Posts
13
Years
  • Seen Nov 19, 2023
can someone help me with my lost item script.

#dynamic 0x800000

#org @start
lock
msgbox @talk 0x5
compare LASTRESULT 0x1
if 0x1 goto @give
release
end

#org @give
giveitem 0x44 0x01 msg_obtain
hidesprite 0x06
setflag 0x305
release
end

#org @talk
= Looks like someone dropped a RARE\nCANDY. Will you take it?


after i compile this script i try to test it out. when I click the item it turns into a talking script I set one of the other OW in the map. is this a bug? or maybe the flag has been used?
 

destinedjagold

You can contact me in PC's discord server...
8,593
Posts
16
Years
  • Age 33
  • Seen Dec 23, 2023
can someone help me with my lost item script.

#dynamic 0x800000

#org @start
lock
msgbox @talk 0x5
compare LASTRESULT 0x1
if 0x1 goto @give
release
end

#org @give
giveitem 0x44 0x01 msg_obtain
hidesprite 0x06
setflag 0x305
release
end

#org @talk
= Looks like someone dropped a RARE\nCANDY. Will you take it?


after i compile this script i try to test it out. when I click the item it turns into a talking script I set one of the other OW in the map. is this a bug? or maybe the flag has been used?

There's nothing wrong with your script.
Maybe the Person Event Number of the OW isn't 6?
 

Darthatron

巨大なトロール。
1,152
Posts
18
Years
Thanks very much. And where can you find the values to copy to a variable?
You can only use a handful of variables in this way. Pretty much just 0x8000-0x800F I think.

0x020370B8 is 0x8000, then add #2 for the next variable, 0x020370BA for 0x8001, 0x020370BC for 0x8002, etc.
 

Quicksken

Modder/Hacker/Gamer/Dreamer
7
Posts
12
Years
Hey, I'm having some trouble with a script (obviously, else I wouldn't be posting here). This script:
Spoiler:

Was meant to activate when you walk on the green square with the S and the red selection indicator (screen shot 1). EDIT: When you step on that script, Oak should walk to you, "push" you away, say something, and walk back in. The checkflags are irrelevant at the moment. I didn't know what to give for these values in A-Map (screen shot 2). I have a bit of experience with scripting by now, so I thought my script was good, but I'm not sure, so if anyone could check this for me, it would be great. And if I should post this question in another thread, please say so, because I wasn't sure about that either.
 
Last edited:

Quickster

Dream or Drop?
351
Posts
16
Years
  • Seen Apr 4, 2016
Hey, I'm having some trouble with a script (obviously, else I wouldn't be posting here). This script:
Spoiler:

Was meant to activate when you walk on the green square with the S and the red selection indicator (screen shot 1). I didn't know what to give for these values in A-Map (screen shot 2). I have a bit of experience with scripting by now, so I thought my script was good, but I'm not sure, so if anyone could check this for me, it would be great. And if I should post this question in another thread, please say so, because I wasn't sure about that either.

Well the unknown should be 0003, and the var number should be 4050. Now for the script, what exactly are you trying to do? Or is that just an unfinished script?
 

Quickster

Dream or Drop?
351
Posts
16
Years
  • Seen Apr 4, 2016
Okay, so I have this script.

Spoiler:


Whats supposed to happen is this:
Today is Day,
(0)Hour:(0)Minute AM/PM.

The 0 varies...

But What happens is (taken at 12:56 AM):
116oqvo.png


Can any one help me out here?

EDIT:
Spoiler:


Here is a slightly revised one, because Im assuming there is no buffer4? It works at 1 pm. Ill just need to see if it doesnt work at 12 again... Does anyone have any idea how I can implement the AM and PM?
 
Last edited:
3
Posts
12
Years
  • Seen Apr 24, 2012
Game: FireRed Type: Finding existing script to replace it Editor: ... Script: Need to find one

1) I need to find the location of the script where I can define the players' and the rivals' name. It's right after prof Oak describes the pokemon world and you can insert your gender, name and rivals' name.
Basically I want to add another rival to the game.
2) Follow-up question - I know there is h01 for player name and h06 (?) for rivals' name. Where could I place the name of rival 2? h07? How many hxx can be used?
3) Can I somehow completeley remove all map data and scripts associated with it so the final hack wouldn't have excess data? World map and pokedex data and pokemon finding data should be removed too so I could re-enter everything myself later.
I want to leave only data about the pokemon, items, tilesets etc that can be used to build up a new world.

 
275
Posts
13
Years
  • Seen Oct 9, 2019
Game: FireRed Type: Finding existing script to replace it Editor: ... Script: Need to find one

1) I need to find the location of the script where I can define the players' and the rivals' name. It's right after prof Oak describes the pokemon world and you can insert your gender, name and rivals' name.
Basically I want to add another rival to the game.
2) Follow-up question - I know there is h01 for player name and h06 (?) for rivals' name. Where could I place the name of rival 2? h07? How many hxx can be used?
3) Can I somehow completeley remove all map data and scripts associated with it so the final hack wouldn't have excess data? World map and pokedex data and pokemon finding data should be removed too so I could re-enter everything myself later.
I want to leave only data about the pokemon, items, tilesets etc that can be used to build up a new world.
1. Those aren't done with a script. It's ASM.

2. You'd have to find some free space in RAM to store it, I think, and you'd have to make sure the location you pick is part of the RAM areas that get saved. I'm not aware of any unused buffers (besides the scriptable ones, which are not reliable for persistent storage) you could use.

3. Search for a "clean" patch; those have all OWs, scripts, etc. removed. The maps are still left intact, as are the world map and Pokedex, namely because it's easier and safer to edit these than to delete and rebuild all of them from scratch.
 

AustinWolff

has left
100
Posts
12
Years
This might be a n00b question, but so far, I haven't found a way for the game to check if you have a certain wild pokemon before continuing. If there is already a "checkpokemon" command, then can u explain how to use it? If not, I kinda have a hint of where to start:
Spoiler:

I dont know exactly how to do it, but I'm on the right track.
Also:
Spoiler:
 
88
Posts
12
Years
  • Seen Jun 18, 2020
Hello ^^
I'm French and I'm only 14, so my English isn't great x)

I've got a problem to create a new respawn :s
In a script, I write this (I use Pokemon Fire Red) :

Code:
sethealingplace 0x1
After that, when my Pokemon are dead, I go in the player's house.

So, I write this on the place of "sethealingplace 0x1" :

Code:
sethealingplace 0x2
And when my Pokemon are dead, I go in the first Pokemon Center.

So, my question is : How to create a new respawn, for use it in a new map ?

Thx, and sorry for the faults ^^
 

Binary

え?
3,977
Posts
16
Years
  • Age 29
  • Seen Apr 7, 2014
This might be a n00b question, but so far, I haven't found a way for the game to check if you have a certain wild pokemon before continuing. If there is already a "checkpokemon" command, then can u explain how to use it? If not, I kinda have a hint of where to start:
Spoiler:

I dont know exactly how to do it, but I'm on the right track.
Also:
Spoiler:
There is no checkpokemon command, but you're on the right track. For checking Pokemon, the code is set out like this:
Code:
setvar 0x8004 0x[I][pokemon number to check][/I]
special2 0x800D 0x17C
compare 0x800D 0x1
if 0x1 goto @pointer
The value of the Pokemon we want to check for is stored in 0x8004. special2 is like special, but stores a returned value from the event called. We use 0x17C, this checks if the pokemon corresponding to the value we've stored in variable 0x8004 is in our party. Then either 0x0 or 0x1 is stored in 0x800D (LASTRESULT), true or false respectively. compare checks if the value is true, in which case the script goes to @pointer. Also, this is only usable in FireRed. There is no special 0x17C in Ruby.

Sorry. Just realized that you were working on a Ruby ROM. This thread might be of help. The Pokemon checking portion in Hackmew's script will give you a clear idea.
 
Last edited:

colcolstyles

Yours truly
1,588
Posts
15
Years
Okay, so I have this script.

Spoiler:


Whats supposed to happen is this:
Today is Day,
(0)Hour:(0)Minute AM/PM.

The 0 varies...

But What happens is (taken at 12:56 AM):
116oqvo.png


Can any one help me out here?

EDIT:
Spoiler:


Here is a slightly revised one, because Im assuming there is no buffer4? It works at 1 pm. Ill just need to see if it doesnt work at 12 again... Does anyone have any idea how I can implement the AM and PM?

Try this:

Code:
#define V_DAY 0x8005
#define V_HOUR 0x8006
#define V_MIN 0x8007

#erase 0x800000 0x1000
#dynamic 0x800000

#org @main
call @day
call @hour

setvar V_MIN 0
copybyte 0x20370C6 0x3005543
buffernumber 2 V_MIN

compare V_HOUR 10
if B_>= goto @ht

compare V_MIN 010
if B_< goto @nhm

msgbox @0n MSG_FACE
release
end


#org @day
setvar V_DAY 0
copybyte 0x20370C2 0x3005541
compare V_DAY 0
if B_== goto @sunday
compare V_DAY 1
if B_== goto @monday
compare V_DAY 2
if B_== goto @tuesday
compare V_DAY 3
if B_== goto @wednesday
compare V_DAY 4
if B_== goto @thursday
compare V_DAY 5
if B_== goto @friday
compare V_DAY 6
if B_== goto @saturday
return

#org @sunday
bufferstring 0 @sunday1
return

#org @monday
bufferstring 0 @monday1
return

#org @tuesday
bufferstring 0 @tuesday1
return

#org @wednesday
bufferstring 0 @wednesday1
return

#org @thursday
bufferstring 0 @thursday1
return

#org @friday
bufferstring 0 @friday1
return

#org @saturday
bufferstring 0 @saturday1
return

#org @sunday1
= Sunday

#org @monday1
= Monday

#org @tuesday1
= Tuesday

#org @wednesday1
= Wednesday

#org @thursday1
= Thursday

#org @friday1
= Friday

#org @saturday1
= Saturday


#org @hour
setvar V_HOUR 0
copybyte 0x20370C4 0x3005542

compare V_HOUR 12
if B_<= goto @am

subvar V_HOUR 12
goto @am

#org @am
buffernumber 1 V_HOUR
return


#org @ht
compare V_MIN 10
if B_< goto @mn
msgbox @nn MSG_FACE
release
end

#org @mn
msgbox @n0 MSG_FACE
release
end

#org @nhm
msgbox @00 MSG_FACE
release
end

#org @nn
= Today is [buffer1],\n[buffer2]:[buffer3].

#org @n0
= Today is [buffer1],\n[buffer2]:0[buffer3].

#org @0n
= Today is [buffer1],\n0[buffer2]:[buffer3].

#org @00
= Today is [buffer1],\n0[buffer2]:0[buffer3].
 

The Void

hiiiii
1,416
Posts
13
Years
Try this:

Code:
#define V_DAY 0x8005
#define V_HOUR 0x8006
#define V_MIN 0x8007

#erase 0x800000 0x1000
#dynamic 0x800000

#org @main
call @day
call @hour

setvar V_MIN 0
copybyte 0x20370C6 0x3005543
buffernumber 2 V_MIN

compare V_HOUR 10
if B_>= goto @ht

compare V_MIN 010
if B_< goto @nhm

msgbox @0n MSG_FACE
release
end


#org @day
setvar V_DAY 0
copybyte 0x20370C2 0x3005541
compare V_DAY 0
if B_== goto @sunday
compare V_DAY 1
if B_== goto @monday
compare V_DAY 2
if B_== goto @tuesday
compare V_DAY 3
if B_== goto @wednesday
compare V_DAY 4
if B_== goto @thursday
compare V_DAY 5
if B_== goto @friday
compare V_DAY 6
if B_== goto @saturday
return

#org @sunday
bufferstring 0 @sunday1
return

#org @monday
bufferstring 0 @monday1
return

#org @tuesday
bufferstring 0 @tuesday1
return

#org @wednesday
bufferstring 0 @wednesday1
return

#org @thursday
bufferstring 0 @thursday1
return

#org @friday
bufferstring 0 @friday1
return

#org @saturday
bufferstring 0 @saturday1
return

#org @sunday1
= Sunday

#org @monday1
= Monday

#org @tuesday1
= Tuesday

#org @wednesday1
= Wednesday

#org @thursday1
= Thursday

#org @friday1
= Friday

#org @saturday1
= Saturday


#org @hour
setvar V_HOUR 0
copybyte 0x20370C4 0x3005542

compare V_HOUR 12
if B_<= goto @am

subvar V_HOUR 12
goto @am

#org @am
buffernumber 1 V_HOUR
return


#org @ht
compare V_MIN 10
if B_< goto @mn
msgbox @nn MSG_FACE
release
end

#org @mn
msgbox @n0 MSG_FACE
release
end

#org @nhm
msgbox @00 MSG_FACE
release
end

#org @nn
= Today is [buffer1],\n[buffer2]:[buffer3].

#org @n0
= Today is [buffer1],\n[buffer2]:0[buffer3].

#org @0n
= Today is [buffer1],\n0[buffer2]:[buffer3].

#org @00
= Today is [buffer1],\n0[buffer2]:0[buffer3].

Problem: XSE keeps on telling me to change the if B_< lines. I tried changing them to a "less than or equal to" thingy, but it still won't work. All I hear is beeping sounds, but no text. Any thoughts here?
 
27
Posts
12
Years
Okay, so I was wondering how you would be able to have a sprite, like professor oak in pallet town, be able to be invisible before activating any "disappear" scripts, and then appear at a later time? By the way, I'm using pksv.
 
Last edited:
Status
Not open for further replies.
Back
Top