• 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?".
  • Forum moderator applications are now open! Click here for details.
  • 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.
10,078
Posts
15
Years
  • Age 32
  • UK
  • Seen Oct 17, 2023
Alright, so I'm having a bit of an issue with my camera movement script.
So I have the main character standing somewhere with another character.
I pan the camera up to view a conversation, but when I bring the camera back to my player, the character he was with has disappeared. I do have a hidesprite in the code, but it seems to be activating way to soon.

I thought maybe when the camera was moving, the sprites got reset to there original area, so I added a movesprite in there, and stille the guy is no where to be seen.

The rest of the script goes on fine, except for the fact that he is either invisible, or nowhere to be found


I think your problem is the distance, movesprite only works when the sprites are close to the screen (not say 10 tiles off screen).

Try breaking down your movecam (on the way back) so it's:

...
applymovement 0x7F @MoveCamstep1
waitmovement 0x0
movesprite 0xWhatever 0x 0x
applymovement 0x7F @MoveCamstep2
...


Make step1 take you to just above the sprite that needs moving (2 tiles above or so) and step2 to take the rest of the way.
 
30
Posts
14
Years
  • Seen Jul 27, 2012
I think your problem is the distance, movesprite only works when the sprites are close to the screen (not say 10 tiles off screen).

Try breaking down your movecam (on the way back) so it's:

...
applymovement 0x7F @MoveCamstep1
waitmovement 0x0
movesprite 0xWhatever 0x 0x
applymovement 0x7F @MoveCamstep2
...


Make step1 take you to just above the sprite that needs moving (2 tiles above or so) and step2 to take the rest of the way.

I think I may have mislead as to what my problem is.

My problem isn't the move sprite, the move sprite isn't even nesseary, I just thought it may fix my problem.

My problem is, when I move the camera away from my character, and then back to my character, a sprite that was next to him has vanished as if a hidesprite has been applied.
 
10,078
Posts
15
Years
  • Age 32
  • UK
  • Seen Oct 17, 2023
I think I may have mislead as to what my problem is.

My problem isn't the move sprite, the move sprite isn't even nesseary, I just thought it may fix my problem.

My problem is, when I move the camera away from my character, and then back to my character, a sprite that was next to him has vanished as if a hidesprite has been applied.


I'm not really sure what to suggest, sorry I interpreted as the player seemed hidden but was actually in it's original position off of screen ><.

Do decompile the script and check a hidesprite hasn't shifted position, if not try changing the hidesprite to another personID and see if the sprite then shows up. It's hard to visualise your problem haha.
 
24
Posts
11
Years
I am terrible at scripting. I'm using PKSVUI and I need help. So I'm creating a gym leader fight where before the fight, the gym leader gives an item, and then the person talks and you battle.
But for some reason I can only get the give item part of the script to work, nothing else. D: And yes all the flags you see are unused, trust me.
Spoiler:


EDIT:
I fixed it! I had to use the "Jump" command. xD
 
Last edited:
32
Posts
13
Years
  • Seen Jul 20, 2012
is there a way to extract scripts from game

so the title says it.is there a way i could extract scripts from fr and lf.then edit them
 
10,078
Posts
15
Years
  • Age 32
  • UK
  • Seen Oct 17, 2023
Hello guys, how would could I make an event with PKSV so that I give someone an item and I get a Pokémon? N00b here!

I'm afraid asking for entire scripts (which this basically is) isn't allowed in this thread, have a read of this tutorial, as it takes you through different scripts.
 
48
Posts
11
Years
  • Seen Jul 30, 2012
Sorry dude, I suck at scripting... It confuses me! I don't know how to layer scipts, if you know what I mean. What does \v\ho2 mean!? What I did is I found a guy who wanted to trade to try and help me to create a script and it tells me this:

Spoiler:

What is this?!
 
10,078
Posts
15
Years
  • Age 32
  • UK
  • Seen Oct 17, 2023
Sorry dude, I suck at scripting... It confuses me! I don't know how to layer scipts, if you know what I mean. What does \v\ho2 mean!? What I did is I found a guy who wanted to trade to try and help me to create a script and it tells me this:

Spoiler:

What is this?!

Seriously, looking at a tutorial is the way to go.

