Script Help Thread (DO NOT REQUEST SCRIPTS) Page 232

Started by HackMew December 20th, 2008 5:10 AM
  • 625760 views
  • 9682 replies
Male
Seen July 12th, 2012
Posted November 27th, 2011
43 posts
12 Years
Hello everybody.

I was playtesting my FireRed hack when I noticed that the first Gym Leader battle has none of the special Gym effects (no mugshots, no special battle music, etc) and is treated as a normal trainer battle. However, the scripts for the leader talking still work fine, and the badge-obtained music still plays (a little delayed, but that might just be the ROM). I have the script in hide tags below.
Spoiler:
'---------------
#org 0x16A593
setvar 0x8004 0x2
setvar 0x8005 0x2
special 0x174
trainerbattle 0x1 0x19E 0x0 0x8190CD4 0x8190E4F 0x816A5C5
checkflag 0x254
if 0x0 goto 0x816A5F3
msgbox 0x819110F MSG_KEEPOPEN '"There are all kinds of TRAINERS in..."
release
end

'---------------
#org 0x16A5C5
setvar 0x8004 0x2
setvar 0x8005 0x1
special 0x173
setflag 0x4B0
setflag 0x820
setvar 0x406C 0x1
setflag 0x2E
clearflag 0x92
setvar 0x8008 0x1
call 0x81A6B18
goto 0x816A5F3

'---------------
#org 0x16A5F3
msgbox 0x8190FC1 MSG_KEEPOPEN '"Wait!\nTake this with you."
checkitemroom 0x147 0x1
compare LASTRESULT 0x0
if 0x1 goto 0x816A634
additem 0x147 0x1
loadpointer 0x0 0x8190FDB '"[player] received TM39\nfrom EARL."
giveitem2 0x147 0x1 0x101
setflag 0x254
msgbox 0x8190FF8 MSG_KEEPOPEN '"A TM, Technical Machine, contains ..."
release
end

'---------------
#org 0x1A6B18
copyvar 0x8000 0x8008
compare 0x8000 0x1
if 0x1 goto 0x81A6B76
compare 0x8000 0x2
if 0x1 goto 0x81A6B7A
compare 0x8000 0x3
if 0x1 goto 0x81A6B81
compare 0x8000 0x4
if 0x1 goto 0x81A6B8B
compare 0x8000 0x5
if 0x1 goto 0x81A6BA1
compare 0x8000 0x6
if 0x1 goto 0x81A6BB4
compare 0x8000 0x7
if 0x1 goto 0x81A6BCA
compare 0x8000 0x8
if 0x1 goto 0x81A6BE0
end

'---------------
#org 0x16A634
msgbox 0x81911CE MSG_KEEPOPEN '"You don't have room for this."
release
end

'---------------
#org 0x1A6B76
cleartrainerflag 0x8E
return

'---------------
#org 0x1A6B7A
cleartrainerflag 0x96
cleartrainerflag 0xEA
return

'---------------
#org 0x1A6B81
cleartrainerflag 0x8D
cleartrainerflag 0xDC
cleartrainerflag 0x1A7
return

'---------------
#org 0x1A6B8B
cleartrainerflag 0x84
cleartrainerflag 0x85
cleartrainerflag 0xA0
cleartrainerflag 0x109
cleartrainerflag 0x10A
cleartrainerflag 0x10B
cleartrainerflag 0x192
return

'---------------
#org 0x1A6BA1
cleartrainerflag 0x126
cleartrainerflag 0x127
cleartrainerflag 0x120
cleartrainerflag 0x121
cleartrainerflag 0x124
cleartrainerflag 0x125
return

'---------------
#org 0x1A6BB4
cleartrainerflag 0x118
cleartrainerflag 0x119
cleartrainerflag 0x11A
cleartrainerflag 0x11B
cleartrainerflag 0x1CE
cleartrainerflag 0x1CF
cleartrainerflag 0x1D0
return

'---------------
#org 0x1A6BCA
cleartrainerflag 0xB1
cleartrainerflag 0xB2
cleartrainerflag 0xB3
cleartrainerflag 0xB4
cleartrainerflag 0xD5
cleartrainerflag 0xD6
cleartrainerflag 0xD7
return

'---------------
#org 0x1A6BE0
cleartrainerflag 0x128
cleartrainerflag 0x129
cleartrainerflag 0x142
cleartrainerflag 0x143
cleartrainerflag 0x144
cleartrainerflag 0x188
cleartrainerflag 0x190
cleartrainerflag 0x191
return


