• 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.
6
Posts
11
Years
  • Seen Nov 21, 2015
Yo, I'm having trouble with some flags. The basic set-up is that there's an NPC who won't fight you. However, once talking to a signpost event, talking to this NPC will trigger a battle. I'm doing this via a setflag, which only seems to work on the same map. I'm not sure if I'm doing something wrong, or if flags only apply to the same map. I'm using pksv if that means anything

Code:
#org 0x87408D6
'-----------------------------------
lock
faceplayer
msgbox 0x87408EB ' Howdy, youngster!\pD...
callstd MSG_LOCK ' Built-in lock command
checkflag 0x911
if true jump 0x87406E3 ' Flag is set
release
end

#org 0x87406E3
'-----------------------------------
trainerbattle 0x0 0x14F 0x0 0x8740703 0x874077D
msgbox 0x87407F6 ' FILLER FILLER FILLER...
callstd MSG_LOCK ' Built-in lock command
checkflag 0x912
if false jump 0x87406C9 ' Flag is unset
end

#org 0x87406C9
'-----------------------------------
checkflag 0x912
if true jump 0x87406E1 ' Flag is set
copyvarifnotzero 0x8000 SECRETKEY
copyvarifnotzero 0x8001 0x1
callstd MSG_OBTAIN ' Obtained the XXXXXX!
setflag 0x912
end

#org 0x87406E1
'-----------------------------------
end
 

TweenyTodd

Quitting cuz i got a job
95
Posts
11
Years
I'm going to clean this up:

Spoiler:


Now, compile this into your rom. Then, take the offset of @start and put it in the box for Script Offset 2: of map script number 1 in the player's bedroom. Don't change any other settings. Also, find the original script that was map script 0 and restore it to its original place and condition. You were trying to change the wrong one.

I've done exactly that and it STILL doesn't work. I used a clean ROM and re-placed all the characters, set up their flags, and put in the script. I made sure it was script 1 not script 0, and I made sure all the offscripts match. I don't understand whats wrong...
 

karatekid552

What happens if I push it?....
1,771
Posts
11
Years
Yo, I'm having trouble with some flags. The basic set-up is that there's an NPC who won't fight you. However, once talking to a signpost event, talking to this NPC will trigger a battle. I'm doing this via a setflag, which only seems to work on the same map. I'm not sure if I'm doing something wrong, or if flags only apply to the same map. I'm using pksv if that means anything

Code:
#org 0x87408D6
'-----------------------------------
lock
faceplayer
msgbox 0x87408EB ' Howdy, youngster!\pD...
callstd MSG_LOCK ' Built-in lock command
checkflag 0x911
if true jump 0x87406E3 ' Flag is set
release
end

#org 0x87406E3
'-----------------------------------
trainerbattle 0x0 0x14F 0x0 0x8740703 0x874077D
msgbox 0x87407F6 ' FILLER FILLER FILLER...
callstd MSG_LOCK ' Built-in lock command
checkflag 0x912
if false jump 0x87406C9 ' Flag is unset
end

#org 0x87406C9
'-----------------------------------
checkflag 0x912
if true jump 0x87406E1 ' Flag is set
copyvarifnotzero 0x8000 SECRETKEY
copyvarifnotzero 0x8001 0x1
callstd MSG_OBTAIN ' Obtained the XXXXXX!
setflag 0x912
end

#org 0x87406E1
'-----------------------------------
end

The answer to your problem is something I have said 1000 times answering questions: NO flags over 900. They overwrite the RAM used for vars 4000 and up as well as PC box space. Flags 900-90F exist in var 4000, and flags 910-91F exist within var 4001. (Flags are stored in bits, and each var is 16 bits). These vars are temporary and are reset after leaving the map. Read these two posts and learn:

http://www.pokecommunity.com/showpost.php?p=6829256&postcount=158
http://www.pokecommunity.com/showpost.php?p=6902344&postcount=183

I've done exactly that and it STILL doesn't work. I used a clean ROM and re-placed all the characters, set up their flags, and put in the script. I made sure it was script 1 not script 0, and I made sure all the offscripts match. I don't understand whats wrong...

I am going to go test this myself right now. This should be working.

Edit: I compiled it and it worked just fine. Here, let me post a screenshot.

Screen:
Spoiler:
 
Last edited:
6
Posts
11
Years
  • Seen Nov 21, 2015
Thanks for the reply. Fortunately I managed to figure it out myself but thanks for the clarification. Funny, pksv said those would be safe :P.
 

ProfessorBeeching

Professor Of Fail
20
Posts
11
Years
I cannot make the most simple script work. I compiled it and inserted it to a character, but when I interatct with the sprite, it makes the clicking sound and nothing happens.
The game does not freeze. The rom is clean.

That's more or less the problem I've been having. Main difference being sometimes the person makes a clicking noise with nothing happening and sometimes I get a glitchy shop menu. I should probably screenshot or video it to make it clearer to understand...
 
948
Posts
11
Years
Double-click the person you gave the script to see if it was properly compiled. Also, make you sure you made no mistake in pointers and that the script was inserted in a free space.
Make also sure that you have XSE v1.1.1 (latest version). (You can download a French version here)
 

