Script Help Thread (DO NOT REQUEST SCRIPTS) Page 221

Started by HackMew December 20th, 2008 5:10 AM
  • 625760 views
  • 9682 replies
Male
Tartarus; come visit me some time! :)
Seen June 21st, 2013
Posted September 8th, 2011
58 posts
12.1 Years
Okay, I'm still trying to figure out how to do this. I just tried to change the scripts, FireRed, so that instead of Oak appearing just before you enter the grass on Route One, he appears the moment you set foot on the second row grass tiles. Now when I set foot on the grass Oak appears, but he's invisible and when I enter the lab it's from the back of the building.

I tried to alter the script on XSE but it's like I can't save any changes to the actual script, what am I doing wrong? Please help.
just move the script in the events view (in advance map, after you have opened the map) to where you want the same script to happen.

Edit: make sure to just change the movements so that prof. oak doesn't walk into trees lol. You need to write down the movement using raw, which is the following (this shows what kind of movement each raw represents):

#raw 0x0 = Face Down
#raw 0x1 = Face Up
#raw 0x2 = Face Left
#raw 0x3 = Face Right
#raw 0x4 = Face Down (Faster)
#raw 0x5 = Face Up (Faster)
#raw 0x6 = Face Left (Faster)
#raw 0x7 = Face Right (Faster)
#raw 0x8 = Step Down (Very Slow)
#raw 0x9 = Step Up (Very Slow)
#raw 0xA = Step Left (Very Slow)
#raw 0xB = Step Right (Very Slow)
#raw 0xC = Step Down (Slow)
#raw 0xD = Step Up (Slow)
#raw 0xE = Step Left (Slow)
#raw 0xF = Step Right (Slow)
#raw 0x10 = Step Down (Normal)
#raw 0x11 = Step Up (Normal)
#raw 0x12 = Step Left (Normal)
#raw 0x13 = Step Right (Normal)
#raw 0x14 = Jump2 Down
#raw 0x15 = Jump2 Up
#raw 0x16 = Jump2 Left
#raw 0x17 = Jump2 Right
#raw 0x18 = Delay1
#raw 0x19 = Delay2
#raw 0x1A = Delay3
#raw 0x1B = Delay4
#raw 0x1C = Delay5
#raw 0x1D = Step Down (Fast)
#raw 0x1E = Step Up (Fast)
#raw 0x1F = Step Left (Fast)
#raw 0x20 = Step Right (Fast)
#raw 0x21 = Step on the Spot Down (Normal)
#raw 0x22 = Step on the Spot Up (Normal)
#raw 0x23 = Step on the Spot Left (Normal)
#raw 0x24 = Step on the Spot Right (Normal)
#raw 0x25 = Step on the Spot Down (Faster)
#raw 0x26 = Step on the Spot Up (Faster)
#raw 0x27 = Step on the Spot Left (Faster)
#raw 0x28 = Step on the Spot Right (Faster)
#raw 0x29 = Step on the Spot Down (Fastest)
#raw 0x2A = Step on the Spot Up (Fastest)
#raw 0x2B = Step on the Spot Left (Fastest)
#raw 0x2C = Step on the Spot Right (Fastest)
#raw 0x2D = Face Down (Delayed)
#raw 0x2E = Face Up (Delayed)
#raw 0x2F = Face Left (Delayed)
#raw 0x30 = Face Right (Delayed)
#raw 0x31 = Slide Down (Slow)
#raw 0x32 = Slide Up (Slow)
#raw 0x33 = Slide Left (Slow)
#raw 0x34 = Slide Right (Slow)
#raw 0x35 = Slide Down (Normal)
#raw 0x36 = Slide Up (Normal)
#raw 0x37 = Slide Left (Normal)
#raw 0x38 = Slide Right (Normal)
#raw 0x39 = Slide Down (Fast)
#raw 0x3A = Slide Up (Fast)
#raw 0x3B = Slide Left (Fast)
#raw 0x3C = Slide Right (Fast)
#raw 0x3D = Slide Running on Right Foot (Down)
#raw 0x3E = Slide Running on Right Foot (Up)
#raw 0x3F = Slide Running on Right Foot (Left)
#raw 0x40 = Slide Running on Right Foot (Right)
#raw 0x41 = Slide Running on Left Foot (Down)
#raw 0x42 = Slide Running on Left Foot (Up)
#raw 0x43 = Slide Running on Left Foot (Left)
#raw 0x44 = Slide Running on Left Foot (Right)
#raw 0x46 = Jump Facing Left (Down)
#raw 0x47 = Jump Facing Down (Up)
#raw 0x48 = Jump Facing Up (Left)
#raw 0x49 = Jump Facing Left (Right)
#raw 0x4A = Face Player
#raw 0x4B = Face Against Player
#raw 0x4C = Lock Sprite Facing
#raw 0x4D = Release Sprite Facing
#raw 0x4E = Jump Down
#raw 0x4F = Jump Up
#raw 0x50 = Jump Left
#raw 0x51 = Jump Right
#raw 0x52 = Jump in Place (Facing Down)
#raw 0x53 = Jump in Place (Facing Up)
#raw 0x54 = Jump in Place (Facing Left)
#raw 0x55 = Jump in Place (Facing Right)
#raw 0x56 = Jump in Place (Facing Down/Up)
#raw 0x57 = Jump in Place (Facing Up/Down)
#raw 0x58 = Jump in Place (Facing Left/Right)
#raw 0x59 = Jump in Place (Facing Right/Left)
#raw 0x60 = Hide Sprite
#raw 0x61 = Show Sprite
#raw 0x62 = Exclamation Mark (!)
#raw 0x63 = Question Mark (?)
#raw 0x64 = Cross (X)
#raw 0x65 = Double Exclamation Mark (!!)
#raw 0x66 = Happy (^_^)
#raw 0xFE = End of Movements

