• 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.
29
Posts
15
Years
  • Seen Feb 10, 2013
Er, I wasn't really using a person, just a script trap. I guess using a person would be better.

So, what you're saying is, I should just program the script without setflag/clearflag stuff, and have another script work all of that out instead?

Yeah, the only thing your current script would have to do is check your flag. The person vs. script trap thing is whatever you want it to be, if your story (Or whatever you're doing) applies more to a person blocking your way, use a person. If, say, you want a script to block you from going out to sea because the tides are too strong, you'd throw in some character judgement and use a script trap.

Like I said, totally up to you, I just recommend that you use an event to trigger your current script, or if you want you could even do it all with one script and every time you run this script have a line that checks if you've done something. If so it checks your flag and continues with the other script, then stops checking the old flag.

If the last part was confusing I'd just stick with another event triggering it like I was saying earlier, the all-in-one-script method would be an unnecessary amount of work if you don't understand it.

hi dude would you please help me i'm making a hack for pokemon ruby and i wanted to make a script using PKSV to allow the pokemon picture to appear while talking to the person like in the hack which is called : Pokemon Ruby Destiny-Life of Guardian i think so and i did every thing right but when i talk to him the pokemon colors appears to different like this/imageshackDOTus/photo/my-images/72/imageerrorDOTpng/
Ill be really happy if you helped and sorry if it was a long message :)

I don't care about the length (That's what she said xD), I myself tend to write really long messages too.

Can you post your script here? I haven't really done that recently so I'm not really sure without reading through.
 

destinedjagold

You can contact me in PC's discord server...
8,593
Posts
16
Years
  • Age 33
  • Seen Dec 23, 2023
Sorry, I was loading my script (So I'd have the version with pointers and before compilation. When I decompile it doesn't really do anything :/

I did have waitmovement 0x0, it didn't work. Then I thought I might need it to be 0xF, since that was my sprite's event number. It still doesn't work, not sure why.

Can anyone help me with this?

Here's the compiled version:
Spoiler:

I think it's because of this line of code...
Code:
...
#org 0xE00ABF
msgbox 0x8E00B16 MSG_FACE '"Hey man, my boss told me\nto let y..."
applymovement 0xF 0x8E00AD7
waitmovement 0xF
hidesprite 0xF
setflag 0x904
[COLOR="Red"]if 0x7 call 0x4040407[/COLOR]
call 0x4040404
call 0x6C00FE04
end

There are no commands before that(in red) that requires an 'if' statement.
Also, where does the 4040404 address even lead?
I guess is that this script has glitched up at the very end.
Try and compile your script again in a different free space address.
 
90
Posts
11
Years
  • Seen Aug 21, 2013
First time doing apply movement trying to make it so when you walk on the script event you look around but it freezes for me. I didn't add anything to the side panel of the event but the script offset couldn't understand what he was doing on diegos script tutorial but yeah. FireRed
Spoiler:
 

DrFuji

[I]Heiki Hecchara‌‌[/I]
1,691
Posts
14
Years
First time doing apply movement trying to make it so when you walk on the script event you look around but it freezes for me. I didn't add anything to the side panel of the event but the script offset couldn't understand what he was doing on diegos script tutorial but yeah. FireRed
Spoiler:

The reason why it is freezing is because, as you said, you haven't edited the side panel. Just copy exactly what diegoisawesome has done in his tutorial unless you have used the variable 0x4050 beforehand. If you have used it previously then place another variable that you aren't using. Also, that script is going to activate every time you step on it so I would advise placing a setflag command so it doesn't trip when it is no longer necessary, or put in a set/add/subvar command that changes the variable which you put into the side panel (If the variable's value is not equal to the number in the 'Var value' box then the screen script will not activate).
 
90
Posts
11
Years
  • Seen Aug 21, 2013
The reason why it is freezing is because, as you said, you haven't edited the side panel. Just copy exactly what diegoisawesome has done in his tutorial unless you have used the variable 0x4050 beforehand. If you have used it previously then place another variable that you aren't using. Also, that script is going to activate every time you step on it so I would advise placing a setflag command so it doesn't trip when it is no longer necessary, or put in a set/add/subvar command that changes the variable which you put into the side panel (If the variable's value is not equal to the number in the 'Var value' box then the screen script will not activate).

Well where he put 300 in unknown I can't b/c I only have enough spaces for 2 numbers, the text does go off though just doesn't move.
 

DrFuji

[I]Heiki Hecchara‌‌[/I]
1,691
Posts
14
Years
Well where he put 300 in unknown I can't b/c I only have enough spaces for 2 numbers, the text does go off though just doesn't move.

