Script Help Thread (DO NOT REQUEST SCRIPTS) Page 218

Started by HackMew December 20th, 2008 5:10 AM
  • 625760 views
  • 9682 replies

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 need help with this. It's meant to, if the player has the Pokedex and hasn't activated the flag (which is activated by finishing this script) Oak gives the player the National Dex. I don't see anything wrong with it..

Spoiler:
#dynamic 0x805000

#org @begin
checkflag 0x829
if 0x1 goto @holdon
goto @nea

#org @hek
lock
msgbox @wait 0x6
applymovement 0x5 @toplayer
waitmovement 0x0
msgbox @forgot 0x6
special 0x16F
fanfare 0x13E
msgbox @yay 0x4
waitfanfare
closeonkeypress
msgbox @cya 0x6
applymovement 0x5 @back
checkflag 0x1872
release
end

#org @holdon
checkflag 0x1872
if 0x0 goto @hek
release
end

#org @nea
release
end

#org @wait
= Oak: Wait a second!

#org @forgot
= I almost forgot. I need to give\nyou this National Pokedex, there\lhave been reports of Roaming\lPokemon from Hoenn lately.\pThe National Pokedex allows you to\nrecord data about Pokemon from\lother regions.\pHere you go!

#org @yay
= [black_fr][player] obtained the National Pokedex!

#org @cya
= Oak: Take care now!

#org @toplayer
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0xFE

#org @back
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x0
#raw 0xFE
The changes are in red...

Seen June 13th, 2011
Posted March 24th, 2011
1 posts
12.2 Years
I have a question.In Battle Tower, multi battles are using front sprites for player and tag team partner. I'm trying to change that to use backsprites. Since there are no backsprites for regular trainers, i want to switch tag team partners to characters that has backsprites. I should change trainers in the sallon that we choose partner too, they should be switched to Steven,Brendan,Red and other trainers that has backsprites.

But despite that i tried to change scripts of battle tower regular ways with the Advance Map, I didn't find the scripts that i need to change. I clicked on the players but the "Open Script" button was still unable to click. I changed the world sprites easily but i still don't have any idea about switching front sprites to backsprites. In the other hand i need to have codes for backsprites to reveal them in the Tilemolester somehow. It is possible to switch them?
I like writing scripts.

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
Doesn't work, nothing happens.
Then maybe you should use a different flag.

Anyway, I tried fixing your script once again.
#dynamic 0x805000

#org @begin
checkflag 0x829
if 0x0 goto @done
checkflag 0x1872
if 0x0 goto @hek
release
end

#org @done
release
end

#org @hek
lock
msgbox @wait 0x6
applymovement 0x5 @toplayer
waitmovement 0x0
msgbox @forgot 0x6
special 0x16F
fanfare 0x13E
msgbox @yay 0x4
waitfanfare
closeonkeypress
msgbox @cya 0x6
applymovement 0x5 @back
waitmovement 0x0
setflag 0x1872
release
end

#org @wait
= Oak: Wait a second!

#org @forgot
= I almost forgot. I need to give\nyou this National Pokedex, there\lhave been reports of Roaming\lPokemon from Hoenn lately.\pThe National Pokedex allows you to\nrecord data about Pokemon from\lother regions.\pHere you go!

#org @yay
= [black_fr][player] obtained the National Pokedex!

#org @cya
= Oak: Take care now!

#org @toplayer
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0xFE

#org @back
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x0
#raw 0xFE

edit:
Here's a video for you to see that the script I posted is working properly.


But if your script is a trigger-type of script, then write 0003 on the 'Unknown' field and 4050 on the 'Var number' field...

Complans

Trainer

Seen August 27th, 2015
Posted April 11th, 2011
98 posts
13.1 Years


Then maybe you should use a different flag.

Anyway, I tried fixing your script once again.
#dynamic 0x805000

#org @begin
checkflag 0x829
if 0x0 goto @done
checkflag 0x1872
if 0x0 goto @hek
release
end

#org @done
release
end

#org @hek
lock
msgbox @wait 0x6
applymovement 0x5 @toplayer
waitmovement 0x0
msgbox @forgot 0x6
special 0x16F
fanfare 0x13E
msgbox @yay 0x4
waitfanfare
closeonkeypress
msgbox @cya 0x6
applymovement 0x5 @back
waitmovement 0x0
setflag 0x1872
release
end

#org @wait
= Oak: Wait a second!

