Go Back   The PokéCommunity Forums > ROM Hacking > ROM Hacking Hub

Notices
For all updates, view the main page.

ROM Hacking Hub General discussions about ROM Hacking and Emulation. Not sure where to start? This is the place for you.
Posting links to ROMs is illegal and is not tolerated anywhere on the forum.
New threads in this forum are to be approved by a moderator before they are displayed.



Closed Thread
Click here to go to the first staff post in this thread.  
Thread Tools
  #5451    
Old March 28th, 2011 (05:30 PM).
SuperMeip's Avatar
SuperMeip
Beginning Trainer
 
Join Date: Mar 2011
Gender: Male
Quote originally posted by destinedjagold:


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?
  #5452    
Old March 28th, 2011 (05:34 PM).
destinedjagold's Avatar
destinedjagold
Oh Hai Thar~ 'ω'
Community Supporter
 
Join Date: May 2007
Location: Philippines
Gender: Male
Nature: Careful
Copy the Unknown and the Var number only.
  #5453    
Old March 28th, 2011 (05:59 PM).
SuperMeip's Avatar
SuperMeip
Beginning Trainer
 
Join Date: Mar 2011
Gender: Male
Quote originally posted by destinedjagold:
Copy the Unknown and the Var number only.
I copied them and it didn't work, but when I changed the vat number to a new one it suddenly worked, but now my sprite turns away instead of him facing me
  #5454    
Old March 29th, 2011 (02:11 AM). Edited March 29th, 2011 by Pogeygothaxed.
Pogeygothaxed's Avatar
Pogeygothaxed
Pokémon exDeltaSpecies Creator
 
Join Date: Jun 2009
Location: Too far away from my girlfriend.
Age: 24
Gender: Male
Nature: Adamant
Send a message via Windows Live Messenger to Pogeygothaxed
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!
  #5455    
Old March 29th, 2011 (11:51 AM).
metapod23's Avatar
metapod23
Hardened Trainer
 
Join Date: Mar 2009
Gender: Male
Nature: Timid
Quote originally posted by Pogeygothaxed:
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:

Code:
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:

Code:
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).
__________________
  #5456    
Old March 29th, 2011 (11:58 AM).
Swellow rules
Beginning Trainer
 
Join Date: Jul 2007
Location: Calgary, AB
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.
Code:
#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
  #5457    
Old March 29th, 2011 (01:02 PM).
AtlasOnEarth
Beginning Trainer
 
Join Date: Feb 2011
Gender: Male
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:
Code:
#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...
  #5458    
Old March 29th, 2011 (02:59 PM). Edited March 29th, 2011 by Pogeygothaxed.
Pogeygothaxed's Avatar
Pogeygothaxed
Pokémon exDeltaSpecies Creator
 
Join Date: Jun 2009
Location: Too far away from my girlfriend.
Age: 24
Gender: Male
Nature: Adamant
Send a message via Windows Live Messenger to Pogeygothaxed
Quote originally posted by metapod23:
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:

Code:
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:

Code:
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!
  #5459    
Old March 29th, 2011 (07:42 PM).
SuperMeip's Avatar
SuperMeip
Beginning Trainer
 
Join Date: Mar 2011
Gender: Male
Anybody know the offset for the champion battle in ruby, along with how to make the end credits roll?
No matter what I can't find the champion(steven)'s offset in the elite four, everything has $000000 in a-map and there are no scripts
  #5460    
Old March 30th, 2011 (01:00 PM). Edited March 30th, 2011 by metapod23.
metapod23's Avatar
metapod23
Hardened Trainer
 
Join Date: Mar 2009
Gender: Male
Nature: Timid
Quote originally posted by Pogeygothaxed:
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.
I think I may have misunderstood something about the special before. I don't think (from my understanding of the manual) that you can dynamically load a set of Pokemon to battle with. 0x8006 in this special is used to set the "pointer location" - which should mean that it has to be a pointer. I think JPAN just allowed you three different ways of loading the pointer to the Pokemon data.

That being said, if I'm right about this, you would have to add the data in a hex editor manually and keep the offset. (If I'm not right, I have no idea how to to the switch dynamically, sorry.)

You should have to have a set of data consisting of 4 repeating bytes. Since it's a grass battle, you need a total of twelve slots, so if you wanted a random Rattata of various levels (let's say each one range from level 1-5 in the first slot, 6-10 in the second, 11-15 in the third, etc.) the hex data you would insert would be:

Code:
01 05 00 13 06 0A 00 13 0B 0F 00 13 10 14 00 13 15 19 00 13 1A 1E 00 13 1F 24 00
13 25 29 00 13 2A 2E 00 13 2F 33 00 13 34 38 00 13 39 3D 00 13
Every four bytes would indicate a new Pokemon. You have to list all twelve, or else you'll get question-mark Pokemon instead.

I may try this special out and report back to you to see if I can get it to work.

EDIT: Reading up on it, it doesn't appear that special 0x97 actually generates an instant battle - rather, it seems to just allow random battles to take place at the current map.

Also, I tried the special but haven't gotten it to work properly - I get question mark Pokemon appearing.

I wonder, though, why can't you use the random command to generate you random wild battles. Like, if you wanted a random battle with, say, Pikachu, Rattata, Pidgey, and Spearow of the same level, you could do:

Code:
random 0x4
compare lastresult 0x0
if 0x1 call @pikachu
compare lastresult 0x1
if 0x1 call @rattata
compare lastresult 0x2
if 0x1 call @pidgey
compare lastresult 0x3
if 0x1 call @spearow
msgbox @Cry 0x2
release
end

#org @pikachu
wildbattle 0x19 0xa 0x0
return

#org @rattata
wildbattle 0x13 0xa 0x0
return

#org @pidgey
wildbattle 0x10 0xa 0x0
return

#org @spearow
wildbattle 0x15 0xa 0x0
return
?
__________________
  #5461    
Old March 30th, 2011 (10:50 PM). Edited March 31st, 2011 by Pogeygothaxed.
Pogeygothaxed's Avatar
Pogeygothaxed
Pokémon exDeltaSpecies Creator
 
Join Date: Jun 2009
Location: Too far away from my girlfriend.
Age: 24
Gender: Male
Nature: Adamant
Send a message via Windows Live Messenger to Pogeygothaxed
Quote originally posted by metapod23:
I think I may have misunderstood something about the special before. I don't think (from my understanding of the manual) that you can dynamically load a set of Pokemon to battle with. 0x8006 in this special is used to set the &quot;pointer location&quot; - which should mean that it has to be a pointer. I think JPAN just allowed you three different ways of loading the pointer to the Pokemon data.

That being said, if I'm right about this, you would have to add the data in a hex editor manually and keep the offset. (If I'm not right, I have no idea how to to the switch dynamically, sorry.)

You should have to have a set of data consisting of 4 repeating bytes. Since it's a grass battle, you need a total of twelve slots, so if you wanted a random Rattata of various levels (let's say each one range from level 1-5 in the first slot, 6-10 in the second, 11-15 in the third, etc.) the hex data you would insert would be:

Code:
01 05 00 13 06 0A 00 13 0B 0F 00 13 10 14 00 13 15 19 00 13 1A 1E 00 13 1F 24 00
13 25 29 00 13 2A 2E 00 13 2F 33 00 13 34 38 00 13 39 3D 00 13
Every four bytes would indicate a new Pokemon. You have to list all twelve, or else you'll get question-mark Pokemon instead.

I may try this special out and report back to you to see if I can get it to work.

EDIT: Reading up on it, it doesn't appear that special 0x97 actually generates an instant battle - rather, it seems to just allow random battles to take place at the current map.

Also, I tried the special but haven't gotten it to work properly - I get question mark Pokemon appearing.

I wonder, though, why can't you use the random command to generate you random wild battles. Like, if you wanted a random battle with, say, Pikachu, Rattata, Pidgey, and Spearow of the same level, you could do:

Code:
random 0x4
compare lastresult 0x0
if 0x1 call @pikachu
compare lastresult 0x1
if 0x1 call @rattata
compare lastresult 0x2
if 0x1 call @pidgey
compare lastresult 0x3
if 0x1 call @spearow
msgbox @Cry 0x2
release
end

#org @pikachu
wildbattle 0x19 0xa 0x0
return

#org @rattata
wildbattle 0x13 0xa 0x0
return

#org @pidgey
wildbattle 0x10 0xa 0x0
return

#org @spearow
wildbattle 0x15 0xa 0x0
return
?
Well, that's the thing...I didn't want random Pokemon. I wanted to make it like a WildBattle command would be; where it calls that Pokemon. I also wanted to set the level with this variable: setvar 0x4051 0x0a51 'sets the battle level wild Pokemon :I commented in that it sets the battle level, but the actual value of 0xayy (yy being the switch number, i.e. 4051 = Wild, 4052 = Trainer. However, I don't think this particular value would work with 4052?) is supposed to get the party's high and lowest levels, then set the level between that randomly. That way, instead of having the lvl be set, it'd change with your Party.

I also included the Run Trainer Script so that it'd act like a trainer, as shown in the video. But the way I'd have to set it up, from what you told me, is to make a table for each Pokemon in the area, consisting of 12 slots for each, and then point towards that; changing the pointer with the Pokemon OW/Script. That's how it gets complicated, because it needs to be set to that Pokemon as the OW. Then there's the wild generation part, like in the video...as you said: it only makes a chance of encounter(like walking in grass) so it won't force the battle, like in the video. You'd have to "speak" to it, re-executing the script, perhaps several times, until you got the correct percentage. True, with more slots you add more chance, however like in grass, it still won't produce a battle every step.

So at the moment I'm not sure how I could work around it, or if it's even possible to get the desired results. Even if I could find a way to force a battle, there would still need to be those tables, which would take up a decent amount of space for 356 Pokemon...
__________________

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!
  #5462    
Old March 31st, 2011 (05:37 PM).
metapod23's Avatar
metapod23
Hardened Trainer
 
Join Date: Mar 2009
Gender: Male
Nature: Timid
Quote originally posted by Pogeygothaxed:
Well, that's the thing...I didn't want random Pokemon. I wanted to make it like a WildBattle command would be; where it calls that Pokemon. I also wanted to set the level with this variable: setvar 0x4051 0x0a51 'sets the battle level wild Pokemon :I commented in that it sets the battle level, but the actual value of 0xayy (yy being the switch number, i.e. 4051 = Wild, 4052 = Trainer. However, I don't think this particular value would work with 4052?) is supposed to get the party's high and lowest levels, then set the level between that randomly. That way, instead of having the lvl be set, it'd change with your Party.

I also included the Run Trainer Script so that it'd act like a trainer, as shown in the video. But the way I'd have to set it up, from what you told me, is to make a table for each Pokemon in the area, consisting of 12 slots for each, and then point towards that; changing the pointer with the Pokemon OW/Script. That's how it gets complicated, because it needs to be set to that Pokemon as the OW. Then there's the wild generation part, like in the video...as you said: it only makes a chance of encounter(like walking in grass) so it won't force the battle, like in the video. You'd have to "speak" to it, re-executing the script, perhaps several times, until you got the correct percentage. True, with more slots you add more chance, however like in grass, it still won't produce a battle every step.

So at the moment I'm not sure how I could work around it, or if it's even possible to get the desired results. Even if I could find a way to force a battle, there would still need to be those tables, which would take up a decent amount of space for 356 Pokemon...
First, I have to plead ignorance on special 0x58. I thought I understood it, but I can't figure out what needs to be done to get it to work correctly. I now believe that it is done in-script, and no hex-editing is required, but nothing I've tried works. I might try a little more later, as I think it has to do with using the writebytetooffset to change each individual byte, but I'm not sure. JPAN's manual is often worded in a way that I can't grasp what needs to be done.

... That being said, if I'm understanding correctly, you actually want it to run as a trainer script, not a wild battle. The problem is, I think you're misunderstanding the purpose of the "run trainer script." It doesn't cause wild battles to act as trainer battles as far as i know - it just allows the sprite to act as if it's a trainer (exclamation mark, run up to the player) and then execute the script without there needing to be a trainberbattle command in the script. So it won't cause a wild battle to act as a trainer battle.

Now I understand why you're using variable 0x4052. What you want to do can easily be done with a trainer that's already programmed into the game. Here's an example - if you want to use trainerbattle 0x1, and you want the trainer's Pokemon to be two levels higher than your highest level Pokemon, it would go like this:

Code:
#org @start
setvar 0x4052 0x0202
msgbox @cry MSG_FACE
trainerbattle 0x3 0x1 0x0 @lose
setvar 0x4052 0x0
release
end

#org @cry
= Pidgeyy

#org @lose
= I lost!
^ This would make trainer 0x1 (can be edited with A-Trainer) have his whole party consist of Pokemon with levels that are two higher than your highest leveled Pokemon. If I'm understanding right, this is what you're trying to do more or less, but let me know if there's something else I'm missing.
__________________
  #5463    
Old March 31st, 2011 (11:45 PM). Edited April 1st, 2011 by Pogeygothaxed.
Pogeygothaxed's Avatar
Pogeygothaxed
Pokémon exDeltaSpecies Creator
 
Join Date: Jun 2009
Location: Too far away from my girlfriend.
Age: 24
Gender: Male
Nature: Adamant
Send a message via Windows Live Messenger to Pogeygothaxed
Quote originally posted by metapod23:
First, I have to plead ignorance on special 0x58. I thought I understood it, but I can't figure out what needs to be done to get it to work correctly. I now believe that it is done in-script, and no hex-editing is required, but nothing I've tried works. I might try a little more later, as I think it has to do with using the writebytetooffset to change each individual byte, but I'm not sure. JPAN's manual is often worded in a way that I can't grasp what needs to be done.

... That being said, if I'm understanding correctly, you actually want it to run as a trainer script, not a wild Arrest. The problem is, I think you're misunderstanding the purpose of the &quot;run trainer script.&quot; It doesn't cause wild Arrests to act as trainer Arrests as far as i know - it just allows the sprite to act as if it's a trainer (exclamation mark, run up to the player) and then execute the script without there needing to be a trainberArrest command in the script. So it won't cause a wild Arrest to act as a trainer Arrest.

Now I understand why you're using variable 0x4052. What you want to do can easily be done with a trainer that's already programmed into the Blanket. Here's an example - if you want to use trainerArrest 0x1, and you want the trainer's Pokemon to be two levels higher than your highest level Pokemon, it would go like this:

Code:
#org @start
setvar 0x4052 0x0202
msgbox @cry MSG_FACE
trainerArrest 0x3 0x1 0x0 @lose
setvar 0x4052 0x0
release
end

#org @cry
= Pidgeyy

#org @lose
= I lost!
^ This would make trainer 0x1 (can be edited with A-Trainer) have his whatle party consist of Pokemon with levels that are two higher than your highest leveled Pokemon. If I'm understanding right, this is what you're trying to do more or less, but let me know if there's something else I'm missing.
No, I know that...that was the point. I didn't want a trainer Arrest. I wanted a wild (ow) Pokemon to walk around like the trainer sprites do, with the view radius so when it sees you in executes the script(which would be like a wild Arrest). It was working exactly how I thought it would in the last script I made. Here's the script:

Spoiler:
#dynamic 0x800000 #org @start lock setvar 0x4051 0x0a51 'sets the Arrest level wild Pokemon setvar 0x8004 0x0800 'pointer location setvar 0x8005 0x0000 'second half of the first offset setvar 0x8005 0x0 'load from the pointer setvar 0x8006 0x0 'load with the pointer 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 Arrest generator release end #org @Cry = Pidgeyy