Ah, you must be using Advance Map 1.95 rather than 1.92 like he was. Put 03 in the unknown box instead.
 
90
Posts
11
Years
  • Seen Aug 21, 2013
Eh I still think I'm doing something wrong,ima noob.... :pirate:
Spoiler:
 

DrFuji

[I]Heiki Hecchara‌‌[/I]
1,691
Posts
14
Years
Eh I still think I'm doing something wrong,ima noob....
pirate.gif

Spoiler:

Your flag commands are all over the place. You have no 'if' command after your checkflag to determine whether you've been there and there should not be a clearflag anywhere in your script, particularly under the @lonely pointer which is for text rather than commands.

Try this (changes in red):

Spoiler:
 
90
Posts
11
Years
  • Seen Aug 21, 2013
Okay I got it to work thanks but how do I set up the flags or w.e if I wanted a script to stop you from leaving the map until you talk to something like a pc for example? How do I tie them both together? :pirate:

Spoiler:
 
Last edited:

DrFuji

[I]Heiki Hecchara‌‌[/I]
1,691
Posts
14
Years
Okay I got it to work thanks but how do I set up the flags or w.e if I wanted a script to stop you from leaving the map until you talk to something like a pc for example? How do I tie them both together? :pirate:

Spoiler:

You should set a flag in the script that the player must complete before they are allowed to leave - In this instance you would remove the 'setflag 0x828' command from the script you've provided and put that exact same command into the PC script. This way once the player has interacted with the first script they will have everything necessary to get by the second one.
 
90
Posts
11
Years
  • Seen Aug 21, 2013
Okay well everything worked fine but when I go back to the room the script resets. Also how do you do move camera don't see it in diegos tut.

PC
Spoiler:


Script
Spoiler:
 

destinedjagold

You can contact me in PC's discord server...
8,593
Posts
16
Years
  • Age 33
  • Seen Dec 23, 2023
Okay well everything worked fine but when I go back to the room the script resets. Also how do you do move camera don't see it in diegos tut.

PC
Spoiler:


Script
Spoiler:

Your PC script is fine.
The only thing that's wrong there is this line...
Code:
...#org @skip
[COLOR="red"]clearflag 0x200[/COLOR]
release
end
...
In that line of code, you are telling the ROM to clear the flag again, so of course, the scripts that uses to check that flag will reset.
 

Trev