#org @forgot
= I almost forgot. I need to give\nyou this National Pokedex, there\lhave been reports of Roaming\lPokemon from Hoenn lately.\pThe National Pokedex allows you to\nrecord data about Pokemon from\lother regions.\pHere you go!

#org @yay
= [black_fr][player] obtained the National Pokedex!

#org @cya
= Oak: Take care now!

#org @toplayer
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0xFE

#org @back
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x11
#raw 0x0
#raw 0xFE

edit:
Here's a video for you to see that the script I posted is working properly.


But if your script is a trigger-type of script, then write 0003 on the 'Unknown' field and 4050 on the 'Var number' field...
Ohh, I always used 0300 and 4050 for those values. Thank you so much :)

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
Hi, I'm trying to edit the script for the Slakoth-for-Makuhita trade in Rustboro City in my Ruby hack. I want to make it so that you are giving a Wurmple for a Caterpie. Looking at the script.... I'm clueless. Here's the script for it. Any help would be greatly appreciated. Thanks!

#org 0x8157C7D
'-----------------------------------
lock
faceplayer
checkflag 0x99
if true jump 0x8157D13 ' Flag is set
setvar 0x8008 0x0
copyvar 0x8004 0x8008
special2 LASTRESULT 0xFC
copyvar 0x8009 LASTRESULT
msgbox 0x8184EBA ' Do you nickname your...
callstd MSG_YESNO ' Yes/No message
compare LASTRESULT NO
if == jump 0x8157CFB ' Equal To
special 0x9F
waitspecial
copyvar 0x800A 0x8004
compare 0x8004 0xFF
if == jump 0x8157CFB ' Equal To
copyvar 0x8005 0x800A
special2 LASTRESULT 0xFF
copyvar 0x800B LASTRESULT
comparevars2 LASTRESULT 0x8009
if != jump 0x8157D05 ' Not Equal To
copyvar 0x8004 0x8008
copyvar 0x8005 0x800A
special 0xFD
special 0xFE
waitspecial
msgbox 0x8184F6B ' Eheheheh, ooh, this ...
callstd MSG_NOCLOSE ' Non-closing message
setflag 0x99
release
end

#org 0x8157D13
'-----------------------------------
msgbox 0x8184FDD ' Don't you get curiou...
callstd MSG_NOCLOSE ' Non-closing message
release
     ' Release commands close any open messages
end

#org 0x8157CFB
'-----------------------------------
msgbox 0x8184FC1 ' Aww, it's a good POK...
callstd MSG_NOCLOSE ' Non-closing message
release
     ' Release commands close any open messages
end

#org 0x8157D05
'-----------------------------------
storepokemon 0x0 0x8009
msgbox 0x8184F8F ' But that's no \v\h02...
callstd MSG_NOCLOSE ' Non-closing message
release
     ' Release commands close any open messages
end


#org 0x8184EBA
= Do you nickname your POK\eMON?\nI gave a cool name to mine.\pBut when I call my POK\eMON by that\nname, people laugh at me...\pIf it's okay with you, want to trade\nyour \v\h02 for my \v\h03?

#org 0x8184F6B
= Eheheheh, ooh, this is so exciting!

#org 0x8184FDD
= Don't you get curious about what other\npeople named their POK\eMON?

#org 0x8184FC1
= Aww, it's a good POK\eMON...

#org 0x8184F8F
= But that's no \v\h02.\nTch, that's so disappointing...

DrFuji

Heiki Hecchara‌‌

Age 30
Male
Aussie
Seen 4 Days Ago
Posted February 12th, 2021
1,693 posts
13.7 Years
Hi, I'm trying to edit the script for the Slakoth-for-Makuhita trade in Rustboro City in my Ruby hack. I want to make it so that you are giving a Wurmple for a Caterpie. Looking at the script.... I'm clueless. Here's the script for it. Any help would be greatly appreciated. Thanks!

#org 0x8157C7D
'-----------------------------------
lock
faceplayer
checkflag 0x99
if true jump 0x8157D13 ' Flag is set
setvar 0x8008 0x0
copyvar 0x8004 0x8008
special2 LASTRESULT 0xFC
copyvar 0x8009 LASTRESULT
msgbox 0x8184EBA ' Do you nickname your...
callstd MSG_YESNO ' Yes/No message
compare LASTRESULT NO
if == jump 0x8157CFB ' Equal To
special 0x9F
waitspecial
copyvar 0x800A 0x8004
compare 0x8004 0xFF
if == jump 0x8157CFB ' Equal To
copyvar 0x8005 0x800A
special2 LASTRESULT 0xFF
copyvar 0x800B LASTRESULT
comparevars2 LASTRESULT 0x8009
if != jump 0x8157D05 ' Not Equal To
copyvar 0x8004 0x8008
copyvar 0x8005 0x800A
special 0xFD
special 0xFE
waitspecial
msgbox 0x8184F6B ' Eheheheh, ooh, this ...
callstd MSG_NOCLOSE ' Non-closing message
setflag 0x99
release
end
 