ProfessorBeeching

Professor Of Fail
20
Posts
11
Years
Double-click the person you gave the script to see if it was properly compiled. Also, make you sure you made no mistake in pointers and that the script was inserted in a free space.
Make also sure that you have XSE v1.1.1 (latest version). (You can download a French version here)

Double-clicking gives me a 'No Script Editor Defined" error. As for my XSE version, I believe it's the up-to-date one (just with the config file included because of the aforementioned subscript 9 error).
 

TweenyTodd

Quitting cuz i got a job
95
Posts
11
Years
I compiled it and it worked just fine. Here, let me post a screenshot.

Screen:
Spoiler:

But, did you test it out in game? The same compile screen appeared for me, but all 4 people appeared for each gender. I want 2 to appear for either gender.
 

karatekid552

What happens if I push it?....
1,771
Posts
11
Years
But, did you test it out in game? The same compile screen appeared for me, but all 4 people appeared for each gender. I want 2 to appear for either gender.

The problem you had was the script crashing. Mine didn't crash, and I know it worked because the spritefacing command worked. This means that (most likely) the flags were set too, but I didn't actually check.

The most important part here, is not the compile log, but the offsets given. Those settings in A-map: they are settings for my Map Script. Notice, they have the same offset as the compiler log. Those are what I was trying to show you. The only reason XSE was in the picture was so you could see how things lined up.

Double-clicking gives me a 'No Script Editor Defined" error. As for my XSE version, I believe it's the up-to-date one (just with the config file included because of the aforementioned subscript 9 error).

If XSE was on your computer, and you didn't know, and no one ever told you to use it: would you ever think to use it? No. Which is why this isn't working. You never told A-map to use XSE. Go into one of the top menus (Options, I think) and choose "Define Script Editor" or "Choose Script Editor" (can't remember which, but it is at the bottom of one of the top menus.
 
Last edited:

newpick

Guest
0
Posts
First post straight to you guys! tried searching high and lo-tad for it.

Here it is: I want to remove HM05 "Flash" from the game in favor of an item that Oak gives you at the start.

I understand how to make an item given an empty space and have oak give it to you but don't know how to instigate an item into acting as a HM. Help? Thanks!

edit: I could just not have caves :\
 
Last edited:

itman

Back to ROM hacking. :D
98
Posts
16
Years
  • Age 30
  • Seen Feb 5, 2014
First post straight to you guys! tried searching high and lo-tad for it.

Here it is: I want to remove HM05 "Flash" from the game in favor of an item that Oak gives you at the start.

I understand how to make an item given an empty space and have oak give it to you but don't know how to instigate an item into acting as a HM. Help? Thanks!

edit: I could just not have caves :\

I'm pretty sure if you use JPAN's hacked engine, it's a feature, and it's explained in the word document that comes with the patch.
 

karatekid552

What happens if I push it?....
1,771
Posts
11
Years
First post straight to you guys! tried searching high and lo-tad for it.

Here it is: I want to remove HM05 "Flash" from the game in favor of an item that Oak gives you at the start.

I understand how to make an item given an empty space and have oak give it to you but don't know how to instigate an item into acting as a HM. Help? Thanks!

edit: I could just not have caves :\

I know how to make an item that would have the same effect as flash: ie A flashlight, if that is the type of thing you are referring to.

As itman said, there is a way in JPAN's engine to create items that run scripts. However, this is not required to be used with JPAN's engine, as you are probably not using it already. In that case, see this thread for a routine which will run a script in an item: http://www.pokecommunity.com/showthread.php?t=281573

Now, if you wanted to make an HM type item which teaches a pokemon Flash, that will be much more difficult.
 

newpick

Guest
0
Posts
Thank you both! I could see why even complex searching wouldn't have yielded that. I could really see this more generalized hack being useful for more things than i could come up with right now!
 

TweenyTodd

Quitting cuz i got a job
95
Posts
11
Years
The problem you had was the script crashing. Mine didn't crash, and I know it worked because the spritefacing command worked. This means that (most likely) the flags were set too, but I didn't actually check.

The most important part here, is not the compile log, but the offsets given. Those settings in A-map: they are settings for my Map Script. Notice, they have the same offset as the compiler log. Those are what I was trying to show you. The only reason XSE was in the picture was so you could see how things lined up.
I think the offsets line up right, and im sure of the script. But the spriteface script doesn't work.
Spoiler:
 

Bolens

Soul Hacker
359
Posts
14
Years
  • Age 30
  • PA
  • Seen Aug 22, 2016
Game: Firered Type: Level Script Editor: XSE Script:
Spoiler:


Problem: XSE crashes whenever I try to compile this into my ROM. Hopefully someone can help, thanks guys.

~Bolens
 
5,256
Posts
16
Years
Huh, I split up @2 into separate strings and now it compiles perfectly. I really dunno why, but here you go:

Code:
#dynamic 0x745500

#org @start
lockall
msgbox @1 0x6
special 0x113
applymovement 0x7F @move
waitmovement 0x0
setvar 0x7002 0x1
msgbox @2 0x6
msgbox @string1 0x6
msgbox @string3 0x6
applymovement 0x2 @3
applymovement 0x3 @4
applymovement 0x5 @5
applymovement 0x7 @6
applymovement 0x8 @7 
applymovement 0x9 @8
waitmovement 0x0
hidesprite 0x3
hidesprite 0x2 
hidesprite 0x5
hidesprite 0x7
hidesprite 0x8
hidesprite 0x9
applymovement 0x7F @9
waitmovement 0x0
special 0x114
setflag 0x1005
releaseall
end

#org @1
= Mom: Help!!!!

#org @move
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0xFE

#org @2
= Mom: Somebody please help me!

#org @string1
= Grunt 1: Stop screaming, we run\nthis city so no one can help you.

#org @string3
= Grunt 2: Alright everyone, let's\nmove out.\pThe boss wants us to be in Yann\nTown in a couple of hours.\pGrunts: Yes sir!

#org @3
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0xFE

#org @4
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0xFE

#org @5
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0xFE

#org @6
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0xFE

#org @7
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0xFE

#org @8
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0xFE

#org @9
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0xFE
 

Bolens

Soul Hacker
359
Posts
14
Years
  • Age 30
  • PA
  • Seen Aug 22, 2016
Huh, I split up @2 into separate strings and now it compiles perfectly. I really dunno why, but here you go:

Code:
#dynamic 0x745500

#org @start
lockall
msgbox @1 0x6
special 0x113
applymovement 0x7F @move
waitmovement 0x0
setvar 0x7002 0x1
msgbox @2 0x6
msgbox @string1 0x6
msgbox @string3 0x6
applymovement 0x2 @3
applymovement 0x3 @4
applymovement 0x5 @5
applymovement 0x7 @6
applymovement 0x8 @7 
applymovement 0x9 @8
waitmovement 0x0
hidesprite 0x3
hidesprite 0x2 
hidesprite 0x5
hidesprite 0x7
hidesprite 0x8
hidesprite 0x9
applymovement 0x7F @9
waitmovement 0x0
special 0x114
setflag 0x1005
releaseall
end

#org @1
= Mom: Help!!!!

#org @move
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0xFE

#org @2
= Mom: Somebody please help me!

#org @string1
= Grunt 1: Stop screaming, we run\nthis city so no one can help you.

#org @string3
= Grunt 2: Alright everyone, let's\nmove out.\pThe boss wants us to be in Yann\nTown in a couple of hours.\pGrunts: Yes sir!

#org @3
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0xFE

#org @4
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0xFE

#org @5
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0xFE

#org @6
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0xFE

#org @7
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0xFE

#org @8
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0xFE

#org @9
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0x13
#raw 0xFE

Thanks so much! :) It is weird why XSE can be stubborn sometimes, many thanks.
 