'---------
' Strings
'---------
#org 0x190CD4
= So, you're here. I'm EARL.\nI'm CINTA's GYM LEADER.\pMy solid composure is evident\neven in my POKéMON.\pMy POKéMON are all down-to-earth \n and have unrelenting spirit.\pThey're all of the GROUND type!\pFuhaha! You're going to challenge\nme knowing that you'll lose?\pThat's the TRAINER's honor that\ncompels you to challenge me.\pFine, then!\nShow me your best!\c\h0B[Ke]À

#org 0x190E4F
= I took you for granted, and so\nI lost.\pAs proof of your victory, I confer\non you this[.]the official POKéMON\lLEAGUE BOULDERBADGE.\p\c\h06Á[player] received the BOULDERBADGE\nfrom EARL!\c\h17\c\h0BÇÀ\c\h08\n\c\h08[Ke]\c\h18\p\c\h06ÇJust having the BOULDERBADGE makes\nyour POKéMON more powerful.\pIt also enables the use of the\nmove FLASH outside of battle.\pOf course, a POKéMON must know the\nmove FLASH to use it.

#org 0x19110F
= There are all kinds of TRAINERS in\nthis huge world of ours.\pYou appear to be very gifted as a\nPOKéMON TRAINER.\pSo let me make a suggestion.\pGo to the GYM in CERULEAN and test\nyour abilities.

#org 0x190FC1
= Wait!\nTake this with you.

#org 0x190FDB
= [player] received TM39\nfrom EARL.

#org 0x190FF8
= A TM, Technical Machine, contains a\ntechnique for POKéMON.\pUsing a TM teaches the move it\ncontains to a POKéMON.\pA TM is good for only one use.\pSo, when you use one, pick the\nPOKéMON carefully.\pAnyways[.]\nTM39 contains ROCK TOMB.\pIt hurls boulders at the foe and\nlowers its SPEED.

#org 0x1911CE
= You don't have room for this.
I know, I'm a noob. But how do I fix the leader issue?

(I tried going to the help menu and got an error :( )

Satoshi Ookami

Memento Mori

Age 30
Male
Abyss of Time, Great Seal
Seen August 5th, 2018
Posted July 3rd, 2018
14,253 posts
14.8 Years
Sure thing

Spoiler:

'-----------------------
#dyn 0x0950113
#org @start
lock
faceplayer
checkflag 0x200
if 0x1 goto 0x8823481
msgbox 0x8950068 '"It's dangerous to go out alone!\nHe..." 0x6
givepokemon 0x1 0x5 0x0 0x0 0x0 0x0
fanfare 0x13E
msgbox 0x895009B '"Please take good care\nOf this bulb..." 0x6
setflag 0x200
msgbox 0x89500E4 '"Have fun!"
applymovement 0x3 0x895004A
waitmovement 0x0
release
end

'-----------------------
#org 0x823481
msgbox 0x89500C7 '"You will be a hero someday!"
callstd 0x6
nop nop is useless =D
release
end


'-----------
' Movements
'-----------
#org 0x95004A
#raw 0x2
#raw 0x09
#raw 0xFE you need to end person's movement =)

'---------
' Strings
'---------
#org 0x950068
= It's dangerous to go out alone!\nHere, take this!

#org 0x95009B
= Please take good care\nOf this bulbasaur!

#org 0x9500E4
= Have fun!

#org 0x9500C7
= You will be a hero someday!
Okay I see the errors. Changes are in bold.

the trainer in cerulean wont appear when I play. I checked A-Map and the script.

Script
'---------------
#org 0x16AB5B
trainerbattle 0x0 0xEA 0x0 0x8192524 0x8192547
setvar 0x8004 0x3
setvar 0x8005 0x2
special 0x173
msgbox 0x8192556 0x6 '"MISTY is a TRAINER who's going to\..."
end


'---------
' Strings
'---------
#org 0x192524
= Splash!\pI'm first up!\nLet's do it!

#org 0x192547
= That can't be!

#org 0x192556
= MISTY is a TRAINER who's going to\nkeep improving.\pShe won't lose to someone like you!

A- Map hes facing left, has normal talking level, movement 11, 3 view radius, offset-0016AB5B
Try repointing the script into different offset ;)
Adding things to old scripts just won't do =D
ROM hacking FAQ - Read before asking how to play a hack.

Anime List | PSN Trophy List
Male
Seen August 22nd, 2011
Posted July 10th, 2011
13 posts
13.7 Years

Okay I see the errors. Changes are in bold.