colcolstyles

Yours truly

Male
The Bay Area
Seen May 18th, 2019
Posted August 13th, 2012
1,588 posts
15 Years
What I'm trying to do is; there is a lapras in the seashore that when you talk to it asks if you want to use surf, if yes, it changes your overworld to a custom lapras sprite (with player ontop), and when you reach another part of another city it dismounts you.

So, how would I change the player's sprite to another one temporary?
Just create an OW and keep it hidden until you want the player's sprite to change. Then hide the player and show the previously hidden sprite and move the OW & the player at the same time (so that the camera keeps up with the OW). Hopefully that makes sense.

Brother of Vrai

Complans

Trainer

Seen August 27th, 2015
Posted April 11th, 2011
98 posts
13.1 Years
Just create an OW and keep it hidden until you want the player's sprite to change. Then hide the player and show the previously hidden sprite and move the OW & the player at the same time (so that the camera keeps up with the OW). Hopefully that makes sense.
But I want the player to have control of the player, so that's why I need the OW to change..
Male
Tartarus; come visit me some time! :)
Seen June 21st, 2013
Posted September 8th, 2011
58 posts
12.1 Years
I'm not sure there is such a script but try to find an NPC which at some point follows the player. If you decompile the NPC's script just have a look and try to figure out what makes the NPC follow the player, but then adjust the movements so that the NPC is instead ontop of the player (of course hide the player). I find stealing the scripts that already exist ingame the best way to go xD

colcolstyles

Yours truly

Male
The Bay Area
Seen May 18th, 2019
Posted August 13th, 2012
1,588 posts
15 Years
But I want the player to have control of the player, so that's why I need the OW to change..
Oh, like surfing. Well, then just replace the default surfing sprite (looks kinda like a Wailmer) with a Lapras. That won't even require scripting.

Brother of Vrai
Calgary, AB
Seen April 10th, 2012
Posted April 8th, 2012
23 posts
15.8 Years
Ok I've kinda given up on my Snorlax spript becasue it's unimportant but I need your help on this script.

It is a Pokeball that is supposed to give you a Poliwhirl and then disappear but when I try it I get the Poliwhirl but it won't disappear. I have the Person ID set to 1201 and the Person Event # is 1 but it still won't work. Can you help meh?

#org $script
lock
message $poliwhirl
$poliwhirl 1 = Oh!\nHere is my POLIWHIRL.
boxset 6
pause 0x10
message $gotpoliwhirl
$gotpoliwhirl 1 = \v\h01 picked up his POLIWHIRL.
boxset 4
givepokemon 61 5 0x00
setflag 0x828
fadescreen 1
removesprite 1 
setflag 0x1201
setvar 0x6000 0x01
pause 0x10
fadescreen 0
release
end
Also there is the code to stop someone from leaving the area applied to two script boxes that is supposed to stop the player and tell them they forgot their Poliwhirl but it won't stop the player (it seems every script I make doesn't work). This the reason for the setvar in the above script.

