PDA

View Full Version : [Archive] Pokemon Essentials: Starter Kit for RPG Maker XP


Pages : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 [25] 26 27 28 29 30 31 32 33 34 35 36 37 38 39

C0d3 br3ak3r
January 20th, 2010, 01:21 PM
Erm... again. How do I get the program to accept a map with different lenghts and heights????? PLEASE?!

Maruno
January 20th, 2010, 05:38 PM
Erm... again. How do I get the program to accept a map with different lenghts and heights????? PLEASE?!
Wha...? You want to change the size of a map?

Right-click on the map's name in the list at the bottom left of RPG Maker XP, and select "Map Properties". Then spend at least a month just playing with RPG Maker XP before even thinking about trying to make an actual game.

If you meant something else, you need to describe it accurately.

Nosman
January 20th, 2010, 11:49 PM
this has probably been asked before but how do it take and give money to the player.

EDIT: also how do i check if they have a certain amount so i can take it away. i mean check if they have $500 if the do take it away if they don't then do some thing else. i want the check thing to be like a condition branch

Maruno
January 21st, 2010, 08:20 AM
this has probably been asked before but how do it take and give money to the player.

EDIT: also how do i check if they have a certain amount so i can take it away. i mean check if they have $500 if the do take it away if they don't then do some thing else. i want the check thing to be like a condition branch
The "Change Gold" option in the events menu will work on the player's money.

For the checking, make a conditional branch, and the option to check how much Gold the player has is on the 4th page of that. And that's exactly what you wanted.

D-Hero
January 22nd, 2010, 05:57 AM
Hey,
How i can change the Battlebackgrounds for night and afternoon?

TACHAN
January 22nd, 2010, 12:34 PM
Hey, i have a problem in Battle:

Foe Blissey's Natural Cure blocks HEAL BELL!
Foe blocks HEAL BELL!

What happen? :(

somecrazyperson
January 22nd, 2010, 10:17 PM
Hey, does anyone know where I can add more custom pokemons?

adrian12
January 23rd, 2010, 04:34 AM
Hello how can I make a lateral battle and pokemon animations

|Maximus|
January 23rd, 2010, 07:12 AM
How do I change the player graphic?

I used the change player graphic option, but it still doesn't work. It changes for a split second, then goes back.

Poeman
January 23rd, 2010, 07:19 AM
IN metadata
SOAPY SOAPY SOAP

TACHAN
January 23rd, 2010, 07:31 AM
Hey, does anyone know where I can add more custom pokemons?

In the folder "PBS", text document "Pokemon.txt".

|Maximus|
January 23rd, 2010, 08:48 AM
IN metadata
SOAPY SOAPY SOAP

SOAPY SOAPY NOPE :P

Haha, I meant like a costume change.

Maruno
January 23rd, 2010, 09:51 AM
Hello how can I make a lateral battle and pokemon animations
We have no idea what you mean. What do you want?


How do I change the player graphic?

I used the change player graphic option, but it still doesn't work. It changes for a split second, then goes back.
I assume you want to change it in-game, rather than just set it at the start.

Go into the metadata (yes, the metadata) and create a new player character. It'll be number 2 (with the boy character as 0 and the girl character as 1). Make sure you have all the correct sprite sheet pictures for this new character (walking/running/surfing/fishing/surf fishing/cycling sprites).

Then use pbChangePlayer(2) when you want to turn the character into this new one (e.g. when they put on a coat).

If you want both a boy and girl option, each of them can only have 2 different costumes, because there are only 4 spots that can be used for the player character (I may be wrong here, though). Use them wisely.

tImE
January 23rd, 2010, 09:56 AM
http://img222.imageshack.us/img222/589/errorts.jpg
This pops up when the "New Game - Continue - Option" screen is about to show, then
the game exits.

What's wrong?! xD

Neew answer quick. Thanks in Advance.


Cheerz~

Legendaries
January 23rd, 2010, 12:44 PM
Pokemon Center script doesn't work for me. I copy it exactly as it is, don't change any line in event and there is an error during healing Pokemon:
http://i48.tinypic.com/v45kp1.png

Great Mazinger
January 23rd, 2010, 02:35 PM
Is it possible to expand the Metadata to support more playable characters?

Maruno
January 23rd, 2010, 03:45 PM
Is it possible to expand the Metadata to support more playable characters?
The player characters, as battlers, are defined just like any other trainer type, so this part should be easy enough. Decide how many trainers you need in total, and use trainer type IDs 0 to n-1 for your players (you'll need to bump the rest of the list down, or relocate the top few generic trainers to the bottom, e.g. Lass, Youngster - remember to move their sprites/sprite sheets as well in the Characters folder).

Now, despite the IDs 0 and 1 being "PkMnTRAINER_Male" and "Female", you can't use just these two for all your outfits. The reason is that the outfit being shown depends on the ID. Aside from the internal names, though, everything else can stay the same.

Go into trainernames.txt and add in the new trainer types as mentioned, then go into metadata.txt and copy-paste the "PlayerA" line with any necessary changes. Use "PlayerE" and so on - I doubt you'll be wanting more than 26 outfits anyway, but if you do just go for "AA", "AB", "AC" and so on.

Now into the scripts. In Compiler, search for "PlayerA", and add in the extra players with some copy-pasting. Remember to bump the numbers of the rest of the lines in that GlobalTypes array (e.g. "SurfBGM" is 12 by default).

Then go into the script section PokemonUtilities and search for "pbChangePlayer". There's a line that restricts the options to between 0 and 3, so change the upper limit there to n-1 (where n is the total number of outfits).

After that, just make sure you've got all the necessary picture files. This includes all the sprite sheets and the trainer's front sprites, to be put in the Characters folder, and the trainer back sprites, which are in the Pictures folder called "trback###.png" and are wide pictures with 4 frames (regular back, and 3 throwing frames).



I haven't done this myself, so I have no idea what will happen if you listen to me. However, it's a start.

|Maximus|
January 23rd, 2010, 04:35 PM
The player characters, as battlers, are defined just like any other trainer type, so this part should be easy enough. Decide how many trainers you need in total, and use trainer type IDs 0 to n-1 for your players (you'll need to bump the rest of the list down, or relocate the top few generic trainers to the bottom, e.g. Lass, Youngster - remember to move their sprites/sprite sheets as well in the Characters folder).

Now, despite the IDs 0 and 1 being "PkMnTRAINER_Male" and "Female", you can't use just these two for all your outfits. The reason is that the outfit being shown depends on the ID. Aside from the internal names, though, everything else can stay the same.

Go into trainernames.txt and add in the new trainer types as mentioned, then go into metadata.txt and copy-paste the "PlayerA" line with any necessary changes. Use "PlayerE" and so on - I doubt you'll be wanting more than 26 outfits anyway, but if you do just go for "AA", "AB", "AC" and so on.

Now into the scripts. In Compiler, search for "PlayerA", and add in the extra players with some copy-pasting. Remember to bump the numbers of the rest of the lines in that GlobalTypes array (e.g. "SurfBGM" is 12 by default).

Then go into the script section PokemonUtilities and search for "pbChangePlayer". There's a line that restricts the options to between 0 and 3, so change the upper limit there to n-1 (where n is the total number of outfits).

After that, just make sure you've got all the necessary picture files. This includes all the sprite sheets and the trainer's front sprites, to be put in the Characters folder, and the trainer back sprites, which are in the Pictures folder called "trback###.png" and are wide pictures with 4 frames (regular back, and 3 throwing frames).



I haven't done this myself, so I have no idea what will happen if you listen to me. However, it's a start.

Seriously? Hmm...I may try that.

EDIT: How I change the size of text on like the trainer card, or the options menu, etc.?

lezebulon
January 24th, 2010, 11:26 AM
Hi
We are making some pokemon game using the starter's kit.
Can we consider the lastest release a "final" one ? Because I intent on modifying the engine and I won't be able to update the starter's kit after I do so.

So, what are the major points in the starter kit that are not done / missing ? Except the 4th gen stuff of course

Short Range
January 24th, 2010, 11:30 AM
Hi
We are making some pokemon game using the starter's kit.
Can we consider the lastest release a "final" one ? Because I intent on modifying the engine and I won't be able to update the starter's kit after I do so.

So, what are the major points in the starter kit that are not done / missing ? Except the 4th gen stuff of course

I don't think the latest release could be considered final at all. There's still so many things to add and edit, including 4th generation content.

By the way, any idea when we'll see that kind of stuff?

Maruno
January 24th, 2010, 11:59 AM
I don't think the latest release could be considered final at all. There's still so many things to add and edit, including 4th generation content.

By the way, any idea when we'll see that kind of stuff?
Probably never. I think that's the whole point of the kit - it's just a basis, and you add in what you want yourself, rather than have everything there to start with. Making a game shouldn't be too easy, and it wouldn't be "your" game if someone else programmed it all and all you did was draw some maps.

Besides, plenty of us modify the engine, and we don't wait until the hypothetical "final" version of Essentials comes out. I'm using a version that was released a year ago, for example. There's always a change log anyway, so you can add in whatever's changed between versions yourself.

lezebulon
January 24th, 2010, 12:01 PM
Thank you, but you are not really helping me...
I'm just wondering, what is not implemented in the kit, besides the 4th gen stuff ?
From what I have seen everything is here except the poffin
What else is missing ?

Short Range
January 24th, 2010, 12:06 PM
...You realize Poffins are 4th Gen right?

lezebulon
January 24th, 2010, 01:08 PM
I don't, I don't really play pokemon much. I was talking about the thing you need to feed Feebas to make it evolve.

venom12
January 24th, 2010, 01:15 PM
Hi someone can tell me how to get animated pokemon icon? I try AnmatedBitmap, and two others methods but still i getting errors or pokemon not animate please help me.

|Maximus|
January 24th, 2010, 04:31 PM
EDIT: How I change the size of text on like the trainer card, or the options menu, etc.?

Any help on this problem that I have?

ichimaxru
January 27th, 2010, 12:55 PM
I everyone, already im new whit this engine, but i have some questions.
Its possible to make pokemons drop items?
and how can i animate the pokemons in battle?

pbellosom
January 28th, 2010, 08:11 AM
Hi, I was running the original version of Pedapp and whenever I went to a trainer battle, a certain error occurred. I managed to fix it and I cannot remember how, when Pedapp V1 was cancelled I went back to just normal Pokestarter and I'm now getting the same error as before and I have no idea what I'm doing wrong as all the scripts I'm using are the ones that came with Pokestarter. The error goes like this:

---------------------------
Pokemon Essentials
---------------------------
Exception: RuntimeError

Message: Script error within event 19, map 17 (Foamwander Allotments):

Section066:644:in `pbFromPBMove'(eval):1:in `pbFromPBMove'uninitialized constant PokeBattle_Move::PokeBattle_Move_FE

***Full script:

pbTrainerBattle(PBTrainers::BULLY,"GARY",_I("Wha? But how could I lose to a loser like you?"),false,3,true)

Interpreter:238:in `pbExecuteScript'

PokeBattle_Battle:338:in `eval'

PokeBattle_Move:644:in `pbFromPBMove'

PokeBattle_Battle:338:in `initialize'

PokemonTrainers:457:in `new'

PokemonTrainers:457:in `pbTrainerBattle'

(eval):1:in `pbExecuteScript'

Interpreter:789:in `eval'

Interpreter:238:in `pbExecuteScript'

Interpreter:789:in `command_111'



Interpreter:279:in `pbExecuteScript'

Interpreter:789:in `command_111'

Interpreter:322:in `execute_command'

Interpreter:190:in `update'

Interpreter:104:in `loop'

Interpreter:195:in `update'

Scene_Map:100:in `update'

Scene_Map:98:in `loop'

Scene_Map:111:in `update'

Scene_Map:67:in `main'

I don't suppose anyone can tell me what's going wrong could they?

Dark_Soull
January 28th, 2010, 08:22 AM
I have a problem with the game not how to explain it in words so I put in a video:

http://www.youtube.com/watch?v=WeG9CCcxVJc

I have not moved anything or changed anything in the essentials of Poccil pokemon, the overnight pass me that.

I hope you help me thanks.

Legendaries
January 28th, 2010, 08:27 AM
I have a problem with autotiles' transparency in Starter Kit. Example: I have flowers autotile, I put it on the map and test the game. And I see motionless first frame of autotile and flowers covering it and moving. The same with waterfall.
http://i48.tinypic.com/2db5pmo.png

maaddogg
January 28th, 2010, 12:36 PM
ok so im scripting a new menu system thats going to use custom graphics that i made,so heres the problem,when i start my game the menu works fine but scince i made part of the graphics transparent,the transparent part(where the map is suppose to be}just shows a black background behind the graphics.

could someone please tell me how to make the background show the map instead of just the black background.

Maruno
January 28th, 2010, 05:26 PM
I have a problem with autotiles' transparency in Starter Kit. Example: I have flowers autotile, I put it on the map and test the game. And I see motionless first frame of autotile and flowers covering it and moving. The same with waterfall.
http://i48.tinypic.com/2db5pmo.png
If I understand you correctly, the in-game flowers look like they have two layers - the bottom layer is static (the first frame of the moving flowers only), and the top layer is the moving flowers as normal.

Have you put the flowers in the map twice, on two different layers? Or done anything weird in the mapping? I'm not sure where the problem lies with only that little information.


ok so im scripting a new menu system thats going to use custom graphics that i made,so heres the problem,when i start my game the menu works fine but scince i made part of the graphics transparent,the transparent part(where the map is suppose to be}just shows a black background behind the graphics.

could someone please tell me how to make the background show the map instead of just the black background.
So essentially your menu screen is one big picture that covers the entire screen, with parts transparent.

I'm not sure what's going on here. It must be the way you coded it that's causing the problem, because the default menu frame is just a picture itself, and it works fine with its transparent corners. All I can suggest is that you mimic the original code as much as possible.

Then there's the stupidly obvious question of: Are you sure it's transparent?

~JV~
January 29th, 2010, 03:31 AM
I have a problem with autotiles' transparency in Starter Kit. Example: I have flowers autotile, I put it on the map and test the game. And I see motionless first frame of autotile and flowers covering it and moving. The same with waterfall.
http://i48.tinypic.com/2db5pmo.png

The problem is that RMXP has problem with animated autotiles with a transparent background. just use put the grass tile as background for the autotile and it will work.

ok so im scripting a new menu system thats going to use custom graphics that i made,so heres the problem,when i start my game the menu works fine but scince i made part of the graphics transparent,the transparent part(where the map is suppose to be}just shows a black background behind the graphics.

could someone please tell me how to make the background show the map instead of just the black background.


For my menu, I added that to the initialize Def so it use the map as background:

@spriteset = Spriteset_Map.new

Just add that to any line in thei def and it should work, and don't forget to add it to the dispose list as well!

Legendaries
January 29th, 2010, 06:13 AM
The problem is that RMXP has problem with animated autotiles with a transparent background. just use put the grass tile as background for the autotile and it will work.


But there was no problem without starter kit...

Wichu
January 29th, 2010, 09:15 AM
It's a bug in poccil's custom tilemap script. You could PM him and ask him to fix it.

lezebulon
January 29th, 2010, 04:45 PM
Hi
I'm using an old version of the PedApp script (from this summer) and I found I bug I can't correct

After compiling the data on the editor, the pokemon and attack types are wrong.
On the pokemon summary, the type is the wrong one, and the attack type is the right one.
In battle, the move types are wrong too and the engine acts as if the pokemon types were different than what they are registered to be in pokemon.txt

I found out that it was probably a bug during the compilation of the file dexdata.dat , but I don't know how it's handled.
Can someone tell me exactly where does the compiler translate the types from pokemon.txt and put them into dexdata.dat ? Same with the types of moves.txt.
Thanks !

|Maximus|
January 30th, 2010, 07:00 PM
Hmm...I was wondering, is there a way to create a script that generates a circular shadow under the charsets?

HG/SS has one because I had this huge glitch in my ds game, and it still had a shadow under it, plus the Pokemon charsets that a large have a small shadow under it.

Legendaries
January 31st, 2010, 05:29 AM
I have a problem with encounters. When I try to remove redundant encounters from encounters.txt iI have an error while launching Editor
http://i48.tinypic.com/33bl669.png
Every type is written correct. No mistakes are made.

I have to remove these encounters, because now Pokemons attack me inside a house.

Legendaries
February 1st, 2010, 03:30 PM
I have a problem with tones. There is light tone of screen at midnight. I have set the same tones as my friend who has everything fine.

~JV~
February 1st, 2010, 04:57 PM
I have a problem with encounters. When I try to remove redundant encounters from encounters.txt iI have an error while launching Editor
http://i48.tinypic.com/33bl669.png
Every type is written correct. No mistakes are made.

I have to remove these encounters, because now Pokemons attack me inside a house.

I recommend avoiding editing the PBS through the notepad, the trainers.txt, for example, just doesn't work when edited in the notepad (for me at least). To remove a encounter of a map, just press Z when you're selecting it (the arrow).

Example, if you want to remove the Land encounter, just click Z while you get that option selected ;].

Also, don't double post.

Linkey
February 1st, 2010, 11:16 PM
I recommend avoiding editing the PBS through the notepad, the trainers.txt, for example, just doesn't work when edited in the notepad (for me at least). To remove a encounter of a map, just press Z when you're selecting it (the arrow).

Example, if you want to remove the Land encounter, just click Z while you get that option selected ;].

Also, don't double post.

Yeah, at my desktop-pc it doesn't work, if i change any of the pbs files in notepad. If i do this at notebook, it just works fine.

Legendaries
February 2nd, 2010, 02:19 AM
To remove a encounter of a map, just press Z when you're selecting it (the arrow).

I discovered it just yesterday, that I can remove something by pressing Z. But I solve my problem other way. I removed whole text from ecounters.txt, then compiled data, and type only my encounters in txt file. It works fine.

I recommend avoiding editing the PBS through the notepad, the trainers.txt, for example, just doesn't work when edited in the notepad (for me at least).
Editing trainertypes in notepad is problematic too, you can do little error for example while copying BGM and it ruins everything xD. But if you want to change internal name it is necessary to use notepad.


Also, don't double post.
Sorry, I didn't want to wait with my problem until anyone reply, so I wanted to write new post to refresh the thread. Sorry again.

thepsynergist
February 2nd, 2010, 03:07 PM
Ok, so I've had the same question that has yet to be answered like 5 pages ago, and no one has bothered to respond. So, I will ask my question again, and hopefully someone will be nice enough to help me.

I am using the most recent version of Poccil's Starter Kit and I can't get the Bug Catching Contest to work. The script has no syntax errors that the game is picking up and the game acts as if everything is fine, yet the Bug Catching contest is never apparent. The timer doesn't show up, the contest pokemon don't show up and both the ingame menu and the battle menu don't change at all. It's as if there is no code there. Here is the script that I am using and some screenie's as well. Please help me. I really want this feature and I hope someone can help.


class BugContestState
attr_accessor :ballcount
attr_accessor :decision
attr_accessor :steps
attr_accessor :lastPokemon
attr_reader :timer
ContestantNames=[
_INTL("BUG CATCHER BENNY"),
_INTL("COOLTRAINER NICK"),
_INTL("COLLECTOR KIPP"),
_INTL("YOUNGSTER SAMUEL"),
_INTL("BUG CATCHER DON"),
_INTL("PICNICKER CINDY"),
_INTL("CAMPER BARRY"),
_INTL("BUG CATCHER JOSH")
]
TimerSeconds=1200
def initialize
clear
@lastContest=nil
end
def pbContestHeld?
return false if !@lastContest
return Time.new.to_i-@lastContest<86400
end
def expired?
return false if !undecided?
curtime=@timer+TimerSeconds*Graphics.frame_rate
curtime=[curtime-Graphics.frame_count,0].max
return (curtime<=0)
end
def clear
@ballcount=0
@ended=false
@inProgress=false
@decision=0
@encounterMap=0
@lastPokemon=nil
@otherparty=[]
@contestants=[]
@places=[]
@start=nil
@reception=[]
end
def undecided?
return (@inProgress && @decision==0)
end
def decided?
return (@inProgress && @decision!=0) || @ended
end
def pbSetPokemon(chosenpoke)
@chosenPokemon=chosenpoke
end
# Reception map is handled separately from contest map
# since the reception map can be outdoors, with its own
# grassy patches.
def pbSetReception(*arg)
@reception=[]
for i in arg
@reception.push(i)
end
end
def pbOffLimits?(map)
return false if map==@contestMap
for i in @reception
return false if map==i
end
return true
end
def pbSetJudgingPoint(startMap,startX,startY)
@start=[startMap,startX,startY,6]
end
def pbSetContestMap(map)
@contestMap=map
end
def pbJudge
judgearray=[]
if @lastPokemon
judgearray.push([-1,@lastPokemon.species,
pbBugContestScore(@lastPokemon)])
end
@contestants=[]
[5,ContestantNames.length].min.times do
loop do
value=rand(ContestantNames.length)
if !@contestants.any?{|i| i==value }
@contestants.push(value)
break
end
end
end
enctype=EncounterTypes::BugContest
if !$PokemonEncounters.pbMapHasEncounter?(@contestMap,enctype)
enctype=EncounterTypes::Land
end
for cont in @contestants
enc=$PokemonEncounters.pbMapEncounter(@contestMap,enctype)
if !enc
raise _INTL("No encounters, so can't judge contest")
end
pokemon=PokeBattle_Pokemon.new(enc[0],enc[1],$Trainer)
score=pbBugContestScore(pokemon)
judgearray.push([cont,pokemon.species,score])
end
if judgearray.length<3
raise _INTL("Too few bug catching contestants")
end
judgearray.sort!{|a,b| b[2]<=>a[2]} # sort by score in descending order
@places.push(judgearray[0])
@places.push(judgearray[1])
@places.push(judgearray[2])
end
def pbGetPlaceInfo(place)
cont=@places[place][0]
if cont<0
$game_variables[1]=$Trainer.name
else
$game_variables[1]=ContestantNames[cont]
end
$game_variables[2]=PBSpecies.getName(@places[place][1])
$game_variables[3]=@places[place][2]
end
def pbClearIfEnded
if !@inProgress
clear unless @start && @start[0]==$game_map.map_id
end
end
def pbStartJudging
@decision=1
pbJudge
if $scene.is_a?(Scene_Map)
pbFadeOutIn(99999){
$game_temp.player_transferring = true
$game_temp.player_new_map_id = @start[0]
$game_temp.player_new_x = @start[1]
$game_temp.player_new_y = @start[2]
$game_temp.player_new_direction = @start[3]
$MapFactory.setup(@start[0])
$scene.transfer_player
}
end
end
def pbIsContestant?(i)
return @contestants.any?{|item| i==item }
end
def pbStart(ballcount)
@ballcount=ballcount
@inProgress=true
@otherparty=[]
@lastPokemon=nil
@lastContest=nil
@timer=Graphics.frame_count
@places=[]
chosenpkmn=$Trainer.party[@chosenPokemon]
for i in 0...$Trainer.party.length
if i!=@chosenPokemon
@otherparty.push($Trainer.party[i])
end
end
@contestants=[]
[5,ContestantNames.length].min.times do
loop do
value=rand(ContestantNames.length)
if !@contestants.any?{|i| i==value }
@contestants.push(value)
break
end
end
end
$Trainer.party=[chosenpkmn]
@decision=0
@ended=false
end
def place
for i in 0...3
return i if @places[i][0]<0
end
return 3
end
def pbEnd(interrupted=false)
return if !@inProgress
for poke in @otherparty
$Trainer.party.push(poke)
end
if !interrupted
if @lastPokemon
pbNicknameAndStore(@lastPokemon)
end
@ended=true
else
@ended=false
end
@lastPokemon=nil
@otherparty=[]
@reception=[]
@ballcount=0
@inProgress=false
@decision=0
@lastContest=Time.now.to_i
$game_map.need_refresh=true
end
end
def pbBugContestScore(pokemon)
a=0
a+=16 if (pokemon.iv[2]&1)>0
a+=8 if (pokemon.iv[1]&1)>0
a+=4 if (pokemon.iv[4]&1)>0
a+=1 if (pokemon.iv[3]&1)>0
score=(pokemon.totalhp*8)
score+=pokemon.attack
score+=pokemon.defense
score+=pokemon.speed
score+=pokemon.spatk
score+=pokemon.spdef
score+=a+(pokemon.hp/8)+1
return score
end
def pbBugContestState
if !$PokemonGlobal.bugContestState
$PokemonGlobal.bugContestState=BugContestState.new
end
return $PokemonGlobal.bugContestState
end
def pbInBugContest?
return pbBugContestState.undecided?
end
def pbBugContestUndecided?
return pbBugContestState.undecided?
end
def pbBugContestDecided?
return pbBugContestState.decided?
end
class PokeBattle_BugContestBattle < PokeBattle_Battle
attr_accessor :ballcount
def initialize(*arg)
@ballcount=0
super(*arg)
end
def pbItemMenu(i)
@ballcount-=1 if @ballcount>0
return PBItems::SAFARIBALL
end
def pbCommandMenu(i)
return @scene.pbCommandMenuEx(i,[
_INTL("Park Balls: {1}",@ballcount),
_INTL("FIGHT"),
_INTL("POKéMON"),
_INTL("BALL"),
_INTL("RUN")
])
end
def pbStorePokemon(pokemon)
if pbBugContestState.lastPokemon
lastPokemon=pbBugContestState.lastPokemon
pbDisplayPaused(_INTL("You already caught a {1}.",lastPokemon.name))
helptext=_INTL("STOCK POKéMON:\n {1} Lv{2} MaxHP: {3}\nTHIS POKéMON:\n {4} Lv{5} MaxHP: {6}",
lastPokemon.name,lastPokemon.level,lastPokemon.totalhp,
pokemon.name,pokemon.level,pokemon.totalhp
)
@scene.pbShowHelp(helptext)
if pbDisplayConfirm(_INTL("Switch Pokémon?"))
pbBugContestState.lastPokemon=pokemon
@scene.pbHideHelp
else
@scene.pbHideHelp
return
end
else
pbBugContestState.lastPokemon=pokemon
end
pbDisplay(_INTL("Caught {1}!",pokemon.name))
end
def pbEndOfRoundPhase
super
if @ballcount<=0 && @decision==0
@decision=3
end
end
end
class TimerDisplay
def initialize(start,maxtime)
@timer=Window_AdvancedTextPokemon.newWithSize("",360,0,120,64)
@timer.z=99999
@total_sec=nil
@start=start
@maxtime=maxtime
end
def dispose
@timer.dispose
end
def disposed?
@timer.disposed?
end
def update
curtime=[(@start+@maxtime)-Graphics.frame_count,0].max
curtime/=Graphics.frame_rate
if curtime != @total_sec
# Calculate total number of seconds
@total_sec = curtime
# Make a string for displaying the timer
min = @total_sec / 60
sec = @total_sec % 60
@timer.text = _ISPRINTF("<ac>{1:02d}:{2:02d}", min, sec)
end
end
end
Events.onMapChange+=proc{|sender,e|
pbBugContestState.pbClearIfEnded
}
Events.onMapSceneChange+=proc{|sender,e|
scene=e[0]
mapChanged=e[1]
if pbInBugContest? && pbBugContestState.decision==0
scene.spriteset.addUserSprite(TimerDisplay.new(
pbBugContestState.timer,
BugContestState::TimerSeconds*Graphics.frame_rate))
end
}
Events.onMapUpdate+=proc{|sender,e|
if !$Trainer || !$PokemonGlobal || !$game_player ||
!$game_map
# do nothing
elsif !$game_player.move_route_forcing &&
!pbMapInterpreterRunning? &&
!$game_temp.message_window_showing
if pbBugContestState.expired?
$game_system.se_play("endofsafari.wav")
Kernel.pbMessage("ANNOUNCER: Ding-dong!")
Kernel.pbMessage("Time's up!")
pbBugContestState.pbStartJudging
end
end
}
Events.onMapChanging+=proc{|sender,e|
newmapID=e[0]
newmap=e[1]
if pbInBugContest?
if pbBugContestState.pbOffLimits?(newmapID)
# Clear bug contest if player flies/warps/teleports
# out of the contest
pbBugContestState.pbEnd(true)
end
end
}
def Kernel.pbBugContestStartOver
for i in $Trainer.party; i.heal; end
pbBugContestState.pbStartJudging
end
Events.onWildBattleOverride+= proc { |sender,e|
species=e[0]
level=e[1]
handled=e[2]
next if handled[0]!=nil
next if !pbInBugContest?
handled[0]=pbBugContestBattle(species,level)
}
def pbBugContestBattle(species,level)
if (Input.press?(Input::CTRL) && $DEBUG) || $Trainer.pokemonCount==0
if $Trainer.pokemonCount>0
Kernel.pbMessage(_INTL("SKIPPING BATTLE..."))
end
$game_variables[variable]=1 if variable
$PokemonGlobal.nextBattleBGM=nil
$PokemonGlobal.nextBattleME=nil
$PokemonGlobal.nextBattleBack=nil
return true
end
currentlevels=[]
for i in $Trainer.party
currentlevels.push(i.level)
end
genwildpoke=pbGenerateWildPokemon(species,level)
pokerus=(genwildpoke.pokerus==1)
scene=PokeBattle_Scene.new
battle=PokeBattle_BugContestBattle.new(scene,$Trainer.party,[genwildpoke],$Trainer,nil)
battle.ballcount=pbBugContestState.ballcount
battle.internalbattle=true
wildbgm=pbGetWildBattleBGM(species)
playingBGS=$game_system.getPlayingBGS
playingBGM=$game_system.getPlayingBGM
$game_system.bgm_pause
$game_system.bgs_pause
restorebgm=true
decision=0
pbBattleAnimation(wildbgm) {
decision=battle.pbStartBattle
if decision==2
$game_system.bgm_unpause
$game_system.bgs_unpause
Kernel.pbBugContestStartOver
restorebgm=false
else
pbEvolutionCheck(currentlevels)
if decision==1
for pkmn in $Trainer.party
Kernel.pbPickup(pkmn)
end
end
pbPokerusCheck if pokerus
end
}
if restorebgm
$game_system.bgm_resume(playingBGM)
$game_system.bgs_resume(playingBGS)
end
$PokemonGlobal.nextBattleBGM=nil
$PokemonGlobal.nextBattleME=nil
$PokemonGlobal.nextBattleBack=nil
pbBugContestState.ballcount=battle.ballcount
$PokemonEncounters.clearStepCount
Input.update
Events.onWildBattleEnd.trigger(nil,species,level,decision)
if pbBugContestState.ballcount==0
Kernel.pbMessage("ANNOUNCER: The Bug-Catching Contest is over!")
$game_system.se_play("endofsafari.wav")
pbBugContestState.pbStartJudging
end
return (decision!=2)
end


Screenshot 1: http://i212.photobucket.com/albums/cc135/thepsynergist/scr1.png
Screenshot 2: http://i212.photobucket.com/albums/cc135/thepsynergist/scr2.png
Screenshot 3: http://i212.photobucket.com/albums/cc135/thepsynergist/scr3.png

derw
February 3rd, 2010, 04:55 PM
how do i change the position of all menues? i would have a ds style :)
sorry for my bad english i´m german.