The problem is trying to call the table. I could write it in directly, then re-point to it, but how would I keep it from using the same table with a different OW? i.e. I have a Pidgey OW. I call the switch to trigger the Wild Data change, so it makes all 12 slots switch to Pidgey. The reason it'd switch all the slots to that Pokemon, is so that there wouldn't be a ratatta appearing like in the video. But now I have a Ratatta OW roaming on a different part of the screen, and it triggers the script. I don't want Pidgey to appear because the table didn't switch. I'm guessing you'd just use the load pointer, and read from that location? If you used Writebyte, would you just re-write it in a new script and it would over-write the old bytes? XSE didn't tell me much about it besides the obvious, and no tutorial went in-depth with that command.

But with that aside, there isn't a way to force the wild Arrest without pre-setting it. In your script, you used the variable to set the lvl always above 2, but it'd still be a trainer - with a loss message and a sprite appearing before / after the Arrest screen. Refering back to WildArrest command, is there anyway to use a variable instead of 0xX? X = Level. That's the only thing I could think of atm. You'd set the Var with the value of the special and then it'd use that instead of X...nvm, I get an overflow on the line. It won't accept it. Worth a try I guess.

P.s.That's why I was using 4051, because it sets the Wild Data not the Trainers on the map to use the variable. Sorry for not making things more clear...=\ my communication skills are lacking. But there'd need to be a lot of tables and it wouldn't really be worth it to try to implement a feature like that unless it was dynamic.

P.s.s. I was just curious and went looking through an Emerald ROM for the first event when the Prof. gets attacked by a Wild Pokemon. I loaded the scripts in XSE to see if I could find a WildArrest command, which I did not. I may have overlooked part of the script with it, but I'm pretty sure it'd be in the choose your Pokemon part. iirc, it starts the Arrest right after you open the bag, etc. But it didn't in the script, unless it was a special or a flag...and the actual OW(Pokemon) didn't have a script attached to it.
__________________

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!
  #5464    
Old April 1st, 2011 (06:39 AM).
metapod23's Avatar
metapod23
Hardened Trainer
 
Join Date: Mar 2009
Gender: Male
Nature: Timid
Quote originally posted by Pogeygothaxed:
No, I know that...that was the point. I didn't want a trainer Arrest. I wanted a wild (ow) Pokemon to walk around like the trainer sprites do, with the view radius so when it sees you in executes the script(which would be like a wild Arrest). It was working exactly how I thought it would in the last script I made. Here's the script:

Spoiler:
#dynamic 0x800000 #org @start lock setvar 0x4051 0x0a51 'sets the Arrest level wild Pokemon setvar 0x8004 0x0800 'pointer location setvar 0x8005 0x0000 'second half of the first offset setvar 0x8005 0x0 'load from the pointer setvar 0x8006 0x0 'load with the pointer 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 Arrest generator release end #org @Cry = Pidgeyy


The problem is trying to call the table. I could write it in directly, then re-point to it, but how would I keep it from using the same table with a different OW? i.e. I have a Pidgey OW. I call the switch to trigger the Wild Data change, so it makes all 12 slots switch to Pidgey. The reason it'd switch all the slots to that Pokemon, is so that there wouldn't be a ratatta appearing like in the video. But now I have a Ratatta OW roaming on a different part of the screen, and it triggers the script. I don't want Pidgey to appear because the table didn't switch. I'm guessing you'd just use the load pointer, and read from that location? If you used Writebyte, would you just re-write it in a new script and it would over-write the old bytes? XSE didn't tell me much about it besides the obvious, and no tutorial went in-depth with that command.

But with that aside, there isn't a way to force the wild Arrest without pre-setting it. In your script, you used the variable to set the lvl always above 2, but it'd still be a trainer - with a loss message and a sprite appearing before / after the Arrest screen. Refering back to WildArrest command, is there anyway to use a variable instead of 0xX? X = Level. That's the only thing I could think of atm. You'd set the Var with the value of the special and then it'd use that instead of X...nvm, I get an overflow on the line. It won't accept it. Worth a try I guess.

P.s.That's why I was using 4051, because it sets the Wild Data not the Trainers on the map to use the variable. Sorry for not making things more clear...=\ my communication skills are lacking. But there'd need to be a lot of tables and it wouldn't really be worth it to try to implement a feature like that unless it was dynamic.

P.s.s. I was just curious and went looking through an Emerald ROM for the first event when the Prof. gets attacked by a Wild Pokemon. I loaded the scripts in XSE to see if I could find a WildArrest command, which I did not. I may have overlooked part of the script with it, but I'm pretty sure it'd be in the choose your Pokemon part. iirc, it starts the Arrest right after you open the bag, etc. But it didn't in the script, unless it was a special or a flag...and the actual OW(Pokemon) didn't have a script attached to it.
So you want to have the Pidgey OW see you, execute a script, and then have only Pidgey attack you until in the wild until you reset it?
__________________
  #5465    
Old April 1st, 2011 (08:14 AM).
RegisteelX
zomgwut?
 
Join Date: Oct 2009
Age: 22
Gender: Male
Nature: Timid
I have a question.
How can you make this script so that the person doesnt return to the original position.

Code:
#dynamic 0x800727

#org @start
checkflag 0x808
if 0x1 call @next
msgbox @talk 0x6
applymovement 0x09 @move1
waitmovement 0x2
waitmovement 0x0
msgbox @next 0x6
setflag 0x808
release
end

#org @move1
#raw 0x06
#raw 0xFE

#org @talk
= You have collected all badges!\n you may pass.

#org @next
= good luck, your gonna need it.
If sombody can help me.
__________________


  #5466    
Old April 1st, 2011 (05:26 PM). Edited April 1st, 2011 by Pogeygothaxed.
Pogeygothaxed's Avatar
Pogeygothaxed
Pokémon exDeltaSpecies Creator
 
Join Date: Jun 2009
Location: Too far away from my girlfriend.
Age: 24
Gender: Male
Nature: Adamant
Send a message via Windows Live Messenger to Pogeygothaxed
Quote originally posted by metapod23:
So you want to have the Pidgey OW see you, execute a script, and then have only Pidgey attack you until in the wild until you reset it?
Pretty much. I could do that easily, if I didn't need the variables to change the level accordingly. x.x I also wanted to see if I could make it check the level, then change the OW with dynamic OWs. (Maybe activated with a walk-script on the first tiles in the map, or a level map. But from what I read the level maps are limited? I haven't got the first part to work, so I won't bcrazy with that right now.)So if it would call you battling a Pidgey at lvl 18, it'd be a Pidgeotto instead.

I was looking for a way to replace the "randomly generate Arrests in grass" I don't know, I was just experimenting with the new code available. I wasn't too big on scripting up 'til now, so I had no idea what anything meant when it was released. But now I'm trying to get my hands more dirty because I couldn't achieve what I wanted in my crazy hacks.

Quote originally posted by RegisteelX:
I have a question.
How can you make this script so that the person doesnt return to the original position.

Code:
#dynamic 0x800727

#org @start
checkflag 0x808
if 0x1 call @next
msgbox @talk 0x6
applymovement 0x09 @move1
waitmovement 0x2
waitmovement 0x0
msgbox @next 0x6
setflag 0x808
release
end

#org @move1
#raw 0x06
#raw 0xFE

#org @talk
= You have collected all plasplasbadges!\n you may pass.

#org @next
= good luck, your gonna need it.
If sombody can help me.
I haven't script much movement, but I believe you need to use the command "waitmovement" and then set the amount of time to wait.

i.e.
applymovement 0xX @movelist 'X = Person number
waitmovement 0x0
Hopefully this helps.
__________________

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!
  #5467    
Old April 1st, 2011 (06:59 PM).
imaier's Avatar
imaier
Pro Hacker
 
Join Date: Mar 2011
Location: Canada Eh?
Gender: Male
Nature: Calm
Send a message via Skype™ to imaier
Quote originally posted by Swellow rules:
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.
Code:
#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

Well First of all. After you do:
Code:
showpokepic 0x8F 0xA 0x3
you are going to have to do:
Code:
hidepokepic 0x8F 0xA 0x3
or the picture will just site there forever.

