• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Our weekly protagonist poll is now up! Vote for your favorite Trading Card Game 2 protagonist in the poll by clicking here.
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

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

Status
Not open for further replies.
/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.
 
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: 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!
 
/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.

Code:
#===============================================================================
# Pokemon Essentials Region Battle Music
# By Crazyninjaguy
# https://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
end
This 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.

MinorThreat0987 said:
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?

~Money Stack~ said:
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.

RiJaN_nEa said:
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 :)
 
Last edited:
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:

Code:
#===============================================================================
# Pokemon Essentials Regional Battle Music
# By Crazyninjaguy
# https://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
 
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
---------------------------
 
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?
 
Hmmm, not too sure.

Try this version:

Code:
#===============================================================================
# Pokemon Essentials Region Battle Music
# By Crazyninjaguy
# https://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
 
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?
 
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
---------------------------
 
Last edited:
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. :)
 
[QUOTE="RiJaN_nEa, post: 5573739, member: 195682"]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.
[B]File PBS/trainers.txt, line 6
MAGIKARP,8,10,,Splash,false,false[/B]
 
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   
---------------------------[/QUOTE]

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.
 
@thepsynergist, sorry >.<
Here's another fix, you shouldnt have any problems with this one :)

Code:
#===============================================================================
# Pokemon Essentials Region Battle Music
# By Crazyninjaguy
# https://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
 
Last edited:
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.
 
Hello
How can I change the scripts so we actually see berry sprites when you planted a berry ??
 
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?
 
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.
 
Status
Not open for further replies.
Back
Top