thx

NeoStar
February 3rd, 2010, 08:02 PM
@ Derw It's in your window and tilemap script around line 5.

derw
February 4th, 2010, 01:53 AM
wich script do you mean?

window script
class WindowCursorRect < Rect
def initialize(window)
@window=window
@x=0
@y=0
@width=0
@height=0
end
attr_reader :x,:y,:width,:height
def empty
needupdate=@x!=0 || @y!=0 || @width!=0 || @height!=0
if needupdate
@x=0
@y=0
@width=0
@height=0
@window.width=@window.width
end
end
def isEmpty?
return @x==0 && @y==0 && @width==0 && @height==0
end
def set(x,y,width,height)
needupdate=@x!=x || @y!=y || @width!=width || @height!=height
if needupdate
@x=x
@y=y
@width=width
@height=height
@window.width=@window.width
end
end
def height=(value)
@height=value; @window.width=@window.width
end
def width=(value)
@width=value; @window.width=@window.width
end
def x=(value)
@x=value; @window.width=@window.width
end
def y=(value)
@y=value; @window.width=@window.width
end
end
class Window
attr_reader :tone
attr_reader :color
attr_reader :blend_type
attr_reader :contents_blend_type
attr_reader :viewport
attr_reader :contents
attr_reader :ox
attr_reader :oy
attr_reader :x
attr_reader :y
attr_reader :z
attr_reader :width
attr_reader :active
attr_reader :pause
attr_reader :height
attr_reader :opacity
attr_reader :back_opacity
attr_reader :contents_opacity
attr_reader :visible
attr_reader :cursor_rect
attr_reader :openness
attr_reader :stretch
def windowskin
@_windowskin
end
def initialize(viewport=nil)
@sprites={}
@spritekeys=[
"back",
"corner0","side0","scroll0",
"corner1","side1","scroll1",
"corner2","side2","scroll2",
"corner3","side3","scroll3",
"cursor","contents","pause"
]
@sidebitmaps=[nil,nil,nil,nil]
@cursorbitmap=nil
@bgbitmap=nil
@viewport=viewport
for i in @spritekeys
@sprites[i]=Sprite.new(@viewport)
end
@disposed=false
@tone=Tone.new(0,0,0)
@color=Color.new(0,0,0,0)
@blankcontents=Bitmap.new(1,1) # RGSS2 requires this
@contents=@blankcontents
@_windowskin=nil
@rpgvx=false # Set to true to emulate RPGVX windows
@x=0
@y=0
@width=0
@openness=255
@height=0
@ox=0
@oy=0
@z=0
@stretch=true
@visible=true
@active=true
@blend_type=0
@contents_blend_type=0
@opacity=255
@back_opacity=255
@contents_opacity=255
@cursor_rect=WindowCursorRect.new(self)
@cursorblink=0
@cursoropacity=255
@pause=false
@pauseopacity=255
@pauseframe=0
privRefresh(true)
end
def dispose
if !self.disposed?
for i in @sprites
i[1].dispose if i[1]
@sprites[i[0]]=nil
end
for i in 0...@sidebitmaps.length
@sidebitmaps[i].dispose if @sidebitmaps[i]
@sidebitmaps[i]=nil
end
@blankcontents.dispose
@cursorbitmap.dispose if @cursorbitmap
@backbitmap.dispose if @backbitmap
@sprites.clear
@sidebitmaps.clear
@_windowskin=nil
@_contents=nil
@disposed=true
end
end
def openness=(value)
@openness=value
@openness=0 if @openness<0
@openness=255 if @openness>255
privRefresh
end
def stretch=(value)
@stretch=value
privRefresh(true)
end
def visible=(value)
@visible=value
privRefresh
end
def viewport=(value)
@viewport=value
for i in @spritekeys
@sprites[i].dispose
if @sprites[i].is_a?(Sprite)
@sprites[i]=Sprite.new(@viewport)
else
@sprites[i]=nil
end
end
privRefresh(true)
end
def z=(value)
@z=value
privRefresh
end
def disposed?
return @disposed
end
def contents=(value)
@contents=value
privRefresh
end
def windowskin=(value)
@_windowskin=value
if value && value.is_a?(Bitmap) && !value.disposed? && value.width==128
@rpgvx=true
else
@rpgvx=false
end
privRefresh(true)
end
def ox=(value)
@ox=value
privRefresh
end
def active=(value)
@active=value
privRefresh(true)
end
def cursor_rect=(value)
if !value
@cursor_rect.empty
else
@cursor_rect.set(value.x,value.y,value.width,value.height)
end
end
def oy=(value)
@oy=value
privRefresh
end
def width=(value)
@width=value
privRefresh(true)
end
def height=(value)
@height=value
privRefresh(true)
end
def pause=(value)
@pause=value
@pauseopacity=0 if !value
privRefresh
end
def x=(value)
@x=value
privRefresh
end
def y=(value)
@y=value
privRefresh
end
def opacity=(value)
@opacity=value
@opacity=0 if @opacity<0
@opacity=255 if @opacity>255
privRefresh
end
def back_opacity=(value)
@back_opacity=value
@back_opacity=0 if @back_opacity<0
@back_opacity=255 if @back_opacity>255
privRefresh
end
def contents_opacity=(value)
@contents_opacity=value
@contents_opacity=0 if @contents_opacity<0
@contents_opacity=255 if @contents_opacity>255
privRefresh
end
def tone=(value)
@tone=value
privRefresh
end
def color=(value)
@color=value
privRefresh
end
def blend_type=(value)
@blend_type=value
privRefresh
end
def flash(color,duration)
return if disposed?
for i in @sprites
i[1].flash(color,duration)
end
end
def update
return if disposed?
mustchange=false
if @active
if @cursorblink==0
@cursoropacity-=8
@cursorblink=1 if @cursoropacity<=128
else
@cursoropacity+=8
@cursorblink=0 if @cursoropacity>=255
end
mustchange=true if !@cursor_rect.isEmpty?
else
mustchange=true if @cursoropacity!=128
@cursoropacity=128
end
if @pause
@pauseframe=(Graphics.frame_count / 8) % 4
@pauseopacity=[@pauseopacity+64,255].min
mustchange=true
end
privRefresh if mustchange
for i in @sprites
i[1].update
end
end
private
def ensureBitmap(bitmap,dwidth,dheight)
if !bitmap||bitmap.disposed?||bitmap.width<dwidth||bitmap.height<dheight
bitmap.dispose if bitmap
bitmap=Bitmap.new([1,dwidth].max,[1,dheight].max)
end
return bitmap
end
def tileBitmap(dstbitmap,dstrect,srcbitmap,srcrect)
return if !srcbitmap || srcbitmap.disposed?
left=dstrect.x
top=dstrect.y
y=0;loop do break unless y<dstrect.height
x=0;loop do break unless x<dstrect.width
dstbitmap.blt(x+left,y+top,srcbitmap,srcrect)
x+=srcrect.width
end
y+=srcrect.height
end
end
def privRefresh(changeBitmap=false)
return if self.disposed?
backopac=self.back_opacity*self.opacity/255
contopac=self.contents_opacity
cursoropac=@cursoropacity*contopac/255
for i in 0...4
@sprites["corner#{i}"].bitmap=@_windowskin
@sprites["scroll#{i}"].bitmap=@_windowskin
end
@sprites["pause"].bitmap=@_windowskin
@sprites["contents"].bitmap=@contents
if @_windowskin && !@_windowskin.disposed?
for i in 0...4
@sprites["corner#{i}"].opacity=@opacity
@sprites["corner#{i}"].tone=@tone
@sprites["corner#{i}"].color=@color
@sprites["corner#{i}"].blend_type=@blend_type
@sprites["corner#{i}"].visible=@visible
@sprites["side#{i}"].opacity=@opacity
@sprites["side#{i}"].tone=@tone
@sprites["side#{i}"].color=@color
@sprites["side#{i}"].blend_type=@blend_type
@sprites["side#{i}"].visible=@visible
@sprites["scroll#{i}"].opacity=@opacity
@sprites["scroll#{i}"].tone=@tone
@sprites["scroll#{i}"].blend_type=@blend_type
@sprites["scroll#{i}"].color=@color
@sprites["scroll#{i}"].visible=@visible
end
for i in ["back","cursor","pause","contents"]
@sprites[i].color=@color
@sprites[i].tone=@tone
@sprites[i].blend_type=@blend_type
end
@sprites["contents"].blend_type=@contents_blend_type
@sprites["back"].opacity=backopac
@sprites["contents"].opacity=contopac
@sprites["cursor"].opacity=cursoropac
@sprites["pause"].opacity=@pauseopacity
@sprites["back"].visible=@visible
@sprites["contents"].visible=@visible && @openness==255
@sprites["pause"].visible=@visible && @pause
@sprites["cursor"].visible=@visible && @openness==255
hascontents=(@contents && !@contents.disposed?)
@sprites["scroll0"].visible = @visible && hascontents && @oy > 0
@sprites["scroll1"].visible = @visible && hascontents && @ox > 0
@sprites["scroll2"].visible = @visible && hascontents && (@contents.width - @ox) > @width-32
@sprites["scroll3"].visible = @visible && hascontents && (@contents.height - @oy) > @height-32
else
for i in 0...4
@sprites["corner#{i}"].visible=false
@sprites["side#{i}"].visible=false
@sprites["scroll#{i}"].visible=false
end
@sprites["contents"].visible=@visible && @openness==255
@sprites["contents"].color=@color
@sprites["contents"].tone=@tone
@sprites["contents"].blend_type=@contents_blend_type
@sprites["contents"].opacity=contopac
@sprites["back"].visible=false
@sprites["pause"].visible=false
@sprites["cursor"].visible=false
end
for i in @sprites
i[1].z=@z
end
if @rpgvx
@sprites["cursor"].z=@z # For Compatibility
@sprites["contents"].z=@z # For Compatibility
@sprites["pause"].z=@z # For Compatibility
else
@sprites["cursor"].z=@z+1 # For Compatibility
@sprites["contents"].z=@z+2 # For Compatibility
@sprites["pause"].z=@z+2 # For Compatibility
end
if @rpgvx
trimX=64
trimY=0
backRect=Rect.new(0,0,64,64)
blindsRect=Rect.new(0,64,64,64)
else
trimX=128
trimY=0
backRect=Rect.new(0,0,128,128)
blindsRect=nil
end
@sprites["corner0"].src_rect.set(trimX,trimY+0,16,16);
@sprites["corner1"].src_rect.set(trimX+48,trimY+0,16,16);
@sprites["corner2"].src_rect.set(trimX,trimY+48,16,16);
@sprites["corner3"].src_rect.set(trimX+48,trimY+48,16,16);
@sprites["scroll0"].src_rect.set(trimX+24, trimY+16, 16, 8) # up
@sprites["scroll3"].src_rect.set(trimX+24, trimY+40, 16, 8) # down
@sprites["scroll1"].src_rect.set(trimX+16, trimY+24, 8, 16) # left
@sprites["scroll2"].src_rect.set(trimX+40, trimY+24, 8, 16) # right
cursorX=trimX
cursorY=trimY+64
sideRects=[
Rect.new(trimX+16,trimY+0,32,16),
Rect.new(trimX,trimY+16,16,32),
Rect.new(trimX+48,trimY+16,16,32),
Rect.new(trimX+16,trimY+48,32,16)
]
if @width>32 && @height>32
@sprites["contents"].src_rect.set(@ox,@oy,@width-32,@height-32)
else
@sprites["contents"].src_rect.set(0,0,0,0)
end
pauseRects=[
trimX+32,trimY+64,
trimX+48,trimY+64,
trimX+32,trimY+80,
trimX+48,trimY+80,
]
pauseWidth=16
pauseHeight=16
@sprites["pause"].src_rect.set(
pauseRects[@pauseframe*2],
pauseRects[@pauseframe*2+1],
pauseWidth,pauseHeight
)
@sprites["pause"].x=@x+(@width/2)-(pauseWidth/2)
@sprites["pause"].y=@y+@height-16 # 16 refers to skin margin
@sprites["contents"].x=@x+16
@sprites["contents"].y=@y+16
@sprites["corner0"].x=@x
@sprites["corner0"].y=@y
@sprites["corner1"].x=@x+@width-16
@sprites["corner1"].y=@y
@sprites["corner2"].x=@x
@sprites["corner2"].y=@y+@height-16
@sprites["corner3"].x=@x+@width-16
@sprites["corner3"].y=@y+@height-16
@sprites["side0"].x=@x+16
@sprites["side0"].y=@y
@sprites["side1"].x=@x
@sprites["side1"].y=@y+16
@sprites["side2"].x=@x+@width-16
@sprites["side2"].y=@y+16
@sprites["side3"].x=@x+16
@sprites["side3"].y=@y+@height-16
@sprites["scroll0"].x = @x+@width / 2 - 8
@sprites["scroll0"].y = @y+8
@sprites["scroll1"].x = @x+8
@sprites["scroll1"].y = @y+@height / 2 - 8
@sprites["scroll2"].x = @x+@width - 16
@sprites["scroll2"].y = @y+@height / 2 - 8
@sprites["scroll3"].x = @x+@width / 2 - 8
@sprites["scroll3"].y = @y+@height - 16
@sprites["back"].x=@x+2
@sprites["back"].y=@y+2
@sprites["cursor"].x=@x+16+@cursor_rect.x
@sprites["cursor"].y=@y+16+@cursor_rect.y
if changeBitmap && @_windowskin && !@_windowskin.disposed?
width=@cursor_rect.width
height=@cursor_rect.height
if width > 0 && height > 0
cursorrects=[
# sides
Rect.new(cursorX+2, cursorY+0, 28, 2),
Rect.new(cursorX+0, cursorY+2, 2, 28),
Rect.new(cursorX+30, cursorY+2, 2, 28),
Rect.new(cursorX+2, cursorY+30, 28, 2),
# corners
Rect.new(cursorX+0, cursorY+0, 2, 2),
Rect.new(cursorX+30, cursorY+0, 2, 2),
Rect.new(cursorX+0, cursorY+30, 2, 2),
Rect.new(cursorX+30, cursorY+30, 2, 2),
# back
Rect.new(cursorX+2, cursorY+2, 28, 28)
]
margin=2
fullmargin=4
@cursorbitmap = ensureBitmap(@cursorbitmap, width, height)
@cursorbitmap.clear
@sprites["cursor"].bitmap=@cursorbitmap
@sprites["cursor"].src_rect.set(0,0,width,height)
rect = Rect.new(margin,margin,
width - fullmargin, height - fullmargin)
@cursorbitmap.stretch_blt(rect, @_windowskin, cursorrects[8])
@cursorbitmap.blt(0, 0, @_windowskin, cursorrects[4])# top left
@cursorbitmap.blt(width-margin, 0, @_windowskin, cursorrects[5]) # top right
@cursorbitmap.blt(0, height-margin, @_windowskin, cursorrects[6]) # bottom right
@cursorbitmap.blt(width-margin, height-margin, @_windowskin, cursorrects[7]) # bottom left
rect = Rect.new(margin, 0,
width - fullmargin, margin)
@cursorbitmap.stretch_blt(rect, @_windowskin, cursorrects[0])
rect = Rect.new(0, margin,
margin, height - fullmargin)
@cursorbitmap.stretch_blt(rect, @_windowskin, cursorrects[1])
rect = Rect.new(width - margin, margin,
margin, height - fullmargin)
@cursorbitmap.stretch_blt(rect, @_windowskin, cursorrects[2])
rect = Rect.new(margin, height-margin,
width - fullmargin, margin)
@cursorbitmap.stretch_blt(rect, @_windowskin, cursorrects[3])
else
@sprites["cursor"].visible=false
@sprites["cursor"].src_rect.set(0,0,0,0)
end
for i in 0..3
dwidth=(i==0||i==3) ? @width-32 : 16
dheight=(i==0||i==3) ? 16 : @height-32
@sidebitmaps[i]=ensureBitmap(@sidebitmaps[i],dwidth,dheight)
@sprites["side#{i}"].bitmap=@sidebitmaps[i]
@sprites["side#{i}"].src_rect.set(0,0,dwidth,dheight)
@sidebitmaps[i].clear
if sideRects[i].width>0 && sideRects[i].height>0
@sidebitmaps[i].stretch_blt(@sprites["side#{i}"].src_rect,
@_windowskin,sideRects[i])
end
end
backwidth=@width-4
backheight=@height-4
if backwidth>0 && backheight>0
@backbitmap=ensureBitmap(@backbitmap,backwidth,backheight)
@sprites["back"].bitmap=@backbitmap
@sprites["back"].src_rect.set(0,0,backwidth,backheight)
@backbitmap.clear
if @stretch
@backbitmap.stretch_blt(@sprites["back"].src_rect,@_windowskin,backRect)
else
tileBitmap(@backbitmap,@sprites["back"].src_rect,@_windowskin,backRect)
end
if blindsRect
tileBitmap(@backbitmap,@sprites["back"].src_rect,@_windowskin,blindsRect)
end
else
@sprites["back"].visible=false
@sprites["back"].src_rect.set(0,0,0,0)
end
end
if @openness!=255
opn=@openness/255.0
for k in @spritekeys
sprite=@sprites[k]
ratio=(@height<=0) ? 0 : (sprite.y-@y)*1.0/@height
sprite.zoom_y=opn
sprite.oy=0
sprite.y=(@y+(@height/2.0)+(@height*ratio*opn)-(@height/2*opn)).floor
end
else
for k in @spritekeys
sprite=@sprites[k]
sprite.zoom_y=1.0
end
end
i=0
# Ensure Z order
for k in @spritekeys
sprite=@sprites[k]
y=sprite.y
sprite.y=i
sprite.oy=(sprite.zoom_y<=0) ? 0 : (i-y)/sprite.zoom_y
end
end
end



but i have tilemapxp and tilemaploader...

lezebulon
February 4th, 2010, 06:17 AM
Hello
I got a simple question : Is there a way to reorder the scripts once you are in the script section (F11) ?

udivision
February 4th, 2010, 10:48 AM
Hello
I got a simple question : Is there a way to reorder the scripts once you are in the script section (F11) ?

Yea, you could cut and paste the script names on the left to move them around. But I don't see the point...

Klofkac
February 4th, 2010, 02:48 PM
How I can upgrade version without lose of any custom scripts?

|Maximus|
February 4th, 2010, 05:08 PM
Hi, I just deleted my PokemonOptions script, because it glitched up, and replaced it with the newest version but it shows errors, could somebody please post theirs?

lezebulon
February 4th, 2010, 06:41 PM
What is the right way to add new variables to $PokemonGlobal, that can be saved and loaded ??

I tried to do something, it works when I laucnh my game from RPGMaker, but not from game.exe

derw
February 5th, 2010, 01:40 AM
@ Derw It's in your window and tilemap script around line 5.

where can i find the scripts?? i ´ve search but nothing find...

lezebulon
February 5th, 2010, 07:33 AM
What is the right way to add new variables to $PokemonGlobal, that can be saved and loaded ??

I tried to do something, it works when I laucnh my game from RPGMaker, but not from game.exe

I'm rephrasing it, sorry :

What is the right way to add new variables that are begins with a $ ? For instance, I created $var1, that works fine and is global to all my scripts, but I get an error everytime I launch game.exe because of this (and not when I launch from RPGMaker)

1ninjadude1701
February 5th, 2010, 11:24 AM
hey how do i use pokemon roaming script? i know to unquote in script editor but how do i use on the map i want and set the pokemon?

Legendaries
February 5th, 2010, 02:52 PM
Can I set in some way that Pokemon given to the player by a NPC will be caught into, for example, Premier Ball?