#org 0x8157D13
'-----------------------------------
msgbox 0x8184FDD ' Don't you get curiou...
callstd MSG_NOCLOSE ' Non-closing message
release
     ' Release commands close any open messages
end
 
#org 0x8157CFB
'-----------------------------------
msgbox 0x8184FC1 ' Aww, it's a good POK...
callstd MSG_NOCLOSE ' Non-closing message
release
     ' Release commands close any open messages
end
 
#org 0x8157D05
'-----------------------------------
storepokemon 0x0 0x8009
msgbox 0x8184F8F ' But that's no \v\h02...
callstd MSG_NOCLOSE ' Non-closing message
release
     ' Release commands close any open messages
end
 
 
#org 0x8184EBA
= Do you nickname your POK\eMON?\nI gave a cool name to mine.\pBut when I call my POK\eMON by that\nname, people laugh at me...\pIf it's okay with you, want to trade\nyour \v\h02 for my \v\h03?
 
#org 0x8184F6B
= Eheheheh, ooh, this is so exciting!
 
#org 0x8184FDD
= Don't you get curious about what other\npeople named their POK\eMON?
 
#org 0x8184FC1
= Aww, it's a good POK\eMON...
 
#org 0x8184F8F
= But that's no \v\h02.\nTch, that's so disappointing...
You can't individually determine what Pokemon you trade/ recieve in a script like this (barring ASM of course). Each game has a series preset trades which are determined through the line 'setvar 0x8008 0xZZ' where ZZ tells the game which trade number will be occuring - trade 0 in this case. There is a tool that can change the Pokemon involved, but sadly it only works for BPRE FR.

DeepKickSavior

is readin' up on his XSE :3

Age 28
Male
USA
Seen February 28th, 2013
Posted June 20th, 2011
10 posts
12.2 Years
#org $Trisha
lock
message $...
$... 1 = ... ...\nHmm...
boxset 6
applymovement 5 $down
$down 1 ; #binary 0x4A 0x62 0xFE
pause 0x20
message $oh
$oh 1 = Oh! Hi \v\h01! \nI can't get past here... \lThis tree needs to be CUT. \pI tried asking some of \nthe kids around here, \lbut they're all so rude. \pCould you help? \nPlease, follow me.
boxset 2
applymovement 5 $1st
$1st 1 ; #binary 0x13 0x14 0x02 0xFE
pausemove 0x0000
message $way
$way 1 = C'mon, this way!
boxset 2
applymovement 5 $2nd
$2nd 1 ; #binary 0x10 0x10 0x10 0x10 0x12 0x12 0x10 0x10 0x10 0x10 0x13 0x13 0x13 0x10 0x13 0x10 0x10 0x10 0x10 0x01 0xFE
pausemove 0x0000
setflag 0x1251
release
end



I can't get this script to work, I keep getting an error message "Run-Time Error 13 - Type Mismatch" when I try to compile it. I want the sprite to (starting from facing away from the player) say some stuff and then face the player, say more stuff, then walk right and jump down a ledge, stop, say more stuff, and walk offscreen where she waits to be talked to again (and where more movement will start) So far, the script works if I take out the last set of movements, thus ending the script with $way 1 = "...", boxset 2, release, and end (except at the end of the 2nd movement, the sprite faces left like I want her to, but them faces down when the messagebox comes up)

Please help D: also, I want to be able to move while the other sprite is moving, but I'm not too worried about that right now
Working on a FireRed Hack! My first hack, but I'm making it as detailed and non-half-assed as possible!! No name yet. Main antagonist is Professor Mharú (Gaelic for slaughter, or killing) (Thanks Spherical Ice) who does evil things that are a secret and I won't reveal ;D

Complans

Trainer