Since you asked, \v\ho2 and \v\hh03 are buffers, they load a predefined word/name/number into a text.

Looking at a trade script isn't going to help you with what you want however, in the tutorial thread look up the following commands:

checkitem - Used to see if you have the item needed to 'trade'.
removeitem - Takes it off you, to simulate the trade.
givepokemon - Huzzah! You gave an item and got a Pokémon in exchange.

Each of these commands have certain criteria, numbers to include to specify what is it/how many, and is all explained clearly in the tutorial.

 
30
Posts
18
Years
  • Seen May 26, 2022
Got a problem with my new script. I'm using the music switching method found here for the following:

Code:
#dyn 0x740000
#org @begin
lock
faceplayer
msgbox @steven
callstd msg_normal
setvar 0x6008 0x129
setvar 0x600A 0x12B
trainerbattle 0x3 0x9 0x0 @defeat
msgbox @afterwards
callstd msg_normal
release
end

#org @steven
= Oh? Did you come to look\nfor fossils as well?\p[.]\pYour name is \v\h01?\nMine is STEVEN.\pI came from the HOENN region\nto look for rare fossils here\lat MT. MOON.\pI can tell by your eyes that\nyou are no ordinary trainer.\pCoincidentally, I was the also\nCHAMPION of the HOENN region for\la short time, so I know that\llook.\pYou've been through a tough journey,\nwhich has now brought you here.\pIt is no coincidence we have met.\nLet us battle to determine your\lworth.

#org @defeat
= Kudos to you, \v\h01.\pI can see that I was not\nmistaken.

#org @afterwards
= Well, that was exciting.\pIt seems as if all the fossils\nhere have already been dug\lup.\pCome again, I'll be happy to\nshare some of my own with you.

For the most part this works fine. It replaces the normal trainer music with the champion music, but if I lose and fight another trainer, the music does not change back. I tried setting both variables to FFFF after the battle but the same thing persists when I lose. Is there a way to solve this other than setting the variables for EVERY trainer in the game?
 
Last edited:
5,256
Posts
16
Years
Code:
#dyn 0x740000
#org @begin
lock
faceplayer
msgbox @steven
callstd msg_normal
setvar 0x6008 0x129
setvar 0x600A 0x12B
trainerbattle 0x3 0x9 0x0 @defeat
[B]setvar 0x6008 0x
setvar 0x600A 0x[/B]
msgbox @afterwards
callstd msg_normal
release
end

#org @steven
= Oh? Did you come to look\nfor fossils as well?\p[.]\pYour name is \v\h01?\nMine is STEVEN.\pI came from the HOENN region\nto look for rare fossils here\lat MT. MOON.\pI can tell by your eyes that\nyou are no ordinary trainer.\pCoincidentally, I was the also\nCHAMPION of the HOENN region for\la short time, so I know that\llook.\pYou've been through a tough journey,\nwhich has now brought you here.\pIt is no coincidence we have met.\nLet us battle to determine your\lworth.

#org @defeat
= Kudos to you, \v\h01.\pI can see that I was not\nmistaken.

#org @afterwards
= Well, that was exciting.\pIt seems as if all the fossils\nhere have already been dug\lup.\pCome again, I'll be happy to\nshare some of my own with you.

I've added in the bolded text. You then just add the hex numbers for the ordinary battle theme (I'm not sure which, AdvanceMap has a list in the Header Tab). That should work, but I haven't tested it so I'm not 100% sure.
 

OMGWURMPLES!

För Sverige i tiden
49
Posts
14
Years
  • Seen Jun 15, 2012
Starter pokemon script?

Hi, I'm working on a FireRed hack. At the moment, I am trying to make a script in which you choose your starter and your rival goes and chooses the other opposite...
I've gotten to the point where the rival moves from (soon to be her) spot, says, "I'll take this one!" and "takes" the PokeBall. Unfortunately, the setflag command does not seem to be working. The Pokeball's ID-thing is set as 920, but when I "setflag 0x920" it doesn't work. At all.
Here's my code (I plan on duplicating it with small changes to make it fit the other Pokeballs):
Code:
#dynamic 0x800260
#org @getstartersquirt
checkflag 0x910
if 0x1 goto @check
setflag 0x910
release
end