Maruno
February 5th, 2010, 06:42 PM
Can I set in some way that Pokemon given to the player by a NPC will be caught into, for example, Premier Ball?
Yes. The type of Ball a caught pokémon is in is one of its variables, just like HP and Level are variables for a pokémon. Use a modified version of the "Modifying a Pokémon before adding it" (http://upokecenter.com/projects/pokestarter/notes.html#modifyingapokemonbeforeaddingit) examples to change the "ballused" variable attached to that pokémon. The Ball will be a number (see the list at the top of PokeBattle_Battle, remembering that the list is zero-based), and odds are the list isn't in the same order as they are in the items.txt file (so be careful!).

thepsynergist
February 5th, 2010, 09:47 PM
Hey Maruno, can you please help me with my problem? Check my above post...

Maruno
February 6th, 2010, 09:27 AM
Hey Maruno, can you please help me with my problem? Check my above post...
Sorry, no. I haven't looked at the Bug Catching Contest scripts, so I don't know how they work.

1ninjadude1701
February 6th, 2010, 11:58 AM
how do i make a trianer notice you i looked in the notes and i don't know how make it walk up to you and battle for X amount of spaces?

Maruno
February 6th, 2010, 01:17 PM
how do i make a trianer notice you i looked in the notes and i don't know how make it walk up to you and battle for X amount of spaces?
The first line in the section called "Trainers" (http://upokecenter.com/projects/pokestarter/notes.html#trainers) may help, in that it fully answers your question.

1ninjadude1701
February 6th, 2010, 01:32 PM
all right i got it but i get this error
---------------------------
Pokemon Essentials
---------------------------
Exception: RuntimeError

Message: Script error within event 2, map 41 (Route 1):

Exception: NoMethodError

Message: (eval):1:in `pbExecuteScript'undefined method `Dude_?' for PBTrainers:Class

***Full script:

pbTrainerBattle(PBTrainers::Dude_???,"Dude",_I("A very good battle, indeed."),false,0)

Interpreter:239:in `pbExecuteScript'

Interpreter:785:in `eval'

Interpreter:239:in `pbExecuteScript'

Interpreter:785:in `command_111'

Interpreter:318:in `execute_command'

Interpreter:191:in `update'

Interpreter:104:in `loop'

Interpreter:196:in `update'

Scene_Map:96:in `update'

Scene_Map:94:in `loop'



Interpreter:274:in `pbExecuteScript'

Interpreter:785:in `command_111'

Interpreter:318:in `execute_command'

Interpreter:191:in `update'

Interpreter:104:in `loop'

Interpreter:196:in `update'

Scene_Map:96:in `update'

Scene_Map:94:in `loop'

Scene_Map:107:in `update'

Scene_Map:63:in `main'



This exception was logged in errorlog.txt.

Press Ctrl+C to copy this message to the clipboard.
---------------------------
OK
---------------------------

Maruno
February 6th, 2010, 02:00 PM
all right i got it but i get this error
---------------------------
Pokemon Essentials
---------------------------
Exception: RuntimeError
Message: Script error within event 2, map 41 (Route 1):
Exception: NoMethodError
Message: (eval):1:in `pbExecuteScript'undefined method `Dude_?' for PBTrainers:Class

***Full script:
pbTrainerBattle(PBTrainers::Dude_???,"Dude",_I("A very good battle, indeed."),false,0)
Interpreter:239:in `pbExecuteScript'
Interpreter:785:in `eval'
Interpreter:239:in `pbExecuteScript'
Interpreter:785:in `command_111'
Interpreter:318:in `execute_command'
Interpreter:191:in `update'
Interpreter:104:in `loop'
Interpreter:196:in `update'
Scene_Map:96:in `update'
Scene_Map:94:in `loop'
Interpreter:274:in `pbExecuteScript'
Interpreter:785:in `command_111'
Interpreter:318:in `execute_command'
Interpreter:191:in `update'
Interpreter:104:in `loop'
Interpreter:196:in `update'
Scene_Map:96:in `update'
Scene_Map:94:in `loop'
Scene_Map:107:in `update'
Scene_Map:63:in `main'
This exception was logged in errorlog.txt.
You seem to be using a trainer class internal name of "Dude_???". Take the question marks out, and replace them with something else (if necessary), e.g. "DUDE_QQQ". Remember to change both the event and trainernames.txt and trainers.txt when you do so.

In general, stick with capital letters only (and underscores/lower case letters if you really want them) when writing internal names. Don't use any symbols at all. This minimises errors, and they stand out more in a block of code. The internal name is never shown in the game, so it doesn't matter what it actually looks like (i.e. all caps or otherwise).

thepsynergist
February 6th, 2010, 05:14 PM
Oh well, thx anyway Maruno.

I wish Poccil would fix the Bug Catching contest and the problems with the trainer intro ME overrunning the trainer battle BGM.

Shorthand
February 6th, 2010, 11:48 PM
How exactly do you change the default controls? I've tried using the F1 menu to switch the C button to Z, but it doesn't work.

V0RT3X
February 7th, 2010, 06:42 AM
can someone help me?
I tried to zoom out the whole thing. I saw poccil inpritted a resizefactor, but if i change the factor to 0.5 instead of 1.0, nothing happens.
Can someone please tell me how i turn a map with 32x32 tiles into a map with 16x16 tiles ( with the character and movement halved)?

1ninjadude1701
February 7th, 2010, 05:05 PM
Hey that help Maruno Thank you very much. :D

Maruno
February 7th, 2010, 06:03 PM
How exactly do you change the default controls? I've tried using the F1 menu to switch the C button to Z, but it doesn't work.
Look in PokemonEntry near the top for def self.buttonToKey(button). To change the controls, simply change the "0x50" type codes to what you want. You'll probably want to do some research into which keys do what first, before you start reassigning them.


can someone help me?
I tried to zoom out the whole thing. I saw poccil inpritted a resizefactor, but if i change the factor to 0.5 instead of 1.0, nothing happens.
Can someone please tell me how i turn a map with 32x32 tiles into a map with 16x16 tiles ( with the character and movement halved)?
If I understand you correctly, you want to create a game in which each step the player takes is only half his width (i.e. you need to take two steps in order to reach the same position the official games take you to with just one step).

I would suggest using double sized graphics (NPCs, houses, trees, everything - physically resize all the picture files, and rebuild the tilesets to match), and setting the default resize factor to 0.25 (which shrinks it all again). The reasoning is that the game's default graphics are meant for a resize factor of 0.5, which gives 1 classical step per step. Doubling the graphics sizes and halving the resize factor (to 0.25) keeps the graphics looking the same, but you now get 1 classical step for every 2 steps you take (because you doubled the size of all the graphics, so the player character's graphic covers two tiles across).

Look in SpriteResizer for $ResizeFactor (set this to 0.25 instead of 1.0), and see where things go from there. You may also want to at least change the screen size option in PokemonOptions so that it doesn't affect the resize factor.

This is a complicated feat, mainly due to having to resize all the graphics and make your own tilesets (one grass tile will now cover 4 tiles, so effectively tilesets now only have a width of 4 tiles). Drawing maps will also be more complicated, since each "tile" is actually 4 tiles now. Your maps will also be huge, even if you're only making a small place (luckily RPG Maker XP allows you to zoom out while you draw your maps).



I'm more than willing to bet there's a way to change how large RPG Maker XP thinks a tile is (perhaps involving @tileWidth and @tileHeight in TilemapXP), but that's beyond me (i.e. I don't know whether it would affect mapping or just movement within the game, etc. etc.). What I said would work, even though it creates a major pain during mapping (and eventing, too).

Legendaries
February 8th, 2010, 04:08 AM
I have a problem with Pokemon battle. When it starts and I want to choose "Battle" an error shows:
http://i48.tinypic.com/de1cm8.png
What's wrong?

V0RT3X
February 8th, 2010, 07:15 AM
Look in PokemonEntry near the top for def self.buttonToKey(button). To change the controls, simply change the "0x50" type codes to what you want. You'll probably want to do some research into which keys do what first, before you start reassigning them.



If I understand you correctly, you want to create a game in which each step the player takes is only half his width (i.e. you need to take two steps in order to reach the same position the official games take you to with just one step).

I would suggest using double sized graphics (NPCs, houses, trees, everything - physically resize all the picture files, and rebuild the tilesets to match), and setting the default resize factor to 0.25 (which shrinks it all again). The reasoning is that the game's default graphics are meant for a resize factor of 0.5, which gives 1 classical step per step. Doubling the graphics sizes and halving the resize factor (to 0.25) keeps the graphics looking the same, but you now get 1 classical step for every 2 steps you take (because you doubled the size of all the graphics, so the player character's graphic covers two tiles across).

Look in SpriteResizer for $ResizeFactor (set this to 0.25 instead of 1.0), and see where things go from there. You may also want to at least change the screen size option in PokemonOptions so that it doesn't affect the resize factor.

This is a complicated feat, mainly due to having to resize all the graphics and make your own tilesets (one grass tile will now cover 4 tiles, so effectively tilesets now only have a width of 4 tiles). Drawing maps will also be more complicated, since each "tile" is actually 4 tiles now. Your maps will also be huge, even if you're only making a small place (luckily RPG Maker XP allows you to zoom out while you draw your maps).



I'm more than willing to bet there's a way to change how large RPG Maker XP thinks a tile is (perhaps involving @tileWidth and @tileHeight in TilemapXP), but that's beyond me (i.e. I don't know whether it would affect mapping or just movement within the game, etc. etc.). What I said would work, even though it creates a major pain during mapping (and eventing, too).
thanks maruno, but if it is that much work, i think i'll let it stay at the normal format of 32x32 tiles. Maybe, some time later i will do this, when i got more scripter skills in ruby :D

Legendaries
February 8th, 2010, 07:33 AM
I have a problem with positioning:
http://i49.tinypic.com/1y9500.png
In editor I set position of Eevee and then in game Eevee is floating. The same with Starly and every other Pokemon.

Maruno
February 8th, 2010, 01:55 PM
I have a problem with positioning:
http://i49.tinypic.com/1y9500.png
In editor I set position of Eevee and then in game Eevee is floating. The same with Starly and every other Pokemon.
The back sprite position is a combination of a default value plus an offset. The default value is in the scripts somewhere, and the offset is in pokemon.txt as "BattlerPlayerY".

The simplest solution is to edit all the back sprite graphics to make them sit on the bottom edge, set all the offsets to zero, and just work with the default value in the scripts. That's what I did.

I also had no idea there was an editor like you've shown. I did my work the hard way. I'll have to look it up, because there's still some positioning I need to do.

Peeky Chew
February 10th, 2010, 05:38 AM
On one of my maps I walf through everything, except if I've set layer 3 parts to not walk through. I created a new map and uploaded a different tile set and this still happens! Help!
Also, when I start a new game it constantly makes the colliding with object noise during the intro...

Dragma
February 10th, 2010, 02:45 PM
Hey everyone!

I apologize if this question was answered earlier in the thread, but I have no time to read nearly 250 pages.

Anyways, here it is:

I'm in the beginning stages of my 1st town. I have two events that are giving me problems. They both work fine, but when I enter a building and then exit, they both start again.

1st event: After the player is transported from a location, the professor approaches the player and talks to him/her. After this he leaves.

2nd Event: I talk to a person standing in front of his house. After he introduces himself, a battle ensues.

1st Event Problem: When I re-enter the map, the professor talks and walks automatically again. How can I fix this?

2nd Event Problem: When I re-enter the map, the text that the person says after the battle continues to appear.
--------------------------------------------------------------------------

I can post pics of the code if needed. Thanks in advance.

Colbex
February 10th, 2010, 06:04 PM
Oh, well that's pretty simple actually. On both events, at the bottom, control your self switches so self switch A is on. Then, create a 2nd event page that's blank for the professor event. On this second page, however, make sure that the condition of self switch A is on. You should see this in the top left hand box beneath the name of the event. You do the same thing for the other event, however, I'm guessing you don't want the trainer to just go and disappear. Use the same graphic(probably) you used on the first page and add what you want him to do, whether it be walk off or talk. If you want him to walk off also, however, you should set his move route on the first event page and do what you did for the professor.

Unless I've misunderstood what you're asking, that should help you. Also, for future reference, if there's something you're unsure about, you can always use the "search this thread" feature for something that may have been already answered.

Dragma
February 10th, 2010, 08:15 PM
Thanks a lot. That really helped.

Oh, one more question if you don't mind. I'm trying to create a transfer from the outside of the lab to the inside by creating a simple event. I used the same coding for any other door, but this one seems to be different.

I keep getting this error message, and I'm not sure why:

Message: undefined method `unlock' for nil:NilClass
Interpreter:509:in `command_end'
Interpreter:293:in `execute_command'
Interpreter:191:in `update'
Interpreter:104:in `loop'
Interpreter:196:in `update'
Scene_Map:96:in `update'
Scene_Map:94:in `loop'
Scene_Map:107:in `update'
Scene_Map:63:in `main'
Scene_Map:60:in `loop'
Exception: NoMethodError


Thanks again for your helpful tips! :)

EDIT:
This only happens when the player attempts to enter the Lab. Exiting is no problem (Debugged), but I'm hung up on why this transition seems to be erroneous.

Legendaries
February 11th, 2010, 04:52 PM
I have a strange problem. When I use any Pokeball trying to capture Pokemon nothing happens. There's a text "Player used Master Ball", but nothing else. No animation of throwing the ball, wild pokemon is not captured or something and used ball is lost.

It was eveything ok before. I've changed something by accident it seems, but I don't really know what. :/

Maruno
February 11th, 2010, 07:04 PM
I have a strange problem. When I use any Pokeball trying to capture Pokemon nothing happens. There's a text "Player used Master Ball", but nothing else. No animation of throwing the ball, wild pokemon is not captured or something and used ball is lost.

It was eveything ok before. I've changed something by accident it seems, but I don't really know what. :/
PokeBattle_Battle has the basic battle system in it. pbRegisterItem is the def that decides to throw a Poké Ball if you've chosen to use one, so check that. If that looks fine, check around it (e.g. pbThrowPokeBall, pbCommandPhase) to see if anything there looks wrong. Assuming you can still continue the battle after failing to use a Ball (e.g. you can conduct a battle/switch Pokémon), the problem should be somewhere in that area.

Worst comes to worst, open a clean copy of Essentials and copy-paste the entire PokeBattle_Battle script.

Peeky Chew
February 12th, 2010, 01:30 AM
On one of my maps I walk through everything, except if I've set layer 3 parts to not walk through. I created a new map and uploaded a different tile set and this still happens! Help!
Also, when I start a new game it constantly makes the colliding with object noise during the intro...

Legendaries
February 12th, 2010, 02:40 AM
PokeBattle_Battle has the basic battle system in it. pbRegisterItem is the def that decides to throw a Poké Ball if you've chosen to use one, so check that. If that looks fine, check around it (e.g. pbThrowPokeBall, pbCommandPhase) to see if anything there looks wrong. Assuming you can still continue the battle after failing to use a Ball (e.g. you can conduct a battle/switch Pokémon), the problem should be somewhere in that area.

Worst comes to worst, open a clean copy of Essentials and copy-paste the entire PokeBattle_Battle script.

Maruno, you are great! It works :D Now I know what was wrong. I was using D/P/Pt PokeBalls, then I removed them from PBS/items.txt, but I forgot to remove them from PokeBattle_Battle.

Now it works :D Thank you.

Also, thanks for helping me with battle position, it works fine too :)

Worldslayer608
February 12th, 2010, 07:08 AM
So I am trying to figure out how to get the message box to fit in to the little mini screen. But I am having trouble. I can't seem to find the right line of code to edit. Here is a screenshot to show what I am trying to do I guess.

*Not sure if this belonged in the Help and Requests or here...

FROM

http://i47.tinypic.com/2z7mtcp.jpg

TO

http://i48.tinypic.com/35ibouw.png

~Frozen Darkness~
February 12th, 2010, 05:59 PM
I just found a strange glitch.

Basically, when battling a wild Pokemon, the wild pokemon's sprite placement is fine.
However, when I fight the same Pokemon in a Trainer Battle, the sprite is placed lower than it should be. I can post a screenshot if you need one, but what I just wrote was pretty understandable, no?

This problem is really starting to annoy me now. :(

Maruno
February 12th, 2010, 06:44 PM
I just found a strange glitch.

Basically, when battling a wild Pokemon, the wild pokemon's sprite placement is fine.
However, when I fight the same Pokemon in a Trainer Battle, the sprite is placed lower than it should be. I can post a screenshot if you need one, but what I just wrote was pretty understandable, no?

This problem is really starting to annoy me now. :(
It's not a glitch; that's how it's programmed.

Wild Pokémon glide in from the left, standing on the battle base. Trainer Pokémon get thrown out into the air from a Poké Ball and then drop down to the ground. It's because these two appearance methods are different that battles against wild foes and trainer-owned foes are handled differently (at least in this respect).

Go into PokeBattle_ActualScene and search for the term "metrics". This is the name the code gives to those three y-positioning factors you can set in pokemon.txt (BattlerPlayerY, BattlerEnemyY and BattlerAltitude). "metrics" will show up in several places, but it'd not difficult to find out what each place does. When you've found the two sections of code that determine the coordinates for both the wild foe and trainer-owned foe, all you need to do is make sure they look the same (at least as far as the y-position goes).

I'm missing out a lot of detail here. The sprite positioning is a rather complex affair.

~Frozen Darkness~
February 13th, 2010, 05:23 AM
Thanks, Maruno. I found it. :)

Just for those who are also annoyed by this:

Go into PokeBattle_ActualScene and go to Line 738 and replace that with this:

@endspritey=factor*0.95+halfY # from center

0.95 is the number needed to make trainer Pokemon have the same Y as Wild Pokemon. :)

Enjoy!

Peeky Chew
February 13th, 2010, 05:36 AM
On one of my maps I walk through everything, except if I've set layer 3 parts to not walk through. I created a new map and uploaded a different tile set and this still happens! Help!
Also, when I start a new game it constantly makes the colliding with object noise during the intro...Still need help with this.

Colbex
February 13th, 2010, 07:34 AM
For your first problem, have you made sure that Always on Top isn't on or some other event? That sounds like what it might be. Um, maybe you should post a picture of your introduction, in case you made the error somewhere in there.

Legendaries
February 13th, 2010, 08:09 AM
Just a simple question:
When the regional numbers of each Pokemon are set, how do I make the player receives Regional Pokedex, not the National one?

lezebulon
February 13th, 2010, 08:20 AM
Hi
I think this is a known glitch but I don't know how to solve it :
in my version of the starter kit, the pokemon sprites from my side are moving up and down a little (that's ok), but after a while they drift up and they end up being so high that there is a gap with nothing under the pokemon sprite... anyone knows why ?

Maruno
February 13th, 2010, 08:59 AM
Just a simple question:
When the regional numbers of each Pokemon are set, how do I make the player receives Regional Pokedex, not the National one?
In PokemonPokedex, there's a def called pbGetPokedexRegion. This returns the region number (default is whatever region you're standing in). To start off with the Regional Dex, you can change this def to "return 1 if $game_switches[42]", where switch 42 is turned on as long as you want to look at the Regional Dex (i.e. for the first half of the game). Just turn it on when you receive the Pokédex, and turn it off once you get the National Dex.

You can make a way to freely alternate between the two, but I won't get into that again. I've talked about it recently. (http://www.pokecommunity.com/showthread.php?p=5506445#post5506445)


Hi
I think this is a known glitch but I don't know how to solve it :
in my version of the starter kit, the pokemon sprites from my side are moving up and down a little (that's ok), but after a while they drift up and they end up being so high that there is a gap with nothing under the pokemon sprite... anyone knows why ?
You're talking about the back sprites in battle, I presume. It helps to include that kind of information.

I discovered that glitch a while ago, except in my case they were sinking. My version of Essentials is a year old now, so I don't know what the most recent version looks like (i.e. whether an attempt to fix this has been made).

To solve this, fiddle with def update in class PokemonSprite < RPG::Sprite in PokeBattle_ActualScene. I found that adding in an extra "elsif @selected==1" clause as the second clause, the contents of which are identical to the first except it sets the y coordinate to a set number rather than "@spriteY-2" (or whatever), it's fixed.

lezebulon
February 13th, 2010, 09:54 AM
Thanks I fixed it !
random text cause the message was too short

Dragma
February 13th, 2010, 01:35 PM
Does anyone know what causes the "hanging script" error? I've searched around, and I can't seem to find an answer...

Legendaries
February 15th, 2010, 02:50 AM
I have an error like that while choosing "Switches" in F9 Debug menu:

---------------------------
Pokémon Saturn Version
---------------------------
Exception: NoMethodError

Message: undefined method `bitmap' for nil:NilClass

PokemonDebug:1135:in `refresh'

PokemonDebug:1121:in `each'

PokemonDebug:1121:in `refresh'

SpriteWindow:2809:in `priv_update_cursor_rect'

SpriteWindow:2671:in `index='

PokemonDebug:1094:in `initialize'

PokemonDebug:1188:in `new'

PokemonDebug:1188:in `pbDebugScreen'

PokemonDebug:871:in `pbDebugMenu'

PokemonDebug:871:in `pbFadeOutIn'



This exception was logged in ./errorlog.txt.

Press Ctrl+C to copy this message to the clipboard.
---------------------------
OK
---------------------------


And the other problem:
When I try to change player graphic via "set move route -> event:player -> change graphic" the graphic doesn't change or if it changes it's restored to the default one while using any teleport.

EDIT:
Problem solved.

Crazyninjaguy
February 15th, 2010, 10:00 AM
When I try to change player graphic via "set move route -> event:player -> change graphic" the graphic doesn't change or if it changes it's restored to the default one while using any teleport.

The change graphic command doesnt work because poccil took it out when he wrote the scripts.

I have a small problem too, i need to be able to use the $Trainer class or method or whatever in Scene_Map but it gives me an error about an undefined method. Is there any way i can use this? Mainly for $Trainer.party.length

Thanks in advance.

Dragma
February 15th, 2010, 11:14 AM
So, I have a tough question here.