Crocky

SuperScarlet!
97
Posts
15
Years
  • Seen Jul 23, 2020
I wanted to add headbutt trees to my hack, and I found this script by google. It works until after you use headbutt, then the game just doesn't allow you to move, like it's missing somthing. How can this be fixed and actually produce a headbutt encounter?

Spoiler:
 

karatekid552

What happens if I push it?....
1,771
Posts
11
Years
I think the offsets line up right, and im sure of the script. But the spriteface script doesn't work.
Spoiler:

It is perfect (except the image looks like it is setting flag 0x001 on the last line instead of 0x801, just an image problem I hope.) The only thing I can think of is you are not starting a new game when you test your script. This script will only run on a completely brand new game start because the variable is changed as soon as the game starts preventing the map script from running again.
 
5,256
Posts
16
Years
I wanted to add headbutt trees to my hack, and I found this script by google. It works until after you use headbutt, then the game just doesn't allow you to move, like it's missing somthing. How can this be fixed and actually produce a headbutt encounter?

Spoiler:
It says to go to 0x1be06f, but that might be corrupt in you ROM. Here's what the script meant to say:

Code:
#dynamic 0x800000

#org @headbutt
checkattack 0x1D
compare 0x800D 0x06
if 0x1 jump @could
setanimation 0x00 0x800D
bufferpartypokemon 0x00 0x800D
bufferattack 0x01 0x1D
message @question MSG_YESNO
compare 0x800D 0x00
if 0x1 jump @end
message @used MSG_NORMAL
closeonkeypress
doanimation 0x25
waitstate
goto @snippet2

#org @could
message @you MSG_NORMAL
release
end

#org @end
release
end

#org @question
= This tree could have a Pokemon\nin it. Use HEADBUTT?

#org @used
= [buffer1] used [buffer2]!

#org @you
= This tree could be HEADBUTTed!

#org @snippet2
applymovement LASTTALKED @move1
waitmovement 0x0
hidesprite LASTTALKED
special 0xAB
compare LASTRESULT 0x0
if 0x1 goto @snippet2
waitstate
releaseall
end

//---------------
#org @snippet2
releaseall
end


//-----------
// Movements
//-----------
#org @move1
#raw 0x68 //mov68
#raw 0xFE //End of Movements
 
Status
Not open for further replies.
Back
Top