#org @take
givepokemon 0x7 0x5 0x0 0x0 0x0 0x0
fanfare 0x13E
msgbox @3 0x4
waitfanfare
closeonkeypress
msgbox @4 0x5
hidepokepic
compare 0x800D 0x1
if 0x1 gosub @name
msgbox @5 0x2
setflag 0x828
setflag 0x910
applymovement 8 @moverival
msgbox @6 0x06
checkflag 0x910
if 0x0 goto @pokedisappear
release
end

#org @name
countpokemon
subvar 0x800D 0x1
copyvar 0x8004 0x800D
fadescreen 0x1a
special 0x166
waitstate
return

#org @check
showpokepic 0x7 0x0A 0x03
msgbox @7 0x5
compare 0x800D 0x1
if 0x1 goto @take
hidepokepic
return

#org @7
= Do ya want this SQUIRTLE? \nIt's fun to raise!

#org @3
= You've received a SQUIRTLE!

#org @4
= Would you like to nickname this \nSQUIRTLE?

#org @5
= Take good care of it!

#org @6
= I'll have this one, then!

#org @moverival
#raw 0x03 0x13 0x013 0x01 0x11 0x03 0x013 0x13 0x13 0x0

#org @pokedisappear
setflag 0x920
release
end

Is there something I can do? Or an easier way to make this script? That would be great! Thank you.
 
10,078
Posts
15
Years
  • Age 32
  • UK
  • Seen Oct 17, 2023
Hi, I'm working on a FireRed hack. At the moment, I am trying to make a script in which you choose your starter and your rival goes and chooses the other opposite...
I've gotten to the point where the rival moves from (soon to be her) spot, says, "I'll take this one!" and "takes" the PokeBall. Unfortunately, the setflag command does not seem to be working. The Pokeball's ID-thing is set as 920, but when I "setflag 0x920" it doesn't work. At all.
Here's my code (I plan on duplicating it with small changes to make it fit the other Pokeballs):
Code:
#dynamic 0x800260
#org @getstartersquirt
checkflag 0x910
if 0x1 goto @check
setflag 0x910
release
end

#org @take
givepokemon 0x7 0x5 0x0 0x0 0x0 0x0
fanfare 0x13E
msgbox @3 0x4
waitfanfare
closeonkeypress
msgbox @4 0x5
hidepokepic
compare 0x800D 0x1
if 0x1 gosub @name
msgbox @5 0x2
setflag 0x828
setflag 0x910
applymovement 8 @moverival
msgbox @6 0x06
checkflag 0x910
if 0x0 goto @pokedisappear
release
end

#org @name
countpokemon
subvar 0x800D 0x1
copyvar 0x8004 0x800D
fadescreen 0x1a
special 0x166
waitstate
return

#org @check
showpokepic 0x7 0x0A 0x03
msgbox @7 0x5
compare 0x800D 0x1
if 0x1 goto @take
hidepokepic
return

#org @7
= Do ya want this SQUIRTLE? \nIt's fun to raise!

#org @3
= You've received a SQUIRTLE!

#org @4
= Would you like to nickname this \nSQUIRTLE?

#org @5
= Take good care of it!

#org @6
= I'll have this one, then!

#org @moverival
#raw 0x03 0x13 0x013 0x01 0x11 0x03 0x013 0x13 0x13 0x0

#org @pokedisappear
setflag 0x920
release
end

Is there something I can do? Or an easier way to make this script? That would be great! Thank you.

You need to actually hide the sprite, 'hidesprite 0x__' as well as set the flag to make it instant and permanent.
 

myrrhman

Challenge God
1,824
Posts
14
Years
Quick question:

A year or so ago, a friend and I started making a hack. We ran into the problem of accidentally saving new scripts over old scripts.

Now I know there is a free space finder thing that helps you find unused space, but my friend (who was doing the scripting) said that using a free space finder took a really long time.

Now, we're starting to make a hack again, but this time, instead of editing stuff like we were doing the first time around, we're starting from scratch. Could we just start at 0 (or wherever the beginning of script in the game is) and just save over everything? Or would we risk the chance of it saving over moves and accessing your PC and stuff like that?
 
Status
Not open for further replies.
Back
Top