I'm making a new HM called Lava that allows the player to "surf" across lava. So I edited the game's script (even though I have no experience with ruby). I replaced Flash with Lava (using Surf's syntax), and it seemed to work.
However, I can only "surf" on the lava. When I try to surf on water, Lava is used instead.

How can I edit the script to allow surfing on water and "surfing" on lava?

EDIT:
In the script, Surf is still there. However, the game seems to only be interpreting Lava's commands. Maybe there's a way I can define a terrain tag? Help please!

Crazyninjaguy
February 15th, 2010, 11:22 AM
EDIT: Actually, try replacing your whole PokemonHiddenMoves script with this:

BADGEFORCUT=0
BADGEFORFLASH=1
BADGEFORROCKSMASH=2
BADGEFORSURF=3
BADGEFORLAVA=3
BADGEFORFLY=4
BADGEFORSTRENGTH=5
BADGEFORDIVE=6
BADGEFORWATERFALL=7

class MoveHandlerHash < HandlerHash
def initialize
super(:PBMoves)
end
end

module HiddenMoveHandlers
CanUseMove=MoveHandlerHash.new
UseMove=MoveHandlerHash.new
def self.addCanUseMove(item,proc)
CanUseMove.add(item,proc)
end
def self.addUseMove(item,proc)
UseMove.add(item,proc)
end
def self.hasHandler(item)
return CanUseMove[item]!=nil && UseMove[item]!=nil
end
def self.triggerCanUseMove(item,pokemon)
# Returns whether move can be used
if !CanUseMove[item]
return false
else
return CanUseMove.trigger(item,pokemon)
end
end
def self.triggerUseMove(item,pokemon)
# Returns whether move was used
if !UseMove[item]
return false
else
return UseMove.trigger(item,pokemon)
end
end
end

def pbHiddenMoveAnimation(pokemon)
return false if !pokemon
viewport=Viewport.new(0,0,0,0)
viewport.z=99999
ptinterp=nil
plane=ColoredPlane.new(Color.new(0,0,0,255),viewport)
sprite=PokemonSprite.new
sprite.z=99999
sprite.setPokemonBitmap(pokemon)
sprite.visible=false
interp=RectInterpolator.new(
Rect.new(Graphics.width,Graphics.height/2,0,0),
Rect.new(0,(Graphics.height-sprite.bitmap.height)/2,
Graphics.width,sprite.bitmap.height),20
)
sprite.ox=sprite.bitmap.width/2
sprite.oy=sprite.bitmap.height/2
strobes=[]
15.times do |i|
strobe=BitmapSprite.new(80,8,viewport)
strobe.bitmap.fill_rect(0,0,80,8,Color.new(248,248,248))
strobe.visible=false
strobes.push(strobe)
end
phase=1
frames=0
begin
Graphics.update
Input.update
case phase
when 1
interp.update
interp.set(viewport.rect)
if interp.done?
phase=2
ptinterp=PointInterpolator.new(
Graphics.width+(sprite.bitmap.width/2),Graphics.height/2,
Graphics.width/2,Graphics.height/2,15
)
end
when 2
ptinterp.update
sprite.x=ptinterp.x
sprite.y=ptinterp.y
sprite.visible=true
if ptinterp.done?
phase=3
pbPlayCry(pokemon)
frames=0
end
when 3
frames+=1
if frames>30
phase=4
ptinterp=PointInterpolator.new(
Graphics.width/2,Graphics.height/2,
-(sprite.bitmap.width/2),Graphics.height/2,15
)
frames=0
end
when 4
ptinterp.update
sprite.x=ptinterp.x
sprite.y=ptinterp.y
if ptinterp.done?
phase=5
sprite.visible=false
interp=RectInterpolator.new(
Rect.new(0,(Graphics.height-sprite.bitmap.height)/2,
Graphics.width,sprite.bitmap.height),
Rect.new(0,(Graphics.height)/2,Graphics.width,0),20
)
end
when 5
interp.update
interp.set(viewport.rect)
phase=6 if interp.done?
end
for strobe in strobes
strobe.ox=strobe.viewport.rect.x
strobe.oy=strobe.viewport.rect.y
if strobe.visible && strobe.x+strobe.src_rect.width>=0
strobe.x-=32
elsif !strobe.visible
randomY=[80,100,120,140,160,180,200,220,240]
strobe.y=randomY[rand(randomY.length)]
strobe.x=rand(Graphics.width)
strobe.src_rect.width=20+rand(40)
strobe.visible=true
else
randomY=[80,100,120,140,160,180,200,220,240]
strobe.y=randomY[rand(randomY.length)]
strobe.x=Graphics.width+rand(Graphics.width/4)
strobe.src_rect.width=20+rand(40)
end
end
pbUpdateSceneMap
end while phase!=6
sprite.dispose
for strobe in strobes
strobe.dispose
end
strobes.clear
plane.dispose
viewport.dispose
return true
end

def Kernel.pbCut
if $DEBUG || $Trainer.badges[BADGEFORCUT]
movefinder=Kernel.pbCheckMove(:CUT)
if $DEBUG || movefinder
Kernel.pbMessage(_INTL("This tree looks like it can be cut down!\1"))
if Kernel.pbConfirmMessage(_INTL("Would you like to cut it?"))
speciesname=!movefinder ? $Trainer.name : movefinder.name
Kernel.pbMessage(_INTL("{1} used Cut!",speciesname))
pbHiddenMoveAnimation(movefinder)
return true
end
else
Kernel.pbMessage(_INTL("This tree looks like it can be cut down."))
end
else
Kernel.pbMessage(_INTL("This tree looks like it can be cut down."))
end
return false
end


def Kernel.pbHeadbuttEffect(event)
a=((event.x*event.y+event.x*event.y)/5)%10
b=($Trainer.id&0xFFFF)%10
chance=1
if a==b
chance=8
elsif a>b && (a-b).abs<5
chance=5
elsif a<b && (a-b).abs>5
chance=5
end
if rand(10)>=chance
Kernel.pbMessage(_INTL("Nope. Nothing..."))
else
if !pbEncounter(chance==1 ? 7 : 8)
Kernel.pbMessage(_INTL("Nope. Nothing..."))
end
end
end

def Kernel.pbHeadbutt(event)
movefinder=Kernel.pbCheckMove(:HEADBUTT)
if $DEBUG || movefinder
if Kernel.pbConfirmMessage(_INTL("A Pokémon could be in this tree. Want to headbutt it?"))
speciesname=!movefinder ? $Trainer.name : movefinder.name
Kernel.pbMessage(_INTL("{1} did a headbutt!",speciesname))
Kernel.pbHeadbuttEffect(event)
end
else
Kernel.pbMessage(_INTL("A Pokémon could be in this tree. Maybe a Pokémon could shake it."))
end
Input.update
return
end

def pbRockSmashRandomEncounter
if rand(100)<25
pbEncounter(EncounterTypes::RockSmash)
end
end


def Kernel.pbRockSmash
if $DEBUG || $Trainer.badges[BADGEFORROCKSMASH]
movefinder=Kernel.pbCheckMove(:ROCKSMASH)
if $DEBUG || movefinder
if Kernel.pbConfirmMessage(_INTL("This rock appears breakable. Would you like to use Rock Smash?"))
speciesname=!movefinder ? $Trainer.name : movefinder.name
Kernel.pbMessage(_INTL("{1} used Rock Smash!",speciesname))
pbHiddenMoveAnimation(movefinder)
return true
end
else
Kernel.pbMessage(_INTL("It's a rugged rock, but a Pokémon may be able to smash it."))
end
else
Kernel.pbMessage(_INTL("It's a rugged rock, but a Pokémon may be able to smash it."))
end
return false
end

def Kernel.pbStrength
if $PokemonMap.strengthUsed
Kernel.pbMessage(_INTL("Strength made it possible to move boulders around."))
elsif $DEBUG || $Trainer.badges[BADGEFORSTRENGTH]
movefinder=Kernel.pbCheckMove(:STRENGTH)
if $DEBUG || movefinder
Kernel.pbMessage(_INTL("It's a big boulder, but a Pokémon may be able to push it aside."))
if Kernel.pbConfirmMessage(_INTL("Would you like to use Strength?"))
speciesname=!movefinder ? $Trainer.name : movefinder.name
pbHiddenMoveAnimation(movefinder)
Kernel.pbMessage(_INTL("{1} used Strength!\1",speciesname))
Kernel.pbMessage(_INTL("{1}'s Strength made it possible to move boulders around!",speciesname))
$PokemonMap.strengthUsed=true
return true
end
else
Kernel.pbMessage(_INTL("It's a big boulder, but a Pokémon may be able to push it aside."))
end
else
Kernel.pbMessage(_INTL("It's a big boulder, but a Pokémon may be able to push it aside."))
end
return false
end

def Kernel.pbSurf
if $game_player.pbHasDependentEvents?
return false
end
if $DEBUG || $Trainer.badges[BADGEFORSURF]
movefinder=Kernel.pbCheckMove(:SURF)
if $DEBUG || movefinder
if Kernel.pbConfirmMessage(_INTL("The water is dyed a deep blue... Would you like to surf?"))
speciesname=!movefinder ? $Trainer.name : movefinder.name
Kernel.pbMessage(_INTL("{1} used Surf!",speciesname))
pbHiddenMoveAnimation(movefinder)
surfbgm=pbGetMetadata(0,MetadataSurfBGM)
if surfbgm
pbCueBGM(surfbgm,0.5)
end
pbStartSurfing()
return true
end
end
end
return false
end

def Kernel.pbLava
if $game_player.pbHasDependentEvents?
return false
end
if $DEBUG || $Trainer.badges[BADGEFORLAVA]
movefinder=Kernel.pbCheckMove(:LAVA)
if $DEBUG || movefinder
if Kernel.pbConfirmMessage(_INTL("You can surf on this lava... Would you like to surf?"))
speciesname=!movefinder ? $Trainer.name : movefinder.name
Kernel.pbMessage(_INTL("{1} used Lava!",speciesname))
pbHiddenMoveAnimation(movefinder)
surfbgm=pbGetMetadata(0,MetadataSurfBGM)
if surfbgm
pbCueBGM(surfbgm,0.5)
end
pbStartSurfing()
return true
end
end
end
return false
end

def Kernel.pbSurfacing
return if !$PokemonGlobal.diving
divemap=nil
meta=pbLoadMetadata
for i in 0...meta.length
if meta[i] && meta[i][MetadataDiveMap]
if meta[i][MetadataDiveMap]==$game_map.map_id
divemap=i
break
end
end
end
return if !divemap
movefinder=Kernel.pbCheckMove(:DIVE)
if $DEBUG || (movefinder && $Trainer.badges[BADGEFORDIVE])
if Kernel.pbConfirmMessage(_INTL("Light is filtering down from above. Would you like to use Dive?"))
speciesname=!movefinder ? $Trainer.name : movefinder.name
Kernel.pbMessage(_INTL("{1} used Dive.",speciesname))
pbHiddenMoveAnimation(movefinder)
pbFadeOutIn(99999){
$game_temp.player_new_map_id=divemap
$game_temp.player_new_x=$game_player.x
$game_temp.player_new_y=$game_player.y
$game_temp.player_new_direction=$game_player.direction
pbCancelVehicles
$PokemonGlobal.surfing=true
pbUpdateVehicle
$scene.transfer_player(false)
surfbgm=pbGetMetadata(0,MetadataSurfBGM)
if surfbgm
pbBGMPlay(surfbgm)
else
$game_map.autoplayAsCue
end
$game_map.refresh
}
return true
end
else
Kernel.pbConfirmMessage(_INTL("Light is filtering down from above. A Pokémon may be able to surface here."))
end
return false
end

def Kernel.pbAscendWaterfall(event=nil)
event=$game_player if !event
return if !event
return if event.direction!=8 # can't ascend if not facing up
oldthrough=event.through
oldmovespeed=event.move_speed
terrain=Kernel.pbFacingTerrainTag(nil,event)
return if terrain!=PBTerrain::Waterfall && terrain!=PBTerrain::WaterfallCrest
event.through=true
event.move_speed=2
loop do
event.move_up
terrain=pbGetTerrainTag(event)
break if terrain!=PBTerrain::Waterfall && terrain!=PBTerrain::WaterfallCrest
end
event.through=oldthrough
event.move_speed=oldmovespeed
end

def Kernel.pbDescendWaterfall(event=nil)
event=$game_player if !event
return if !event
return if event.direction!=2 # Can't descend if not facing down
oldthrough=event.through
oldmovespeed=event.move_speed
terrain=Kernel.pbFacingTerrainTag(nil,event)
return if terrain!=PBTerrain::Waterfall && terrain!=PBTerrain::WaterfallCrest
event.through=true
event.move_speed=2
loop do
event.move_down
terrain=pbGetTerrainTag(event)
break if terrain!=PBTerrain::Waterfall && terrain!=PBTerrain::WaterfallCrest
end
event.through=oldthrough
event.move_speed=oldmovespeed
end

def Kernel.pbSlideOnIce(event=nil)
event=$game_player if !event
return if !event
direction=event.direction
continuing=true
oldwalkanime=event.walk_anime
event.straighten
event.walk_anime=false
begin
break if !event.passable?(event.x,event.y,direction)
case direction
when 2
event.move_down
when 4
event.move_left
when 6
event.move_right
when 8
event.move_up
end
while event.moving?
Graphics.update
Input.update
pbUpdateSceneMap
end
end while pbGetTerrainTag(event)==PBTerrain::Ice
event.walk_anime=oldwalkanime
end


def Kernel.pbWaterfall
if $DEBUG || $Trainer.badges[BADGEFORWATERFALL]
movefinder=Kernel.pbCheckMove(:WATERFALL)
if $DEBUG || movefinder
if Kernel.pbConfirmMessage(_INTL("It's a large waterfall. Would you like to use Waterfall?"))
speciesname=!movefinder ? $Trainer.name : movefinder.name
Kernel.pbMessage(_INTL("{1} used Waterfall.",speciesname))
pbHiddenMoveAnimation(movefinder)
pbAscendWaterfall
return true
end
else
Kernel.pbMessage(_INTL("A wall of water is crashing down with a mighty roar."))
end
else
Kernel.pbMessage(_INTL("A wall of water is crashing down with a mighty roar."))
end
return false
end


def Kernel.pbDive
divemap=pbGetMetadata($game_map.map_id,MetadataDiveMap)
return false if !divemap
if $DEBUG || $Trainer.badges[BADGEFORDIVE]
movefinder=Kernel.pbCheckMove(:DIVE)
if $DEBUG || movefinder
if Kernel.pbConfirmMessage(_INTL("The sea is deep here. Would you like to use Dive?"))
speciesname=!movefinder ? $Trainer.name : movefinder.name
Kernel.pbMessage(_INTL("{1} used Dive.",speciesname))
pbHiddenMoveAnimation(movefinder)
pbFadeOutIn(99999){
$game_temp.player_new_map_id=divemap
$game_temp.player_new_x=$game_player.x
$game_temp.player_new_y=$game_player.y
$game_temp.player_new_direction=$game_player.direction
pbCancelVehicles
$PokemonGlobal.diving=true
pbUpdateVehicle
$scene.transfer_player(false)
$game_map.autoplay
$game_map.refresh
}
return true
end
else
Kernel.pbMessage(_INTL("The sea is deep here. A Pokémon may be able to go underwater."))
end
else
Kernel.pbMessage(_INTL("The sea is deep here. A Pokémon may be able to go underwater."))
end
return false
end


def pbEndSurf(xOffset,yOffset)
return false if !$PokemonGlobal.surfing
x=$game_player.x
y=$game_player.y
currentTag=$game_map.terrain_tag(x,y)
facingTag=Kernel.pbFacingTerrainTag
if pbIsWaterTag?(currentTag)&&!pbIsWaterTag?(facingTag)
if Kernel.pbJumpToward
Kernel.pbCancelVehicles
$game_map.autoplayAsCue
$game_player.increase_steps
result=$game_player.check_event_trigger_here([1,2])
Kernel.pbOnStepTaken(result)
end
return true
end
return false
end

def pbEndLava(xOffset,yOffset)
return false if !$PokemonGlobal.surfing
x=$game_player.x
y=$game_player.y
currentTag=$game_map.terrain_tag(x,y)
facingTag=Kernel.pbFacingTerrainTag
if pbIsWaterTag?(currentTag)&&!pbIsWaterTag?(facingTag)
if Kernel.pbJumpToward
Kernel.pbCancelVehicles
$game_map.autoplayAsCue
$game_player.increase_steps
result=$game_player.check_event_trigger_here([1,2])
Kernel.pbOnStepTaken(result)
end
return true
end
return false
end

HiddenMoveHandlers::CanUseMove.add(:FLY,proc{|move,pkmn|
if !$DEBUG && !$Trainer.badges[BADGEFORFLY]
Kernel.pbMessage(_INTL("Sorry, a new Badge is required."))
return false
end
if $game_player.pbHasDependentEvents?
Kernel.pbMessage(_INTL("You can't use that if you have someone with you."))
return false
end
if !pbGetMetadata($game_map.map_id,MetadataOutdoor)
Kernel.pbMessage(_INTL("Can't use that here."))
return false
end
return true
})
HiddenMoveHandlers::CanUseMove.add(:CUT,proc{|move,pkmn|
if !$DEBUG && !$Trainer.badges[BADGEFORCUT]
Kernel.pbMessage(_INTL("Sorry, a new Badge is required."))
return false
end
facingEvent=$game_player.pbFacingEvent
if !facingEvent || facingEvent.name!="Tree"
Kernel.pbMessage(_INTL("Can't use that here."))
return false
end
return true
})
HiddenMoveHandlers::CanUseMove.add(:HEADBUTT,proc{|move,pkmn|
facingEvent=$game_player.pbFacingEvent
if !facingEvent || facingEvent.name!="HeadbuttTree"
Kernel.pbMessage(_INTL("Can't use that here."))
return false
end
return true
})
HiddenMoveHandlers::CanUseMove.add(:SURF,proc{|move,pkmn|
terrain=Kernel.pbFacingTerrainTag
if !$DEBUG && !$Trainer.badges[BADGEFORCUT]
Kernel.pbMessage(_INTL("Sorry, a new Badge is required."))
return false
end
if $PokemonGlobal.surfing
Kernel.pbMessage(_INTL("You're already surfing."))
return false
end
if $game_player.pbHasDependentEvents?
Kernel.pbMessage(_INTL("You can't use that if you have someone with you."))
return false
end
terrain=Kernel.pbFacingTerrainTag
if pbGetMetadata($game_map.map_id,MetadataBicycleAlways)
Kernel.pbMessage(_INTL("Let's enjoy cycling!"))
return false
end
if !pbIsWaterTag?(terrain)
Kernel.pbMessage(_INTL("No surfing here!"))
return false
end
return true
})
HiddenMoveHandlers::CanUseMove.add(:STRENGTH,proc{|move,pkmn|
if !$DEBUG && !$Trainer.badges[BADGEFORSTRENGTH]
Kernel.pbMessage(_INTL("Sorry, a new Badge is required."))
return false
end
facingEvent=$game_player.pbFacingEvent
if !facingEvent || facingEvent.name!="Boulder"
Kernel.pbMessage(_INTL("Can't use that here."))
return false
end
return true
})
HiddenMoveHandlers::CanUseMove.add(:ROCKSMASH,proc{|move,pkmn|
terrain=Kernel.pbFacingTerrainTag
if !$DEBUG && !$Trainer.badges[BADGEFORROCKSMASH]
Kernel.pbMessage(_INTL("Sorry, a new Badge is required."))
return false
end
facingEvent=$game_player.pbFacingEvent
if !facingEvent || facingEvent.name!="Rock"
Kernel.pbMessage(_INTL("Can't use that here."))
return false
end
return true
})
HiddenMoveHandlers::CanUseMove.add(:FLASH,proc{|move,pkmn|
if !$DEBUG && !$Trainer.badges[BADGEFORFLASH]
Kernel.pbMessage(_INTL("Sorry, a new Badge is required."))
return false
end
if !pbGetMetadata($game_map.map_id,MetadataDarkMap)
Kernel.pbMessage(_INTL("Can't use that here."))
return false
end
if $PokemonGlobal.flashUsed
Kernel.pbMessage(_INTL("This is in use already."))
return false
end
return true
})
HiddenMoveHandlers::CanUseMove.add(:WATERFALL,proc{|move,pkmn|
if !$DEBUG && !$Trainer.badges[BADGEFORWATERFALL]
Kernel.pbMessage(_INTL("Sorry, a new Badge is required."))
return false
end
terrain=Kernel.pbFacingTerrainTag
if terrain!=PBTerrain::Waterfall
Kernel.pbMessage(_INTL("Can't use that here."))
return false
end
return true
})
HiddenMoveHandlers::CanUseMove.add(:DIVE,proc{|move,pkmn|
if !$DEBUG && !$Trainer.badges[BADGEFORDIVE]
Kernel.pbMessage(_INTL("Sorry, a new Badge is required."))
return false
end
if $PokemonGlobal.diving
return true
end
if $game_player.terrain_tag!=PBTerrain::DeepWater
Kernel.pbMessage(_INTL("Can't use that here."))
return false
end
if !pbGetMetadata($game_map.map_id,MetadataDiveMap)
Kernel.pbMessage(_INTL("Can't use that here."))
return false
end
return true
})
HiddenMoveHandlers::CanUseMove.add(:TELEPORT,proc{|move,pkmn|
if !pbGetMetadata($game_map.map_id,MetadataOutdoor)
Kernel.pbMessage(_INTL("Can't use that here."))
return false
end
if $game_player.pbHasDependentEvents?
Kernel.pbMessage(_INTL("You can't use that if you have someone with you."))
return false
end
healing=$PokemonGlobal.healingSpot
if !healing
healing=pbGetMetadata(0,MetadataHome) # Home
end
if healing
mapname=pbGetMapNameFromId(healing[0])
if Kernel.pbConfirmMessage(_INTL("Want to return to the healing spot used last in {1}?",mapname))
return true
end
return false
else
Kernel.pbMessage(_INTL("Can't use that here."))
return false
end
})
HiddenMoveHandlers::CanUseMove.add(:DIG,proc{|move,pkmn|
escape=pbGetMetadata($game_map.map_id,MetadataEscapePoint)
if !escape
Kernel.pbMessage(_INTL("Can't use that here."))
return false
end
if $game_player.pbHasDependentEvents?
Kernel.pbMessage(_INTL("You can't use that if you have someone with you."))
return false
end
mapname=pbGetMapNameFromId(escape[0])
if Kernel.pbConfirmMessage(_INTL("Want to escape from here and return to {1}?",mapname))
return true
end
return false
})
HiddenMoveHandlers::CanUseMove.add(:SWEETSCENT,proc{|move,pkmn|
return true
})

HiddenMoveHandlers::UseMove.add(:FLY,proc{|move,pokemon|
if !$PokemonTemp.flydata
Kernel.pbMessage(_INTL("Can't use that here."))
end
if !pbHiddenMoveAnimation(pokemon)
Kernel.pbMessage(_INTL("{1} used {2}!",pokemon.name,PBMoves.getName(move)))
end
pbFadeOutIn(99999){
$game_temp.player_new_map_id=$PokemonTemp.flydata[0]
$game_temp.player_new_x=$PokemonTemp.flydata[1]
$game_temp.player_new_y=$PokemonTemp.flydata[2]
$PokemonTemp.flydata=nil
$game_temp.player_new_direction=2
$scene.transfer_player
$game_map.autoplay
$game_map.refresh
}
return true
})
HiddenMoveHandlers::UseMove.add(:CUT,proc{|move,pokemon|
if !pbHiddenMoveAnimation(pokemon)
Kernel.pbMessage(_INTL("{1} used {2}!",pokemon.name,PBMoves.getName(move)))
end
facingEvent=$game_player.pbFacingEvent
if facingEvent
facingEvent.erase
$PokemonMap.addErasedEvent(facingEvent.id)
end
return true
})
HiddenMoveHandlers::UseMove.add(:SURF,proc{|move,pokemon|
if !pbHiddenMoveAnimation(pokemon)
Kernel.pbMessage(_INTL("{1} used {2}!",pokemon.name,PBMoves.getName(move)))
end
pbStartSurfing()
return true
})
HiddenMoveHandlers::UseMove.add(:LAVA,proc{|move,pokemon|
if !pbHiddenMoveAnimation(pokemon)
Kernel.pbMessage(_INTL("{1} used {2}!",pokemon.name,PBMoves.getName(move)))
end
pbStartSurfing()
return true
})
HiddenMoveHandlers::UseMove.add(:STRENGTH,proc{|move,pokemon|
pbHiddenMoveAnimation(pokemon)
Kernel.pbMessage(_INTL("{1} used {2}!\1",pokemon.name,PBMoves.getName(move)))
Kernel.pbMessage(_INTL("{1}'s Strength made it possible to move boulders around!",pokemon.name))
$PokemonGlobal.strengthUsed=true
return true
})
HiddenMoveHandlers::UseMove.add(:ROCKSMASH,proc{|move,pokemon|
if !pbHiddenMoveAnimation(pokemon)
Kernel.pbMessage(_INTL("{1} used {2}!",pokemon.name,PBMoves.getName(move)))
end
facingEvent=$game_player.pbFacingEvent
if facingEvent
facingEvent.erase
$PokemonMap.addErasedEvent(facingEvent.id)
end
return true
})
HiddenMoveHandlers::UseMove.add(:FLASH,proc{|move,pokemon|
darkness=$PokemonTemp.darknessSprite
return false if !darkness || darkness.disposed?
if !pbHiddenMoveAnimation(pokemon)
Kernel.pbMessage(_INTL("{1} used {2}!",pokemon.name,PBMoves.getName(move)))
end
$PokemonGlobal.flashUsed=true
while darkness.radius<300
Graphics.update
Input.update
pbUpdateSceneMap
darkness.radius+=2
end
darkness.dispose
$PokemonTemp.darknessSprite=nil
return true
})
HiddenMoveHandlers::UseMove.add(:WATERFALL,proc{|move,pokemon|
if !pbHiddenMoveAnimation(pokemon)
Kernel.pbMessage(_INTL("{1} used {2}.",pokemon.name,PBMoves.getName(move)))
end
pbAscendWaterfall
return true
})
HiddenMoveHandlers::UseMove.add(:DIVE,proc{|move,pokemon|
wasdiving=$PokemonGlobal.diving
if $PokemonGlobal.diving
divemap=nil
meta=pbLoadMetadata
for i in 0...meta.length
if meta[i] && meta[i][MetadataDiveMap]
if meta[i][MetadataDiveMap]==$game_map.map_id
divemap=i
break
end
end
end
else
divemap=pbGetMetadata($game_map.map_id,MetadataDiveMap)
end
return false if !divemap
if !pbHiddenMoveAnimation(pokemon)
Kernel.pbMessage(_INTL("{1} used {2}.",pokemon.name,PBMoves.getName(move)))
end
pbFadeOutIn(99999){
$game_temp.player_new_map_id=divemap
$game_temp.player_new_x=$game_player.x
$game_temp.player_new_y=$game_player.y
$game_temp.player_new_direction=$game_player.direction
pbCancelVehicles
if wasdiving
$PokemonGlobal.surfing=true
else
$PokemonGlobal.diving=true
end
pbUpdateVehicle
$scene.transfer_player(false)
$game_map.autoplay
$game_map.refresh
}
return true
})
HiddenMoveHandlers::UseMove.add(:HEADBUTT,proc{|move,pokemon|
if !pbHiddenMoveAnimation(pokemon)
Kernel.pbMessage(_INTL("{1} used {2}!",pokemon.name,PBMoves.getName(move)))
end
Kernel.pbHeadbuttEffect(event)
})
HiddenMoveHandlers::UseMove.add(:SWEETSCENT,proc{|move,pokemon|
if !pbHiddenMoveAnimation(pokemon)
Kernel.pbMessage(_INTL("{1} used {2}!",pokemon.name,PBMoves.getName(move)))
end
pbSweetScent
return true
})
HiddenMoveHandlers::UseMove.add(:DIG,proc{|move,pokemon|
escape=pbGetMetadata($game_map.map_id,MetadataEscapePoint)
if escape
Kernel.pbMessage(_INTL("{1} used {2}!",pokemon.name,PBMoves.getName(move)))
pbFadeOutIn(99999){
Kernel.pbCancelVehicles
$game_temp.player_new_map_id=escape[0]
$game_temp.player_new_x=escape[1]
$game_temp.player_new_y=escape[2]
$game_temp.player_new_direction=2
$scene.transfer_player
$game_map.autoplay
$game_map.refresh
}
return true
end
return false
})
HiddenMoveHandlers::UseMove.add(:TELEPORT,proc{|move,pokemon|
healing=$PokemonGlobal.healingSpot
if !healing
healing=pbGetMetadata(0,MetadataHome)
end
if healing
Kernel.pbMessage(_INTL("{1} used {2}!",pokemon.name,PBMoves.getName(move)))
pbFadeOutIn(99999){
Kernel.pbCancelVehicles
$game_temp.player_new_map_id=healing[0]
$game_temp.player_new_x=healing[1]
$game_temp.player_new_y=healing[2]
$game_temp.player_new_direction=2
$scene.transfer_player
$game_map.autoplay
$game_map.refresh
}
return true
end
return false
})

def Kernel.pbCanUseHiddenMove?(pkmn,move)
return HiddenMoveHandlers.triggerCanUseMove(move,pkmn)
end


def Kernel.pbUseHiddenMove(pokemon,move)
return HiddenMoveHandlers.triggerUseMove(move,pokemon)
end


def pbSweetScent
viewport=Viewport.new(0,0,Graphics.width,Graphics.height)
viewport.z=99999
count=0
viewport.color.alpha-=10
begin
if viewport.color.alpha<128 && count==0
viewport.color.red=255
viewport.color.green=0
viewport.color.blue=0
viewport.color.alpha+=10
else
count+=1
if count>60
viewport.color.alpha-=10
end
end
Graphics.update
Input.update
pbUpdateSceneMap
end until viewport.color.alpha<=0
viewport.dispose
encounter=nil
enctype=nil
enctype=$PokemonEncounters.pbEncounterType
if enctype<0 ||
!$PokemonEncounters.isEncounterPossibleHere?() ||
!pbEncounter(enctype)
Kernel.pbMessage(_INTL("There appears to be nothing here..."))
end
end


def Kernel.pbHiddenMoveEvent
terrain=Kernel.pbFacingTerrainTag
if pbIsWaterTag?(terrain) &&
!$PokemonGlobal.surfing &&
!pbGetMetadata($game_map.map_id,MetadataBicycleAlways)
Kernel.pbSurf
return
end
if terrain==PBTerrain::Waterfall
Kernel.pbWaterfall
return
end
if terrain==PBTerrain::WaterfallCrest
Kernel.pbMessage(_INTL("A wall of water is crashing down with a mighty roar."))
return
end
terrain=$game_player.terrain_tag
if terrain==PBTerrain::DeepWater
Kernel.pbDive
return
end
if $PokemonGlobal.diving
Kernel.pbSurfacing
return
end
facingEvent=$game_player.pbFacingEvent
if facingEvent
if facingEvent.name=="Boulder"
Kernel.pbStrength
return
end
end
end



Again, not tested so im not sure if it'll work.

Dragma
February 15th, 2010, 11:26 AM
That's right, crazyninjaguy.

However, at the top, it says pbSurf instead.
And the game interprets my command for Lava.

When I changed it to pbLava, the game interpreted Surf...

This is what I have currently:


def Kernel.pbSurf
if $game_player.pbHasDependentEvents?
return false
end
if $DEBUG || $Trainer.badges[BADGEFORLAVA]
movefinder=Kernel.pbCheckMove(:LAVA)
if $DEBUG || movefinder
if Kernel.pbConfirmMessage(_INTL("This stuff is hot! Would you like to use Lava?"))
speciesname=!movefinder ? $Trainer.name : movefinder.name
Kernel.pbMessage(_INTL("{1} used Lava!",speciesname))
pbHiddenMoveAnimation(movefinder)
surfbgm=pbGetMetadata(0,MetadataSurfBGM)
if surfbgm
pbCueBGM(surfbgm,0.5)
end
pbStartSurfing()
return true
end
end
end
return false
end

Crazyninjaguy
February 15th, 2010, 11:29 AM
Ok, well i edited my post above before you posted then, so here is the script.
I'm not sure if it'll work, but try it anyway.

BADGEFORCUT=0
BADGEFORFLASH=1
BADGEFORROCKSMASH=2
BADGEFORSURF=3
BADGEFORLAVA=3
BADGEFORFLY=4
BADGEFORSTRENGTH=5
BADGEFORDIVE=6
BADGEFORWATERFALL=7

class MoveHandlerHash < HandlerHash
def initialize
super(:PBMoves)
end
end

module HiddenMoveHandlers
CanUseMove=MoveHandlerHash.new
UseMove=MoveHandlerHash.new
def self.addCanUseMove(item,proc)
CanUseMove.add(item,proc)
end
def self.addUseMove(item,proc)
UseMove.add(item,proc)
end
def self.hasHandler(item)
return CanUseMove[item]!=nil && UseMove[item]!=nil
end
def self.triggerCanUseMove(item,pokemon)
# Returns whether move can be used
if !CanUseMove[item]
return false
else
return CanUseMove.trigger(item,pokemon)
end
end
def self.triggerUseMove(item,pokemon)
# Returns whether move was used
if !UseMove[item]
return false
else
return UseMove.trigger(item,pokemon)
end
end
end

def pbHiddenMoveAnimation(pokemon)
return false if !pokemon
viewport=Viewport.new(0,0,0,0)
viewport.z=99999
ptinterp=nil
plane=ColoredPlane.new(Color.new(0,0,0,255),viewport)
sprite=PokemonSprite.new
sprite.z=99999
sprite.setPokemonBitmap(pokemon)
sprite.visible=false
interp=RectInterpolator.new(
Rect.new(Graphics.width,Graphics.height/2,0,0),
Rect.new(0,(Graphics.height-sprite.bitmap.height)/2,
Graphics.width,sprite.bitmap.height),20
)
sprite.ox=sprite.bitmap.width/2
sprite.oy=sprite.bitmap.height/2
strobes=[]
15.times do |i|
strobe=BitmapSprite.new(80,8,viewport)
strobe.bitmap.fill_rect(0,0,80,8,Color.new(248,248,248))
strobe.visible=false
strobes.push(strobe)
end
phase=1
frames=0
begin
Graphics.update
Input.update
case phase
when 1
interp.update
interp.set(viewport.rect)
if interp.done?
phase=2
ptinterp=PointInterpolator.new(
Graphics.width+(sprite.bitmap.width/2),Graphics.height/2,
Graphics.width/2,Graphics.height/2,15
)
end
when 2
ptinterp.update
sprite.x=ptinterp.x
sprite.y=ptinterp.y
sprite.visible=true
if ptinterp.done?
phase=3
pbPlayCry(pokemon)
frames=0
end
when 3
frames+=1
if frames>30
phase=4
ptinterp=PointInterpolator.new(
Graphics.width/2,Graphics.height/2,
-(sprite.bitmap.width/2),Graphics.height/2,15
)
frames=0
end
when 4
ptinterp.update
sprite.x=ptinterp.x
sprite.y=ptinterp.y
if ptinterp.done?
phase=5
sprite.visible=false
interp=RectInterpolator.new(
Rect.new(0,(Graphics.height-sprite.bitmap.height)/2,
Graphics.width,sprite.bitmap.height),
Rect.new(0,(Graphics.height)/2,Graphics.width,0),20
)
end
when 5
interp.update
interp.set(viewport.rect)
phase=6 if interp.done?
end
for strobe in strobes
strobe.ox=strobe.viewport.rect.x
strobe.oy=strobe.viewport.rect.y
if strobe.visible && strobe.x+strobe.src_rect.width>=0
strobe.x-=32
elsif !strobe.visible
randomY=[80,100,120,140,160,180,200,220,240]
strobe.y=randomY[rand(randomY.length)]
strobe.x=rand(Graphics.width)
strobe.src_rect.width=20+rand(40)
strobe.visible=true
else
randomY=[80,100,120,140,160,180,200,220,240]
strobe.y=randomY[rand(randomY.length)]
strobe.x=Graphics.width+rand(Graphics.width/4)
strobe.src_rect.width=20+rand(40)
end
end
pbUpdateSceneMap
end while phase!=6
sprite.dispose
for strobe in strobes
strobe.dispose
end
strobes.clear
plane.dispose
viewport.dispose
return true
end

def Kernel.pbCut
if $DEBUG || $Trainer.badges[BADGEFORCUT]
movefinder=Kernel.pbCheckMove(:CUT)
if $DEBUG || movefinder
Kernel.pbMessage(_INTL("This tree looks like it can be cut down!\1"))
if Kernel.pbConfirmMessage(_INTL("Would you like to cut it?"))
speciesname=!movefinder ? $Trainer.name : movefinder.name
Kernel.pbMessage(_INTL("{1} used Cut!",speciesname))
pbHiddenMoveAnimation(movefinder)
return true
end
else
Kernel.pbMessage(_INTL("This tree looks like it can be cut down."))
end
else
Kernel.pbMessage(_INTL("This tree looks like it can be cut down."))
end
return false
end


def Kernel.pbHeadbuttEffect(event)
a=((event.x*event.y+event.x*event.y)/5)%10
b=($Trainer.id&0xFFFF)%10
chance=1
if a==b
chance=8
elsif a>b && (a-b).abs<5
chance=5
elsif a<b && (a-b).abs>5
chance=5
end
if rand(10)>=chance
Kernel.pbMessage(_INTL("Nope. Nothing..."))
else
if !pbEncounter(chance==1 ? 7 : 8)
Kernel.pbMessage(_INTL("Nope. Nothing..."))
end
end
end

def Kernel.pbHeadbutt(event)
movefinder=Kernel.pbCheckMove(:HEADBUTT)
if $DEBUG || movefinder
if Kernel.pbConfirmMessage(_INTL("A Pokémon could be in this tree. Want to headbutt it?"))
speciesname=!movefinder ? $Trainer.name : movefinder.name
Kernel.pbMessage(_INTL("{1} did a headbutt!",speciesname))
Kernel.pbHeadbuttEffect(event)
end
else
Kernel.pbMessage(_INTL("A Pokémon could be in this tree. Maybe a Pokémon could shake it."))
end
Input.update
return
end

def pbRockSmashRandomEncounter
if rand(100)<25
pbEncounter(EncounterTypes::RockSmash)
end
end


def Kernel.pbRockSmash
if $DEBUG || $Trainer.badges[BADGEFORROCKSMASH]
movefinder=Kernel.pbCheckMove(:ROCKSMASH)
if $DEBUG || movefinder
if Kernel.pbConfirmMessage(_INTL("This rock appears breakable. Would you like to use Rock Smash?"))
speciesname=!movefinder ? $Trainer.name : movefinder.name
Kernel.pbMessage(_INTL("{1} used Rock Smash!",speciesname))
pbHiddenMoveAnimation(movefinder)
return true
end
else
Kernel.pbMessage(_INTL("It's a rugged rock, but a Pokémon may be able to smash it."))
end
else
Kernel.pbMessage(_INTL("It's a rugged rock, but a Pokémon may be able to smash it."))
end
return false
end

def Kernel.pbStrength
if $PokemonMap.strengthUsed
Kernel.pbMessage(_INTL("Strength made it possible to move boulders around."))
elsif $DEBUG || $Trainer.badges[BADGEFORSTRENGTH]
movefinder=Kernel.pbCheckMove(:STRENGTH)
if $DEBUG || movefinder
Kernel.pbMessage(_INTL("It's a big boulder, but a Pokémon may be able to push it aside."))
if Kernel.pbConfirmMessage(_INTL("Would you like to use Strength?"))
speciesname=!movefinder ? $Trainer.name : movefinder.name
pbHiddenMoveAnimation(movefinder)
Kernel.pbMessage(_INTL("{1} used Strength!\1",speciesname))
Kernel.pbMessage(_INTL("{1}'s Strength made it possible to move boulders around!",speciesname))
$PokemonMap.strengthUsed=true
return true
end
else
Kernel.pbMessage(_INTL("It's a big boulder, but a Pokémon may be able to push it aside."))
end
else
Kernel.pbMessage(_INTL("It's a big boulder, but a Pokémon may be able to push it aside."))
end
return false
end

def Kernel.pbSurf
if $game_player.pbHasDependentEvents?
return false
end
if $DEBUG || $Trainer.badges[BADGEFORSURF]
movefinder=Kernel.pbCheckMove(:SURF)
if $DEBUG || movefinder
if Kernel.pbConfirmMessage(_INTL("The water is dyed a deep blue... Would you like to surf?"))
speciesname=!movefinder ? $Trainer.name : movefinder.name
Kernel.pbMessage(_INTL("{1} used Surf!",speciesname))
pbHiddenMoveAnimation(movefinder)
surfbgm=pbGetMetadata(0,MetadataSurfBGM)
if surfbgm
pbCueBGM(surfbgm,0.5)
end
pbStartSurfing()
return true
end
end
end
return false
end

def Kernel.pbLava
if $game_player.pbHasDependentEvents?
return false
end
if $DEBUG || $Trainer.badges[BADGEFORLAVA]
movefinder=Kernel.pbCheckMove(:LAVA)
if $DEBUG || movefinder
if Kernel.pbConfirmMessage(_INTL("You can surf on this lava... Would you like to surf?"))
speciesname=!movefinder ? $Trainer.name : movefinder.name
Kernel.pbMessage(_INTL("{1} used Lava!",speciesname))
pbHiddenMoveAnimation(movefinder)
surfbgm=pbGetMetadata(0,MetadataSurfBGM)
if surfbgm
pbCueBGM(surfbgm,0.5)
end
pbStartSurfing()
return true
end
end
end
return false
end

def Kernel.pbSurfacing
return if !$PokemonGlobal.diving
divemap=nil
meta=pbLoadMetadata
for i in 0...meta.length
if meta[i] && meta[i][MetadataDiveMap]
if meta[i][MetadataDiveMap]==$game_map.map_id
divemap=i
break
end
end
end
return if !divemap
movefinder=Kernel.pbCheckMove(:DIVE)
if $DEBUG || (movefinder && $Trainer.badges[BADGEFORDIVE])
if Kernel.pbConfirmMessage(_INTL("Light is filtering down from above. Would you like to use Dive?"))
speciesname=!movefinder ? $Trainer.name : movefinder.name
Kernel.pbMessage(_INTL("{1} used Dive.",speciesname))
pbHiddenMoveAnimation(movefinder)
pbFadeOutIn(99999){
$game_temp.player_new_map_id=divemap
$game_temp.player_new_x=$game_player.x
$game_temp.player_new_y=$game_player.y
$game_temp.player_new_direction=$game_player.direction
pbCancelVehicles
$PokemonGlobal.surfing=true
pbUpdateVehicle
$scene.transfer_player(false)
surfbgm=pbGetMetadata(0,MetadataSurfBGM)
if surfbgm
pbBGMPlay(surfbgm)
else
$game_map.autoplayAsCue
end
$game_map.refresh
}
return true
end
else
Kernel.pbConfirmMessage(_INTL("Light is filtering down from above. A Pokémon may be able to surface here."))
end
return false
end

def Kernel.pbAscendWaterfall(event=nil)
event=$game_player if !event
return if !event
return if event.direction!=8 # can't ascend if not facing up
oldthrough=event.through
oldmovespeed=event.move_speed
terrain=Kernel.pbFacingTerrainTag(nil,event)
return if terrain!=PBTerrain::Waterfall && terrain!=PBTerrain::WaterfallCrest
event.through=true
event.move_speed=2
loop do
event.move_up
terrain=pbGetTerrainTag(event)
break if terrain!=PBTerrain::Waterfall && terrain!=PBTerrain::WaterfallCrest
end
event.through=oldthrough
event.move_speed=oldmovespeed
end

def Kernel.pbDescendWaterfall(event=nil)
event=$game_player if !event
return if !event
return if event.direction!=2 # Can't descend if not facing down
oldthrough=event.through
oldmovespeed=event.move_speed
terrain=Kernel.pbFacingTerrainTag(nil,event)
return if terrain!=PBTerrain::Waterfall && terrain!=PBTerrain::WaterfallCrest
event.through=true
event.move_speed=2
loop do
event.move_down
terrain=pbGetTerrainTag(event)
break if terrain!=PBTerrain::Waterfall && terrain!=PBTerrain::WaterfallCrest
end
event.through=oldthrough
event.move_speed=oldmovespeed
end

def Kernel.pbSlideOnIce(event=nil)
event=$game_player if !event
return if !event
direction=event.direction
continuing=true
oldwalkanime=event.walk_anime
event.straighten
event.walk_anime=false
begin
break if !event.passable?(event.x,event.y,direction)
case direction
when 2
event.move_down
when 4
event.move_left
when 6
event.move_right
when 8
event.move_up
end
while event.moving?
Graphics.update
Input.update
pbUpdateSceneMap
end
end while pbGetTerrainTag(event)==PBTerrain::Ice
event.walk_anime=oldwalkanime
end


def Kernel.pbWaterfall
if $DEBUG || $Trainer.badges[BADGEFORWATERFALL]
movefinder=Kernel.pbCheckMove(:WATERFALL)
if $DEBUG || movefinder
if Kernel.pbConfirmMessage(_INTL("It's a large waterfall. Would you like to use Waterfall?"))
speciesname=!movefinder ? $Trainer.name : movefinder.name
Kernel.pbMessage(_INTL("{1} used Waterfall.",speciesname))
pbHiddenMoveAnimation(movefinder)
pbAscendWaterfall
return true
end
else
Kernel.pbMessage(_INTL("A wall of water is crashing down with a mighty roar."))
end
else
Kernel.pbMessage(_INTL("A wall of water is crashing down with a mighty roar."))
end
return false
end


def Kernel.pbDive
divemap=pbGetMetadata($game_map.map_id,MetadataDiveMap)
return false if !divemap
if $DEBUG || $Trainer.badges[BADGEFORDIVE]
movefinder=Kernel.pbCheckMove(:DIVE)
if $DEBUG || movefinder
if Kernel.pbConfirmMessage(_INTL("The sea is deep here. Would you like to use Dive?"))
speciesname=!movefinder ? $Trainer.name : movefinder.name
Kernel.pbMessage(_INTL("{1} used Dive.",speciesname))
pbHiddenMoveAnimation(movefinder)
pbFadeOutIn(99999){
$game_temp.player_new_map_id=divemap
$game_temp.player_new_x=$game_player.x
$game_temp.player_new_y=$game_player.y
$game_temp.player_new_direction=$game_player.direction
pbCancelVehicles
$PokemonGlobal.diving=true
pbUpdateVehicle
$scene.transfer_player(false)
$game_map.autoplay
$game_map.refresh
}
return true
end
else
Kernel.pbMessage(_INTL("The sea is deep here. A Pokémon may be able to go underwater."))
end
else
Kernel.pbMessage(_INTL("The sea is deep here. A Pokémon may be able to go underwater."))
end
return false
end


def pbEndSurf(xOffset,yOffset)
return false if !$PokemonGlobal.surfing
x=$game_player.x
y=$game_player.y
currentTag=$game_map.terrain_tag(x,y)
facingTag=Kernel.pbFacingTerrainTag
if pbIsWaterTag?(currentTag)&&!pbIsWaterTag?(facingTag)
if Kernel.pbJumpToward
Kernel.pbCancelVehicles
$game_map.autoplayAsCue
$game_player.increase_steps
result=$game_player.check_event_trigger_here([1,2])
Kernel.pbOnStepTaken(result)
end
return true
end
return false
end

def pbEndLava(xOffset,yOffset)
return false if !$PokemonGlobal.surfing
x=$game_player.x
y=$game_player.y
currentTag=$game_map.terrain_tag(x,y)
facingTag=Kernel.pbFacingTerrainTag
if pbIsWaterTag?(currentTag)&&!pbIsWaterTag?(facingTag)
if Kernel.pbJumpToward
Kernel.pbCancelVehicles
$game_map.autoplayAsCue
$game_player.increase_steps
result=$game_player.check_event_trigger_here([1,2])
Kernel.pbOnStepTaken(result)
end
return true
end
return false
end

HiddenMoveHandlers::CanUseMove.add(:FLY,proc{|move,pkmn|
if !$DEBUG && !$Trainer.badges[BADGEFORFLY]
Kernel.pbMessage(_INTL("Sorry, a new Badge is required."))
return false
end
if $game_player.pbHasDependentEvents?
Kernel.pbMessage(_INTL("You can't use that if you have someone with you."))
return false
end
if !pbGetMetadata($game_map.map_id,MetadataOutdoor)
Kernel.pbMessage(_INTL("Can't use that here."))
return false
end
return true
})
HiddenMoveHandlers::CanUseMove.add(:CUT,proc{|move,pkmn|
if !$DEBUG && !$Trainer.badges[BADGEFORCUT]
Kernel.pbMessage(_INTL("Sorry, a new Badge is required."))
return false
end
facingEvent=$game_player.pbFacingEvent
if !facingEvent || facingEvent.name!="Tree"
Kernel.pbMessage(_INTL("Can't use that here."))
return false
end
return true
})
HiddenMoveHandlers::CanUseMove.add(:HEADBUTT,proc{|move,pkmn|
facingEvent=$game_player.pbFacingEvent
if !facingEvent || facingEvent.name!="HeadbuttTree"
Kernel.pbMessage(_INTL("Can't use that here."))
return false
end
return true
})
HiddenMoveHandlers::CanUseMove.add(:SURF,proc{|move,pkmn|
terrain=Kernel.pbFacingTerrainTag
if !$DEBUG && !$Trainer.badges[BADGEFORCUT]
Kernel.pbMessage(_INTL("Sorry, a new Badge is required."))
return false
end
if $PokemonGlobal.surfing
Kernel.pbMessage(_INTL("You're already surfing."))
return false
end
if $game_player.pbHasDependentEvents?
Kernel.pbMessage(_INTL("You can't use that if you have someone with you."))
return false
end
terrain=Kernel.pbFacingTerrainTag
if pbGetMetadata($game_map.map_id,MetadataBicycleAlways)
Kernel.pbMessage(_INTL("Let's enjoy cycling!"))
return false
end
if !pbIsWaterTag?(terrain)
Kernel.pbMessage(_INTL("No surfing here!"))
return false
end
return true
})
HiddenMoveHandlers::CanUseMove.add(:STRENGTH,proc{|move,pkmn|
if !$DEBUG && !$Trainer.badges[BADGEFORSTRENGTH]
Kernel.pbMessage(_INTL("Sorry, a new Badge is required."))
return false
end
facingEvent=$game_player.pbFacingEvent
if !facingEvent || facingEvent.name!="Boulder"
Kernel.pbMessage(_INTL("Can't use that here."))
return false
end
return true
})
HiddenMoveHandlers::CanUseMove.add(:ROCKSMASH,proc{|move,pkmn|
terrain=Kernel.pbFacingTerrainTag
if !$DEBUG && !$Trainer.badges[BADGEFORROCKSMASH]
Kernel.pbMessage(_INTL("Sorry, a new Badge is required."))
return false
end
facingEvent=$game_player.pbFacingEvent
if !facingEvent || facingEvent.name!="Rock"
Kernel.pbMessage(_INTL("Can't use that here."))
return false
end
return true
})
HiddenMoveHandlers::CanUseMove.add(:FLASH,proc{|move,pkmn|
if !$DEBUG && !$Trainer.badges[BADGEFORFLASH]
Kernel.pbMessage(_INTL("Sorry, a new Badge is required."))
return false
end
if !pbGetMetadata($game_map.map_id,MetadataDarkMap)
Kernel.pbMessage(_INTL("Can't use that here."))
return false
end
if $PokemonGlobal.flashUsed
Kernel.pbMessage(_INTL("This is in use already."))
return false
end
return true
})
HiddenMoveHandlers::CanUseMove.add(:WATERFALL,proc{|move,pkmn|
if !$DEBUG && !$Trainer.badges[BADGEFORWATERFALL]
Kernel.pbMessage(_INTL("Sorry, a new Badge is required."))
return false
end
terrain=Kernel.pbFacingTerrainTag
if terrain!=PBTerrain::Waterfall
Kernel.pbMessage(_INTL("Can't use that here."))
return false
end
return true
})
HiddenMoveHandlers::CanUseMove.add(:DIVE,proc{|move,pkmn|
if !$DEBUG && !$Trainer.badges[BADGEFORDIVE]
Kernel.pbMessage(_INTL("Sorry, a new Badge is required."))
return false
end
if $PokemonGlobal.diving
return true
end
if $game_player.terrain_tag!=PBTerrain::DeepWater
Kernel.pbMessage(_INTL("Can't use that here."))
return false
end
if !pbGetMetadata($game_map.map_id,MetadataDiveMap)
Kernel.pbMessage(_INTL("Can't use that here."))
return false
end
return true
})
HiddenMoveHandlers::CanUseMove.add(:TELEPORT,proc{|move,pkmn|
if !pbGetMetadata($game_map.map_id,MetadataOutdoor)
Kernel.pbMessage(_INTL("Can't use that here."))
return false
end
if $game_player.pbHasDependentEvents?
Kernel.pbMessage(_INTL("You can't use that if you have someone with you."))
return false
end
healing=$PokemonGlobal.healingSpot
if !healing
healing=pbGetMetadata(0,MetadataHome) # Home
end
if healing
mapname=pbGetMapNameFromId(healing[0])
if Kernel.pbConfirmMessage(_INTL("Want to return to the healing spot used last in {1}?",mapname))
return true
end
return false
else
Kernel.pbMessage(_INTL("Can't use that here."))
return false
end
})
HiddenMoveHandlers::CanUseMove.add(:DIG,proc{|move,pkmn|
escape=pbGetMetadata($game_map.map_id,MetadataEscapePoint)
if !escape
Kernel.pbMessage(_INTL("Can't use that here."))
return false
end
if $game_player.pbHasDependentEvents?
Kernel.pbMessage(_INTL("You can't use that if you have someone with you."))
return false
end
mapname=pbGetMapNameFromId(escape[0])
if Kernel.pbConfirmMessage(_INTL("Want to escape from here and return to {1}?",mapname))
return true
end
return false
})
HiddenMoveHandlers::CanUseMove.add(:SWEETSCENT,proc{|move,pkmn|
return true
})

HiddenMoveHandlers::UseMove.add(:FLY,proc{|move,pokemon|
if !$PokemonTemp.flydata
Kernel.pbMessage(_INTL("Can't use that here."))
end
if !pbHiddenMoveAnimation(pokemon)
Kernel.pbMessage(_INTL("{1} used {2}!",pokemon.name,PBMoves.getName(move)))
end
pbFadeOutIn(99999){
$game_temp.player_new_map_id=$PokemonTemp.flydata[0]
$game_temp.player_new_x=$PokemonTemp.flydata[1]
$game_temp.player_new_y=$PokemonTemp.flydata[2]
$PokemonTemp.flydata=nil
$game_temp.player_new_direction=2
$scene.transfer_player
$game_map.autoplay
$game_map.refresh
}
return true
})
HiddenMoveHandlers::UseMove.add(:CUT,proc{|move,pokemon|
if !pbHiddenMoveAnimation(pokemon)
Kernel.pbMessage(_INTL("{1} used {2}!",pokemon.name,PBMoves.getName(move)))
end
facingEvent=$game_player.pbFacingEvent
if facingEvent
facingEvent.erase
$PokemonMap.addErasedEvent(facingEvent.id)
end
return true
})
HiddenMoveHandlers::UseMove.add(:SURF,proc{|move,pokemon|
if !pbHiddenMoveAnimation(pokemon)
Kernel.pbMessage(_INTL("{1} used {2}!",pokemon.name,PBMoves.getName(move)))
end
pbStartSurfing()
return true
})
HiddenMoveHandlers::UseMove.add(:LAVA,proc{|move,pokemon|
if !pbHiddenMoveAnimation(pokemon)
Kernel.pbMessage(_INTL("{1} used {2}!",pokemon.name,PBMoves.getName(move)))
end
pbStartSurfing()
return true
})
HiddenMoveHandlers::UseMove.add(:STRENGTH,proc{|move,pokemon|
pbHiddenMoveAnimation(pokemon)
Kernel.pbMessage(_INTL("{1} used {2}!\1",pokemon.name,PBMoves.getName(move)))
Kernel.pbMessage(_INTL("{1}'s Strength made it possible to move boulders around!",pokemon.name))
$PokemonGlobal.strengthUsed=true
return true
})
HiddenMoveHandlers::UseMove.add(:ROCKSMASH,proc{|move,pokemon|
if !pbHiddenMoveAnimation(pokemon)
Kernel.pbMessage(_INTL("{1} used {2}!",pokemon.name,PBMoves.getName(move)))
end
facingEvent=$game_player.pbFacingEvent
if facingEvent
facingEvent.erase
$PokemonMap.addErasedEvent(facingEvent.id)
end
return true
})
HiddenMoveHandlers::UseMove.add(:FLASH,proc{|move,pokemon|
darkness=$PokemonTemp.darknessSprite
return false if !darkness || darkness.disposed?
if !pbHiddenMoveAnimation(pokemon)
Kernel.pbMessage(_INTL("{1} used {2}!",pokemon.name,PBMoves.getName(move)))
end
$PokemonGlobal.flashUsed=true
while darkness.radius<300
Graphics.update
Input.update
pbUpdateSceneMap
darkness.radius+=2
end
darkness.dispose
$PokemonTemp.darknessSprite=nil
return true
})
HiddenMoveHandlers::UseMove.add(:WATERFALL,proc{|move,pokemon|
if !pbHiddenMoveAnimation(pokemon)
Kernel.pbMessage(_INTL("{1} used {2}.",pokemon.name,PBMoves.getName(move)))
end
pbAscendWaterfall
return true
})
HiddenMoveHandlers::UseMove.add(:DIVE,proc{|move,pokemon|
wasdiving=$PokemonGlobal.diving
if $PokemonGlobal.diving
divemap=nil
meta=pbLoadMetadata
for i in 0...meta.length
if meta[i] && meta[i][MetadataDiveMap]
if meta[i][MetadataDiveMap]==$game_map.map_id
divemap=i
break
end
end
end
else
divemap=pbGetMetadata($game_map.map_id,MetadataDiveMap)
end
return false if !divemap
if !pbHiddenMoveAnimation(pokemon)
Kernel.pbMessage(_INTL("{1} used {2}.",pokemon.name,PBMoves.getName(move)))
end
pbFadeOutIn(99999){
$game_temp.player_new_map_id=divemap
$game_temp.player_new_x=$game_player.x
$game_temp.player_new_y=$game_player.y
$game_temp.player_new_direction=$game_player.direction
pbCancelVehicles
if wasdiving
$PokemonGlobal.surfing=true
else
$PokemonGlobal.diving=true
end
pbUpdateVehicle
$scene.transfer_player(false)
$game_map.autoplay
$game_map.refresh
}
return true
})
HiddenMoveHandlers::UseMove.add(:HEADBUTT,proc{|move,pokemon|
if !pbHiddenMoveAnimation(pokemon)
Kernel.pbMessage(_INTL("{1} used {2}!",pokemon.name,PBMoves.getName(move)))
end
Kernel.pbHeadbuttEffect(event)
})
HiddenMoveHandlers::UseMove.add(:SWEETSCENT,proc{|move,pokemon|
if !pbHiddenMoveAnimation(pokemon)
Kernel.pbMessage(_INTL("{1} used {2}!",pokemon.name,PBMoves.getName(move)))
end
pbSweetScent
return true
})
HiddenMoveHandlers::UseMove.add(:DIG,proc{|move,pokemon|
escape=pbGetMetadata($game_map.map_id,MetadataEscapePoint)
if escape
Kernel.pbMessage(_INTL("{1} used {2}!",pokemon.name,PBMoves.getName(move)))
pbFadeOutIn(99999){
Kernel.pbCancelVehicles
$game_temp.player_new_map_id=escape[0]
$game_temp.player_new_x=escape[1]
$game_temp.player_new_y=escape[2]
$game_temp.player_new_direction=2
$scene.transfer_player
$game_map.autoplay
$game_map.refresh
}
return true
end
return false
})
HiddenMoveHandlers::UseMove.add(:TELEPORT,proc{|move,pokemon|
healing=$PokemonGlobal.healingSpot
if !healing
healing=pbGetMetadata(0,MetadataHome)
end
if healing
Kernel.pbMessage(_INTL("{1} used {2}!",pokemon.name,PBMoves.getName(move)))
pbFadeOutIn(99999){
Kernel.pbCancelVehicles
$game_temp.player_new_map_id=healing[0]
$game_temp.player_new_x=healing[1]
$game_temp.player_new_y=healing[2]
$game_temp.player_new_direction=2
$scene.transfer_player
$game_map.autoplay
$game_map.refresh
}
return true
end
return false
})

def Kernel.pbCanUseHiddenMove?(pkmn,move)
return HiddenMoveHandlers.triggerCanUseMove(move,pkmn)
end


def Kernel.pbUseHiddenMove(pokemon,move)
return HiddenMoveHandlers.triggerUseMove(move,pokemon)
end


def pbSweetScent
viewport=Viewport.new(0,0,Graphics.width,Graphics.height)
viewport.z=99999
count=0
viewport.color.alpha-=10
begin
if viewport.color.alpha<128 && count==0
viewport.color.red=255
viewport.color.green=0
viewport.color.blue=0
viewport.color.alpha+=10
else
count+=1
if count>60
viewport.color.alpha-=10
end
end
Graphics.update
Input.update
pbUpdateSceneMap
end until viewport.color.alpha<=0
viewport.dispose
encounter=nil
enctype=nil
enctype=$PokemonEncounters.pbEncounterType
if enctype<0 ||
!$PokemonEncounters.isEncounterPossibleHere?() ||
!pbEncounter(enctype)
Kernel.pbMessage(_INTL("There appears to be nothing here..."))
end
end


def Kernel.pbHiddenMoveEvent
terrain=Kernel.pbFacingTerrainTag
if pbIsWaterTag?(terrain) &&
!$PokemonGlobal.surfing &&
!pbGetMetadata($game_map.map_id,MetadataBicycleAlways)
Kernel.pbSurf
return
end
if terrain==PBTerrain::Waterfall
Kernel.pbWaterfall
return
end
if terrain==PBTerrain::WaterfallCrest
Kernel.pbMessage(_INTL("A wall of water is crashing down with a mighty roar."))
return
end
terrain=$game_player.terrain_tag
if terrain==PBTerrain::DeepWater
Kernel.pbDive
return
end
if $PokemonGlobal.diving
Kernel.pbSurfacing
return
end
facingEvent=$game_player.pbFacingEvent
if facingEvent
if facingEvent.name=="Boulder"
Kernel.pbStrength
return
end
end
end



Just replace the whole of your PokemonHiddenMoves script with that.

Dragma
February 15th, 2010, 11:38 AM
Ok, well i edited my post above before you posted then, so here is the script.
I'm not sure if it'll work, but try it anyway.

Well, I tried it and all it did was display the "would you like to use surf?" text for the lava as well... Maybe I have to define pbLava somewhere?


Thanks anyway, Crazyninjaguy...

Crazyninjaguy
February 15th, 2010, 11:53 AM
Add this after line 571


HiddenMoveHandlers::CanUseMove.add(:LAVA,proc{|move,pkmn|
terrain=14
if !$DEBUG && !$Trainer.badges[BADGEFORCUT]
Kernel.pbMessage(_INTL("Sorry, a new Badge is required."))
return false
end
if $PokemonGlobal.surfing
Kernel.pbMessage(_INTL("You're already surfing."))
return false
end
if $game_player.pbHasDependentEvents?
Kernel.pbMessage(_INTL("You can't use that if you have someone with you."))
return false
end
terrain=14
if pbGetMetadata($game_map.map_id,MetadataBicycleAlways)
Kernel.pbMessage(_INTL("Let's enjoy cycling!"))
return false
end
if !pbIsWaterTag?(terrain)
Kernel.pbMessage(_INTL("No surfing here!"))
return false
end
return true
})


Then open up the Editor.exe and set the lava tile terrain tag to 14
Hopefully that'll work :)

Dragma
February 15th, 2010, 12:06 PM
The only problem now is, that when I define my lava tile to Terrain 14, it reverts back to 0 when I check it in Database...

Maybe 14 hasn't been defined?

Crazyninjaguy
February 15th, 2010, 12:13 PM
Oh thats meant to happen, by default RMXP terrain tags only go up to 7 so just ignore it :P

Other than that does the move work now?

Poeman
February 15th, 2010, 12:14 PM
The only problem now is, that when I define my lava tile to Terrain 14, it reverts back to 0 when I check it in Database...

Maybe 14 hasn't been defined?
You can't go above 9 in the DB, don't check it it's fine

Dragma
February 15th, 2010, 12:15 PM
Well, then nothing is happening.

If I use the action button on the lava tile, nothing is happening.

Crazyninjaguy
February 15th, 2010, 12:18 PM
Nothing happens when you use the move?
Hmmm, time to look into the scripts again...

EDIT: Just a thought, do you have the 4th badge in your game?

Dragma
February 15th, 2010, 12:23 PM
Nothing happens when you use the move?
Hmmm, time to look into the scripts again...

EDIT: Just a thought, do you have the 4th badge in your game?


No, but it should work while I'm playtesting, right?

Crazyninjaguy
February 15th, 2010, 12:25 PM
Not sure...just run $Trainer.badges[3]=true
In a new script command then try lava surfing. If that doesnt work im at a loss :/

Dragma
February 15th, 2010, 12:30 PM
Nope, it doesn't work.

Oh well, thanks for your help anyways. I'll just keep toying with it. ;)

Legendaries
February 16th, 2010, 04:18 AM
Since I use the latest Starter Kit version I noticed that player's water reflection is totally opaque.
http://i46.tinypic.com/126cqps.png
In which script I could change it?

Restless
February 16th, 2010, 04:35 AM
hey guys im new here, ive been hearing about this poccil and I don't know what it is. can anyone explain it to me?thanks

Billyman31
February 16th, 2010, 04:37 AM
Hello i have recently downloaded RPG Maker XP and pokestarter/pokemon essentials. I started to make a game, with success. Everything was going well until i decided to test the game again and this message came up.

---------------------------
Pokemon Thunder yellow
---------------------------
Exception: NameError
Message: uninitialized constant Scene_DebugIntro
Main:4:in `pbCallTitle'
Main:35:in `mainFunctionDebug'
Main:16:in `mainFunction'
Main:16:in `pbCriticalCode'
Main:16:in `mainFunction'
Main:48
Main:47:in `loop'
Main:56

This exception was logged in ./errorlog.txt.
Press Ctrl+C to copy this message to the clipboard.
---------------------------
OK
---------------------------

I think this is because somewhere along the line i have somehow managed to accidently delete one of the script and i am looking for the script i need to put back in to make the game work. Thank you in advance :)