Try repointing the script into different offset ;)
Adding things to old scripts just won't do =D
It works now, except that there's not a message when I first speak to the person. I do receive the pokemon, but it doesn't show up on the menu...Is that perhaps because it is the first pokemon??

Satoshi Ookami

Memento Mori

Age 30
Male
Abyss of Time, Great Seal
Seen August 5th, 2018
Posted July 3rd, 2018
14,253 posts
14.8 Years
It works now, except that there's not a message when I first speak to the person. I do receive the pokemon, but it doesn't show up on the menu...Is that perhaps because it is the first pokemon??
I see... then I'd suggest writing callstd 0x6 instead of 0x6 on the new line in both msgboxes.
ROM hacking FAQ - Read before asking how to play a hack.

Anime List | PSN Trophy List

Spherical Ice

Age 25
Leicester, UK
Seen 21 Hours Ago
Posted February 20th, 2022
5,251 posts
15.5 Years
Um, no, you need to setflag 0x828. Why would he need to add callstd? Unless he has a really out of date version of XSE, in which case he needs a serious update. :/

DuoRyan

Hack'in as usual, it seem.

Age 26
Male
Somewhere.
Seen January 7th, 2017
Posted October 12th, 2014
335 posts
13.5 Years
Okay fix the first problem, anywho how do you make it show a pokemon not from your party in a set animation command?
Spoiler:

#dynamic 0x800000

#org @start
lock
faceplayer
checkflag 0x206
if 0x1 goto @done
checkgender
compare LASTRESULT 0x0
if 0x1 goto @boy
compare LASTRESULT 0x1
if 0x1 goto @girl
release
end

#org @boy
setflag 0x204
special 0x113
applymovement 0x7F @move
waitmovement 0x0
special 0x114
msgbox @1 0x6
pause 0x10
fadescreen 0x1
fadescreen 0x0
setweather 0x0D
doweather
showsprite 0x5
applymovement 0x7 @move2
waitmovement 0x0
playsong 0x112 0x0
msgbox @2 0x6
pause 0x10
msgbox @3 0x6
pause 0x10
msgbox @4 0x6
pause 0x10
compare 0x4001 0x0
if 0x1 goto @girl2
compare 0x4001 0x1
if 0x1 goto @girl3
end


#org @girl2
sound 0x0F
fadescreen 0x2
showsprite 0x8
cry 0x15D 0x0
applymovement 0x5 @move3
waitmovement 0x0
msgbox @5 0x6
applymovement 0x8 @move3a
waitmovement 0x0
setanimation 0x0 LASTRESULT
doanimation 0x25
waitstate
setvar 0x8004 0x01
setvar 0x8005 0x01
setvar 0x8006 0x0C
setvar 0x8007 0x02
special 0x136
pause 0x10
fadescreen 0x1
fadescreen 0x0
hidesprite 0x5
setweather 0x2
doweather
msgbox @6 0x6
pause 0x10
applymovement 0x7 @move4
waitmovement 0x0
msgbox @7 0x6
pause 0x10
sound 0x0F
fadescreen 0x1
fadescreen 0x0
hidesprite 0x8
msgbox @8 0x6
pause 0x10
msgbox @9 0x6
pause 0x10
applymovement 0x7 @move5
waitmovement 0x0
fadesong 0x123
setflag 0x205
hidesprite 0x7
special 0x113
applymovement 0x7F @move6
waitmovement 0x0
special 0x114
release
end

#org @girl3
sound 0x0F
fadescreen 0x2
showsprite 0x9
cry 0x15C 0x0
applymovement 0x5 @move3
waitmovement 0x0
msgbox @5a 0x6
pause 0x10
applymovement 0x9 @move3a
waitmovement 0x0
setanimation 0x0 LASTRESULT
doanimation 0x25
waitstate
setvar 0x8004 0x01
setvar 0x8005 0x01
setvar 0x8006 0x0C
setvar 0x8007 0x02
special 0x136
fadescreen 0x1
fadescreen 0x0
hidesprite 0x5
setweather 0x2
doweather
msgbox @6 0x6
pause 0x10
applymovement 0x7 @move4
waitmovement 0x0
msgbox @7a 0x6
pause 0x10
sound 0x0F
fadescreen 0x1
fadescreen 0x0
hidesprite 0x9
msgbox @8 0x6
pause 0x10
msgbox @9 0x6
pause 0x10
applymovement 0x7 @move5
waitmovement 0x0
fadesong 0x123
setflag 0x205
hidesprite 0x7
special 0x113
applymovement 0x7F @move6
waitmovement 0x0
special 0x114
release
end