#org $forgot
jingle
message $youforgot
applymovement 1 $move
$move 1 ; #binary 0x62 0xFE
pausemove 0x0000
$youforgot 1 = Oops!\nI forgot my POLIWHIRL on the\ltable.
applymovemont 1 $move2
$move2 1 ; #binary 0x10 0xFE
pausemove 0x0000
release
end
Thanks in advance!
I'd appreciate if you could find out what's wrong with my scripts.

colcolstyles

Yours truly

Male
The Bay Area
Seen May 18th, 2019
Posted August 13th, 2012
1,588 posts
15 Years
I'd appreciate if you could find out what's wrong with my scripts.
Are you using Pokescript? Because I don't think there is support for the "hidesprite" / "removesprite" command in Pokescript. You'll have to switch to XSE or PKSV or use a "#raw".

Brother of Vrai
Male
Seen August 17th, 2016
Posted May 9th, 2015
673 posts
14.2 Years
What I'm trying to do is; there is a lapras in the seashore that when you talk to it asks if you want to use surf, if yes, it changes your overworld to a custom lapras sprite (with player ontop), and when you reach another part of another city it dismounts you.

So, how would I change the player's sprite to another one temporary?
If you're using Fire Red, you can use JPAN's hacked engine - it has a feature that changes the player's sprites. You'd have to remove the raft from the game and insert an extra surfing sprite with the player on top of Lapras, then activate the special for changing the surf OW, then activate the special for the surfing animation.
Male
Seen January 14th, 2022
Posted January 10th, 2014
63 posts
12.6 Years
...like legendaries, for example...
This is how I did it. I've made an event for catching Entei in my hack.
Please note it's XSE, not PKSV.
5BB is the ID# of the event. A single "clearflag 0x5BB" is in a level script, allowing it to appear (once) as soon as the player enters the map. It won't disappear until he interacts with event.
Only "problem" is that the you only have one chance to catch it. Even if you wipe, if you save after it, you don't have another chance. (something not likely to happen, but still...)
Spoiler:
#include stditems.rbh
#include stdpoke.rbh

'---------------
#org @start
lock
faceplayer
checksound
cry PKMN_ENTEI 0x2
pause 0x28
waitcry
setwildbattle PKMN_ENTEI 0x46 ITEM_SALACBERRY
setflag 0x8C1
special 0x13A
waitstate
clearflag 0x8C1
special2 LASTRESULT 0xB7
compare LASTRESULT 0x1
if 0x1 goto @snippet1
compare LASTRESULT 0x7
if 0x1 goto @snippet1
compare LASTRESULT 0x2
if 0x1 goto @snippet2
compare LASTRESULT 0x5
if 0x1 goto @snippet2
setflag 0x5BB
release
end

'---------------
#org @snippet1
setflag 0x5BB
goto @snippet3

'---------------
#org @snippet2
setvar 0x8004 0xF4
goto @snippet4

'---------------
#org @snippet3
fadescreen3 0x1
hidesprite LASTTALKED
fadescreen3 0x0
release
end

'---------------
#org @snippet4
fadescreen3 0x1
hidesprite LASTTALKED
fadescreen3 0x0
bufferpokemon 0x0 0x8004
msgbox @string1 MSG_KEEPOPEN '"The [buffer1] flew away!"
release
end


'---------
' Strings
'---------
#org @string1
= The [buffer1] flew away!


Simple, yet effective - and you don't need to set an additional flag
If I shouldn't be doing it this way, tell me so.
Male
Seen May 5th, 2013
Posted June 25th, 2011
10 posts
12.1 Years
i've done a script that should implement the mew event in fire red using xse,
the script almost work, after the fight he's espected to disappear, and he does, but when i move from my current position he just pop back re-enabling the event... can someone plz tell me what i'm doing wrong???