Dragma
February 16th, 2010, 06:09 AM
hey guys im new here, ive been hearing about this poccil and I don't know what it is. can anyone explain it to me?thanks

Well, Poccil is the user who created Pokemon Essentials for the RPG Maker XP.

If you're wondering what the software does, then I'll tell you: It allows you to create your own RPG. Poccil just added scripts and a whole bunch of goodies so that anyone can create a custom Pokemon game.

Crazyninjaguy
February 16th, 2010, 10:38 AM
Heya, i have a new problem. I've been trying to fix this all day and i'm completely lost for ideas.

Basically, i'm using the AWorks input module with Pokemon Essentials, and whenever i try to navigate the pokemon selection screen, i get this error:

Exception: NoMethodError
Message: undefined method `>=' for [102, 39]:Array
PokemonScreen:710:in `pbChoosePokemon'
PokemonScreen:692:in `loop'
PokemonScreen:728:in `pbChoosePokemon'
PokemonScreen:1198:in `pbPokemonScreen'
PokemonScreen:1195:in `loop'
PokemonScreen:1439:in `pbPokemonScreen'
Scene_Map*:531:in `update_icons'
Scene_Map*:530:in `pbFadeOutIn'
Scene_Map*:530:in `update_icons'
Scene_Map*:298:in `main'Now i know it's to do with this part of the Input module:

def Input.repeat?(vk)
@repeat.indexes(*vk).include?(true)
end

And this part of the PokemonScreen script:

def pbChoosePokemon(switching=false)
for i in 0...6
@sprites["pokemon#{i}"].preselected=(switching&&i==@activecmd)
end
loop do
Graphics.update
Input.update
self.update
oldsel=@activecmd
key=-1
key=Input::DOWN if Input.repeat?(Input::DOWN)
key=Input::RIGHT if Input.repeat?(Input::RIGHT)
key=Input::LEFT if Input.repeat?(Input::LEFT)
key=Input::UP if Input.repeat?(Input::UP)
if key>=0
@activecmd=pbChangeSelection(key,@activecmd)
end
if @activecmd!=oldsel # Changing selection
pbPlayCursorSE()
numsprites=(@multiselect) ? 8 : 7
for i in 0...numsprites
@sprites["pokemon#{i}"].selected=(i==@activecmd)
end
end
if Input.trigger?(Input::B)
return -1
end
if Input.trigger?(Input::C)
pbPlayDecisionSE()
cancelsprite=(@multiselect) ? 7 : 6
return (@activecmd==cancelsprite) ? -1 : @activecmd
end
end
end

Because i've taken away every other method in the AWorks script to test what the problem is.
So yeah, if anyone could help me fix this error that'd be great!
Thanks.

kaijerem
February 16th, 2010, 02:04 PM
hello, I want the 2VS2 battle script please :classic:

Nickalooose
February 16th, 2010, 02:29 PM
@KAIJEREM: Check the notes.html in the Pokemon Essentials folder... search for 'battles'

Here's my problem... yesterday, i updated my scripts with the new ones from the new starter kit... added my custom scripts i made... everything is fan-dabbi-dozey... except... wild battles dont appear in grass anymore... why?

Restless
February 16th, 2010, 06:23 PM
Well, Poccil is the user who created Pokemon Essentials for the RPG Maker XP.

If you're wondering what the software does, then I'll tell you: It allows you to create your own RPG. Poccil just added scripts and a whole bunch of goodies so that anyone can create a custom Pokemon game.

thanks i checked it out too. i found out that poccil already inputed some ready to go scripts in rpg maker.I thought Poccil was the name of the program. but it ended up in the conclusion that Poccil is a person. anyways. thanks

Crazyninjaguy
February 17th, 2010, 02:17 AM
Here's my problem... yesterday, i updated my scripts with the new ones from the new starter kit... added my custom scripts i made... everything is fan-dabbi-dozey... except... wild battles dont appear in grass anymore... why?

Make sure the grass tile is set to terrain tag 2 in the database, that should fix it.

kaijerem
February 17th, 2010, 04:29 AM
@KAIJEREM: Check the notes.html in the Pokemon Essentials folder... search for 'battles'

Here's my problem... yesterday, i updated my scripts with the new ones from the new starter kit... added my custom scripts i made... everything is fan-dabbi-dozey... except... wild battles dont appear in grass anymore... why?

Thanks :) but pokemon essentials has never worked for me. A message that there is an incompatibility with RPG Maker :embarrass

Wichu
February 17th, 2010, 05:15 AM
Which version of RPG Maker are you using?

kaijerem
February 17th, 2010, 05:46 AM
Which version of RPG Maker are you using?


I use RPG Maker XP:), but i have too pokemon script project (french)

Wichu
February 17th, 2010, 05:46 AM
Well then it should work... Are you using the legal version?

kaijerem
February 17th, 2010, 05:55 AM
Well then it should work... Are you using the legal version?

normally yes, I downloaded RPG Maker XP Official Site :(

pokehackster
February 17th, 2010, 11:14 AM
normally yes, I downloaded RPG Maker XP Official Site :(

well not to point out an obvious fact but r u using vista or windows 7

kaijerem
February 17th, 2010, 02:04 PM
well not to point out an obvious fact but r u using vista or windows 7

I have windows7, excuse me for not having state :nervous:

Nickalooose
February 17th, 2010, 04:09 PM
Make sure the grass tile is set to terrain tag 2 in the database, that should fix it.


it is terrain tag 2... i checked through and compared my older script with my new one... it doesnt have anything in the new one, to do with encountertypes::landmorning,landday or landnight... i use them all in my game, and it worked fine before... could that be the problem?

EDIT: Aha, moments after i posted this comment, i found the problem... i made it work now, thanx for your help anyway Crazyninja :)

Geeked
February 17th, 2010, 04:45 PM
Still would like a working Snag ball System.

carmaniac
February 17th, 2010, 05:18 PM
Still would like a working Snag ball System.

There is a working snag ball system though, it was made within the update...

~Frozen Darkness~
February 17th, 2010, 07:01 PM
Just another quick question. I know that there's a function for this in the game's code, but I don't know where.

How can I disable Items/The Bag for a battle, like in the Battle Tower?

Restless
February 18th, 2010, 12:52 AM
normally yes, I downloaded RPG Maker XP Official Site :(

mine is working even if i did not downloaded from the main site.

Wichu
February 18th, 2010, 01:00 AM
Just another quick question. I know that there's a function for this in the game's code, but I don't know where.

How can I disable Items/The Bag for a battle, like in the Battle Tower?

You need to set the battle's internalBattle flag to false. This also disables switching after an enemy is defeated and gaining Exp.

kaijerem
February 18th, 2010, 06:06 AM
mine is working even if i did not downloaded from the main site.

Could I have the link where you downloaded your software please?:classic:
and send the link by PM

Peeky Chew
February 18th, 2010, 11:43 AM
Something I didn't realise untill now, Pokemon essentials has a title screen...
How do I get it to start when the game does?

|Maximus|
February 18th, 2010, 12:24 PM
Something I didn't realise untill now, Pokemon essentials has a title screen...
How do I get it to start when the game does?

If you are in debug mode, then the title screen does not show.

If you publish the game, and run "game.exe" from the folder, then the title screen shows.

Peeky Chew
February 18th, 2010, 02:31 PM
If you are in debug mode, then the title screen does not show.

If you publish the game, and run "game.exe" from the folder, then the title screen shows.

Ok, thank you for the help.

Stratega
February 18th, 2010, 04:56 PM
¿Where can find the dual screen script? im looking but not found this.
Please help me.
Sorry for my bad english.

Maruno
February 18th, 2010, 05:24 PM
¿Where can find the dual screen script? im looking but not found this.
Please help me.
Sorry for my bad english.
There isn't one in Essentials, and no one will give it to you - they've worked too hard making them just to hand it out to everyone for free.

MercilessZealot
February 18th, 2010, 06:35 PM
Call me a noob (which I basically am on this site, considering this is my first post here) but I can't find animmaker.exe anywhere, either within the Starter Kit or on Poccil's website. Is it just the Animation Editor in the Debug Menu, or is it some other file that I'm missing?

Nickalooose
February 18th, 2010, 06:48 PM
Call me a noob (which I basically am on this site, considering this is my first post here) but I can't find animmaker.exe anywhere, either within the Starter Kit or on Poccil's website. Is it just the Animation Editor in the Debug Menu, or is it some other file that I'm missing?


if you're on about batle animations its in the editor.exe :) hope that helps

MercilessZealot
February 18th, 2010, 06:55 PM
Thanks, but I already knew about that - what I was asking is if that editor is the same as the "animmaker.exe" which is referenced in "animmaker.txt" in the Starter Kit:

animmaker.exe - Converts sprites to RPG Maker XP format animations
(C) 2008 Peter O.

Usage: animmaker xmlfile.xml
('xmlfile.xml' is the path to any XML file, see below)

Example of XML file:

<animations>
<!--Animation file to create (in this case, animation.png)-->
<animation name="animation.png">
<!--Pattern to add to the animation. Consists of the image's
filename plus the rectangle of the pattern to extract
from the image (x, y, width, height) (up to 96x96 in size)
Sprites listed here will be doubled in size in the animation-->
<pattern filename="pkmnfrlg_effects.png" x="50" y="201"
width="56" height="68" />
</animation>
<!--Another animation file, animation2.png)-->
<animation name="animation2.png">
<pattern filename="pkmnfrlg_effects.png" x="50" y="201"
width="56" height="68" />
<!-- You can leave out x, y, etc. to use the whole image-->
<pattern filename="effects2.png" />
</animation>
</animations>

Klofkac
February 19th, 2010, 09:02 AM
Can I make in animations Pokémon moving or darken? Because I can't do anything with pokémon...

Billyman31
February 19th, 2010, 11:24 AM
Which version of RPG Maker are you using?

i have another question. When i try to make a rival and battle him i get this message. What is the soloution to this problem?

---------------------------
Pokemon Thunder yellow
---------------------------
Exception: RuntimeError
Message: Script error within event 12, map 2 (Prof. Oak's Lab):
Exception: SyntaxError
Message: (eval):1:in `pbExecuteScript'compile error
(eval):1: syntax error
pbTrainerBattle(PBTrainers::RIVAL,"???",_I(I need to toughen up my pokémon."),false,0)
^
(eval):1: unterminated string meets end of file
***Full script:
pbTrainerBattle(PBTrainers::RIVAL,"???",_I(I need to toughen up my pokémon."),false,0)

Interpreter:274:in `pbExecuteScript'
Interpreter:785:in `command_111'
Interpreter:318:in `execute_command'
Interpreter:191:in `update'
Interpreter:104:in `loop'
Interpreter:196:in `update'
Scene_Map:96:in `update'
Scene_Map:94:in `loop'
Scene_Map:107:in `update'
Scene_Map:63:in `main'

This exception was logged in ./errorlog.txt.
Press Ctrl+C to copy this message to the clipboard.
---------------------------
OK
---------------------------

~Frozen Darkness~
February 19th, 2010, 11:45 AM
You left out a quotation mark at the beginning of the rival's losing speech. See how much grammar matters in game making?

Ziebart23
February 19th, 2010, 05:34 PM
How do I make a rival with this kit? I tried and it didn't work...

Mrchewy
February 19th, 2010, 08:31 PM
@Ziebart23: What exactly are you trying to do with a rival? Are you trying to start a battle? We could help you more if you gave us more information (like what went wrong, and what exactly you're trying to achieve).

thepsynergist
February 19th, 2010, 09:00 PM
I have 3 regions in my Pokemon game and I am trying to figure out how to have different wild battle and trainer battle music for each. Can someone tell me how to change the music depending on what region you're in?

RiJaN_nEa
February 19th, 2010, 10:00 PM
---------------------------
Pokemon Essentials
---------------------------
Exception: RuntimeError
Message: Expected a species name:
File PBS/trainers.txt, line


Compiler:1347:in `pbCompileTrainers'
Compiler:1341:in `each'
Compiler:1341:in `pbCompileTrainers'
Compiler:1314:in `loop'
Compiler:1377:in `pbCompileTrainers'
Compiler:3817:in `pbCompileAllData'
Compiler:3939

This exception was logged in ./errorlog.txt.
Press Ctrl+C to copy this message to the clipboard.
---------------------------
OK
---------------------------

Peeky Chew
February 20th, 2010, 02:58 AM
All of the collisions don't work at all in any map I created after a month ago. Even if I use tile sets that work in the other maps or upload completely new ones, nothing works. Do I need to redownload pokemon essentials? Help!

Mrchewy
February 20th, 2010, 03:09 AM
@RiJaN_nEa: That error means you've incorrectly formatted the trainers.txt file for a certain trainer. Usually, it appears when there are less listed Pokémon for a trainer than the number you've specified.

@Peeky Chew: First step would be to go through the obvious. Triple check that you've set collisions properly in all tilesets, check for "Through" events ontop of tiles, etc. Reinstalling the latest Essentials update is also worth a try (just follow the updating guide found in notes.html).

Crazyninjaguy
February 20th, 2010, 03:48 AM
Also i'd make sure that the player isnt allowed to walk over or through anything.
Do this by Doing a Set Move Route command, set the event to player and click Through OFF.

RiJaN_nEa
February 20th, 2010, 07:28 AM
Thanks alot Mrchewy, problem solved.
This may be alot to ask for but would any one know how to make it so that when you get to a part of the map you "rival" walks up to you talks for a little then battles you?

Maf
February 20th, 2010, 07:41 AM
Hi everyone i just join this site today and wanna make a hack.... plz help me

Maruno
February 20th, 2010, 08:26 AM
Thanks alot Mrchewy, problem solved.
This may be alot to ask for but would any one know how to make it so that when you get to a part of the map you "rival" walks up to you talks for a little then battles you?
Events can control the movement of other events.

Make an event with no graphic, and have it activate when stepped on. This event will make another event (the Rival) walk up to you, display the dialogue, conduct the battle and make the rival walk off again (if you win). When you win, delete the Rival event and set one of the invisible event's self-switches to ON. The second page of that invisible event should be blank, and occur when that self-switch is ON.

RiJaN_nEa
February 20th, 2010, 08:35 AM
Thank you. It worked to prefection!

Sorry for asking so many questions but when you lose you end up in darkness. Any way to fix this?

Peeky Chew
February 20th, 2010, 10:26 AM
@RiJaN_nEa: That error means you've incorrectly formatted the trainers.txt file for a certain trainer. Usually, it appears when there are less listed Pokémon for a trainer than the number you've specified.

@Peeky Chew: First step would be to go through the obvious. Triple check that you've set collisions properly in all tilesets, check for "Through" events ontop of tiles, etc. Reinstalling the latest Essentials update is also worth a try (just follow the updating guide found in notes.html).Checked all of that and updated, nothing changed.

@CrazyNinjaGuy: I don't really know how to do that, it just made the player be stuck in one spot not moving...

I thought I'd give an image example of the problem:
http://i60.photobucket.com/albums/h5/jippily/Help.png

Legendaries
February 20th, 2010, 11:02 AM
Still have this prob:
Since I use the latest Starter Kit version I noticed that player's water reflection is totally opaque.
http://i46.tinypic.com/126cqps.png
In which script I could change it?

Also a new one: I set battle music, intro music and victory music for each trainer in Editor. Then, I set a script "pbTrainerIntro(:X)" at the beggining of the trainer event. It plays the intro music, but when the battle begins it still plays the intro music, not the battle BGS I set in Editor.

How to fix it?

SpawnHyuuga
February 20th, 2010, 03:44 PM
A music problem, for me: After download the latest Pokemon Essentials, when I try to start "clean" by deleting the basics (maps, musics) after making an original backup. The main title music will not play. I also noticed it holds true for the backup. What happened, where when I'm at the title screen (NEW GAME, OPTIONS) that the music will not play?

Great Mazinger
February 20th, 2010, 04:04 PM
A couple questions:

1) Can you insert a manual line break into a Pokédex entry?
2) Is it possible to run an event only during a certain time? (eg 8pm - 6am)

Maruno
February 20th, 2010, 05:58 PM
If I don't answer your question, I don't know. Just before you start PM'ing me.


Thank you. It worked to prefection!

Sorry for asking so many questions but when you lose you end up in darkness. Any way to fix this?
Hmm...

One wild stab in the dark is that you haven't set a respawn point, but I'd imagine that would give an error message rather than show blackness. Another stab is that the respawn point isn't positioned correctly (i.e. outside a Poké Centre/your house).

Try copying a regular trainer's event and modify it. Regular trainers work, and I don't see why adding a few lines of dialogue at the beginning should break it (Gym Leaders do it all the time).


A couple questions:

1) Can you insert a manual line break into a Pokédex entry?
2) Is it possible to run an event only during a certain time? (eg 8pm - 6am)
1) You can try putting <br> into it, or you can simply put a lot of spaces if that doesn't work. I doubt you'll allow the player to change the size of the Dex text box in-game, so the mass of spaces won't be noticed.