#org @girl
setflag 0x205
special 0x113
applymovement 0x7F @move
waitmovement 0x0
special 0x114
msgbox @1a 0x6
pause 0x10
fadescreen 0x1
fadescreen 0x0
setweather 0x0D
doweather
showsprite 0x4
applymovement 0x6 @move2
waitmovement 0x0
playsong 0x112 0x0
msgbox @2a 0x6
pause 0x10
msgbox @3a 0x6
pause 0x10
msgbox @4a 0x6
pause 0x10
compare 0x4001 0x0
if 0x1 goto @boy2
compare 0x4001 0x1
if 0x1 goto @boy3
end

#org @boy2
sound 0x0F
fadescreen 0x2
showsprite 0x8
cry 0x15D 0x0
applymovement 0x5 @move3
waitmovement 0x0
msgbox @5ba 0x6
applymovement 0x8 @move3a
waitmovement 0x0
setanimation 0x0 LASTRESULT
doanimation 0x25
waitstate
setvar 0x8004 0x01
setvar 0x8005 0x01
setvar 0x8006 0x0C
setvar 0x8007 0x02
special 0x136
pause 0x10
fadescreen 0x1
fadescreen 0x0
hidesprite 0x4
setweather 0x2
doweather
msgbox @6a 0x6
pause 0x10
applymovement 0x6 @move4
waitmovement 0x0
msgbox @7b 0x6
pause 0x10
sound 0x0F
fadescreen 0x1
fadescreen 0x0
hidesprite 0x8
msgbox @8a 0x6
pause 0x10
msgbox @9a 0x6
pause 0x10
applymovement 0x6 @move5
waitmovement 0x0
fadesong 0x123
setflag 0x205
hidesprite 0x6
special 0x113
applymovement 0x7F @move6
waitmovement 0x0
special 0x114
release
end

#org @boy3
sound 0x0F
fadescreen 0x2
showsprite 0x9
cry 0x15C 0x0
applymovement 0x5 @move3
waitmovement 0x0
msgbox @5ba 0x6
pause 0x10
applymovement 0x9 @move3a
waitmovement 0x0
setanimation 0x0 LASTRESULT
doanimation 0x25
waitstate
setvar 0x8004 0x01
setvar 0x8005 0x01
setvar 0x8006 0x0C
setvar 0x8007 0x02
special 0x136
fadescreen 0x1
fadescreen 0x0
hidesprite 0x4
setweather 0x2
doweather
msgbox @6a 0x6
pause 0x10
applymovement 0x6 @move4
waitmovement 0x0
msgbox @7ba 0x6
pause 0x10
sound 0x0F
fadescreen 0x1
fadescreen 0x0
hidesprite 0x9
msgbox @8a 0x6
pause 0x10
msgbox @9a 0x6
pause 0x10
applymovement 0x6 @move5
waitmovement 0x0
fadesong 0x123
setflag 0x205
hidesprite 0x6
special 0x113
applymovement 0x7F @move6
waitmovement 0x0
special 0x114
release
end

#org @done
release
end


#org @1
= Luna: [red_fr]Come out, you stupid shadow!\nI said come out right this\linstance!

#org @1a
= Solar: [blue_fr]Come out, you stupid shadow!\nI not kidding, I will kill\lyou!

#org @2
= Shadow: [blue_fr]Grrrrrrr.....

#org @2a
= Shadow: [red_fr]Grrrrr....

#org @3
= Luna: [red_fr]So you decided to appear,\nwell prepare to be destroy\lonce and for all.

#org @3a
= Solar: [blue_fr]Heh, so you finally appear.\nToday I settle this once and\lfor all!

#org @4
= Luna: [red_fr]Come out!

#org @4a
= Solar: [blue_fr]Come out!

#org @5
= Luna: [red_fr]What with the confuse face?\nHmm, I see you don't have\la single Pokemon with you.\pWell, Solrock use tackle!

#org @5b
= Solar: [blue_fr]What with the confuse face?\nHmm, I see you don't have\la single Pokemon with you.\pWell, Solrock use tackle!

#org @5a
= Luna: [red_fr]What with the confuse face?\nHmm, I see you don't have\la single Pokemon with you.\pWell, Lunatone use tackle!

#org @5ba
= Solar: [blue_fr]What with the confuse face?\nHmm, I see you don't have\la single Pokemon with you.\pWell, Lunatone use tackle!

#org @6
= Luna: [red_fr]................

#org @6a
= Solar: [blue_fr]...............

#org @7
= Luna: [red_fr]Tch, return Solrock.

#org @7b
= Solar: [blue_fr]Tch, return Solrock

