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

SKRoy

Pokémon Hacker
66
Posts
14
Years
  • Age 27
  • Seen Feb 8, 2016


Try this...
Code:
#dynamic 0x800000  

#org @start 
lock 
faceplayer 
cry 0x6 0x0 
msgbox @1 0x6 
wildbattle 0x6 0x1E 0x8B 
hidesprite lasttalked
fadescreen 0x0 
setflag 0x200 
release 
end  

#org @1 
= CHARIZARD: Raaarrgghh!
Also, just for safety of your hack, use the flags 1000 and above. 200 isn't really a safe flag to use, at least, in Ruby...

Some proof that it works...
Spoiler:

Thanks, but I forgot to say that it's for Pokémon FireRed...
When I do it with the program PokéTronic it works, but than I don't know how I must set the flags.
 
Last edited:
275
Posts
13
Years
  • Seen Oct 9, 2019
Thanks, but I forgot to say that it's for Pokémon FireRed...
My signature has a link to a list of every flag in FireRed and what it's used for. If you remove all of the default Nintendo scripts for a particular flag, then that flag will be safe to use in your custom scripts.
 
16
Posts
13
Years
  • Seen Aug 7, 2016
Hello.

I'm having trouble with using "special 0x110" of XSE, which saves the hall of fame and plays the ending in FireRed.

Whenever my script ends, the PLAYER ends up in front of the Pokemon League Building, located in map bank 3, map 9 of Advance Map.

I've tried adding warp command in front of the special 0x110, but the game still sends the PLAYER to (3,9).

Any help is greatly appreciated.

Thanks.
 

SKRoy

Pokémon Hacker
66
Posts
14
Years
  • Age 27
  • Seen Feb 8, 2016
My signature has a link to a list of every flag in FireRed and what it's used for. If you remove all of the default Nintendo scripts for a particular flag, then that flag will be safe to use in your custom scripts.

Thanks, but I still don't know what's wrong with this script:

#dynamic 0x800000
#org @start
lock
faceplayer
msgbox @1 0x6
cry 0x6 0x0
wildbattle 0x6 0x1E 0x8B
fadescreen 0x1
fadescreen 0x0
hidesprite 0x800F
setflag 0x200
release
end

#org @1
= CHARIZARD: Raaarrgghh!

It's for Fire Red, but in XSE I got the error that Wildbattle 0x6 0x1E 0x8B is incorrect. Please help!
 
27
Posts
12
Years
I'm having problems with a script that is supposed to not let you pass until speaking to professor oak. Unfortunately, it just freezes your sprite and you can't move.
Here goes:

#dyn 0x740000
#org @start
compare 0x8001
if == jump @pass
msgbox @talk
callstd MSG_LOCK
applymovement PLAYER @walk
pauseevent 0x0
end

#org @pass
end

#org @talk
= I should get a pokemon before\ngoing out there[.]

#org @walk
M walk_down end
 
Last edited:

Roboto-kun

is an Ace Trainer.
10
Posts
12
Years
  • Seen Nov 30, 2012
I'm having problems with a script that is supposed to not let you pass until speaking to professor oak. Unfortunately, it just freezes your sprite and you can't move.
Here goes:

#dyn 0x740000
#org @start
compare 0x8001
if == jump @pass
msgbox @talk
callstd MSG_LOCK
applymovement PLAYER @walk
pauseevent 0x0
end

#org @pass
end

#org @talk
= I should get a pokemon before\ngoing out there[.]

#org @walk
M walk_down end

Are you using PKSV? If that's the case, then I'll be able to help. Replace "compare" with "checkflag." So your script now looks likes this:

Spoiler:


Dunno if it's the same with XSE.
 

Satoshi Ookami

Memento Mori
14,254
Posts
15
Years
Are you using PKSV? If that's the case, then I'll be able to help. Replace "compare" with "checkflag." So your script now looks likes this:

Spoiler:


Dunno if it's the same with XSE.
I can say for sure it is not same as XSE's style since XSE does not use "==" ;)
 

Ghost

[b][color=orange]ツ[/color][color=teal][i]In the Ma
742
Posts
16
Years
Hello, I'm having minor difficulties with a "special/healing pokemon" script. Everything works fine, it's just that the nurse doesn't put an actual "pokeball" on the healing machine. Thanks, if anyone could assist me.

Code:
#dynamic 0x800000

#org @start
lock
faceplayer
msgbox @10 0x5
applymovement 0x1 @nursing
pause 0x35
fadescreen 0x1
fanfare 0x100
special 0x0
waitfanfare
fadescreen 0x0
applymovement 0x1 @done
closeonkeypress
msgbox @11 0x6
release
end