Spoiler:
'---------------
#org 0x71ABEA
special 0x187
compare LASTRESULT 0x2
if 0x1 goto 0x871AC48
special 0x188
lock
faceplayer
checksound
cry 0x97 0x2
waitcry
pause 0x14
playsong 0x156 0x27
setwildbattle 0x97 0x46 0xD6
setflag 0x7
special 0x138
waitstate
clearflag 0x7
special2 LASTRESULT 0xB4
compare LASTRESULT 0x1
if 0x1 goto 0x871AC4B
compare LASTRESULT 0x4
if 0x1 goto 0x871AC54
compare LASTRESULT 0x5
if 0x1 goto 0x871AC54
setflag 0x9
release
end

'---------------
#org 0x71AC48
setflag 0x9
release
end

'---------------
#org 0x71AC4B
setflag 0x9
goto 0x871AC5F

'---------------
#org 0x71AC54
setvar 0x8004 0x97
goto 0x871AC69

'---------------
#org 0x71AC5F
fadescreen 0x1
hidesprite LASTTALKED
fadescreen 0x0
release
end

'---------------
#org 0x71AC69
fadescreen 0x1
hidesprite LASTTALKED
fadescreen 0x0
bufferpokemon 0x0 0x8004
msgbox 0x871AC7F MSG_KEEPOPEN '"The [buffer1] flew away!"
setflag 0x9
release
end


'---------
' Strings
'---------
#org 0x71AC7F
= The [buffer1] flew away!

colcolstyles

Yours truly

Male
The Bay Area
Seen May 18th, 2019
Posted August 13th, 2012
1,588 posts
15 Years
No, it's not the proper Surf, it's way before the player obtains Surf. It's just a "special" time the player gets to surf as part of a quest.
Then just create a script with a 'special 0x161' in there. That will make the play start surfing temporarily, even if they don't have HM Surf or the badge required for it. But if you want the Lapras to only appear then, that will require ASM.

Brother of Vrai
Male
Seen January 14th, 2022
Posted January 10th, 2014
63 posts
12.6 Years
i've done a script that should implement the mew event in fire red using xse,
the script almost work, after the fight he's espected to disappear, and he does, but when i move from my current position he just pop back re-enabling the event... can someone plz tell me what i'm doing wrong???

Spoiler:
'---------------
#org 0x71ABEA
special 0x187
compare LASTRESULT 0x2
if 0x1 goto 0x871AC48
special 0x188
lock
faceplayer
checksound
cry 0x97 0x2
waitcry
pause 0x14
playsong 0x156 0x27
setwildbattle 0x97 0x46 0xD6
setflag 0x7
special 0x138
waitstate
clearflag 0x7
special2 LASTRESULT 0xB4
compare LASTRESULT 0x1
if 0x1 goto 0x871AC4B
compare LASTRESULT 0x4
if 0x1 goto 0x871AC54
compare LASTRESULT 0x5
if 0x1 goto 0x871AC54
compare LASTRESULT 0x7
if 0x1 goto 0x871AC4B
setflag 0x9
release
end

'---------------
#org 0x71AC48
setflag 0x9
release
end

'---------------
#org 0x71AC4B
setflag 0x9
goto 0x871AC5F

'---------------
#org 0x71AC54
setvar 0x8004 0x97
goto 0x871AC69

'---------------
#org 0x71AC5F
fadescreen 0x1
hidesprite LASTTALKED
fadescreen 0x0
release
end

'---------------
#org 0x71AC69
fadescreen 0x1
hidesprite LASTTALKED
fadescreen 0x0
bufferpokemon 0x0 0x8004
msgbox 0x871AC7F MSG_KEEPOPEN '"The [buffer1] flew away!"
setflag 0x9
release
end


'---------
' Strings
'---------
#org 0x71AC7F
= The [buffer1] flew away!
Edited in bold; check if it works now.

Complans

Trainer

Seen August 27th, 2015
Posted April 11th, 2011
98 posts
13.1 Years
Then just create a script with a 'special 0x161' in there. That will make the play start surfing temporarily, even if they don't have HM Surf or the badge required for it. But if you want the Lapras to only appear then, that will require ASM.
Ah, okay. Thanks! Does the special make the music change to surfing music?

colcolstyles

Yours truly

Male
The Bay Area
Seen May 18th, 2019
Posted August 13th, 2012
1,588 posts
15 Years
Ah, okay. Thanks! Does the special make the music change to surfing music?
It doesn't seem like it does. You'll have to figure out the value for the surfing music and use a 'playsong' to get the music.