Unfortunatly thats all I can see wrong...are you using PokeScript or
XSE because XSE is much better.
  #5468    
Old April 2nd, 2011 (12:51 AM).
RegisteelX
zomgwut?
 
Join Date: Oct 2009
Age: 22
Gender: Male
Nature: Timid
Quote originally posted by Pogeygothaxed:
Pretty much. I could do that easily, if I didn't need the variables to change the level accordingly. x.x I also wanted to see if I could make it check the level, then change the OW with dynamic OWs. (Maybe activated with a walk-script on the first tiles in the map, or a level map. But from what I read the level maps are limited? I haven't got the first part to work, so I won't bcrazy with that right now.)So if it would call you battling a Pidgey at lvl 18, it'd be a Pidgeotto instead.

I was looking for a way to replace the "randomly generate Arrests in grass" I don't know, I was just experimenting with the new code available. I wasn't too big on scripting up 'til now, so I had no idea what anything meant when it was released. But now I'm trying to get my hands more dirty because I couldn't achieve what I wanted in my crazy hacks.



I haven't script much movement, but I believe you need to use the command "waitmovement" and then set the amount of time to wait.

i.e.
applymovement 0xX @movelist 'X = Person number
waitmovement 0x0
Hopefully this helps.
Thanks, but that didn't help. As soon as he gets out of view, he returns to its original place and does nothing anymore.
__________________


  #5469    
Old April 2nd, 2011 (05:07 AM). Edited April 2nd, 2011 by CrazyShooter.
CrazyShooter's Avatar
CrazyShooter
Beginning Trainer
 