[span="font-size: 8px; color: white;"][font="Monts
1,505
Posts
11
Years
  • Age 27
  • Seen Nov 15, 2023
Okay well everything worked fine but when I go back to the room the script resets. Also how do you do move camera don't see it in diegos tut.

PC
Spoiler:


Script
Spoiler:
Spoiler:
 
90
Posts
11
Years
  • Seen Aug 21, 2013
I'm trying to add a trainer script but his view radius isn't working I set it to 5 I have to talk to him for the battle to start.
Spoiler:
 
Last edited:
6
Posts
12
Years
  • Seen Jul 29, 2022
XSE crashes upon compiling script

Thanks, Drfuji and redriders180! It was very helpful.

Now I have a new problem. Whenever I try to compile a specific script with XSE, XSE crashes. At first I thought it was happening because of an extremely long message (hence the multiple msgbox's), but now I have no idea what is causing the crash. This crash is happening on my laptop. I tried compiling it on another computer and I got the error "Subscript out of range" on lines 65, 71, and 74 which are messages 6, 8, and 9. What does this error mean?
EDIT: The problem must be with the messages because it was able to successfully compile without them.

Code:
#dynamic 0x71B791

#org @start
lock 
faceplayer
checkflag 0x829
if 0x1 goto @done
checkflag 0x26E
if 0x1 goto @choosepokemon
msgbox @1 0x6
msgbox @10 0x6
msgbox @11 0x6
msgbox @12 0x6
msgbox @13 0x6
msgbox @2 0x6
msgbox @3 0x6
setflag 0x26E
release
end

#org @choosepokemon
checkflag 0x828
if 0x1 goto @pokedex
msgbox @4 0x6
release
end

#org @pokedex
msgbox @6 0x6
fanfare 0x13E
msgbox @7 0x6
waitfanfare
setflag 0x829
special 0x181
setvar 0x407C 0x1
msgbox @8 0x6
msgbox @9 0x6
release
end

#org @done
msgbox @5 0x6
release
end


#org @1
= Ah, there you are, [player]! Today is a\nspecial day for you and [rival]. 

#org @2
= [rival]: Why does [player] get to choose\nfirst?

#org @3
= Oak: Be patient, [rival]. You will get\nyour turn soon enough.

#org @4
= Once you have chosen your Pokemon,\ndon't leave. I have something for\lyou.

#org @5
= How is your Pokedex coming along?

#org @6
= Oak: Before you and [rival] go off on\nyour adventure, I'd like to give\lyou something.

#org @7
= [player] received the Pokedex!

#org @8
= That is a Pokedex, a Pokemon\nencyclopedia. I invented it to\lmake a detailed record of Pokemon\lthat the user encounters and\lcaptures. The Pokedex records\lsome data when you encounter a\lPokemon, but it records a lot\lmore data when you capture a\lPokemon. Make sure to catch'em\lall!

#org @9
= [rival]: I bet I'll catch more Pokemon\nthan you, [player]! Smell you later!

#org @10
= Today is the day that you will\nreceive your first Pokemon!

#org @11
= Beside me are the keepers of the\nstarters.

#org @12
= There are nine starters—three\ngrass, three fire, and three\lwater—to choose from; you may\lonly have one.

#org @13
= [player], why don't you choose first?
 
Last edited:

Alignment

Revered with the stars
308
Posts
14
Years
  • Seen Dec 25, 2016
Thanks, Drfuji and redriders180! It was very helpful.

Now I have a new problem. Whenever I try to compile a specific script with XSE, XSE crashes. At first I thought it was happening because of an extremely long message (hence the multiple msgbox's), but now I have no idea what is causing the crash. This crash is happening on my laptop. I tried compiling it on another computer and I got the error "Subscript out of range" on lines 65, 71, and 74 which are messages 6, 8, and 9. What does this error mean?
EDIT: The problem must be with the messages because it was able to successfully compile without them.

Code:
#dynamic 0x71B791
 
#org @start
lock 
faceplayer
checkflag 0x829
if 0x1 goto @done
checkflag 0x26E
if 0x1 goto @choosepokemon
msgbox @1 0x6
msgbox @10 0x6
msgbox @11 0x6
msgbox @12 0x6
msgbox @13 0x6
msgbox @2 0x6
msgbox @3 0x6
setflag 0x26E
release
end
 
#org @choosepokemon
checkflag 0x828
if 0x1 goto @pokedex
msgbox @4 0x6
release
end
 
#org @pokedex
msgbox @6 0x6
fanfare 0x13E
msgbox @7 0x6
waitfanfare
setflag 0x829
special 0x181
setvar 0x407C 0x1
msgbox @8 0x6
msgbox @9 0x6
release
end
 
#org @done
msgbox @5 0x6
release
end
 
 
#org @1
= Ah, there you are, [player]! Today is a\nspecial day for you and [rival]. 
 
#org @2
= [rival]: Why does [player] get to choose\nfirst?
 
#org @3
= Oak: Be patient, [rival]. You will get\nyour turn soon enough.
 
#org @4
= Once you have chosen your Pokemon,\ndon't leave. I have something for\lyou.
 
#org @5
= How is your Pokedex coming along?
 
#org @6
= Oak: Before you and [rival] go off on\nyour adventure, I'd like to give\lyou something.
 
#org @7
= [player] received the Pokedex!
 
#org @8
= That is a Pokedex, a Pokemon\nencyclopedia. I invented it to\lmake a detailed record of Pokemon\lthat the user encounters and\lcaptures. The Pokedex records\lsome data when you encounter a\lPokemon, but it records a lot\lmore data when you capture a\lPokemon. Make sure to catch'em\lall!
 
#org @9
= [rival]: I bet I'll catch more Pokemon\nthan you, [player]! Smell you later!
 
#org @10
= Today is the day that you will\nreceive your first Pokemon!
 
#org @11
= Beside me are the keepers of the\nstarters.
 
#org @12
= There are nine starters—three\ngrass, three fire, and three\lwater—to choose from; you may\lonly have one.
 
#org @13
= [player], why don't you choose first?

combine
msgbox @1 0x6
msgbox @10 0x6
msgbox @11 0x6
msgbox @12 0x6
msgbox @13 0x6
msgbox @2 0x6
msgbox @3 0x6

into one msgbox. Do the same with msgbox 8 &9. Don't forget the \n's and stuff.
 

hinkage

Everyone currently in an argument with this member
383
Posts
13
Years
  • Age 28
  • Seen Apr 15, 2024
I have a problem with free space.

I expanded my Emerald ROM to 32 MB. To avoid sound corruption, I have to use #dynamic 0xE3CF64 in scripts. However, when compiling in PKSV it assigns all offsets to 0x100001 no matter how big they are, and when compiling in XSE I get a "Not enough free space" error.

I tried HackMew's Free Space Finder, but it is dangerous because it can overwrite scripts if I'm not careful, so I can't use it.
How can I fix this? I don't know what to do. ;-;
 
Status
Not open for further replies.
Back
Top