Seen August 27th, 2015
Posted April 11th, 2011
98 posts
13.1 Years
#org $Trisha
lock
message $...
$... 1 = ... ...\nHmm...
boxset 6
applymovement 5 $down
$down 1 ; #binary 0x4A 0x62 0xFE
pause 0x20
message $oh
$oh 1 = Oh! Hi \v\h01! \nI can't get past here... \lThis tree needs to be CUT. \pI tried asking some of \nthe kids around here, \lbut they're all so rude. \pCould you help? \nPlease, follow me.
boxset 2
applymovement 5 $1st
$1st 1 ; #binary 0x13 0x14 0x02 0xFE
pausemove 0x0000
message $way
$way 1 = C'mon, this way!
boxset 2
applymovement 5 $2nd
$2nd 1 ; #binary 0x10 0x10 0x10 0x10 0x12 0x12 0x10 0x10 0x10 0x10 0x13 0x13 0x13 0x10 0x13 0x10 0x10 0x10 0x10 0x01 0xFE
pausemove 0x0000
setflag 0x1251
release
end



I can't get this script to work, I keep getting an error message "Run-Time Error 13 - Type Mismatch" when I try to compile it. I want the sprite to (starting from facing away from the player) say some stuff and then face the player, say more stuff, then walk right and jump down a ledge, stop, say more stuff, and walk offscreen where she waits to be talked to again (and where more movement will start) So far, the script works if I take out the last set of movements, thus ending the script with $way 1 = "...", boxset 2, release, and end (except at the end of the 2nd movement, the sprite faces left like I want her to, but them faces down when the messagebox comes up)

Please help D: also, I want to be able to move while the other sprite is moving, but I'm not too worried about that right now
What script editor are you using?

And to make two sprites move at once, use two (or more) applymovements (one for each sprite) and then end the movements with one waitmovement pausemove.

DeepKickSavior

is readin' up on his XSE :3

Age 28
Male
USA
Seen February 28th, 2013
Posted June 20th, 2011
10 posts
12.2 Years
What script editor are you using?

And to make two sprites move at once, use two (or more) applymovements (one for each sprite) and then end the movements with one waitmovement pausemove.
I'm using PoketScript since I started learning with it, and I can't seem to make the switch to XSE :P and I figured that, but what would the sprite # be for the hero? I'm pretty sure I saw a foullump video explaining that, so again, I'm not worried about that right now. I just want the one sprite to work :P
Working on a FireRed Hack! My first hack, but I'm making it as detailed and non-half-assed as possible!! No name yet. Main antagonist is Professor Mharú (Gaelic for slaughter, or killing) (Thanks Spherical Ice) who does evil things that are a secret and I won't reveal ;D

Complans

Trainer

Seen August 27th, 2015
Posted April 11th, 2011
98 posts
13.1 Years
I'm using PoketScript since I started learning with it, and I can't seem to make the switch to XSE :P and I figured that, but what would the sprite # be for the hero? I'm pretty sure I saw a foullump video explaining that, so again, I'm not worried about that right now. I just want the one sprite to work :P
The sprite # for the hero is FF, so 0xFF.

DeepKickSavior

is readin' up on his XSE :3

Age 28
Male
USA
Seen February 28th, 2013
Posted June 20th, 2011
10 posts
12.2 Years
The sprite # for the hero is FF, so 0xFF.
OK, thanks... but... I don't need help with that I need help with my script TT-TT
Working on a FireRed Hack! My first hack, but I'm making it as detailed and non-half-assed as possible!! No name yet. Main antagonist is Professor Mharú (Gaelic for slaughter, or killing) (Thanks Spherical Ice) who does evil things that are a secret and I won't reveal ;D

Gars129

Is now focused on other things

Age 29
Puerto Rico
Seen October 5th, 2014
Posted September 18th, 2014
218 posts
14.5 Years
When I try to compile my script, it says there is not enough space. What is wrong?
El Yunque National Forest in Puerto Rico, the only tropical rainforest in the U.S., needs your help to become one of the new 7 natural wonders of the world.
http://voteforelyunque.com


[IMG]http://www.mubos-md.com/brawlcards/cards/wqz8wnx8.png[/IMG]
Click here to level up my card![/url]

Diamond FC 3522 8541 4119

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 compile my script, it says there is not enough space. What is wrong?
What offset does your script have?
It might be offset that is already used.
ROM hacking FAQ - Read before asking how to play a hack.