2) Yes indeed (http://upokecenter.com/projects/pokestarter/notes.html#nightlytrainers) (you can adapt that section to things other than nightly trainers, such as lit building windows). And this part (http://upokecenter.com/projects/pokestarter/notes.html#lightsources) explains how to make the event a light source and a shadow-casting event (again, for windows and lampposts).

RiJaN_nEa
February 20th, 2010, 06:41 PM
Thanks Maruno. could you also help me with one more little thing?
How would I go about adding Tilesheets to my RPGmaker? Right now its only allowing 7 and I have many more I would like to use.

MercilessZealot
February 20th, 2010, 06:49 PM
Hate to bother you all, but does anyone have an answer for this?

Thanks, but I already knew about that - what I was asking is if that editor is the same as the "animmaker.exe" which is referenced in "animmaker.txt" in the Starter Kit:

animmaker.exe - Converts sprites to RPG Maker XP format animations
(C) 2008 Peter O.

Usage: animmaker xmlfile.xml
('xmlfile.xml' is the path to any XML file, see below)

Example of XML file:

<animations>
<!--Animation file to create (in this case, animation.png)-->
<animation name="animation.png">
<!--Pattern to add to the animation. Consists of the image's
filename plus the rectangle of the pattern to extract
from the image (x, y, width, height) (up to 96x96 in size)
Sprites listed here will be doubled in size in the animation-->
<pattern filename="pkmnfrlg_effects.png" x="50" y="201"
width="56" height="68" />
</animation>
<!--Another animation file, animation2.png)-->
<animation name="animation2.png">
<pattern filename="pkmnfrlg_effects.png" x="50" y="201"
width="56" height="68" />
<!-- You can leave out x, y, etc. to use the whole image-->
<pattern filename="effects2.png" />
</animation>
</animations>

Maruno
February 20th, 2010, 07:14 PM
Thanks Maruno. could you also help me with one more little thing?
How would I go about adding Tilesheets to my RPGmaker? Right now its only allowing 7 and I have many more I would like to use.
At the bottom left of that window is a button that says "Change Maximum". Guess what it does...

RiJaN_nEa
February 20th, 2010, 07:49 PM
The bottom left of what window?

MercilessZealot
February 20th, 2010, 07:53 PM
Also, the sprites show up fine in the "Reposition Sprites" part of the debug menu, yet the opponents' Pokemon sprites show up at almost the top of the screen in-game, and the trainer's Pokemon aren't perfect either (using custom sprites); how do I fix this?

Mrchewy
February 20th, 2010, 08:00 PM
A music problem, for me: After download the latest Pokemon Essentials, when I try to start "clean" by deleting the basics (maps, musics) after making an original backup. The main title music will not play. I also noticed it holds true for the backup. What happened, where when I'm at the title screen (NEW GAME, OPTIONS) that the music will not play?

If I'm understanding you correctly, you started off fresh by deleting all the maps and music? If that's the case, then the reason there is no main title music is because you deleted it. You can change the default title music by going into Tools > Database > System and selecting the Title BGM you want.

As far as I know, the New Game/Options screen doesn't play music by default.

@RiJaN_nEa: Maruno is referring to the Tools > Database > Tilesets screen.

@Peeky Chew: Does this only happen on your older maps, or does it occur to all your new maps as well? Also, try Crazyninjaguy's suggestion if you already haven't:

Also i'd make sure that the player isnt allowed to walk over or through anything.
Do this by Doing a Set Move Route command, set the event to player and click Through OFF.

RiJaN_nEa
February 20th, 2010, 08:28 PM
Oh! I see it now. Thanks.

pokehackster
February 20th, 2010, 11:26 PM
im not sure if poccil even checks this thread anymore but im planning on doing a full update on all of the graphics and im going to attempt to keep all of the graphics originally put in the starter kit while still adding all of the graphics from D/P/P and HG/SS. and im also updating the events and a lot of other stuff too

TACHAN
February 21st, 2010, 05:41 AM
Hey, one question:

How can I put Pokemon's Areas in the Pokedex?


And...


Foe Blissey's Natural Cure blocks HEAL BELL!
Foe blocks HEAL BELL!

How do I fix it?

Maruno
February 21st, 2010, 07:10 AM
Also, the sprites show up fine in the "Reposition Sprites" part of the debug menu, yet the opponents' Pokemon sprites show up at almost the top of the screen in-game, and the trainer's Pokemon aren't perfect either (using custom sprites); how do I fix this?
Manually, I'm afraid, if the debug thing doesn't work for you. Edit the numbers directly in pokémon.txt (for vertical placement of sprites), and the scripts for the horizontal placements. I've explained how to do so several times before.