#org @7a
= Luna: [red_fr]Tch, return Lunatone.

#org @7ba
= Solar: [blue_fr]Tch, return Lunatone

#org @8
= Luna: [red_fr]Darn it, this is the\nsixth time that shadow slip\laway from me.\pI was to careless and didn't\nattack it quick enough.

#org @8a
= Solar: [blue_fr]Dam it, I can't believe\nthis is the sixth time it slip\laway from me.\pI was too anxious and I\ncouldn't attack it quick enough.

#org @9
= Luna: [red_fr]Mom, don't worry I find the\nshadow so I can avenged you.\lI guess I have to search\pthe whole region for this shadow.\nIOkay, time for me to go.

#org @9a
= Solar: [blue_fr]Mom, I sorry I try to\ndestroy the shadow for you.\lI have to search this big region\pfor that shadow.\nOkay, time for me to go.



#org @move
#raw 0x62
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x12
#raw 0x12
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x12
#raw 0x12
#raw 0xfe

#org @move2
#raw 0x62
#raw 0xfe

#org @move3
#raw 0x63
#raw 0xfe

#org @move3a
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0xfe

#org @move4
#raw 0x12
#raw 0x12
#raw 0x12
#raw 0xfe

#org @move5
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0xfe

#org @move6
#raw 0x13
#raw 0x13
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x13
#raw 0x13
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0xfe


Here a video of what I mean
http://www.youtube.com/watch?v=Jkkc4TamU7U
Pokemon Treasure.
Progress: Planning.
Seen March 2nd, 2015
Posted July 1st, 2011
6 posts
15.7 Years
Hello,

I made this awesome script, however it doesn't work the way it should.

#dynamic 0x806500

#org @start
lock
checkflag 0x1002
if 0x1 goto @done
msgbox @1 0x6
applymovement 0x0A @MW1
waitmovement 0x0
pause 0x10
applymovement 0x0B @JAW1
waitmovement 0x0
pause 0x10
applymovement 0x09 @JEW1
waitmovement 0x0
msgbox @2 0x6
pause 0x20
msgbox @3 0x6
applymovement 0x0D @SUPERMAN1
waitmovement 0x0
applymovement 0x02 @bbbb
waitmovement 0x0
applymovement 0x03 @cccc
waitmovement 0x0
applymovement 0x04 @dddd
waitmovement 0x0
release 
end

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

#org @cccc
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x13
#raw 0x11
#raw 0x11
#raw 0x13
#raw 0x11
#raw 0x02
#raw 0xFE

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

#org @bbbb
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x13
#raw 0x11
#raw 0x11
#raw 0x13
#raw 0x11
#raw 0x11
#raw 0x12
#raw 0x00
#raw 0xFE





#org @1
= Ej Homo! Wachten!

#org @MW1
#raw 0x11
#raw 0x12
#raw 0x12
#raw 0x00
#raw 0xFE

#org @JAW1
#raw 0x02
#raw 0xFE

#org @JEW1
#raw 0x03
#raw 0xFE

#org @2
= [red_fr]JESSIE: Hier die POKéMON!\n[black_fr]MEOWTH: Ja, Etterbakje!\l[blue_fr]JAMES: of anders...\l[black_fr]MEOWTH: Als we je GROWLITHE hebben\ldan geven we hem aan de baas,\l[red_fr]JESSIE: Ja en dan krijgen we vast\lpromotie!

#org @3
= [blue_fr]SUPERMAN: WAAAAAAAACHT!\nIN DE NAAM DER GERECHTIGHEID!

#org @done 
release
end
I'm Hacking Fire red, and this script is located at a sciprt tile.
The Var number is set to 3, and the unkown number to 4050.
The first 4 movements work however the last doesn't work. (@bbbb, @cccc, @dddd). They don't move at all, the rom doesn't crash or anything.
They just don't move and the script ends.
Does anybody know what I'm doing wrong.

Satoshi Ookami

Memento Mori

Age 30
Male
Abyss of Time, Great Seal
Seen August 5th, 2018
Posted July 3rd, 2018
14,253 posts
14.8 Years
Okay... first... being you I wouldn't say that script that easy is "awesome" =)
Anyways onto the script... I don't see any visible mistakes... so I'd try removing those pause commands that are after waitmovement 0x0.
But if that does not work then I think there's only one other sollution...
Your OWs are too far for movement to start.
ROM hacking FAQ - Read before asking how to play a hack.

Anime List | PSN Trophy List
Seen May 4th, 2013
Posted July 13th, 2011
9 posts
13.8 Years
Ok, I'm new on hacking, so don't hate me please.