Anime List | PSN Trophy List
Male
Seen April 15th, 2011
Posted April 6th, 2011
17 posts
12.2 Years
i got a problem, please help, this is the script(using pksv with ruby)
Spoiler:
#org 0x874157D
'-----------------------------------
lockall
applymovement PLAYER 0x87415DA ' walk_right_vslow wal...
pauseevent 0x0
msgbox 0x87415B1 ' ???:Hmm this is new\...
applymovement 0x36 0x87415DE ' alert look_left end
pauseevent 0x0
jump 0x874159D

#org 0x874159D
'-----------------------------------
trainerbattle 0x1 0xA 0x0 0x87415E1 0x874163C 0x874164B
releaseall
end

#org 0x874164B
'-----------------------------------
message 0x8741661 ' umm umm you didn't s...
callstd MSG_NOCLOSE ' Non-closing message
applymovement 0x36 0x8741682 ' walk_up walk_up walk...
pauseevent 0x0
disappear 0x36
releaseall
end


#org 0x87415B1
= ???:Hmm this is new\n what could this be?

#org 0x87415E1
= ???:Wait who are you?\p I, wasnt doing anything suspicious hehe\p um um um look whats that!?

#org 0x874163C
= Um um um......

#org 0x8741661
= umm umm you didn't see anything!

#org 0x87415DA
M walk_right_vslow walk_right_vslow walk_right_vslow end

#org 0x87415DE
M alert look_left end

#org 0x8741682
M walk_up walk_up walk_up walk_up walk_up end




when the player steps on the square with the script, the player is suposed to walk 3 squares to the right, next to a person who is facing up , the person then turns and sasy somthing,a battl insuse, and when you win he runs away to the right, but it just freezes when i step on the square
anyone know whats wrong?

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 got a problem, please help, this is the script(using pksv with ruby)
Spoiler:
#org 0x874157D
'-----------------------------------
lockall
applymovement PLAYER 0x87415DA ' walk_right_vslow wal...
pauseevent 0x0
msgbox 0x87415B1 ' ???:Hmm this is new\...
applymovement 0x36 0x87415DE ' alert look_left end
pauseevent 0x0
jump 0x874159D

#org 0x874159D
'-----------------------------------
trainerbattle 0x1 0xA 0x0 0x87415E1 0x874163C 0x874164B
releaseall
end

#org 0x874164B
'-----------------------------------
message 0x8741661 ' umm umm you didn't s...
callstd MSG_NOCLOSE ' Non-closing message
applymovement 0x36 0x8741682 ' walk_up walk_up walk...
pauseevent 0x0
disappear 0x36
releaseall
end


#org 0x87415B1
= ???:Hmm this is new\n what could this be?

#org 0x87415E1
= ???:Wait who are you?\p I, wasnt doing anything suspicious hehe\p um um um look whats that!?

#org 0x874163C
= Um um um......

#org 0x8741661
= umm umm you didn't see anything!

#org 0x87415DA
M walk_right_vslow walk_right_vslow walk_right_vslow end

#org 0x87415DE
M alert look_left end

#org 0x8741682
M walk_up walk_up walk_up walk_up walk_up end




when the player steps on the square with the script, the player is suposed to walk 3 squares to the right, next to a person who is facing up , the person then turns and sasy somthing,a battl insuse, and when you win he runs away to the right, but it just freezes when i step on the square
anyone know whats wrong?
Maybe you forgot to set the right values of the script tile through A-Map...

Look at other already-made scripts on the ROM and try to use those values for your script tile.

Male
Seen April 15th, 2011
Posted April 6th, 2011
17 posts
12.2 Years


Maybe you forgot to set the right values of the script tile through A-Map...
Look at other already-made scripts on the ROM and try to use those values for your script tile.
Do you mean copy the numbers from another event, or base them off the other numbers, if you mean the second could you help me understand how to do that?

Pogeygothaxed

Pokémon exDeltaSpecies Creator

Age 32
Male
Too far away from my girlfriend.
Seen April 16th, 2015
Posted April 5th, 2011
231 posts
14 Years
Wasn't sure if it belonged here or in the Hacked FireRed engine thread, but...
Game: FireRed Type: BPRE Editor: XSE/A-Map? Script: Trainer/Wild Battle?
Spoiler:
#dynamic 0x800000

#org @start
lock
special 0x58 'the special for the Wild Battle switch
setvar 0x1 0x4051 'set the variables for the special
compare 0x1 0x58 'simple check to see if it's set or not
if 0x0 goto @fail 'if it fails
cry 0x10 0x0 'self explaintory
msgbox @rawr 0x2 'self explaintory
wildbattle 0x10 0x2 0x0 'Battle vs Pidgey @lv2 by default and no held item.
release
end