Brother of Vrai
Male
Seen January 14th, 2022
Posted January 10th, 2014
63 posts
12.6 Years
unfortunately.... nope :(
I hope you have a level script in the same map, tied with the flags you made on this script. You can check the ones in the original Mew event for an example.

Also, be aware that the flags are also tied with the ID Number of the object in A-Map [I can see only the flag 0x9 referring to Mew in your script, check if the Mew object has the ID # of "0009". Otherwise, you're setting a flag that has nothing to do with the event, being it pointless]
Male
Seen January 8th, 2012
Posted January 8th, 2012
69 posts
12.8 Years
i am using the same pokemon centers for my game i used the hacked engine for my game which i think deletes all scripts in the game because the original joys arn't there i make nurse joys and copy the original scripts to my pokemon centers in my hack yet the pokemon centers still do not work they will heal but when you run out of usable pokemon you dont go to the last pokemon center for two of them only one of them works any ideas?
Calgary, AB
Seen April 10th, 2012
Posted April 8th, 2012
23 posts
15.8 Years
I got my script that gives the player the Poliwhirl working but the script that tells the player that they forgot the Poliwhirl isn't. The player is just walking through the script box stopping for about half a second then nothing happens.

Heres the script in PKSV if you want it.

 
#org 0x880084D
'-----------------------------------
lockall
msgbox 0x880087C ' Oops!\nI forgot my P...
applymovement 0x1 0x880087A ' say_! end
pauseevent 0x0
cleartrainerflag 0x7070
release
addpokemon 0x6F6D 118 0x6D65 0x6F 0x3120746E 0x6F6D2420
hidepokepic
spritebehave 0x2032 0x51
nop0 ' #raw 0x0
nop0 ' #raw 0x0
release
end


#org 0x880087C
= Oops!\nI forgot my POLIWHIRL on the\ltable.

#org 0x880087A
M say_! end

deoxys121

White Kyurem Cometh

Age 31
Male
Flat Rock, MI, United States
Seen September 25th, 2016
Posted May 27th, 2012
1,254 posts
12.4 Years
I found out how to create a script that will give you the National Pokedex. And it works. It's all thanks to this YouTube video:



Here's the script I came up with from this video I found. I take no credit for writing the script, I'm simply sharing it to help fellow hackers.

#org 0x<offset>
lock
faceplayer
checkflag 0x<flag>
writebytetooffset 0x2 0x2026B00
writebytetooffset 0x3 0x2026B01
writebytetooffset 0xDA 0x2024EBE
writebytetooffset 0x67 0x2026A5A
clearflag 0x<flag>
release
end
Male
Seen July 16th, 2016
Posted August 5th, 2014
559 posts
13.3 Years
i am using the same pokemon centers for my game i used the hacked engine for my game which i think deletes all scripts in the game because the original joys arn't there i make nurse joys and copy the original scripts to my pokemon centers in my hack yet the pokemon centers still do not work they will heal but when you run out of usable pokemon you dont go to the last pokemon center for two of them only one of them works any ideas?
I'm not entirely sure, as I have yet to experiment with that type of thing, but I believe it has something to do with the "sethealingplace" command, if there is one. You might want to try looking over that area in the readme tutorial or whatever it was that came with the engine.

destinedjagold

You can contact me in PC's discord server...

Age 32
Male
Seen 3 Days Ago
Posted March 24th, 2023
8,579 posts
16 Years
i am using the same pokemon centers for my game i used the hacked engine for my game which i think deletes all scripts in the game because the original joys arn't there i make nurse joys and copy the original scripts to my pokemon centers in my hack yet the pokemon centers still do not work they will heal but when you run out of usable pokemon you dont go to the last pokemon center for two of them only one of them works any ideas?
As TheNoobHacker mentioned, you must have activated only one sethealing place. You know, those 'F' tiles on every town. Those are flight positions where you'll appear if you fly to the place, or if you got white out.

Male
Seen January 8th, 2012
Posted January 8th, 2012
69 posts
12.8 Years

As TheNoobHacker mentioned, you must have activated only one sethealing place. You know, those 'F' tiles on every town. Those are flight positions where you'll appear if you fly to the place, or if you got white out.
very informative for a newbie (my thing still says im a newb too lolz) but yeah i saw in research and developement that its sethealing place in the map script yet two of my pokemon centers will not work :\

what relevence do the flight position exactly have?