Now, after messing up with scripts, Oak speech script (when he gives Pokedex to players) messed up. There is no way to change it - when I change it to normal script and press "compile", it shows that everything is OK, but when I look at the script again - it is the same as old script. I use PKSV-UI.
Tried to find answer here, but it seems that no one answered normally (or I just don't understand). Please help, because tutorials doesn't say how to fix it.. but it looks like it's common bug here
Female
Seen December 13th, 2011
Posted October 20th, 2011
13 posts
11.9 Years
i'm trying to make a script delete fainted pokemon for my nuzlocke hack but it doesn't seem to work the way i want it to..

so basically what it does is perform a countpokemon then start checking the last slot up to the first slot for fainted pokemon if it finds one it calls a special which deletes it(P.S. im using JPAN's hacked engine) and then moves on to the next slot up until to the first slot.
i also tested the specials exclusive from JPAN's engine individually and they're both working
#dynamic 0x800000

#org @start
lock
faceplayer
setvar 0x8004 0x0
countpokemon
copyvar 0x8004 LASTRESULT   //puts 0x1 - 0x6 to 0x8004 depending on pkmn amount
goto @initial
msgbox @string 0x6
release
end

#org @initial
subvar 0x8004 0x1        //subtracted 1 so i can use 0x8004 as the slot pointer and also the counter
compare 0x8004 0x0     //check if pointer is in the 1st slot or only has 1 pkmn
if 0x0 goto @next
special2 0x8005 0x65    //HP check for the 1st slot pkmn, store hp value to 0x8005
compare 0x8005 0x0     //check if fainted
if 0x1 goto @end
msgbox @string 0x6
release
end

#org @next
special2 0x8005 0x65    //check HP of pkmn in current slot pointer, store hp value to 0x8005
compare 0x8005 0x0     //check if fainted
if 0x1 goto @yes
goto @initial

#org @yes
special2 0x8004 0x62     //deletes it and store pkmn party size to 0x8004
goto @initial

#org @end
special 0x62                 //deletes it
msgbox @string 0x6
release
end

#org @string
= removed all dead
additional info

special 0x65
(uses the value inside 0x8004 to determine the slot in the party to check, then returns the current hp of the asked pokemon)

special 0x62
(uses the value inside 0x8004 to determine the slot in the party to delete pkmn then returns the remaining party size, kinda like the take pokemon routine+countpokemon combo)

atm what it does is check the pkmn in the last slot if it is fainted deletes it , if it's alive does nothing. any fainted pkmn that isn't in the last slot still remains also i didn't used call/return commands it just freezes for no apparent reason O_O
there must be something wrong with the way im looping it.. HALP anyone
Male
Seen August 17th, 2016
Posted May 9th, 2015
673 posts
14.2 Years
i'm trying to make a script delete fainted pokemon for my nuzlocke hack but it doesn't seem to work the way i want it to..

so basically what it does is perform a countpokemon then start checking the last slot up to the first slot for fainted pokemon if it finds one it calls a special which deletes it(P.S. im using JPAN's hacked engine) and then moves on to the next slot up until to the first slot.
i also tested the specials exclusive from JPAN's engine individually and they're both working
#dynamic 0x800000

#org @start
lock
faceplayer
setvar 0x8004 0x0
countpokemon
copyvar 0x8004 LASTRESULT   //puts 0x1 - 0x6 to 0x8004 depending on pkmn amount
goto @initial
msgbox @string 0x6
release
end

#org @initial
compare 0x8004 0x0     //check if pointer is in the 1st slot or only has 1 pkmn
if 0x0 goto @next
special2 0x8005 0x65    //HP check for the 1st slot pkmn, store hp value to 0x8005
compare 0x8005 0x0     //check if fainted
if 0x1 goto @end
subvar 0x8004 0x1
goto @initial

#org @next
special2 0x8005 0x65    //check HP of pkmn in current slot pointer, store hp value to 0x8005
compare 0x8005 0x0     //check if fainted
if 0x1 goto @yes
release
end

#org @yes
special2 0x8004 0x62     //deletes it and store pkmn party size to 0x8004
release
end

#org @end
special 0x62                 //deletes it
subvar 0x8004 0x1
goto @initial

#org @string
= removed all dead
additional info

special 0x65
(uses the value inside 0x8004 to determine the slot in the party to check, then returns the current hp of the asked pokemon)

special 0x62
(uses the value inside 0x8004 to determine the slot in the party to delete pkmn then returns the remaining party size, kinda like the take pokemon routine+countpokemon combo)

atm what it does is check the pkmn in the last slot if it is fainted deletes it , if it's alive does nothing. any fainted pkmn that isn't in the last slot still remains also i didn't used call/return commands it just freezes for no apparent reason O_O
there must be something wrong with the way im looping it.. HALP anyone
@end should have a command that loops you back to the @initial script at the end (goto @initial).

Otherwise, if you have 6 Pokemon in your party, the script will goto @end to delete it, but then will, well, end, because the @end script ends with "release, end". Have it loop back to @initial again to start the process over and see if the Pokemon in the 5th slot has HP or not.

You should probably get rid of the subvar 0x8004 0x1 in @initial. Instead, put the subvar command at the end of @end, before it loops you back to @initial. Also, put the subvar at the end of @initial, so it can reset the count if the last Pokemon in the party has more than 0 HP and check the previous Pokemon in the party - this way it should reset the count to one less each time whether the Pokemon gets deleted or not, until there's only one Pokemon in the party, in which case you have a command at the beginning of @initial that deals with that. However, that should lead you to a separate script that, at the end of it, ends the entire script altogether, because once you've checked all the Pokemon up to the first slot, the script needs to end. You would probably need a special "delete Pokemon" script for that as well, one that doesn't loop it back to the @initial script.

I put the changes in bold. I think that should work, but let me know since I haven't tested it.

Satoshi Ookami

Memento Mori

Age 30
Male
Abyss of Time, Great Seal
Seen August 5th, 2018
Posted July 3rd, 2018
14,253 posts
14.8 Years
I'd like to ask you guys something =)
I kinda wanna get back to hacking but I encountered a problem :/
(Didn't script for a while o.O)
I'd like to change the truck scene in Ruby/Emerald into something dream-like but for that reason I need to insert level script and remove the 2 level scripts that are already on the map that I know...
I tried it but nothing good came of it... :/ First time ROM stopped in shrinking scene and then the second time after it...

It's not complicated script or something so is there something that needs to be done in order to make intro script working?
Or is it because I'm using 1.0.1 XSE?

Spoiler:
#dynamic 0x800000
#org @start
lockall
setvar 0x7000 0x1
some random msgboxes
setflag 0x800
givepokemon
givepokemon
releaseall
warp
end
ROM hacking FAQ - Read before asking how to play a hack.

Anime List | PSN Trophy List
Age 31
Male
North Wales, United Kingdom
Seen August 3rd, 2022
Posted September 18th, 2020
26 posts
11.9 Years
Uh, yeah, just made this. It's purpose is to stop the player from leaving before talking to a specific person (by using flags of course) and when I walk on the the script event, the player locks in place and nothing else happens. Any ideas?

#dynamic 0x800A00

#org @start
checkflag 0x828
if 0x1 goto @done
msgbox @1 0x6
applymovement 0xFF @move
waitmovement 0x0
release
end

#org @done
release
end

#org @move
#raw 0xC

#org @1
= I can't leave without/ntalking to DR.YUN!
EDIT: Sorry, the flag that was written in the script is the one used to bring up the Pokemon menu >.<

EDIT2: Still doesn't work.

Spherical Ice

Age 25
Leicester, UK
Seen 21 Hours Ago
Posted February 20th, 2022
5,251 posts
15.5 Years
Uh, yeah, just made this. It's purpose is to stop the player from leaving before talking to a specific person (by using flags of course) and when I walk on the the script event, the player locks in place and nothing else happens. Any ideas?
#dynamic 0x800A00

#org @start
checkflag 0x828
if 0x1 goto @done
msgbox @1 0x6
applymovement 0xFF @move
waitmovement 0x0
release
end

#org @done
release
end

#org @move
#raw 0xC

#org @1
= I can't leave without/ntalking to DR.YUN!
Try this:
#dynamic 0x800A00

#org @start
checkflag 0x828
if 0x1 goto @done
msgbox @1 0x6
applymovement 0xFF @move
waitmovement 0x0
release
end

#org @done
release
end

#org @move
#raw 0xC
#raw 0xFE

#org @1
= I can't leave without/ntalking to DR.YUN!
When scripting movements, all movements must end in #raw 0xFE.

I'd like to ask you guys something =)
I kinda wanna get back to hacking but I encountered a problem :/
(Didn't script for a while o.O)
I'd like to change the truck scene in Ruby/Emerald into something dream-like but for that reason I need to insert level script and remove the 2 level scripts that are already on the map that I know...
I tried it but nothing good came of it... :/ First time ROM stopped in shrinking scene and then the second time after it...

It's not complicated script or something so is there something that needs to be done in order to make intro script working?
Or is it because I'm using 1.0.1 XSE?
Spoiler:
#dynamic 0x800000
#org @start
lockall
setvar 0x7000 0x1
some random msgboxes
setflag 0x800
givepokemon
givepokemon
releaseall
warp
end
Would it hurt to post the actual script?
Age 31
Male
North Wales, United Kingdom
Seen August 3rd, 2022
Posted September 18th, 2020
26 posts
11.9 Years
Try this:
#dynamic 0x800A00

#org @start
checkflag 0x828
if 0x1 goto @done
msgbox @1 0x6
applymovement 0xFF @move
waitmovement 0x0
release
end

#org @done
release
end

#org @move
#raw 0xC
#raw 0xFE

#org @1
= I can't leave without/ntalking to DR.YUN!
When scripting movements, all movements must end in #raw 0xFE.
Tried it, still doesn't do anything. I changed the checkflag to 0x8C0 to see if that would do anything but I'm still stuck.
Male
Poland
Seen March 26th, 2023
Posted May 28th, 2019
69 posts
14.9 Years
Allright guys, i have two problems.
1st, the script...
It lags when the exclamation cloud appears. This is the script.
Spoiler:
#dynamic 0x800000
#org @start
lock
faceplayer
msgbox @1 0x6
applymovement 0x01 @move
waitmovement 0x0
msgbox @2 0x6
applymovement 0x1 @move2
waitmovement 0x0
givepokemon 0x186 0x7 0x44 0x0 0x0 0x0
fanfare 0x13E
msgbox @anorith 0x6
waitfanfare
msgbox @3 0x6
applymovement 0xFF @movehero
waitmovement 0x0
applymovement 0x1 @move3
waitmovement 0x0
fadescreen 0x1
hidesprite 0x800F
setflag 0x200
fadescreen 0x0
release
end

#org @1
= BEN: Hey pal, i think i found a\nfossil!\lI think it's a Claw Fossil.\lGood thing i took Devon's device!\lLet's try it!

#org @move
#raw 0x01
#raw 0x56

#org @2
= BEN: Sweet! It worked perfectly!\nDevon Corporation is awesome!

#org @move2
#raw 0x00

#org @3
= BEN: Never underestimate science,\npal!\l...\lI think we've found what we were\llooking for. Let's erase that\lboulder.

#org @movehero
#raw 0x0A
#raw 0x00

#org @anorith
= \v\h01 obtained an ANORITH!

#org @move3
#raw 0x04
#raw 0x04
#raw 0x04
#raw 0x04
#raw 0x04

#org @move4
#raw 0x03


And there's a screen with this happening.
And another problem, cause i didn't put this brown part of big stone.


Does it have anything with script?
(i mean that big brown rock on wall)

Spherical Ice

Age 25
Leicester, UK
Seen 21 Hours Ago
Posted February 20th, 2022
5,251 posts
15.5 Years
Try adding #raw 0xFE after each movement list. You need to do that, as it tells the game that that set of movements has finished. As for the rock, I'm not sure. Perhaps there are some interfering level scripts - try removing them (save the offsets and details of them first just in case you need to put them back).
Male
Poland
Seen March 26th, 2023
Posted May 28th, 2019
69 posts
14.9 Years
Thank you very much, Spherical Ice. You're a nice guy.
But still there's a problem with that rock on wall...

Maybe that rock out of nowhere(yay), is made cause it's start map? That cave is edited Scorched Slab. I used Start Map Chooser Advance version 1.20. This is my setup(sorry for off-topic, i want to solve this problem...)


Again, sorry for off-topic.
Male
Poland
Seen March 26th, 2023
Posted May 28th, 2019
69 posts
14.9 Years
Actually, i did this. I erased all level scripts. I actually saw another problem.

Fat Ben stands very weird.

Oh, i found the reason that made the "magical rock".
Truck has setmaptile script, right?
Then that means, that Setmaptile script is occuring in the cave. Even when i delete every script.
I think that makes sense.

Satoshi Ookami

Memento Mori

Age 30
Male
Abyss of Time, Great Seal
Seen August 5th, 2018
Posted July 3rd, 2018
14,253 posts
14.8 Years
When I try to make a script that gives the very first pokemon, you receive the pokemon, but it doesn't show up, what am I doing wrong?
What doesn't show up? O.o
Though I suppose you did not set flag for activating Pokémon menu.
And what ROM do you use?
ROM hacking FAQ - Read before asking how to play a hack.

Anime List | PSN Trophy List