#org @fail
msgbox @fail2 0x2

#org @fail2
= derp 'Just a stupid notice that the levels weren't even.

#org @rawr
= Pidgeyy '<_< lol


So, it's basicly supposed to check if the special is active (lvl balance in this case) and then start the battle if it is.
I'm trying to utilize the "Run Trainer Script" routine and the Wild Battle data switch.

It works, only it starts the battle with an uneven lvl. Like it's not using the Special.
Plus, it's supposed to -act- like a trainer, correct? After I activate a GivePokemon script, it just walks around until I "speak" to it...
however, without the GivePokemon script, it -sees- me, and contiunes a trainer-like script, but with the Wild Battle data.
The problem is obviously your Pokemon is the ???? and it still doesn't seem to set the lvl...maybe I set the variables incorrectly?

Any help would be much appreciated.

P.s. the reason I didn't add a flag was because it's supposed to be included in the sub-routine for the Run Trainer Script. Although I doubt that this would effect the script very much, besides the obvious removal of the sprite afterwards. =|

If you'd like support this hack, then please add this to your sig!
http://i266.photobucket.com/albums/ii245/xmouvelianx/exdeltaspeciess.png
Pixel Placement - My Pixel Art Showcasing thread;
http://www.pokecommunity.com/showthread.php?t=195942
You can see the latest concept art for exDelta here, along with some other things related and not to the hack!
Male
Seen August 17th, 2016
Posted May 9th, 2015
673 posts
14.2 Years
Wasn't sure if it belonged here or in the Hacked FireRed engine thread, but...
Game: FireRed Type: BPRE Editor: XSE/A-Map? Script: Trainer/Wild Battle?
Spoiler:
#dynamic 0x800000

#org @start
lock
special 0x58 'the special for the Wild Battle switch
setvar 0x1 0x4051 'set the variables for the special
compare 0x1 0x58 'simple check to see if it's set or not
if 0x0 goto @fail 'if it fails
cry 0x10 0x0 'self explaintory
msgbox @rawr 0x2 'self explaintory
wildbattle 0x10 0x2 0x0 'Battle vs Pidgey @lv2 by default and no held item.
release
end

#org @fail
msgbox @fail2 0x2

#org @fail2
= derp 'Just a stupid notice that the levels weren't even.

#org @rawr
= Pidgeyy '<_< lol


So, it's basicly supposed to check if the special is active (lvl balance in this case) and then start the battle if it is.
I'm trying to utilize the "Run Trainer Script" routine and the Wild Battle data switch.

It works, only it starts the battle with an uneven lvl. Like it's not using the Special.
Plus, it's supposed to -act- like a trainer, correct? After I activate a GivePokemon script, it just walks around until I "speak" to it...
however, without the GivePokemon script, it -sees- me, and contiunes a trainer-like script, but with the Wild Battle data.
The problem is obviously your Pokemon is the ???? and it still doesn't seem to set the lvl...maybe I set the variables incorrectly?

Any help would be much appreciated.

P.s. the reason I didn't add a flag was because it's supposed to be included in the sub-routine for the Run Trainer Script. Although I doubt that this would effect the script very much, besides the obvious removal of the sprite afterwards. =|
There seems to be a few problems with the script. I haven't used special 0x58 from JPAN's engine, but reading the manual, I think the first thing you must do is use a hex editor to write out a table of the Pokemon you want to appear.

The data at the pointer would have to be something like:

0A 14 00 010
The first byte would be the minimum level of the first Pokemon you want to appear (0A = 10), the second would be the highest level (14 = 20) and the last two bytes would be the Pokemon # (10 = Pidgey). You would do this a total of 12 times if it were for walking in the grass (12 Pokemon total included in the table).

If this table was located at offset 812345, you would then write:

setvar 0x8004 0x0881
setvar 0x8005 0x2345
setvar 0x8005 0x0
setvar 0x8006 0x0
special 0x58
if it was for switching the appearance of grass Pokemon (for surfing you would set variable 0x8005 to 0x1, fishing to 0x3 ...)

I think that would get the special to work properly. I think you can also use writebytetooffset and change the value of 0x0203f488 with it, and write out the same table without writing it permanently in with a hex editor (and, thus make it setvar 0x8006 0x2 instead), but I'm not sure.

As for the problems I see with your script in general, it seems you're inverting the setvars (it should be setvar 0x4051 0x1; not setvar 0x1 0x4051), as well as the compare command; and you can't really check whether a special is activated with the compare commands, anyway.