Join Date: Apr 2011
Location: Tartarus; come visit me some time! :)
Gender: Male
Can anyone please help me with this script? I am not sure what's wrong with it but it doesn't compile. It says "No "#org/#seek directives were found" when I try to compile it.
What I'm trying to do is to make a NPC not let me past a point if I don't have the boulderbadge (since it is leaf green version I'm hacking). Actually, I just copied another NPC's script, edited the text and added the dynamic offset since I don't want to edit an old script, rather i want to make a new one.

(Let's call this one Script A)
Spoiler:
dynamic 0x2DD2E9

#org @start
lock
faceplayer
setvar 0x4001 0x1
bufferstd 0x0 0xF
goto @snippet1

'---------------
#org @snippet1
comparevars 0x405F 0x4001
if 0x4 goto @snippet2
copyvar 0x8000 0x4001
compare 0x8000 0x1
if 0x1 goto @snippet3
compare 0x8000 0x2
if 0x1 goto @snippet4
compare 0x8000 0x3
if 0x1 goto @snippet5
compare 0x8000 0x4
if 0x1 goto @snippet6
compare 0x8000 0x5
if 0x1 goto @snippet7
compare 0x8000 0x6
if 0x1 goto @snippet8
compare 0x8000 0x7
if 0x1 goto @snippet9
compare 0x8000 0x8
if 0x1 goto @snippet10
end

'---------------
#org @snippet2
preparemsg @string1 '"Go right ahead."
waitmsg
fanfare 0x101
waitfanfare
waitkeypress
release
end

'---------------
#org @snippet3
checkflag 0x820
if 0x1 goto @snippet11
goto @snippet12

'---------------
#org @snippet4
checkflag 0x821
if 0x1 goto @snippet13
goto @snippet14

'---------------
#org @snippet5
checkflag 0x822
if 0x1 goto @snippet13
goto @snippet14

'---------------
#org @snippet6
checkflag 0x823
if 0x1 goto @snippet13
goto @snippet14

'---------------
#org @snippet7
checkflag 0x824
if 0x1 goto @snippet13
goto @snippet14

'---------------
#org @snippet8
checkflag 0x825
if 0x1 goto @snippet13
goto @snippet14

'---------------
#org @snippet9
checkflag 0x826
if 0x1 goto @snippet13
goto @snippet14

'---------------
#org @snippet10
checkflag 0x827
if 0x1 goto @snippet13
goto @snippet14

'---------------
#org @snippet11
preparemsg @string1 '"Go right ahead."
waitmsg
fanfare 0x101
waitfanfare
waitkeypress
copyvar 0x405F 0x4001
release
end

'---------------
#org @snippet12
msgbox @string2 MSG_KEEPOPEN '"I'm sorry, in this privately\nowned area of PALLET TOWN\lonly trainers are allowed through.\pWhat? You are a trainer? I don't believe you!\pShow me a gym badge and I'll believe you."
sound 0x16
msgbox @string3 MSG_KEEPOPEN '"Rules are rules.\nI can't let you pass."
release
end

'---------------
#org @snippet13
msgbox @string4 MSG_KEEPOPEN '"I'm sorry, in this privately\nowned area of PALLET TOWN\lonly trainers are allowed through.\pWhat? You are a trainer? I don't believe you!\pOh! That is the [buffer1]!\c\h17\c\h0BAA\c\h08[ME]\c\h18\pOkay, then.\nPlease, go right ahead."
copyvar 0x405F 0x4001
release
end

'---------------
#org @snippet14
preparemsg @string5 '"You can pass here only if you are a trainer. \pYou don't have a gym badge\nyet.\pYou have to have it to get to\nthe Pokemon Academy Area."
waitmsg
sound 0x16
waitkeypress
closeonkeypress
checksound
release
end


'---------
' Strings
'---------
#org @string1
= Go right ahead.

#org @string2
= I'm sorry, in this privately\nowned area of PALLET TOWN\lonly trainers are allowed through.\pWhat? You are a trainer? I don't believe you!\pShow me a gym badge and I'll believe you.

#org @string3
= Rules are rules.\nI can't let you pass.

#org @string4
= I'm sorry, in this privately\nowned area of PALLET TOWN\lonly trainers are allowed through.\pWhat? You are a trainer? I don't believe you!\pOh! That is the [buffer1]!\c\h17\c\h0BAA\c\h08[ME]\c\h18\pOkay, then.\nPlease, go right ahead.

#org @string5
= You can pass here only if you are a trainer. \pYou don't have a gym badge\nyet.\pYou have to have it to get to\nthe Pokemon Academy Area.


Now have a look at the picture in the attachement.

See, when you step infront of the door, the script activates which makes the NPC prevent you from going there.

The original scripts are:

Player (Let's call this script B):
Spoiler:
'---------------
#org @start
lock
faceplayer
setvar 0x4001 0x1
bufferstd 0x0 0xF
goto @snippet1

'---------------
#org @snippet1
comparevars 0x405F 0x4001
if 0x4 goto @snippet2
copyvar 0x8000 0x4001
compare 0x8000 0x1
if 0x1 goto @snippet3
compare 0x8000 0x2
if 0x1 goto @snippet4
compare 0x8000 0x3
if 0x1 goto @snippet5
compare 0x8000 0x4
if 0x1 goto @snippet6
compare 0x8000 0x5
if 0x1 goto @snippet7
compare 0x8000 0x6
if 0x1 goto @snippet8
compare 0x8000 0x7
if 0x1 goto @snippet9
compare 0x8000 0x8
if 0x1 goto @snippet10
end

'---------------
#org @snippet2
preparemsg @string1 '"Oh! That is the [buffer1]!\nGo rig..."
waitmsg
fanfare 0x101
waitfanfare
waitkeypress
release
end

'---------------
#org @snippet3
checkflag 0x820
if 0x1 goto @snippet11
goto @snippet12

'---------------
#org @snippet4
checkflag 0x821
if 0x1 goto @snippet13
goto @snippet14

'---------------
#org @snippet5
checkflag 0x822
if 0x1 goto @snippet13
goto @snippet14

'---------------
#org @snippet6
checkflag 0x823
if 0x1 goto @snippet13
goto @snippet14

'---------------
#org @snippet7
checkflag 0x824
if 0x1 goto @snippet13
goto @snippet14

'---------------
#org @snippet8
checkflag 0x825
if 0x1 goto @snippet13
goto @snippet14

'---------------
#org @snippet9
checkflag 0x826
if 0x1 goto @snippet13
goto @snippet14

'---------------
#org @snippet10
checkflag 0x827
if 0x1 goto @snippet13
goto @snippet14

'---------------
#org @snippet11
preparemsg @string1 '"Oh! That is the [buffer1]!\nGo rig..."
waitmsg
fanfare 0x101
waitfanfare
waitkeypress
copyvar 0x405F 0x4001
release
end

'---------------
#org @snippet12
msgbox @string2 MSG_KEEPOPEN '"Only truly skilled TRAINERS are\na..."
sound 0x16
msgbox @string3 MSG_KEEPOPEN '"Rules are rules.\nI can't let you ..."
release
end

'---------------
#org @snippet13
msgbox @string4 MSG_KEEPOPEN '"You can pass here only if you have..."
copyvar 0x405F 0x4001
release
end

'---------------
#org @snippet14
preparemsg @string5 '"You can pass here only if you have..."
waitmsg
sound 0x16
waitkeypress
closeonkeypress
checksound
release
end


'---------
' Strings
'---------
#org @string1
= Oh! That is the [buffer1]!\nGo right ahead.

#org @string2
= Only truly skilled TRAINERS are\nallowed through.\pYou don't have the [buffer1]\nyet!

#org @string3
= Rules are rules.\nI can't let you pass.

#org @string4
= You can pass here only if you have\nthe [buffer1].\pOh! That is the [buffer1]!\c\h17\c\h0BAA\c\h08[ME]\c\h18\pOkay, then.\nPlease, go right ahead.

#org @string5
= You can pass here only if you have\nthe [buffer1].\pYou don't have the [buffer1]\nyet.\pYou have to have it to get to\nthe POKeMON LEAGUE.


Other Script (Let's call it script C):
Spoiler:
'---------------
#org @start
lockall
setvar 0x4001 0x1
setvar 0x8009 0x1
bufferstd 0x0 0xF
goto @snippet1

'---------------
#org @snippet1
textcolor 0x0
applymovement 0x8009 @move1
waitmovement 0x0
copyvar 0x8000 0x4001
compare 0x8000 0x1
if 0x1 goto @snippet2
compare 0x8000 0x2
if 0x1 goto @snippet3
compare 0x8000 0x3
if 0x1 goto @snippet4
compare 0x8000 0x4
if 0x1 goto @snippet5
compare 0x8000 0x5
if 0x1 goto @snippet6
compare 0x8000 0x6
if 0x1 goto @snippet7
compare 0x8000 0x7
if 0x1 goto @snippet8
compare 0x8000 0x8
if 0x1 goto @snippet9
end

'---------------
#org @snippet2
checkflag 0x820
if 0x1 goto @snippet10
goto @snippet11

'---------------
#org @snippet3
checkflag 0x821
if 0x1 goto @snippet12
goto @snippet13

'---------------
#org @snippet4
checkflag 0x822
if 0x1 goto @snippet12
goto @snippet13

'---------------
#org @snippet5
checkflag 0x823
if 0x1 goto @snippet12
goto @snippet13

'---------------
#org @snippet6
checkflag 0x824
if 0x1 goto @snippet12
goto @snippet13

'---------------
#org @snippet7
checkflag 0x825
if 0x1 goto @snippet12
goto @snippet13

'---------------
#org @snippet8
checkflag 0x826
if 0x1 goto @snippet12
goto @snippet13

'---------------
#org @snippet9
checkflag 0x827
if 0x1 goto @snippet12
goto @snippet13

'---------------
#org @snippet10
preparemsg @string1 '"Oh! That is the [buffer1]!\nGo rig..."
waitmsg
fanfare 0x101
waitfanfare
waitkeypress
copyvar 0x405F 0x4001
releaseall
end

'---------------
#org @snippet11
msgbox @string2 MSG_KEEPOPEN '"Only truly skilled TRAINERS are\na..."
sound 0x16
msgbox @string3 MSG_KEEPOPEN '"Rules are rules.\nI can't let you ..."
closeonkeypress
applymovement MOVE_PLAYER @move2
applymovement 0x8009 @move3
waitmovement 0x0
releaseall
end

'---------------
#org @snippet12
msgbox @string4 MSG_KEEPOPEN '"You can pass here only if you have..."
copyvar 0x405F 0x4001
releaseall
end

'---------------
#org @snippet13
preparemsg @string5 '"You can pass here only if you have..."
waitmsg
sound 0x16
waitkeypress
closeonkeypress
checksound
applymovement MOVE_PLAYER @move2
applymovement 0x8009 @move3
waitmovement 0x0
releaseall
end


'---------
' Strings
'---------
#org @string1
= Oh! That is the [buffer1]!\nGo right ahead.

#org @string2
= Only truly skilled TRAINERS are\nallowed through.\pYou don't have the [buffer1]\nyet!

#org @string3
= Rules are rules.\nI can't let you pass.

#org @string4
= You can pass here only if you have\nthe [buffer1].\pOh! That is the [buffer1]!\c\h17\c\h0BAA\c\h08[ME]\c\h18\pOkay, then.\nPlease, go right ahead.

#org @string5
= You can pass here only if you have\nthe [buffer1].\pYou don't have the [buffer1]\nyet.\pYou have to have it to get to\nthe POKeMON LEAGUE.


'-----------
' Movements
'-----------
#org @move1
#raw 0x2F 'Face Left (Delayed)
#raw 0xFE 'End of Movements

#org @move2
#raw 0x10 'Step Down (Normal)
#raw 0xFE 'End of Movements

#org @move3
#raw 0x2D 'Face Down (Delayed)
#raw 0xFE 'End of Movements


Sorry for the long post.

P.S. I'm gonna need a script like Script C above to go with my script A, but I'd like to make the second script on my own, as long as you tell me whats wrong with script A.
Attached Images
File Type: png 2remil1.png‎ (20.8 KB, 4 views) (Save to Dropbox)
  #5470    
Old April 2nd, 2011 (05:19 AM).
DrFuji's Avatar
DrFuji
Helfen, Wehren, Heilen
Community Supporter
 
Join Date: Sep 2009
Location: Upside-downia
Age: 22
Gender: Male
Nature: Jolly
Quote originally posted by CrazyShooter:
Can anyone please help me with this script? I am not sure what's wrong with it but it doesn't compile. It says "No "#org/#seek directives were found" when I try to compile it.
What I'm trying to do is to make a NPC not let me past a point if I don't have the boulderbadge (since it is leaf green version I'm hacking). Actually, I just copied another NPC's script, edited the text and added the dynamic offset since I don't want to edit an old script, rather i want to make a new one.

(Let's call this one Script A)
Spoiler:
dynamic 0x2DD2E9

#org @start
lock
faceplayer
setvar 0x4001 0x1
bufferstd 0x0 0xF
goto @snippet1

'---------------
#org @snippet1
comparevars 0x405F 0x4001
if 0x4 goto @snippet2
copyvar 0x8000 0x4001
compare 0x8000 0x1
if 0x1 goto @snippet3
compare 0x8000 0x2
if 0x1 goto @snippet4
compare 0x8000 0x3
if 0x1 goto @snippet5
compare 0x8000 0x4
if 0x1 goto @snippet6
compare 0x8000 0x5
if 0x1 goto @snippet7
compare 0x8000 0x6
if 0x1 goto @snippet8
compare 0x8000 0x7
if 0x1 goto @snippet9
compare 0x8000 0x8
if 0x1 goto @snippet10
end

'---------------
#org @snippet2
preparemsg @string1 '"Go right ahead."
waitmsg
fanfare 0x101
waitfanfare
waitkeypress
release
end

'---------------
#org @snippet3
checkflag 0x820
if 0x1 goto @snippet11
goto @snippet12

'---------------
#org @snippet4
checkflag 0x821
if 0x1 goto @snippet13
goto @snippet14

'---------------
#org @snippet5
checkflag 0x822
if 0x1 goto @snippet13
goto @snippet14

'---------------
#org @snippet6
checkflag 0x823
if 0x1 goto @snippet13
goto @snippet14

'---------------
#org @snippet7
checkflag 0x824
if 0x1 goto @snippet13
goto @snippet14

'---------------
#org @snippet8
checkflag 0x825
if 0x1 goto @snippet13
goto @snippet14

'---------------
#org @snippet9
checkflag 0x826
if 0x1 goto @snippet13
goto @snippet14

'---------------
#org @snippet10
checkflag 0x827
if 0x1 goto @snippet13
goto @snippet14

'---------------
#org @snippet11
preparemsg @string1 '"Go right ahead."
waitmsg
fanfare 0x101
waitfanfare
waitkeypress
copyvar 0x405F 0x4001
release
end

'---------------
#org @snippet12
msgbox @string2 MSG_KEEPOPEN '"I'm sorry, in this privately\nowned area of PALLET TOWN\lonly trainers are allowed through.\pWhat? You are a trainer? I don't believe you!\pShow me a gym badge and I'll believe you."
sound 0x16
msgbox @string3 MSG_KEEPOPEN '"Rules are rules.\nI can't let you pass."
release
end

'---------------
#org @snippet13
msgbox @string4 MSG_KEEPOPEN '"I'm sorry, in this privately\nowned area of PALLET TOWN\lonly trainers are allowed through.\pWhat? You are a trainer? I don't believe you!\pOh! That is the [buffer1]!\c\h17\c\h0BAA\c\h08[ME]\c\h18\pOkay, then.\nPlease, go right ahead."
copyvar 0x405F 0x4001
release
end

'---------------
#org @snippet14
preparemsg @string5 '"You can pass here only if you are a trainer. \pYou don't have a gym badge\nyet.\pYou have to have it to get to\nthe Pokemon Academy Area."
waitmsg
sound 0x16
waitkeypress
closeonkeypress
checksound
release
end


'---------
' Strings
'---------
#org @string1
= Go right ahead.

#org @string2
= I'm sorry, in this privately\nowned area of PALLET TOWN\lonly trainers are allowed through.\pWhat? You are a trainer? I don't believe you!\pShow me a gym badge and I'll believe you.

#org @string3
= Rules are rules.\nI can't let you pass.

#org @string4
= I'm sorry, in this privately\nowned area of PALLET TOWN\lonly trainers are allowed through.\pWhat? You are a trainer? I don't believe you!\pOh! That is the [buffer1]!\c\h17\c\h0BAA\c\h08[ME]\c\h18\pOkay, then.\nPlease, go right ahead.

#org @string5
= You can pass here only if you are a trainer. \pYou don't have a gym badge\nyet.\pYou have to have it to get to\nthe Pokemon Academy Area.


Now have a look at the picture in the attachement.

See, when you step infront of the door, the script activates which makes the NPC prevent you from going there.

The original scripts are:

Player (Let's call this script B):
Spoiler:
'---------------
#org @start
lock
faceplayer
setvar 0x4001 0x1
bufferstd 0x0 0xF
goto @snippet1

'---------------
#org @snippet1
comparevars 0x405F 0x4001
if 0x4 goto @snippet2
copyvar 0x8000 0x4001
compare 0x8000 0x1
if 0x1 goto @snippet3
compare 0x8000 0x2
if 0x1 goto @snippet4
compare 0x8000 0x3
if 0x1 goto @snippet5
compare 0x8000 0x4
if 0x1 goto @snippet6
compare 0x8000 0x5
if 0x1 goto @snippet7
compare 0x8000 0x6
if 0x1 goto @snippet8
compare 0x8000 0x7
if 0x1 goto @snippet9
compare 0x8000 0x8
if 0x1 goto @snippet10
end

'---------------
#org @snippet2
preparemsg @string1 '"Oh! That is the [buffer1]!\nGo rig..."
waitmsg
fanfare 0x101
waitfanfare
waitkeypress
release
end

'---------------
#org @snippet3
checkflag 0x820
if 0x1 goto @snippet11
goto @snippet12

'---------------
#org @snippet4
checkflag 0x821
if 0x1 goto @snippet13
goto @snippet14

'---------------
#org @snippet5
checkflag 0x822
if 0x1 goto @snippet13
goto @snippet14

'---------------
#org @snippet6
checkflag 0x823
if 0x1 goto @snippet13
goto @snippet14

'---------------
#org @snippet7
checkflag 0x824
if 0x1 goto @snippet13
goto @snippet14

'---------------
#org @snippet8
checkflag 0x825
if 0x1 goto @snippet13
goto @snippet14

'---------------
#org @snippet9
checkflag 0x826
if 0x1 goto @snippet13
goto @snippet14

'---------------
#org @snippet10
checkflag 0x827
if 0x1 goto @snippet13
goto @snippet14

'---------------
#org @snippet11
preparemsg @string1 '"Oh! That is the [buffer1]!\nGo rig..."
waitmsg
fanfare 0x101
waitfanfare
waitkeypress
copyvar 0x405F 0x4001
release
end

'---------------
#org @snippet12
msgbox @string2 MSG_KEEPOPEN '"Only truly skilled TRAINERS are\na..."
sound 0x16
msgbox @string3 MSG_KEEPOPEN '"Rules are rules.\nI can't let you ..."
release
end

'---------------
#org @snippet13
msgbox @string4 MSG_KEEPOPEN '"You can pass here only if you have..."
copyvar 0x405F 0x4001
release
end

'---------------
#org @snippet14
preparemsg @string5 '"You can pass here only if you have..."
waitmsg
sound 0x16
waitkeypress
closeonkeypress
checksound
release
end


'---------
' Strings
'---------
#org @string1
= Oh! That is the [buffer1]!\nGo right ahead.

#org @string2
= Only truly skilled TRAINERS are\nallowed through.\pYou don't have the [buffer1]\nyet!

#org @string3
= Rules are rules.\nI can't let you pass.

#org @string4
= You can pass here only if you have\nthe [buffer1].\pOh! That is the [buffer1]!\c\h17\c\h0BAA\c\h08[ME]\c\h18\pOkay, then.\nPlease, go right ahead.

#org @string5
= You can pass here only if you have\nthe [buffer1].\pYou don't have the [buffer1]\nyet.\pYou have to have it to get to\nthe POKeMON LEAGUE.


Other Script (Let's call it script C):
Spoiler:
'---------------
#org @start
lockall
setvar 0x4001 0x1
setvar 0x8009 0x1
bufferstd 0x0 0xF
goto @snippet1

'---------------
#org @snippet1
textcolor 0x0
applymovement 0x8009 @move1
waitmovement 0x0
copyvar 0x8000 0x4001
compare 0x8000 0x1
if 0x1 goto @snippet2
compare 0x8000 0x2
if 0x1 goto @snippet3
compare 0x8000 0x3
if 0x1 goto @snippet4
compare 0x8000 0x4
if 0x1 goto @snippet5
compare 0x8000 0x5
if 0x1 goto @snippet6
compare 0x8000 0x6
if 0x1 goto @snippet7
compare 0x8000 0x7
if 0x1 goto @snippet8
compare 0x8000 0x8
if 0x1 goto @snippet9
end

'---------------
#org @snippet2
checkflag 0x820
if 0x1 goto @snippet10
goto @snippet11

'---------------
#org @snippet3
checkflag 0x821
if 0x1 goto @snippet12
goto @snippet13

'---------------
#org @snippet4
checkflag 0x822
if 0x1 goto @snippet12
goto @snippet13

'---------------
#org @snippet5
checkflag 0x823
if 0x1 goto @snippet12
goto @snippet13

'---------------
#org @snippet6
checkflag 0x824
if 0x1 goto @snippet12
goto @snippet13

'---------------
#org @snippet7
checkflag 0x825
if 0x1 goto @snippet12
goto @snippet13

'---------------
#org @snippet8
checkflag 0x826
if 0x1 goto @snippet12
goto @snippet13

'---------------
#org @snippet9
checkflag 0x827
if 0x1 goto @snippet12
goto @snippet13

'---------------
#org @snippet10
preparemsg @string1 '"Oh! That is the [buffer1]!\nGo rig..."
waitmsg
fanfare 0x101
waitfanfare
waitkeypress
copyvar 0x405F 0x4001
releaseall
end

'---------------
#org @snippet11
msgbox @string2 MSG_KEEPOPEN '"Only truly skilled TRAINERS are\na..."
sound 0x16
msgbox @string3 MSG_KEEPOPEN '"Rules are rules.\nI can't let you ..."
closeonkeypress
applymovement MOVE_PLAYER @move2
applymovement 0x8009 @move3
waitmovement 0x0
releaseall
end

'---------------
#org @snippet12
msgbox @string4 MSG_KEEPOPEN '"You can pass here only if you have..."
copyvar 0x405F 0x4001
releaseall
end

'---------------
#org @snippet13
preparemsg @string5 '"You can pass here only if you have..."
waitmsg
sound 0x16
waitkeypress
closeonkeypress
checksound
applymovement MOVE_PLAYER @move2
applymovement 0x8009 @move3
waitmovement 0x0
releaseall
end


'---------
' Strings
'---------
#org @string1
= Oh! That is the [buffer1]!\nGo right ahead.

#org @string2
= Only truly skilled TRAINERS are\nallowed through.\pYou don't have the [buffer1]\nyet!

#org @string3
= Rules are rules.\nI can't let you pass.

#org @string4
= You can pass here only if you have\nthe [buffer1].\pOh! That is the [buffer1]!\c\h17\c\h0BAA\c\h08[ME]\c\h18\pOkay, then.\nPlease, go right ahead.

#org @string5
= You can pass here only if you have\nthe [buffer1].\pYou don't have the [buffer1]\nyet.\pYou have to have it to get to\nthe POKeMON LEAGUE.


'-----------
' Movements
'-----------
#org @move1
#raw 0x2F 'Face Left (Delayed)
#raw 0xFE 'End of Movements

#org @move2
#raw 0x10 'Step Down (Normal)
#raw 0xFE 'End of Movements

#org @move3
#raw 0x2D 'Face Down (Delayed)
#raw 0xFE 'End of Movements


Sorry for the long post.

P.S. I'm gonna need a script like Script C above to go with my script A, but I'd like to make the second script on my own, as long as you tell me whats wrong with script A.
You forgot to put the '#' infront of the dynamic command in Script A.
__________________
  #5471    
Old April 2nd, 2011 (06:06 AM). Edited April 2nd, 2011 by metapod23.
metapod23's Avatar
metapod23
Hardened Trainer
 
Join Date: Mar 2009
Gender: Male
Nature: Timid
Quote originally posted by Pogeygothaxed:
Pretty much. I could do that easily, if I didn't need the variables to change the level accordingly. x.x I also wanted to see if I could make it check the level, then change the OW with dynamic OWs. (Maybe activated with a walk-script on the first tiles in the map, or a level map. But from what I read the level maps are limited? I haven't got the first part to work, so I won't bcrazy with that right now.)So if it would call you battling a Pidgey at lvl 18, it'd be a Pidgeotto instead.

I was looking for a way to replace the "randomly generate Arrests in grass" I don't know, I was just experimenting with the new code available. I wasn't too big on scripting up 'til now, so I had no idea what anything meant when it was released. But now I'm trying to get my hands more dirty because I couldn't achieve what I wanted in my crazy hacks.
Without being able to figure out exactly what needs to be done to make special 0x58 to work, I can't really be much help, unfortunately (I kind of want to use this in my hack now, too, but can't get it to work). Hopefully someone else will read this and explain what needs to be done. I've tried a few different ways - on two occasions I've managed to get random leveled Sandslash and then Sunflora to appear, but I don't know why (neither was my intention).

EDIT: Though I haven't found a way to get special 0x58 to work, I have discovered a sort of way to do this with special 0x56:

Code:
setvar 0x8004 0x10
setvar 0x8005 0xffff
setvar 0x8006 0x0
setvar 0x8007 0x0
special 0x56
release
end
^ This would make only Pidgey of the levels that are already in that map to appear.

ATM, I couldn't say how to make various Pokemon show up in the map. At best, using special 0x56, it would require using the Walking Script, which, on every step would use the "random" command to generate a new Pokemon (with special 0x56) of a different level (using setvar 0x4051) to appear - none of which should be necessary if I understood how special 0x58 worked ...

Quote originally posted by RegisteelX:
Thanks, but that didn't help. As soon as he gets out of view, he returns to its original place and does nothing anymore.
If you want him to move to a permanent location and stay there every time you enter the map, you must create a header script with "movesprite2" in it, set to activate after this event has completed (with a flag or a variable).

If you just want to hide the sprite after it has walked away, give the sprite an ID # equal to an unused flag, and put in your script: setflag 0x(flag#); hidesprite 0x(sprite#).
__________________
  #5472    
Old April 2nd, 2011 (06:10 AM).
CrazyShooter's Avatar
CrazyShooter
Beginning Trainer
 
Join Date: Apr 2011
Location: Tartarus; come visit me some time! :)
Gender: Male
Quote originally posted by DrFuji:
You forgot to put the '#' infront of the dynamic command in Script A.
I can't believe it's that simple.
I need to get glasses.
Thanks though.
  #5473    
Old April 2nd, 2011 (10:43 AM). Edited April 2nd, 2011 by Pogeygothaxed.
Pogeygothaxed's Avatar
Pogeygothaxed
Pokémon exDeltaSpecies Creator
 
Join Date: Jun 2009
Location: Too far away from my girlfriend.
Age: 24
Gender: Male
Nature: Adamant
Send a message via Windows Live Messenger to Pogeygothaxed
Quote originally posted by metapod23:
Without being able to figure out exactly what needs to be done to make special 0x58 to work, I can't really be much help, unfortunately (I kind of want to use this in my hack now, too, but can't get it to work). Hopefully someone else will read this and explain what needs to be done. I've tried a few different ways - on two occasions I've managed to get random leveled Sandslash and then Sunflora to appear, but I don't know why (neither was my intention).

EDIT: Though I haven't found a way to get special 0x58 to work, I have discovered a sort of way to do this with special 0x56:

Code:
setvar 0x8004 0x10
setvar 0x8005 0xffff
setvar 0x8006 0x0
setvar 0x8007 0x0
special 0x56
release
end
^ This would make only Pidgey of the levels that are already in that map to appear.

ATM, I couldn't say how to make various Pokemon show up in the map. At best, using special 0x56, it would require using the Walking Script, which, on every step would use the &quot;random&quot; command to generate a new Pokemon (with special 0x56) of a different level (using setvar 0x4051) to appear - none of which should be necessary if I understood how special 0x58 worked ...



If you want him to move to a permanent location and stay there every time you enter the map, you must create a header script with &quot;movesprite2&quot; in it, set to activate after this event has completed (with a flag or a variable).

If you just want to hide the sprite after it has walked away, give the sprite an ID # equal to an unused flag, and put in your script: setflag 0x(flag#); hidesprite 0x(sprite#).
Using the Swarm to force an appearance of only one Pokemon is a great idea. Also, I came up with this after scrolling up and down the manual.
Code:
#dynamic 0x800000
#org @start
setvar 0x8005 0x0 'Changes the data for Pokemon to appear - in this case, anywhere
setvar 0x8006 0x0 'Loads from pointers set 
setvar 0x8008 0xf480 'Sets pointer to new Data - memory block for wild pokemon
setvar 0x8009 0x0203  'Second half of the offset
Writebytetooffset 0x12 0x0203f480 'Writes levels to memory block
Writebytetooffset 0x10 0x0203f480 'Writes Pokemon to memory block
special 0x58 'calls Wild Data switch
special 0x59 'calls the cancel of the switch end
Apparently, 0203f480 is a memory block that was made for the Wild Pokemon data. I assume that's what he was referring to when he said dynamically switching with it. You would Writebyte to it using the format Minlv =1 byte, maxlv = 1 byte, species = 2 byte, which would be a total of 4. Feel free to correct me on this if I'm mistaking anything as I'm still learning Hex.

There's also pointers that point to Location data for Pokemon.
Code:
Pointer to Grass pokémon Data
0203f48c 
Pointer to Water pokémon data
0203f490
Pointer to Tree pokémon data
0203f494
Pointer to Fishing pokémon data
0203f498
You would probably load one of these with 8006 depending on where you wanted the data to switch. i.e. if you only wanted to change grass or water. I used 0x0 for all, but you could also use 01 and 0x02 as stated in the manual then point to their locations above. That being said, I believe since the table is only 28 bytes, it wasn't meant to store the data for changing ALL of the Pokemon on the map, instead, it's reserved for only one location type. i.e. Grass.

It's supposed to be set up the same as special 0x56, but in that special you also add the level...which wouldn't be needed, since it's called with the species when the switch triggers? So I think it's only 2 bytes and not 4. 1+1=lvs=2bytes+2bytes for Pokemon = 4 + 2 for location = 6: 6*12 = 72, so you'd need 72 bytes for this method. Obviously 72>28, so...I'm not sure how to set it up completely, since I remember you saying there needs to be 12 slots. However, if used with Swarm, you'd only need 6 bytes, because there's only one Pokemon that will appear?

Thus leading me to my next theory: you were correct when you said that you need to make your own table and then point to it. The dynamic part is where you can switch, on the fly, which table the map uses. i.e. You could change which table the grass uses, the water, or both, at anytime. Makes sense.

All of this is in the manual, you just have to look around for it...I'm still not sure if I put it together correctly.

edit: don't try using the script, I just made an explain one of the layout that might be used when creating the switch.

edit2: I forgot to mention, if you wanted to include the Change Battle Level you could probably do that by making the table, setting the level, and then assigning the hex of the level the variable of 4051, then set 4051 to use one of the switch controls. i.e 0x1yy, etc. I haven't tested this yet, though.
__________________

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!
  #5474    
Old April 2nd, 2011 (07:50 PM).
deoxys121's Avatar
deoxys121
White Kyurem Cometh
 
Join Date: Dec 2010
Location: Flat Rock, MI, United States
Age: 23
Gender: Male
Nature: Calm
Send a message via Yahoo to deoxys121
I'd like to know if there is a way to change which Pokemon you encounter in Pokemon Ruby after you choose your starter. I would like to make this change to a specific Pokemon for an important plot point. I am able to open the scripts that appear on the Route 101 Map using AdvanceMap 1.90 and PKSV. This is the script from the Bag which contains the Pokeballs, but I'm not sure if this is where I start. Any help would be appreciated. I have little experience with scripting, but would like to learn more.

Code:
#org 0x814EA7F
'-----------------------------------
lock
faceplayer
setflag RS_POKEMON
setflag 0x52
fadescreen FADEOUT_BLACK
disappear 0x4
movesprite 0xFF 0x6 0xD
applymovement PLAYER 0x81A083F ' raw_27 end
pauseevent 0x0
special CHOOSE_POKEMON
waitspecial
applymovement 0x2 0x814EAD7 ' walk_right_slow end
pauseevent 0x0
msgbox 0x816D191 ' PROF. BIRCH: Whew......
callstd MSG_NOCLOSE ' Non-closing message
special HEAL_POKEMON
setflag 0x2D0
clearflag 0x2D1
setflag 0x2BC
setvar 0x4084 0x2
setvar 0x4060 0x3
clearflag 0x4000
warp 0x1 0x4 0xFF 0x6 0x5
waitspecial
release
end


#org 0x816D191
= PROF. BIRCH: Whew...\pI was in the tall grass studying wild\nPOK\eMON when I was jumped.\pYou saved me.\nThanks a lot!\pOh?\pHi, you're \v\h01\v\h05!\pThis is not the place to chat, so come\nby my POK\eMON LAB later, okay?

#org 0x81A083F
M raw_27 end

#org 0x814EAD7
M walk_right_slow end
__________________
  #5475    
Old April 2nd, 2011 (08:07 PM).
metapod23's Avatar
metapod23
Hardened Trainer
 
Join Date: Mar 2009
Gender: Male
Nature: Timid
Quote originally posted by Pogeygothaxed:
Using the Swarm to force an appearance of only one Pokemon is a great idea. Also, I came up with this after scrolling up and down the manual.
Code:
#dynamic 0x800000
#org @start
setvar 0x8005 0x0 'Changes the data for Pokemon to appear - in this case, anywhere
setvar 0x8006 0x0 'Loads from pointers set 
setvar 0x8008 0xf480 'Sets pointer to new Data - memory block for wild pokemon
setvar 0x8009 0x0203  'Second half of the offset
Writebytetooffset 0x12 0x0203f480 'Writes levels to memory block
Writebytetooffset 0x10 0x0203f480 'Writes Pokemon to memory block
special 0x58 'calls Wild Data switch
special 0x59 'calls the cancel of the switch end
Apparently, 0203f480 is a memory block that was made for the Wild Pokemon data. I assume that's what he was referring to when he said dynamically switching with it. You would Writebyte to it using the format Minlv =1 byte, maxlv = 1 byte, species = 2 byte, which would be a total of 4. Feel free to correct me on this if I'm mistaking anything as I'm still learning Hex.

There's also pointers that point to Location data for Pokemon.
Code:
Pointer to Grass pokémon Data
0203f48c 
Pointer to Water pokémon data
0203f490
Pointer to Tree pokémon data
0203f494
Pointer to Fishing pokémon data
0203f498
You would probably load one of these with 8006 depending on where you wanted the data to switch. i.e. if you only wanted to change grass or water. I used 0x0 for all, but you could also use 01 and 0x02 as stated in the manual then point to their locations above. That being said, I believe since the table is only 28 bytes, it wasn't meant to store the data for changing ALL of the Pokemon on the map, instead, it's reserved for only one location type. i.e. Grass.

It's supposed to be set up the same as special 0x56, but in that special you also add the level...which wouldn't be needed, since it's called with the species when the switch triggers? So I think it's only 2 bytes and not 4. 1+1=lvs=2bytes+2bytes for Pokemon = 4 + 2 for location = 6: 6*12 = 72, so you'd need 72 bytes for this method. Obviously 72>28, so...I'm not sure how to set it up completely, since I remember you saying there needs to be 12 slots. However, if used with Swarm, you'd only need 6 bytes, because there's only one Pokemon that will appear?

Thus leading me to my next theory: you were correct when you said that you need to make your own table and then point to it. The dynamic part is where you can switch, on the fly, which table the map uses. i.e. You could change which table the grass uses, the water, or both, at anytime. Makes sense.

All of this is in the manual, you just have to look around for it...I'm still not sure if I put it together correctly.

edit: don't try using the script, I just made an explain one of the layout that might be used when creating the switch.

edit2: I forgot to mention, if you wanted to include the Change Battle Level you could probably do that by making the table, setting the level, and then assigning the hex of the level the variable of 4051, then set 4051 to use one of the switch controls. i.e 0x1yy, etc. I haven't tested this yet, though.
I have tried different things with 0x0203f480, including manually writing every byte of the data (i.e. writebytetooffset 0x03 0x0203f480; writebytetooffset 0x03 0x0203f481; writebytetooffset 0x97 0x0203f482; writebytetooffset 0x00 0x0203f483) < Trying to get Mew to appear just to make certain whether it's working or not - and haven't had any success. If you do figure out the correct method, please let me know.
__________________
Closed Thread
Quick Reply

Sponsored Links
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Minimum Characters Per Post: 25



All times are UTC -8. The time now is 08:50 AM.