#org @nursing
#raw 0x3
#raw 0x13
#raw 0x2E
#raw 0x2E
#raw 0x12 
#raw 0x2
#raw 0xFE

#org @done
#raw 0x2
#raw 0x4
#raw 0xFE

#org @10
= What wonderful Pokèmon you\nhave there!\pThey look like\nthey could use a long rest.

#org @11
= Now they look better!\nDon't forget to visit!
 

Truality

Left for good
1,006
Posts
12
Years
  • Age 32
  • Seen May 17, 2013
WHISBII, you're missing these commands (supposing they apply to every 'healing machine' tile):

Code:
doanimation 0x19
checkanimation 0x19
I assume you would add them after the @nursing move ends. Also, wouldn't it be better if you used a waitmovement 0x0 instead of a pause?
 

Ghost

[b][color=orange]ツ[/color][color=teal][i]In the Ma
742
Posts
16
Years
WHISBII, you're missing these commands (supposing they apply to every 'healing machine' tile):

Code:
doanimation 0x19
checkanimation 0x19
I assume you would add them after the @nursing move ends. Also, wouldn't it be better if you used a waitmovement 0x0 instead of a pause?
Waitmovement wasn't working. I'm not exactly sure why? I played it through and it still looks good.

Thanks.
 
5
Posts
12
Years
  • Seen Jul 23, 2014
I have pksv and am trying to make a script where the player is given an item after the person speaks. I can get them to speak but how do I put the additem into the script?
This is what I have

#dynamic 0x74000
#org @main
message @text
callstd 2
end

#org @text
= Hey \v\h01! I hope this will help you.

additem greatball 1
 

AustinWolff

has left
100
Posts
12
Years
I have pksv and am trying to make a script where the player is given an item after the person speaks. I can get them to speak but how do I put the additem into the script?
This is what I have

#dynamic 0x74000
#org @main
message @text
callstd 2
end

#org @text
= Hey \v\h01! I hope this will help you.

additem greatball 1

Spoiler:
 

Ghost

[b][color=orange]ツ[/color][color=teal][i]In the Ma
742
Posts
16
Years
Here is another script I got stuck on. The script is supposed to check if you dont already have the item, then give it to you. Once that's done the movement, etc happens.

I believe most of it is right. However, when I step on the "Script" set on the ground, not on a character it freezes. No dialogue, nothing?

#dynamic 0x800000

#org @start
lock
faceplayer
applymovement 0x1 @miner
compare 0xD2 0x0
if 0x0 goto @obtained
msgbox @done 0x6
release
end

#org @obtained
msgbox @what 0x6
fanfare 0x100
giveitem 0xD2 0x1 MSG_OBTAIN
waitfanfare
msgbox @1 0x6
applymovement 0xFF @player
applymovement 0x1 @later
hidesprite 0x1
setflag 0x1
release
end

#org @miner
#raw 0x1E
#raw 0x1E
#raw 0x1E
#raw 0x1E
#raw 0x1E
#raw 0x6
#raw 0x65
#raw 0xFE

#org @player
#raw 0x55
#raw 0x3B
#raw 0xFE

#org @later
#raw 0x1F
#raw 0x1E
#raw 0x1E
#raw 0xFE

#org @what
= What are you doing kid!? \p[Player] I need to get through this cave. \nBefore you go inside, you should have lthis.

#org @done
= It seems you already have a hammer. \nBest of luck to you on your \padventure.

#org @1
= Professor is on the ocean.
 

Binary

え?
3,977
Posts
16
Years
  • Age 29
  • Seen Apr 7, 2014
Here is another script I got stuck on. The script is supposed to check if you dont already have the item, then give it to you. Once that's done the movement, etc happens.

I believe most of it is right. However, when I step on the "Script" set on the ground, not on a character it freezes. No dialogue, nothing?

Shouldn't there be a waitmovement 0x0 after applymovement 0x1 @miner?And I think it would be better to check if the player has the item in which case the script would be directed to another offset containing the @done msgbox, or if the player doesn't have it, the script would just continue after checking for the item. And I'm assuming the compare 0xD2 0x0 checks for the item?
 

colcolstyles

Yours truly
1,588
Posts
15
Years
the command is giveitem 0x? 0x? 0x0

the first 0x? is the item you are giving. it has to be in hex, and there is a list of the items hex number somewhere (just google it) but for great ball, I think it is 0x3. the second 0x? is the amount you want to give the item. in your case its 0x1. if you want to give 10, it has to be in hex, which would be 0xA. the last 0x0 is a buffer. so your script would look like this:

Spoiler:


the check flags and set flags stop the event from happening again. there are numerous tutorials if you want to know more.

The third parameter is not a buffer. It determines the text that is displayed. The options (MSG_OBTAIN and MSG_FIND) will display something along the lines of "PLAYER obtained/found a ITEM" depending on which value is used. Also, you should just insert a "#include stditems.rbh" statement at the beginning and use "ITEM_GREATBALL" instead of using the hex code. It's more readable that way. Finally, the parameters don't have to be in hex to work.

Here is another script I got stuck on. The script is supposed to check if you dont already have the item, then give it to you. Once that's done the movement, etc happens.

I believe most of it is right. However, when I step on the "Script" set on the ground, not on a character it freezes. No dialogue, nothing?

Spoiler:

If the game is freezing it's most likely because of an error with the event data and not the script itself. Also, you're currently comparing the value of variable 0xd2 to zero. What you're trying to do is check if the player has item 0xd2. You do that by using "checkitem 0xd2 1" followed by "compare LASTRESULT B_TRUE" and "if B_TRUE goto/call @script" (although I would recommend using a symbol like "ITEM_X" instead of a hex number).
 

AustinWolff

has left
100
Posts
12
Years
The third parameter is not a buffer. It determines the text that is displayed. The options (MSG_OBTAIN and MSG_FIND) will display something along the lines of "PLAYER obtained/found a ITEM" depending on which value is used. Also, you should just insert a "#include stditems.rbh" statement at the beginning and use "ITEM_GREATBALL" instead of using the hex code. It's more readable that way. Finally, the parameters don't have to be in hex to work.

really? cool! so what you're saying is you could just do this is in a script?
Spoiler:
 

colcolstyles

Yours truly
1,588
Posts
15
Years
really? cool! so what you're saying is you could just do this is in a script?
Spoiler:

Yup, as long as you use the "#include" preprocessing directive with "stditems.rbh". Also, you can just use "1" instead of "0x1" if you want.
 

AustinWolff

has left
100
Posts
12
Years
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:
 

The Void

hiiiii
1,416
Posts
13
Years
I have pksv and am trying to make a script where the player is given an item after the person speaks. I can get them to speak but how do I put the additem into the script?
This is what I have

#dynamic 0x74000
#org @main
message @text
callstd 2
end

#org @text
= Hey \v\h01! I hope this will help you.

additem greatball 1

Finally, someone who uses PKSV -.-

Anyway, construct it like this:

Code:
#dyn 0x740000
#org @main
lock
faceplayer
message @give
callstd MSG_NORMAL
additem GREATBALL 1
release
end

#org @give
= Hey \v\h01!\nI hope this will help you.

At least that's the basic way of writing it. However, the problem with this is that there are no flags, meaning if you talk to the guy again, he will just give you the same thing over and over. To fix this, flags will be needed. Follow this script:

Code:
[FONT="Courier New"]#dyn 0x740000
#org @main
lock
faceplayer
checkflag 0x200
if == jump @haveit
message @talk
callstd MSG_YESNO 
compare LASTRESULT YES
if == jump @pushedyes
jump @pushedno

#org @haveit
message @howsit
callstd MSG_NORMAL
release
end

#org @pushedyes
setflag 0x200
additem GREATBALL 1
message @take
callstd MSG_NORMAL
release
end

#org @pushedno
message @notake
callstd MSG_NORMAL
release
end

#org @talk
= Here, \v\h01.\nTake this GREAT BALL.

#org @howsit
= Have you used it yet?

#org @take
= I hope it will help you.

#org @notake
= Okay, but this is your loss.[/FONT]

If you are just starting out to script using PKSV, then I suggest reading this guide. Once you're done with that, you can go to more advanced lessons like the one I made here.

I'm having problems with a script that is supposed to not let you pass until speaking to professor oak. Unfortunately, it just freezes your sprite and you can't move.
Here goes:

#dyn 0x740000
#org @start
compare 0x8001
if == jump @pass
msgbox @talk
callstd MSG_LOCK
applymovement PLAYER @walk
pauseevent 0x0
end

#org @pass
end

#org @talk
= I should get a pokemon before\ngoing out there[.]

#org @walk
M walk_down end

Your script is okay; nothing wrong there. However, you probably forgot to set the var number of the green script tile you set for the player (in A-Map). Try setting it to something like 6001 then set the Unknown to 03. Then see if it works.
 
Last edited:
Status
Not open for further replies.
Back
Top