I'm not sure why you would need to use special 0x58 for this script as well, since it seems unnecessarily complicated. Are you just trying to make the Pidgey's level random? If you use the wildbattle command, it's going to go off the data you put in to that command, making the special moot anyway. The special only works for random encounters in grass or surfing, etc, not when using the wildbattle command.

Maybe you can explain more exactly what you're trying to do ... I think i understand that you have a sprite that is supposed to walk up to you when it sees you and start a wild Pokemon battle with a Pidgey, but not sure what else you're after exactly, except that you don't want Pidgey's level to be static (I think).
Calgary, AB
Seen April 10th, 2012
Posted April 8th, 2012
23 posts
15.8 Years
I'm trying to make a script that shows a pokemon's sprite (showpokepic) but if the player says no to a question and the yes/no part works fine but when you say no it just shows a small box with no pokemon in it. What could be causing this. Script is below.
#org $script
lock
faceplayer
message $haveyou
$haveyou 1 = Have you seen SNORLAX?
boxset 5
compare 0x800D 0x0001
if 0x01 goto $yesseen
message $havent
$havent 1 = Oh!\nYou haven't?\pLet me show you!
boxset 6
showpokepic 0x8F 0xA 0x3
release
end

#org $yesseen
message $thatsgreat
$thatsgreat 1 = Isn't he cute!
boxset 6
release
end
Male
Seen April 2nd, 2011
Posted March 29th, 2011
4 posts
12.2 Years
I'm trying to make a script where you battle your rival at the town school after receiving your first pokemon. But everytime I burn it it asks for the offset for pointer h0

The only thing close to h0 I have is \v\h01 for trainer's name.

Spoiler:
#org $battless
message $joining
$joining 1 =I see you have\nyour new Pokemon.\pThat's wonderful.\pBut I hope you have been\npaying attention \v\h01.\pToday Seth will be your rival.
boxset 6
trainerbattle 0x0 0x089 0x0 $intro $defeat
message $wowza
$wowza 1 =That was a\ngreat first battle!
boxset 6

end
#org $intro
= I won't go easy\non you \v\h01.

#org $defeat
= Woah...

Pogeygothaxed

Pokémon exDeltaSpecies Creator

Age 32
Male
Too far away from my girlfriend.
Seen April 16th, 2015
Posted April 5th, 2011
231 posts
14 Years
There seems to be a few problems with the script. I haven't used special 0x58 from JPAN's engine, but reading the manual, I think the first thing you must do is use a hex editor to write out a table of the Pokemon you want to appear.

The data at the pointer would have to be something like:

0A 14 00 010
The first byte would be the minimum level of the first Pokemon you want to appear (0A = 10), the second would be the highest level (14 = 20) and the last two bytes would be the Pokemon # (10 = Pidgey). You would do this a total of 12 times if it were for walking in the grass (12 Pokemon total included in the table).

If this table was located at offset 812345, you would then write:

setvar 0x8004 0x0881
setvar 0x8005 0x2345
setvar 0x8005 0x0
setvar 0x8006 0x0
special 0x58
if it was for switching the appearance of grass Pokemon (for surfing you would set variable 0x8005 to 0x1, fishing to 0x3 ...)

I think that would get the special to work properly. I think you can also use writebytetooffset and change the value of 0x0203f488 with it, and write out the same table without writing it permanently in with a hex editor (and, thus make it setvar 0x8006 0x2 instead), but I'm not sure.

As for the problems I see with your script in general, it seems you're inverting the setvars (it should be setvar 0x4051 0x1; not setvar 0x1 0x4051), as well as the compare command; and you can't really check whether a special is activated with the compare commands, anyway.

I'm not sure why you would need to use special 0x58 for this script as well, since it seems unnecessarily complicated. Are you just trying to make the Pidgey's level random? If you use the wildbattle command, it's going to go off the data you put in to that command, making the special moot anyway. The special only works for random encounters in grass or surfing, etc, not when using the wildbattle command.

Maybe you can explain more exactly what you're trying to do ... I think i understand that you have a sprite that is supposed to walk up to you when it sees you and start a wild Pokemon battle with a Pidgey, but not sure what else you're after exactly, except that you don't want Pidgey's level to be static (I think).
Well, from what I gathered was that the Run Trainer Script just allows the execution of a script without calling the trainer command. (i.e. trainerbattle 0x0) It's supposed to "activate" based on the flag in your A-Map, because there seems to be a check somewhere in there, and after that it runs the sub-routine for the trainerbattle-like command, which means it does the !box, and calls the battle.