Hey, one question:

How can I put Pokemon's Areas in the Pokedex?
As I recently discovered, they're put in automatically. Just set the encounters, and red squares should show up on the Dex nest maps.

TACHAN
February 21st, 2010, 07:35 AM
As I recently discovered, they're put in automatically. Just set the encounters, and red squares should show up on the Dex nest maps.

Thanks!, but, don´t show the Reds Squares of Rattata, Pidgey and others in the Pokedex (Route 1)

Example: RATTATA's NEST AREA UNKNOWN... :/

What version of the Essential do you use?

MercilessZealot
February 21st, 2010, 08:15 AM
Manually, I'm afraid, if the debug thing doesn't work for you. Edit the numbers directly in pokémon.txt (for vertical placement of sprites), and the scripts for the horizontal placements. I've explained how to do so several times before.

Okay, thank you. Sorry, I'm new here and couldn't find that by searching the thread; I'll search the forums now.

Maruno
February 21st, 2010, 08:36 AM
Thanks!, but, don´t show the Reds Squares of Rattata, Pidgey and others in the Pokedex (Route 1)

Example: RATTATA's NEST AREA UNKNOWN... :/

What version of the Essential do you use?
My version of Essentials is a year old now. Maybe the functionality broke in more recent versions. I don't keep up to date with them, so I wouldn't really be able to help fix it.


Okay, thank you. Sorry, I'm new here and couldn't find that by searching the thread; I'll search the forums now.
See here (http://www.pokecommunity.com/showthread.php?p=5366321#post5366321) for information about the positioning as done by the scripts. Editing the numbers in pokemon.txt should be straightforward (although it'll require recompiling and running the game a lot to see how your adjustments look).

TACHAN
February 21st, 2010, 08:59 AM
My version of Essentials is a year old now. Maybe the functionality broke in more recent versions. I don't keep up to date with them, so I wouldn't really be able to help fix it.

Thank you very much ^_^
I found one old version of Essential in my computer (Date in January 2009), and show the red squares. It seems that it is a bug of the new versions.

venom12
February 21st, 2010, 02:53 PM
What i need do, to get types bitmaps in any other script? And for ball's too?

Ziebart23
February 21st, 2010, 03:56 PM
@Ziebart23: What exactly are you trying to do with a rival? Are you trying to start a battle? We could help you more if you gave us more information (like what went wrong, and what exactly you're trying to achieve).
Well, I am trying to get to start the game off with the Professor and everything, but I can't get it to ask what the rival's name is and get that to show up with the right name or anything like that...

RiJaN_nEa
February 21st, 2010, 04:58 PM
Why does my editor act as if I am holding down the Down key? Its moving down by It's self and I cant edit anything. Is there a fix?

~Frozen Darkness~
February 21st, 2010, 06:44 PM
Is it possible to use the Shadow Pokemon script from the new version of essentials in a slightly older one? (late 2009)

If so, how?

thepsynergist
February 21st, 2010, 07:12 PM
/bump

I am trying to make it so that I have different wild battle and trainer battle music in my game depending on what region I am in, in my game. Can someone tell me how to do that? I know its in teh PokemonUtilities section in the script, i just don't know how to script it.

Minorthreat0987
February 21st, 2010, 08:57 PM
Does the newest version of essential not support different encounters for Morning/Day/Night? If not does any one know how to re-implement that because I think it was a poor decision to remove that feature from the game, I don't want to encounter hoot hoot at 1 in the afternoon, that's kinda unrealistic!

Peeky Chew
February 22nd, 2010, 04:24 AM
@Peeky Chew: Does this only happen on your older maps, or does it occur to all your new maps as well? Also, try Crazyninjaguy's suggestion if you already haven't:Only on my newer maps. I tried CrazyNinjaGuy's suggestion, it made no difference. I've made a new map and it all works, except for one 5x7 part of tiles. I tried widening the map and shifting it to the right, the part that didn't work moved too. This makes no sense. I'm starting to hate rmxp. I want an answer!

Crazyninjaguy
February 22nd, 2010, 07:11 AM
/bump

I am trying to make it so that I have different wild battle and trainer battle music in my game depending on what region I am in, in my game. Can someone tell me how to do that? I know its in teh PokemonUtilities section in the script, i just don't know how to script it.

Here you go, just add this in a new script section above main.


#===============================================================================
# Pokemon Essentials Region Battle Music
# By Crazyninjaguy
# http://www.planetdev.net
#===============================================================================

def pbGetWildBattleBGM(species)
if $PokemonGlobal.nextBattleBGM
return $PokemonGlobal.nextBattleBGM.clone
end
ret=nil
if !ret && $game_map
# Check map-specific metadata
music=pbGetMetadata($game_map.map_id,MetadataMapWildBattleBGM)
if music && music!=""
ret=pbStringToAudioFile(music)
end
end
if !ret
# Check global metadata
music=pbGetMetadata(0,MetadataWildBattleBGM)
if music && music!=""
if $game_switches[30]
ret=pbStringToAudioFile("firstregionbattlemusic")
elsif $game_switches[31]
ret=pbStringToAudioFile("secondregionbattlemusic")
end
end
end
ret=pbStringToAudioFile("002-Battle02") if !ret
return ret
endThis basically means that once switch 30 is on, it'll play firstregionbattlemusic.mp3 or midi or whatever, and if switch 31 is on it'll play secondregionbattlemusic.

So just activate the switch in your game when you get to the next region.
But dont forget to turn off the switch for the region you've just left!

The switches for the regions can be changed, just change the 30 and/or 31 to whatever you want, just remember to label the switch!

A consequence of using this script is that setting the battle music in metadata.txt will not work, but that doesn't really matter as you have control over it in game.

Does the newest version of essential not support different encounters for Morning/Day/Night? If not does any one know how to re-implement that because I think it was a poor decision to remove that feature from the game, I don't want to encounter hoot hoot at 1 in the afternoon, that's kinda unrealistic!

I've only just realised that myself after looking to try and help you.
As i dont have an older version of the kit i'm afraid i cant help you, if anyone has an older version perhaps they could upload it for me so i can implement it again?

Is it possible to use the Shadow Pokemon script from the new version of essentials in a slightly older one? (late 2009)

I think so, just try adding the PokemonShadow and PokemonPurifyChamber scripts above DependantEvents and carry out the instructions at the top of the PokemonShadow script.

Why does my editor act as if I am holding down the Down key? Its moving down by It's self and I cant edit anything. Is there a fix?

How old is your computer? I used to have a problem like this when playing RMXP games, the character used to just walk constantly in a direction unless i hit the keyboard a ton :D
Helps if your computer hasnt got enough Memory to grab a bit more :)

thepsynergist
February 22nd, 2010, 11:58 AM
Thank you very much, Crazyninjaguy.

I'll test this to see if there are any conflicts and I will post if I encounter a problem.

Crazyninjaguy
February 22nd, 2010, 12:39 PM
No probs :)
Also you said you wanted trainer music too?
I haven't tested it but it should work all the same.
Just replace the other script section with this:

#===============================================================================
# Pokemon Essentials Regional Battle Music
# By Crazyninjaguy
# http://www.planetdev.net
#===============================================================================

def pbGetWildBattleBGM(species)
if $PokemonGlobal.nextBattleBGM
return $PokemonGlobal.nextBattleBGM.clone
end
ret=nil
if !ret && $game_map
# Check map-specific metadata
music=pbGetMetadata($game_map.map_id,MetadataMapWildBattleBGM)
if music && music!=""
ret=pbStringToAudioFile(music)
end
end
if !ret
# Check global metadata
music=pbGetMetadata(0,MetadataWildBattleBGM)
if music && music!=""
if $game_switches[30]
ret=pbStringToAudioFile("Cave")
elsif $game_switches[31]
ret=pbStringToAudioFile("005-Boss01")
end
end
end
ret=pbStringToAudioFile("002-Battle02") if !ret
return ret
end

def pbGetTrainerBattleBGM(trainer) # can be a PokeBattle_Trainer or an array of PokeBattle_Trainer
if $PokemonGlobal.nextBattleBGM
return $PokemonGlobal.nextBattleBGM.clone
end
music=nil
pbRgssOpen("Data/trainernames.dat","rb"){|f|
trainernames=Marshal.load(f)
if !trainer.is_a?(Array)
trainerarray=[trainer]
else
trainerarray=trainer
end
for i in 0...trainerarray.length
trainertype=trainerarray[i].trainertype
if trainernames[trainertype]
music=trainernames[trainertype][4]
end
end
}
ret=nil
if music && music!=""
ret=pbStringToAudioFile(music)
end
if !ret && $game_map
# Check map-specific metadata
music=pbGetMetadata($game_map.map_id,MetadataMapTrainerBattleBGM)
if music && music!=""
ret=pbStringToAudioFile(music)
end
end
if !ret
# Check global metadata
music=pbGetMetadata(0,MetadataTrainerBattleBGM)
if music && music!=""
if $game_switches[30]
ret=pbStringToAudioFile("region1trainermusic")
elsif $game_switches[31]
ret=pbStringToAudioFile("region2trainermusic")
end
end
end
ret=pbStringToAudioFile("005-Boss01") if !ret
return ret
end

def pbGetTrainerBattleBGMFromType(trainertype)
if $PokemonGlobal.nextBattleBGM
return $PokemonGlobal.nextBattleBGM.clone
end
music=nil
pbRgssOpen("Data/trainernames.dat","rb"){|f|
trainernames=Marshal.load(f)
if trainernames[trainertype]
music=trainernames[trainertype][4]
end
}
ret=nil
if music && music!=""
ret=pbStringToAudioFile(music)
end
if !ret && $game_map
# Check map-specific metadata
music=pbGetMetadata($game_map.map_id,MetadataMapTrainerBattleBGM)
if music && music!=""
ret=pbStringToAudioFile(music)
end
end
if !ret
# Check global metadata
music=pbGetMetadata(0,MetadataTrainerBattleBGM)
if music && music!=""
if $game_switches[30]
ret=pbStringToAudioFile("region1trainermusic")
elsif $game_switches[31]
ret=pbStringToAudioFile("region2trainermusic")
end
end
end
ret=pbStringToAudioFile("005-Boss01") if !ret
return ret
end

RiJaN_nEa
February 22nd, 2010, 01:56 PM
Thank you CrazyNinjaGuy That fixed the problem!

But would anyone know why when I Import animations I am get this error?

---------------------------
Pokemon Essentials
---------------------------
Exception: NoMethodError
Message: undefined method `gold' for nil:NilClass
PokemonMessages:1198:in `pbGetGoldString'
PokemonMessages:1205:in `pbDisplayGoldWindow'
PokemonMessages:1416:in `pbMessageDisplay'
PokemonMessages:1392:in `each'
PokemonMessages:1392:in `pbMessageDisplay'
PokemonMessages:994:in `pbMessage'
PokemonMessages:1013:in `pbConfirmMessage'
EditorMain:18:in `pbSafeCopyFile'
EditorMain:184:in `pbEditorMenu'
EditorMain:183:in `each'

This exception was logged in ./errorlog.txt.
Press Ctrl+C to copy this message to the clipboard.
---------------------------
OK
---------------------------

Crazyninjaguy
February 22nd, 2010, 03:11 PM
That really should have nothing to do with importing animations, are you sure you posted the right error message? If you did then try putting this in the Data/ folder (extracted of course)

thepsynergist
February 22nd, 2010, 03:17 PM
Hey Crazy, I got this error when I imported your script.

---------------------------
Pokemon Pyrite
---------------------------
Exception: RuntimeError

Message: Script error within event 4, map 163 (Route 26/27):

Exception: NameError

Message: Section136:59:in `pbGetTrainerBattleBGM'uninitialized constant MetadataMapTrainerBattleBGM

***Full script:

pbTrainerBattle(PBTrainers::HIKER,"Quinton",_I("I could stay here forever."),false,0)

Interpreter:239:in `pbExecuteScript'

PokemonTrainers:378:in `pbTrainerBattle'

(eval):1:in `pbExecuteScript'

Interpreter:785:in `eval'

Interpreter:239:in `pbExecuteScript'

Interpreter:785:in `command_111'

Interpreter:318:in `execute_command'

Interpreter:191:in `update'

Interpreter:104:in `loop'

Interpreter:196:in `update'



Interpreter:274:in `pbExecuteScript'

Interpreter:785:in `command_111'

Interpreter:318:in `execute_command'

Interpreter:191:in `update'

Interpreter:104:in `loop'

Interpreter:196:in `update'

Scene_Map:96:in `update'

Scene_Map:94:in `loop'

Scene_Map:107:in `update'

Scene_Map:63:in `main'



This exception was logged in errorlog.txt.

Press Ctrl+C to copy this message to the clipboard.
---------------------------
OK
---------------------------


Any idea on how to fix it?

Crazyninjaguy
February 22nd, 2010, 03:23 PM
Hmmm, not too sure.

Try this version:

#===============================================================================
# Pokemon Essentials Region Battle Music
# By Crazyninjaguy
# http://www.planetdev.net
#===============================================================================

def pbGetWildBattleBGM(species)
if $PokemonGlobal.nextBattleBGM
return $PokemonGlobal.nextBattleBGM.clone
end
ret=nil
if !ret && $game_map
# Check map-specific metadata
music=pbGetMetadata($game_map.map_id,MetadataMapWildBattleBGM)
if music && music!=""
ret=pbStringToAudioFile(music)
end
end
if !ret
# Check global metadata
music=pbGetMetadata(0,MetadataWildBattleBGM)
if music && music!=""
if $game_switches[30]
ret=pbStringToAudioFile("Cave")
elsif $game_switches[31]
ret=pbStringToAudioFile("005-Boss01")
end
end
end
ret=pbStringToAudioFile("002-Battle02") if !ret
return ret
end

def pbGetTrainerBattleBGM(trainer) # can be a PokeBattle_Trainer or an array of PokeBattle_Trainer
if $PokemonGlobal.nextBattleBGM
return $PokemonGlobal.nextBattleBGM.clone
end
music=nil
pbRgssOpen("Data/trainernames.dat","rb"){|f|
trainernames=Marshal.load(f)
if !trainer.is_a?(Array)
trainerarray=[trainer]
else
trainerarray=trainer
end
for i in 0...trainerarray.length
trainertype=trainerarray[i].trainertype
if trainernames[trainertype]
music=trainernames[trainertype][4]
end
end
}
ret=nil
if !ret
# Check global metadata
music=pbGetMetadata(0,MetadataTrainerBattleBGM)
if music && music!=""
if $game_switches[30]
ret=pbStringToAudioFile("region1trainermusic")
elsif $game_switches[31]
ret=pbStringToAudioFile("region2trainermusic")
end
end
end
ret=pbStringToAudioFile("005-Boss01") if !ret
return ret
end

def pbGetTrainerBattleBGMFromType(trainertype)
if $PokemonGlobal.nextBattleBGM
return $PokemonGlobal.nextBattleBGM.clone
end
music=nil
pbRgssOpen("Data/trainernames.dat","rb"){|f|
trainernames=Marshal.load(f)
if trainernames[trainertype]
music=trainernames[trainertype][4]
end
}
ret=nil
if music && music!=""
ret=pbStringToAudioFile(music)
end
if !ret
# Check global metadata
music=pbGetMetadata(0,MetadataTrainerBattleBGM)
if music && music!=""
if $game_switches[30]
ret=pbStringToAudioFile("region1trainermusic")
elsif $game_switches[31]
ret=pbStringToAudioFile("region2trainermusic")
end
end
end
ret=pbStringToAudioFile("005-Boss01") if !ret
return ret
end

thepsynergist
February 22nd, 2010, 03:41 PM
Ok, so the trainer battle music works, now I get this error when entering grassy areas with Pokemon.

---------------------------
Pokemon Pyrite
---------------------------
Exception: NameError

Message: uninitialized constant MetadataMapWildBattleBGM

Pokemon Region Battle:14:in `pbGetWildBattleBGM'

PokemonField:772:in `pbWildBattle'

PokemonField:1082:in `pbBattleOnStepTaken'

PokemonField:1105:in `pbOnStepTaken'

Game_Player_:430:in `update_old'

Walk_Run:71:in `update'

Scene_Map:97:in `update'

Scene_Map:94:in `loop'

Scene_Map:107:in `update'

Scene_Map:63:in `main'



This exception was logged in errorlog.txt.

Press Ctrl+C to copy this message to the clipboard.
---------------------------
OK
---------------------------


Any ideas? Thanks again, by the way.

Edit: Is the wild battle script from the PokemonUtilities script section interfering with it?