Now, there's also supposed to be a Wild-data switch, which as you mentioned works for the grass, and there's supposed to be a trainer switch, which would work on trainer battles. I guess I figured that I'd try to mimic a trainerbattle using the Run Trainer Script so that an OW (Pokemon) would force a battle in the wild, instead of you having to randomly generate it with x% chance in grass.

However, I'm not so sure that this method would work because as it's been stated by both of us: the wild data switch is for the grass, and I don't think the wild battle data can be brought over to the WildBattle command? Since it's a pre-determined script(as you mentioned). I'm still some-what intermediate when it comes to scripting. If you can then it's probably way over my head. Second, the trainer switch wouldn't work either because then it'd also be able to control the level via vars, but then it'd be a trainer battle...

Thanks for clearing up some of the functions, though. I have a hard time understanding some parts of JPAN's manual. xd

edit: I had another thought. If I remember correctly, there's a "Wild Battle Generator." It was meant to be used for background byte behavior, but maybe I could convert it to generate a "Wild Battle" instead of using the WildBattle command?

edit 2:
Spoiler:
#dynamic 0x800000

#org @start
lock
checkflag 0x1000 'checks for flag 1000
if 0x1 goto @Set 'skips if set
setflag 0x1000 'sets flag if it hasn't been already
setvar 0x8005 0xffff 'Chance of apperance, in this case always
setvar 0x4051 0x0a51 'sets the battle level wild Pokemon
writebytetooffset 0x10 0x02 'Pidgey encounter data
writebytetooffset 0x05 0x03
writebytetooffset 0x00 0xf4
writebytetooffset 0x10 0x88
setvar 0x8006 0x0203 'load from pointer, where we wrote the data
setvar 0x8007 0xf488 'second half of the first offset
special 0x58 'calls special 58 which changes the wild data to the offset
cry 0x10 0x0 'plays sound for Pidgey
msgbox @Cry 0x2 'points to text
special 0x97 'calls random Wild Battle generator
release
end

#org @Set
special 0x59 'clears the set data for Wild Pokemon
clearflag 0x1000 'clears the flag
release
end

#org @Cry
= Pidgeyy

I added the generator, but it doesn't seem to activate the special. I'm guessing I messed up the writebyte again? I couldn't find very much detail that went into that command...I tried writing it, but the offset must still be off? I didn't create the hex table, because I want it dynamic. I may have inverted it again, but I'm not sure...=\ It looks like the only part of the script not executing is the generator, because it still shows the msgbox and plays the cry?

Again, any help would be much appreciated. -.-'

edit 3: After further testing it seems that the battle actually DOES generate, only not the first time you "speak" to it(it still doesn't do the trainer thing). It also doesn't make it only Pidgey, it also gave a Ratatta. Which would mean that the pointer isn't functioning. Because it's not pointing to the new data like it's supposed to...it's using the old table. Or, because the script only writes the byte for one block, it's not using the others...but that's debatable because then it should be ????...it could also be the daa switch again, I'm not sure...the actual grass, that the switch controls, works perfectly. All the Pokemon in the wild are the same lvl, which is how it's supposed to work. But then again, it's using the old table, so Ratatta appears.

Another thing is that the encounter ratio is off, so it's only generating with a x(?)%. thus resulting in multiple re-tries in order to complete the script process. That's all I could come up with...I'll try to add the table in hex and point to it, as suggested before. But I'm not sure if that would fix the encounter glitch. Any other suggestions?

edit 4(wow this is a lot of editting): I've uploaded a video that may be more helpful.

You can find the updated script in the summary, beneath the video. I had a flag in there, but I quickly found out that it would cause an infinite loop, because I also got the Run Trainer Script to function properly. Basiclly, I just need help with the whole "table" thing - I got the pointer, and I believe I set it correctly, but it's still not using it in the switch...everything else, besides the encounter ratio is working fine. Hopefully the video makes it easier to understand.

If you'd like support this hack, then please add this to your sig!
http://i266.photobucket.com/albums/ii245/xmouvelianx/exdeltaspeciess.png
Pixel Placement - My Pixel Art Showcasing thread;
http://www.pokecommunity.com/showthread.php?t=195942
You can see the latest concept art for exDelta here, along with some other things related and not to the hack!