RiJaN_nEa
February 22nd, 2010, 03:49 PM
I put it in and it gives me this.
---------------------------
Pokemon Essentials
---------------------------
Exception: NoMethodError
Message: undefined method `gold' for nil:NilClass
PokemonMessages:1198:in `pbGetGoldString'
PokemonMessages:1205:in `pbDisplayGoldWindow'
PokemonMessages:1416:in `pbMessageDisplay'
PokemonMessages:1392:in `each'
PokemonMessages:1392:in `pbMessageDisplay'
PokemonMessages:994:in `pbMessage'
PokemonMessages:1013:in `pbConfirmMessage'
EditorMain:18:in `pbSafeCopyFile'
EditorMain:184:in `pbEditorMenu'
EditorMain:183:in `each'

This exception was logged in errorlog.txt.
Press Ctrl+C to copy this message to the clipboard.
---------------------------
OK
---------------------------


Also on a smaller note. Whats with the pokemon faces in the errors?

Plus I dont even know whats wrong here.

---------------------------
Pokemon Essentials
---------------------------
Exception: RuntimeError
Message: Undefined move constant name: FALSE
Name must consist only of letters, numbers, and
underscores and can't begin with a number.
Make sure the name is defined in
PBS/moves.txt.
File PBS/trainers.txt, line 6
MAGIKARP,8,10,,Splash,false,false

Compiler:883:in `pbGetConst'
Compiler:909:in `parseMove'
Compiler:1365:in `pbCompileTrainers'
Compiler:1341:in `each'
Compiler:1341:in `pbCompileTrainers'
Compiler:1314:in `loop'
Compiler:1377:in `pbCompileTrainers'
Compiler:3817:in `pbCompileAllData'
Compiler:3939

This exception was logged in ./errorlog.txt.
Press Ctrl+C to copy this message to the clipboard.
---------------------------
OK
---------------------------

Mrchewy
February 23rd, 2010, 12:28 AM
Also on a smaller note. Whats with the pokemon faces in the errors?

When pasting code, errors, etc. into a post without using the [code] tags, occassionally the forum automatically converts certain strings (usually things with colons and semi-colons) into smilies. :)

Plus I dont even know whats wrong here.

---------------------------
Pokemon Essentials
---------------------------
Exception: RuntimeError
Message: Undefined move constant name: FALSE
Name must consist only of letters, numbers, and
underscores and can't begin with a number.
Make sure the name is defined in
PBS/moves.txt.
File PBS/trainers.txt, line 6
MAGIKARP,8,10,,Splash,false,false

Compiler:883:in `pbGetConst'
Compiler:909:in `parseMove'
Compiler:1365:in `pbCompileTrainers'
Compiler:1341:in `each'
Compiler:1341:in `pbCompileTrainers'
Compiler:1314:in `loop'
Compiler:1377:in `pbCompileTrainers'
Compiler:3817:in `pbCompileAllData'
Compiler:3939

This exception was logged in ./errorlog.txt.
Press Ctrl+C to copy this message to the clipboard.
---------------------------
OK
---------------------------

Erm, you're trying to give that Magikarp the move "false", not once but twice. For a start, there's no such move anyway. If you want him to JUST have Splash, just write Splash and nothing else.

Crazyninjaguy
February 23rd, 2010, 01:29 AM
@thepsynergist, sorry >.<
Here's another fix, you shouldnt have any problems with this one :)

#===============================================================================
# Pokemon Essentials Region Battle Music
# By Crazyninjaguy
# http://www.planetdev.net
#===============================================================================

def pbGetWildBattleBGM(species)
if $PokemonGlobal.nextBattleBGM
return $PokemonGlobal.nextBattleBGM.clone
end
ret=nil
if !ret
# Check global metadata
music=pbGetMetadata(0,MetadataWildBattleBGM)
if music && music!=""
if $game_switches[30]
ret=pbStringToAudioFile("Cave")
elsif $game_switches[31]
ret=pbStringToAudioFile("005-Boss01")
end
end
end
ret=pbStringToAudioFile("002-Battle02") if !ret
return ret
end

def pbGetTrainerBattleBGM(trainer) # can be a PokeBattle_Trainer or an array of PokeBattle_Trainer
if $PokemonGlobal.nextBattleBGM
return $PokemonGlobal.nextBattleBGM.clone
end
music=nil
pbRgssOpen("Data/trainernames.dat","rb"){|f|
trainernames=Marshal.load(f)
if !trainer.is_a?(Array)
trainerarray=[trainer]
else
trainerarray=trainer
end
for i in 0...trainerarray.length
trainertype=trainerarray[i].trainertype
if trainernames[trainertype]
music=trainernames[trainertype][4]
end
end
}
ret=nil
if !ret
# Check global metadata
music=pbGetMetadata(0,MetadataTrainerBattleBGM)
if music && music!=""
if $game_switches[30]
ret=pbStringToAudioFile("region1trainermusic")
elsif $game_switches[31]
ret=pbStringToAudioFile("region2trainermusic")
end
end
end
ret=pbStringToAudioFile("005-Boss01") if !ret
return ret
end

def pbGetTrainerBattleBGMFromType(trainertype)
if $PokemonGlobal.nextBattleBGM
return $PokemonGlobal.nextBattleBGM.clone
end
music=nil
pbRgssOpen("Data/trainernames.dat","rb"){|f|
trainernames=Marshal.load(f)
if trainernames[trainertype]
music=trainernames[trainertype][4]
end
}
ret=nil
if music && music!=""
ret=pbStringToAudioFile(music)
end
if !ret
# Check global metadata
music=pbGetMetadata(0,MetadataTrainerBattleBGM)
if music && music!=""
if $game_switches[30]
ret=pbStringToAudioFile("region1trainermusic")
elsif $game_switches[31]
ret=pbStringToAudioFile("region2trainermusic")
end
end
end
ret=pbStringToAudioFile("005-Boss01") if !ret
return ret
end

RiJaN_nEa
February 23rd, 2010, 02:33 AM
Erm, you're trying to give that Magikarp the move "false", not once but twice. For a start, there's no such move anyway. If you want him to JUST have Splash, just write Splash and nothing else.

But I thought the two "False" was for the the shiny=nil and shadow=nil? Also my editor put it there like that.

lezebulon
February 23rd, 2010, 05:41 PM
Hello
How can I change the scripts so we actually see berry sprites when you planted a berry ??

thepsynergist
February 23rd, 2010, 08:55 PM
Thank you very much, Crazyguy. I'll try it out when I get on my computer that has my game on it. I'll let you know if I get any errors.

Shorthand
February 24th, 2010, 12:44 AM
This may be a silly problem, but I'm new to Pokemon Essentials and don't have much coding experience.

I wanted to change the resolution of the game screen, so I look around in the Notes and found that I had to change the @@width and @@height lines in Sprite Resizer. I did so, and got this problem:

EDIT: I just realised that I can't insert images which are hosted on Photobucket into my posts until I have made 15 posts or more, so it has been attached as a .pgn.

As you can see, the menus and text size/text boxes are too large and cover almost the entire screen, and you can't see the battle screen at all aside from a cropped look at Pikachu. Does anyone have any way for me to fix the menus, boxes, battle screen and text size? Or should I avoid changing the resolution until I either learn more about coding or get help from someone who knows RPGXP's language?

Crazyninjaguy
February 24th, 2010, 12:47 AM
This may be a silly problem, but I'm new to Pokemon Essentials and don't have much coding experience.

I wanted to change the resolution of the game screen, so I look around in the Notes and found that I had to change the @@width and @@height lines in Sprite Resizer. I did so, and got this problem:

EDIT: I just realised that I can't insert images which are hosted on Photobucket into my posts until I have made 15 posts or more, so it has been attached as a .pgn.

As you can see, the menus and text size/text boxes are too large and cover almost the entire screen, and you can't see the battle screen at all aside from a cropped look at Pikachu. Does anyone have any way for me to fix the menus, boxes, battle screen and text size? Or should I avoid changing the resolution until I either learn more about coding or get help from someone who knows RPGXP's language?

Sorry but you should almost definitely wait until you've learnt RGSS.
That's the only way you'll fix these, and that'll be tough in itself.

Shorthand
February 24th, 2010, 12:52 AM
Drat.

Thanks for the quick reply, Crazyninjaguy.

Maruno
February 24th, 2010, 08:09 AM
This may be a silly problem, but I'm new to Pokemon Essentials and don't have much coding experience.

I wanted to change the resolution of the game screen, so I look around in the Notes and found that I had to change the @@width and @@height lines in Sprite Resizer. I did so, and got this problem:

EDIT: I just realised that I can't insert images which are hosted on Photobucket into my posts until I have made 15 posts or more, so it has been attached as a .pgn.

As you can see, the menus and text size/text boxes are too large and cover almost the entire screen, and you can't see the battle screen at all aside from a cropped look at Pikachu. Does anyone have any way for me to fix the menus, boxes, battle screen and text size? Or should I avoid changing the resolution until I either learn more about coding or get help from someone who knows RPGXP's language?
You can halve the size of all the message windows and the battle screen by going into SpriteResizer, finding the line "$ResizeFactor=1.0" and changing it to equal 0.5 instead.

There's a part of this problem that I'm confused by, though. The bottom left screenshot shows the maps have already been resized, but the message boxes have not. Either you've done more to the scripts that you're not telling us, or something dodgy's going on. Either way, don't change the screen size in the in-game Options menu, because that will just confuse things.

Minorthreat0987
February 24th, 2010, 11:29 AM
So I did a little bit of research and the whole no day/night encounter thing has been around since like the January 13th release, but I was able to re-implement it so if any one wants it just replace your PokemonEncounter Script with this script!

To re-implement different encounters depending on the time of day replace your PokemonEncounter Script with this.



module EncounterTypes
Land=0
Cave=1
Water=2
RockSmash=3
OldRod=4
GoodRod=5
SuperRod=6
HeadbuttLow=7
HeadbuttHigh=8
LandMorning=9
LandDay=10
LandNight=11
BugContest=12
Names=[
"Land",
"Cave",
"Water",
"RockSmash",
"OldRod",
"GoodRod",
"SuperRod",
"HeadbuttLow",
"HeadbuttHigh",
"LandMorning",
"LandDay",
"LandNight",
"BugContest"
]
EnctypeChances=[
[20,20,10,10,10,10,5,5,4,4,1,1],
[20,20,10,10,10,10,5,5,4,4,1,1],
[60,30,5,4,1],
[60,30,5,4,1],
[70,30],
[60,20,20],
[40,40,15,4,1],
[30,25,20,10,5,5,4,1],
[30,25,20,10,5,5,4,1],
[20,20,10,10,10,10,5,5,4,4,1,1],
[20,20,10,10,10,10,5,5,4,4,1,1],
[20,20,10,10,10,10,5,5,4,4,1,1],
[20,20,10,10,10,10,5,5,4,4,1,1]
]
end

class PokemonEncounters
def initialize
@enctypes=[]
@density=nil
end
def stepcount
return @stepcount
end
def clearStepCount
@stepcount=0
end
def hasEncounter?(enc)
return false if @density==nil || enc<0
return @enctypes[enc] ? true : false
end
def isCave?
return false if @density==nil
return @enctypes[1] ? true : false
end
def isGrass?
return false if @density==nil
return (@enctypes[0] || @enctypes[9] || @enctypes[10] || @enctypes[11] || @enctypes[12]) ? true : false
end
def isEncounterPossibleHere?
if $PokemonGlobal && $PokemonGlobal.surfing
return true
elsif self.isCave?
return true
elsif self.isGrass?
return pbIsGrassTag?($game_map.terrain_tag($game_player.x,$game_player.y))
else
return false
end
end
def pbEncounterType
if $PokemonGlobal && $PokemonGlobal.surfing
return EncounterTypes::Water
elsif self.isCave?
return EncounterTypes::Cave
elsif self.isGrass?
hour=Time.now.hour
enctype=EncounterTypes::Land
if pbInBugContest?
if self.hasEncounter?(EncounterTypes::BugContest)
enctype=EncounterTypes::BugContest
end
elsif hour<6 || hour>=20
if self.hasEncounter?(EncounterTypes::LandNight)
enctype=EncounterTypes::LandNight
end
elsif hour<12
if self.hasEncounter?(EncounterTypes::LandMorning)
enctype=EncounterTypes::LandMorning
end
else
if self.hasEncounter?(EncounterTypes::LandDay)
enctype=EncounterTypes::LandDay
end
end
return enctype
else
return -1
end
end
def setup(mapID)
@density=nil
@stepcount=0
@enctypes=[]
begin
data=load_data("Data/encounters.dat")
if data.is_a?(Hash) && data[mapID]
@density=data[mapID][0]
@enctypes=data[mapID][1]
else
@density=nil
@enctypes=[]
end
rescue
@density=nil
@enctypes=[]
end
end
def pbMapHasEncounter?(mapID,enctype)
data=load_data("Data/encounters.dat")
if data.is_a?(Hash) && data[mapID]
enctypes=data[mapID][1]
density=data[mapID][0]
else
return false
end
return false if density==nil || enctype<0
return enctypes[enctype] ? true : false
end
def pbMapEncounter(mapID,enctype)
if enctype<0 || enctype>EncounterTypes::EnctypeChances.length
raise ArgumentError.new(_INTL("Encounter type out of range"))
end
data=load_data("Data/encounters.dat")
if data.is_a?(Hash) && data[mapID]
enctypes=data[mapID][1]
else
return nil
end
return nil if enctypes[enctype]==nil
chances=EncounterTypes::EnctypeChances[enctype]
rnd=rand(100)
chosenpkmn=0
chance=0
for i in 0...chances.length
chance+=chances[i]
if rnd<chance
chosenpkmn=i
break
end
end
encounter=enctypes[enctype][chosenpkmn]
level=encounter[1]+rand(1+encounter[2]-encounter[1])
return [encounter[0],level]
end
def pbEncounteredPokemon(enctype)
if enctype<0 || enctype>EncounterTypes::EnctypeChances.length
raise ArgumentError.new(_INTL("Encounter type out of range"))
end
return nil if @enctypes[enctype]==nil
chances=EncounterTypes::EnctypeChances[enctype]
rnd=rand(100)
chosenpkmn=0
chance=0
for i in 0...chances.length
chance+=chances[i]
if rnd<chance
chosenpkmn=i
break
end
end
encounter=@enctypes[enctype][chosenpkmn]
return nil if !encounter
level=encounter[1]+rand(1+encounter[2]-encounter[1])
return [encounter[0],level]
end
def pbGenerateEncounter(enctype)
if enctype<0 || enctype>EncounterTypes::EnctypeChances.length
raise ArgumentError.new(_INTL("Encounter type out of range"))
end
return nil if @density==nil
return nil if @density[enctype]==0 || !@density[enctype]
return nil if @enctypes[enctype]==nil
@stepcount+=1
return nil if @stepcount<=3 # Check three steps after battle ends
encount=@density[enctype]*16
if $PokemonGlobal.bicycle
encount=(encount*4/5)
end
if $PokemonMap.blackFluteUsed
encount/=2
end
if $PokemonMap.whiteFluteUsed
encount=(encount*3/2)
end
if $Trainer.party.length>0
if isConst?($Trainer.party[0].item,PBItems,:CLEANSETAG)
encount=(encount*2/3)
else
if isConst?($Trainer.party[0].ability,PBAbilities,:STENCH)
encount=(encount*1/2)
elsif isConst?($Trainer.party[0].ability,PBAbilities,:ILLUMINATE)
encount=(encount*2/3)
end
end
end
return nil if rand(2874)>=encount
encpoke=pbEncounteredPokemon(enctype)
return nil if !encpoke
if $PokemonGlobal.repel>0 &&
$Trainer.party.length>0 &&
encpoke[1]<=$Trainer.party[0].level
return nil
end
return encpoke
end
end


However let it be known, I haven't been able to make it so you can add LandMorning/LandDay/LandNight encounters using the Editor, so you must add them by hand.

I hope this helps anyone who was having issues with that whole thing.

~Frozen Darkness~
February 24th, 2010, 01:37 PM
Still looking for an answer to my question on the previous page, since Crazyninjaguy's idea didn't work. It gave me a NoMethod Error for "onStartBattle"

Question:

Is it possible to use the PokemonShadow and PokemonPurifyChamber scripts in an older version? (Late 2009)

thepsynergist
February 24th, 2010, 09:33 PM
Hey Crazyninjaguy, your script worked flawlessly now. Thank you again for your help.

Mrchewy
February 25th, 2010, 03:41 AM
Hey folks, I've been recently trying to edit my battle scene to allow for Pokémon animations. I've had somewhat limited success, so was wondering if anyone could offer any suggestions.

Basically, I want the sprite of the enemy Pokémon, once it slides in/pops out of its ball, to alternate between it second frame (which has the prefix "ani_" in the battlers folder) 2-3 times. The actual scripting seemed fairly simple, but after almost two hours of tweaking I've experienced little luck working it out.

Crazyninjaguy
February 25th, 2010, 03:58 AM
Luka S.J released a tutorial around christmas time on this, here you go :)

Mrchewy
February 25th, 2010, 04:37 AM
That was... entirely unexpected =o. I've never seen such third-party documentation for the SK before, lol.

I got -very- close to successful replicating this effect by the looks of things. This system is a lot better, however xD. Many thanks Crazyninjaguy.

lezebulon
February 25th, 2010, 10:01 AM
Hi

What is the best way to have a NPC walking to some place, followed by another NPC, followed by the player ?
I usually use the "set moveroute" event, but is there a simpler way (or another way) ?

Minorthreat0987
February 25th, 2010, 10:12 AM
does anyone know how to change the screen size of the editor? I changed my game screen size to the DS size, but the editor is still GBA size.

Crazyninjaguy
February 25th, 2010, 12:16 PM
does anyone know how to change the screen size of the editor? I changed my game screen size to the DS size, but the editor is still GBA size.

Do you really need the editor DS size lol?
If you resize it, it wont be any different, just longer.

But if you really want to, then do this:

1. Go into the Data folder.
2. Rename Scripts.rxdata to ScriptsORIGINAL.rxdata
3. Rename EditorScripts.rxdata to Scripts.rxdata
4. Load up the project.
5. Edit the scripts.
6. Rename the .rxdata files until they are as they were.

incognito322
February 25th, 2010, 01:39 PM
Eh, whenever I test play the game, it seems to erase the file I saved previously. Any help?

Cilerba
February 25th, 2010, 02:11 PM
Hmm...Is it possible to create a script that generates a circular shadow such as D/P/Pt/HG/SS?

Crazyninjaguy
February 25th, 2010, 02:47 PM
Well a script for that really isn't needed, just add a shadow below the sprite on the Charsets.

Trikeboy
February 25th, 2010, 03:17 PM
Checked all of that and updated, nothing changed.

@CrazyNinjaGuy: I don't really know how to do that, it just made the player be stuck in one spot not moving...

I thought I'd give an image example of the problem:
http://i60.photobucket.com/albums/h5/jippily/Help.png

When you were making the map did you put something on the third layer and use a blank tile to cover it up. If you do that RMXP reads the top most passage settings for the tile. Try deleting the house on layer 3 and putting it back in on layer 2. I once ruined an entire map by trying to fix errors by putting blank tiles on the third layer.

Cilerba
February 25th, 2010, 03:18 PM
Well a script for that really isn't needed, just add a shadow below the sprite on the Charsets.

I have tried that, but it is a pain, since MS Paint doesn't have layer support, and photoshop creates a new layer everytime I copy+paste the shadow.

Crazyninjaguy
February 25th, 2010, 03:50 PM
Hrm, well it could be possible, as i said before though, i have alot of requests at the moment so i'll have to do it when i've finished them.

Cilerba
February 25th, 2010, 04:07 PM
Hrm, well it could be possible, as i said before though, i have alot of requests at the moment so i'll have to do it when i've finished them.

Alright, thanks a lot. Sorry, if I was acting like a n00b, or am just a pain in the neck >.<

Minorthreat0987
February 25th, 2010, 08:38 PM
Do you really need the editor DS size lol?
If you resize it, it wont be any different, just longer.

But if you really want to, then do this:

1. Go into the Data folder.
2. Rename Scripts.rxdata to ScriptsORIGINAL.rxdata
3. Rename EditorScripts.rxdata to Scripts.rxdata
4. Load up the project.
5. Edit the scripts.
6. Rename the .rxdata files until they are as they were.

It just makes using the Reposition sprite feature in the editor more accurate which is important because I would hate to have to edit all those by hand using trial and error. Thank you for the help though! :)

Anyway new question, does anyone know how to fix this?

http://i267.photobucket.com/albums/ii291/Minorthreat0987/Pokemon%20Scarlet/capture000-8.png

When the opponent pokemon dies it goes infront of the Hero's hp bar for the most part which is cosmetically unappealing...Thanks for the help!

Crazyninjaguy
February 26th, 2010, 02:05 AM
Again, i haven't tested this but it should work.

1. Find this script part in Pokebattle_ActualScene (line 497 - 533)

if doublebattle
case @battler.index
when 0
@databox=AnimatedBitmap.new("Graphics/Pictures/doublePlayerBox")
@spriteX=256
@spriteY=124+yoffset
when 1
@databox=AnimatedBitmap.new("Graphics/Pictures/doubleEnemyBox")
@spriteX=26
@spriteY=10+yoffset
@spritebaseX=0
@spritebaseY=0
when 2
@databox=AnimatedBitmap.new("Graphics/Pictures/doublePlayerBox")
@spriteX=280
@spriteY=174+yoffset
when 3
@databox=AnimatedBitmap.new("Graphics/Pictures/doubleEnemyBox")
@spriteX=2
@spriteY=60+yoffset
end
else
case @battler.index
when 0
@databox=AnimatedBitmap.new("Graphics/Pictures/singlePlayerBox")
@spriteX=254
@spriteY=148+yoffset
@showhp=true
@showexp=true
@statusCX=40
@statusY=44
when 1
@databox=AnimatedBitmap.new("Graphics/Pictures/singleEnemyBox")
@spriteX=26
@spriteY=32+yoffset
end
end

2. Replace it with this:

if doublebattle
case @battler.index
when 0
@databox=AnimatedBitmap.new("Graphics/Pictures/doublePlayerBox")
@databox.z = 999999999
@spriteX=256
@spriteY=124+yoffset
when 1
@databox=AnimatedBitmap.new("Graphics/Pictures/doubleEnemyBox")
@databox.z = 999999999
@spriteX=26
@spriteY=10+yoffset
@spritebaseX=0
@spritebaseY=0
when 2
@databox=AnimatedBitmap.new("Graphics/Pictures/doublePlayerBox")
@databox.z = 999999999
@spriteX=280
@spriteY=174+yoffset
when 3
@databox=AnimatedBitmap.new("Graphics/Pictures/doubleEnemyBox")
@databox.z = 999999999
@spriteX=2
@spriteY=60+yoffset
end
else
case @battler.index
when 0
@databox=AnimatedBitmap.new("Graphics/Pictures/singlePlayerBox")
@databox.z = 999999999
@spriteX=254
@spriteY=148+yoffset
@showhp=true
@showexp=true
@statusCX=40
@statusY=44
when 1
@databox=AnimatedBitmap.new("Graphics/Pictures/singleEnemyBox")
@databox.z = 999999999
@spriteX=26
@spriteY=32+yoffset
end
end

So yeah, should work but i haven't tried it.

Mrchewy
February 26th, 2010, 03:48 AM
Well a script for that really isn't needed, just add a shadow below the sprite on the Charsets.

Well, I was trying to do this recently and at first I thought it was the easy solution... until I realized that it looks ridiculous whenever you jump a ledge (the shadow sticks with you). A script for this would be great.

Cilerba
February 26th, 2010, 01:33 PM
Hi again. I was wondering if somebody could help me use the pbDownloadToString method.

I am kind of confused on what to do here.

Mrchewy
February 26th, 2010, 07:46 PM
Hi again. I was wondering if somebody could help me use the pbDownloadToString method.

I am kind of confused on what to do here.


Thankfully, this is quite simple. Basically, start off by creating a text file and uploading it to your site in comma seperated format:

PikaPika,25,10

The actually order and values of course, depends on what you're using the data for. In this case, I'm using nickname, Pokémon number and Pokémon level. There's no limit to the number of values you have. Next, you implement this script - in an event, for example:

string=pbDownloadToString("http://www.yoursite.com/test.txt")
data = []
string.each(',') {|s| data.push(s.delete(","))}

Basically, this code downloads the information from the text file (the text file needs to be in UTF-8) and puts it into an array. So in this case, data[0] is "PikaPika", data[1] is "25" and data[2] is "10". This values could be used for anything, really, but if you say, wanted to give the player a Pokémon...

pbAddForeignPokemon(data[1].to_i,data[2].to_i,_("Previous Owner"),_(data[0]))
In this case, it would give you a level 10 Pikachu, with a nickname "PikaPika". The ".to_i" is added after certain variables to convert strings into integers. In other words, the text string "25", is converted into the number value 25.

incognito322
February 27th, 2010, 09:19 AM
Whenever I test play my game in Pokemon Essentials, it erases the previous save file data. I didn't alter anything besides the script that Maximus gave me to keep the player from doubling the image (and defying priorities) near the intersection of a map. So what's wrong here?

Cilerba
February 27th, 2010, 09:56 AM
Thankfully, this is quite simple. Basically, start off by creating a text file and uploading it to your site in comma seperated format:

PikaPika,25,10

The actually order and values of course, depends on what you're using the data for. In this case, I'm using nickname, Pokémon number and Pokémon level. There's no limit to the number of values you have. Next, you implement this script - in an event, for example:

string=pbDownloadToString("http://www.yoursite.com/test.txt")
data = []
string.each(',') {|s| data.push(s.delete(","))}

Basically, this code downloads the information from the text file (the text file needs to be in UTF-8) and puts it into an array. So in this case, data[0] is "PikaPika", data[1] is "25" and data[2] is "10". This values could be used for anything, really, but if you say, wanted to give the player a Pokémon...

pbAddForeignPokemon(data[1].to_i,data[2].to_i,_("Previous Owner"),_(data[0]))
In this case, it would give you a level 10 Pikachu, with a nickname "PikaPika". The ".to_i" is added after certain variables to convert strings into integers. In other words, the text string "25", is converted into the number value 25.

Thanks! I was also wondering, if I could use that, but have it search the website for a certain text.

Sort of like having a certain code like this...
XdQ8sK9X
...in my thread.

And I was thinking that maybe I could use a conditional branch to check if the website has that code somewhere on it.

It seems like a wacky idea, but maybe it's possible

Peeky Chew
February 27th, 2010, 12:08 PM
I've changed the characters overworld sprite and now it has a white background in-game, even though I've set the white to transparent. I've had this problem before, but can't remember how I fixed it then.

incognito322
February 27th, 2010, 01:46 PM
I think I did that once, and for me the white didn't work either. Try using another color; I use a shade of off-purple that I never use for sprites and tiles as a transparent color.

delyemerald2
February 27th, 2010, 01:56 PM
If got a problem with that Shadow Pokemon system in the newest version of the starterkit. Everytime I throw a pokeball to a Shadow Pokemon, it will be treated like if that Pokemon isn't a Shadow Pokemon, and thus my ball is blocked. If tried a lot of other branches to let it work, but they all failed. Anybody knows how to fix it?

(Just for sure, the lines where everything goes wrong:

if @opponent && (!pbIsSnagBall?(ball) || !battler.isShadow?)
@scene.pbThrowAndDeflect(ball,1)
pbDisplay(_INTL("The Trainer blocked the Ball!\nDon't be a thief!"))
else
pokemon=battler.pokemon
species=pokemon.species

)

Crazyninjaguy
February 27th, 2010, 02:10 PM
Have you tried using a snagball on them? That may work i don't know, i haven't played around with that feature yet.

carmaniac
February 27th, 2010, 02:15 PM
If got a problem with that Shadow Pokemon system in the newest version of the starterkit. Everytime I throw a pokeball to a Shadow Pokemon, it will be treated like if that Pokemon isn't a Shadow Pokemon, and thus my ball is blocked. If tried a lot of other branches to let it work, but they all failed. Anybody knows how to fix it?

(Just for sure, the lines where everything goes wrong:

if @opponent && (!pbIsSnagBall?(ball) || !battler.isShadow?)
@scene.pbThrowAndDeflect(ball,1)
pbDisplay(_INTL("The Trainer blocked the Ball!\nDon't be a thief!"))
else
pokemon=battler.pokemon
species=pokemon.species



)
You need to create an snag ball within the editor. To do this go into edit items and ad new item then, you create a new ball and there should be a list and near the bottom there should be an option to make it a snag ball (I think, I can't remember as I havn't used that feature often).

Mrchewy
February 27th, 2010, 05:20 PM
Thanks! I was also wondering, if I could use that, but have it search the website for a certain text.

Sort of like having a certain code like this...
XdQ8sK9X
...in my thread.

And I was thinking that maybe I could use a conditional branch to check if the website has that code somewhere on it.

It seems like a wacky idea, but maybe it's possible

Its certainly possible, but very tricky. You could replace the URL with, say, the thread URL and download the source code to a string, then just search through the data. This is a bit beyond my knowledge of RGSS, through; you should research it a bit more and find out what functions you could use to search through a string for a substring (in this case, your special code).

Maruno
February 27th, 2010, 06:19 PM
I've changed the characters overworld sprite and now it has a white background in-game, even though I've set the white to transparent. I've had this problem before, but can't remember how I fixed it then.
By this I assume you've just edited the picture file.

You need to re-import the picture file into RPG Maker XP (F10). Delete the old copy of the picture file from the list F10 pops up, and then import the new version.

Wichu
February 28th, 2010, 02:50 AM
Thanks! I was also wondering, if I could use that, but have it search the website for a certain text.

Sort of like having a certain code like this...
XdQ8sK9X
...in my thread.

And I was thinking that maybe I could use a conditional branch to check if the website has that code somewhere on it.

It seems like a wacky idea, but maybe it's possible

Of course it's possible; how do you think the Mystery Gift function in Raptor works? :P

You should use a regular expression to find the text you need. For example, if your text doesn't contain the symbol '#', you could enclose the code in '#'s, like so: #XdQ8sK9X#
Then, use a regular expression to search for a string in between two '#'s:
string[/#(.*?)#/]
code=$1
The '/'s around a string mean the string is treated as a regular expression. In a regular expression, '.' stands for any character, '*' means repeat the previous character an arbitrary number of times, and '?' after the '*' means it stops as soon as it gets to the second '#' (without the '?', it would continue as '#' falls under 'any character'). The brackets around part of the regular expression in this case are used to save the contents of the brackets (the code) into a global variable ($1, as it's the first pair of brackets. If you had another pair, their contents would be in $2 and so on). After using the regular expression, it's a good idea to copy the contents of the $1 variable to your own variable, as next time you use a regular expression, the $1 variable is overwritten.

delyemerald2
February 28th, 2010, 03:51 AM
You need to create an snag ball within the editor. To do this go into edit items and ad new item then, you create a new ball and there should be a list and near the bottom there should be an option to make it a snag ball (I think, I can't remember as I havn't used that feature often).

Ah, thanks! That wasn't included in the notes.
Small bad from Poccil =P

kweshaan212
February 28th, 2010, 11:09 AM
dont mind my post i just need this 1

Crazyninjaguy
February 28th, 2010, 12:04 PM
Well it's clogging up a topic in which people ask for help. Not to be a mini-mod but please don't do it again :/

Klofkac
March 1st, 2010, 07:49 AM
How I can replace transition by image or set transition for specific battle?

Crazyninjaguy
March 1st, 2010, 08:50 AM
For the image one, just do a show picture event command before you call the battle, that should show over the top of the transition.

As for the specific battle, i'm not too sure but try playing around with the execute transition command.

Cilerba
March 1st, 2010, 12:26 PM
Of course it's possible; how do you think the Mystery Gift function in Raptor works? :P

You should use a regular expression to find the text you need. For example, if your text doesn't contain the symbol '#', you could enclose the code in '#'s, like so: #XdQ8sK9X#
Then, use a regular expression to search for a string in between two '#'s:
string[/#(.*?)#/]
code=$1
The '/'s around a string mean the string is treated as a regular expression. In a regular expression, '.' stands for any character, '*' means repeat the previous character an arbitrary number of times, and '?' after the '*' means it stops as soon as it gets to the second '#' (without the '?', it would continue as '#' falls under 'any character'). The brackets around part of the regular expression in this case are used to save the contents of the brackets (the code) into a global variable ($1, as it's the first pair of brackets. If you had another pair, their contents would be in $2 and so on). After using the regular expression, it's a good idea to copy the contents of the $1 variable to your own variable, as next time you use a regular expression, the $1 variable is overwritten.

Thanks a lot! I am still confused where to put the codes though. What exactly would be the script to put. So sorry for being a pain :\

Death5 Shadow
March 1st, 2010, 02:35 PM
How long did it take you guys to unarchive this because it has taken me nearly 24 hours.

Crazyninjaguy
March 1st, 2010, 03:38 PM
Woah! For me it took about a minute and a half.
Which program did you use?

Death5 Shadow
March 1st, 2010, 04:02 PM
ehh mac unarchiver im going to get another one for mac

Crazyninjaguy
March 1st, 2010, 04:11 PM
Ah you have a mac, no use me recommending Winrar then :P

thepsynergist
March 1st, 2010, 09:20 PM
Does anyone know how to make it so that a movie (.avi file) plays before the title screen of my game? I know that Pokemon Essentials comes with the a script that plays movies, but I don't know how to call it before the title screen.

Crazyninjaguy
March 2nd, 2010, 07:53 AM
def pbCallTitle
if $DEBUG
return Scene_DebugIntro.new
else
# First parameter is an array of images in the Titles
# directory without a file extension, to show before the
# actual title screen. Second parameter is the actual
# title screen filename, also in Titles with no extension.
return Scene_Movie.new("INTRO")
end
end

Replace the PbCallTitle section in Main with that.
But remember to edit the end of Scene_Movie so that it goes to PokemonLoad afterwards.

thepsynergist
March 2nd, 2010, 10:51 AM
Quick and helpful as ever Crazyninjaguy. Thank you again for your help.

nmorr
March 2nd, 2010, 02:07 PM
How do you add your own fakemon to a game? When I did, it showed the pokemon, but there were over like, 10 lines between them. As if there were other pokemon, when I only added one......I hope I'm explaining this properly.

thepsynergist
March 2nd, 2010, 03:27 PM
Try adding a Pokemon with an id # of 494. If you start with that number, it will be right after Arceus.

tylerab01
March 2nd, 2010, 03:39 PM
I Think this might be off topic but How do I change the title screen music?

thepsynergist
March 2nd, 2010, 09:58 PM
Open your database within RPG Maker. Go to the system tab and you will see Title BGM. Select which ever you want.

adrian12
March 3rd, 2010, 06:13 AM
Since I can do a system of lateral battle I will give credits.

incognito322
March 3rd, 2010, 02:10 PM
Does anyone have the day/night tint colors that look close to the ones in Pokemon Diamond and Pearl? If not, that's okay; I just wanted to know if anyone else had done it before I go through a ton of trial and error editing that part of the script myself.

nmorr
March 3rd, 2010, 02:11 PM
Try adding a Pokemon with an id # of 494. If you start with that number, it will be right after Arceus.

Ah, sorry, Though, what should I do about it's icon?? The egg just comes up, also, what if I wanna add more then one??
It goes up to icon 539, which is the evolvtion of a shellos. PLEASE HELP!

thepsynergist
March 3rd, 2010, 07:57 PM
Think about how many Fakemon you want in your game. I would just give yourself 100 slots just for simplicity. After you decide, change the number in the filename of all the icons after Arceus (except for items only the Pokemon) by however many Fakemon you want. After that, I forgot where you tell the game what filename the egg is...I don't think it matters, just add the icons based on what the ID # of the Fakemon as normal and it should be okay. Perhaps someone else can explain it better, I forgot how I made mine work.

Vi-black
March 5th, 2010, 01:10 PM
Hi,

I got a problem with the sprites. My Pokémon Backsprites go higher and higher with every choice I make in battle (e.g. Attack). And often the Foe sprites appear way too high on their field.
I also looked at the usage notes, but can't find anything helpful.
I uploaded a screen to show what I mean...

h ttp://poketeam.square7.ch/spritetoohigh1.PNG


It would be very nice if someone could describe in detail what I need to change where to solve that problem... so that I can follow.
(I'm sorry for my English, hope you could understand me)

Vi-black

venom12
March 5th, 2010, 01:48 PM
Where i can edit maps types like with bug contest or safari zone i want to create my map type.

KingCharizard
March 5th, 2010, 01:54 PM
Ok, i have to questions... well more like requests...

1.During long battles the ally's sprite bounces and starts moving away from the bottom of the screen towards the top of the screen. I saw a fix for this awhile ago I cant find it has anyone seen it or does anyone have it and can they share?

2. Does anyone have D/P or HG/SS Trainer sprites already resized and ready to use in RMXP? if you do would u mind providing a link to download them? I can make the trainer sprites but I'd rather not waste my time doing so if its already been done...

EDIT: VI-Black posted the same problem as me so to confirm see his screenie for my first question.

Where i can edit maps types like with bug contest or safari zone i want to create my map type.

In the METADATA use the editor to edit the maps MATADATA