The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Creative Discussions > Game Development > Pokémon Essentials
Sign Up Rules/FAQ Live Battle Blogs Mark Forums Read

Notices

Pokémon Essentials All questions and discussion about Pokémon Essentials, the Pokémon game kit for RPG Maker XP, go in here. Also contains links to the latest downloads and the Essentials Wiki.

Reply
 
Thread Tools
  #1    
Old January 7th, 2013, 11:50 PM
pokehackster's Avatar
pokehackster
 
Join Date: Jan 2009
Gender:
The past 2 days I have been attempting to implement 3 new types of encounters using the method described in the wiki. They are WaterMorning, WaterDay, and WaterNight, and I am near positive I have followed the instructions properly, but the external editor does not show them no matter what I do. I remember having the same problem when poccil was the one making the kit so is this something I am doing wrong or is this normal for the kit?

Defining them:
Code:
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
  WaterMorning = 13
  WaterDay     = 14
  WaterNight   = 15
  Names=[
    "Land",
    "Cave",
    "Water",
    "RockSmash",
    "OldRod",
    "GoodRod",
    "SuperRod",
    "HeadbuttLow",
    "HeadbuttHigh",
    "LandMorning",
    "LandDay",
    "LandNight",
    "BugContest",
    "WaterMorning",
    "WaterDay",
    "WaterNight"
  ]
  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],
    [60,30,5,4,1],
    [60,30,5,4,1],
    [60,30,5,4,1]
  ]
Compiler
Code:
      lastmapid=mapid
      if thisenc && (thisenc[1][EncounterTypes::Land] ||
                     thisenc[1][EncounterTypes::LandMorning] ||
                     thisenc[1][EncounterTypes::LandDay] ||
                     thisenc[1][EncounterTypes::BugContest] ||
                     thisenc[1][EncounterTypes::LandNight]
                     thisenc[1][EncounterTypes::WaterMorning] ||
                     thisenc[1][EncounterTypes::WaterDay] ||
                     thisenc[1][EncounterTypes::WaterNight] ||) &&
                     thisenc[1][EncounterTypes::Cave]
        raise _INTL("Can't define both Land and Cave encounters in the same area (map ID {1})",mapid)
      end
      thisenc=[[25,10,10,0,0,0,0,0,0,25,25,25,25,10,10,10],[]]
      encounters[mapid.to_i]=thisenc
      needdensity=true
      i+=1
      next
    end
    enclines=[12,12,5,5,2,3,5,8,8,12,12,12,12,5,5,5]
So that it cant be used on a cave map
Code:
    elsif needdensity
      needdensity=false
      nums=strsplit(line,/,/)
      if nums && nums.length>=3
        thisenc[0][EncounterTypes::Land]=nums[0].to_i
        thisenc[0][EncounterTypes::LandMorning]=nums[0].to_i
        thisenc[0][EncounterTypes::LandDay]=nums[0].to_i
        thisenc[0][EncounterTypes::LandNight]=nums[0].to_i
        thisenc[0][EncounterTypes::BugContest]=nums[0].to_i
        thisenc[0][EncounterTypes::Cave]=nums[1].to_i
        thisenc[0][EncounterTypes::Water]=nums[2].to_i
        thisenc[0][EncounterTypes::WaterMorning]=nums[2].to_i
        thisenc[0][EncounterTypes::WaterDay]=nums[2].to_i
        thisenc[0][EncounterTypes::WaterNight]=nums[2].to_i
Enabling it:


Code:
  def isGrass?
    return false if @density==nil
    return (@enctypes[EncounterTypes::Land] ||
            @enctypes[EncounterTypes::LandMorning] ||
            @enctypes[EncounterTypes::LandDay] ||
            @enctypes[EncounterTypes::LandNight] ||
            @enctypes[EncounterTypes::BugContest]) ? true : false
  end

  def isWater?
    return false if @density==nil
    return (@enctypes[EncounterTypes::Water] ||
            @enctypes[EncounterTypes::WaterMorning] ||
            @enctypes[EncounterTypes::WaterDay] ||
            @enctypes[EncounterTypes::WaterNight]) ? true : false
  end
Encounter Method
Code:
def pbEncounterType
    if $PokemonGlobal && $PokemonGlobal.surfing
      time=pbGetTimeNow
      enctype=EncounterTypes::Water
      enctype=EncounterTypes::WaterNight if self.hasEncounter?(EncounterTypes::WaterNight) && PBDayNight.isNight?(time)
      enctype=EncounterTypes::WaterDay if self.hasEncounter?(EncounterTypes::WaterDay) && PBDayNight.isDay?(time)
      enctype=EncounterTypes::WaterMorning if self.hasEncounter?(EncounterTypes::WaterMorning) && PBDayNight.isMorning?(time)
    elsif self.isCave?
      return EncounterTypes::Cave
    elsif self.isGrass?
      time=pbGetTimeNow
      enctype=EncounterTypes::Land
      enctype=EncounterTypes::LandNight if self.hasEncounter?(EncounterTypes::LandNight) && PBDayNight.isNight?(time)
      enctype=EncounterTypes::LandDay if self.hasEncounter?(EncounterTypes::LandDay) && PBDayNight.isDay?(time)
      enctype=EncounterTypes::LandMorning if self.hasEncounter?(EncounterTypes::LandMorning) && PBDayNight.isMorning?(time)
Allowing the Editor to Use the method:

Again so it cant be used on a cave map
Code:
elsif i==1
        dogen=true unless enc[1][EncounterTypes::Land] || 
                          enc[1][EncounterTypes::LandMorning] || 
                          enc[1][EncounterTypes::LandDay] || 
                          enc[1][EncounterTypes::LandNight] || 
                          enc[1][EncounterTypes::BugContest] || 
                          enc[1][EncounterTypes::WaterMorning] || 
                          enc[1][EncounterTypes::WaterDay] || 
                          enc[1][EncounterTypes::WaterNight]
and for its density
Code:
  enc[0][EncounterTypes::LandMorning]=enc[0][EncounterTypes::Land]
  enc[0][EncounterTypes::LandDay]=enc[0][EncounterTypes::Land]
  enc[0][EncounterTypes::LandNight]=enc[0][EncounterTypes::Land]
  enc[0][EncounterTypes::BugContest]=enc[0][EncounterTypes::Land]
  enc[0][EncounterTypes::WaterMorning]=enc[0][EncounterTypes::Water]
  enc[0][EncounterTypes::WaterDay]=enc[0][EncounterTypes::Water]
  enc[0][EncounterTypes::WaterNight]=enc[0][EncounterTypes::Water]
With all of it like that I still get this

I've Probably done something wrong in all of this, but I'm terrible with scripting so I have no idea what it is so I could really use some help here.

Edit: here is the tutorial I was following http://pokemonessentials.wikia.com/w...ounter_methods
__________________
Pokémon Dual Shades

My deviantART

Sometimes you just have to ask your self "would I rather be crazy or stupid?"
Reply With Quote
  #2    
Old January 8th, 2013, 06:48 AM
Maruno's Avatar
Maruno
Lead Dev of Pokémon Essentials
 
Join Date: Jan 2008
Location: England
Code:
      lastmapid=mapid
      if thisenc && (thisenc[1][EncounterTypes::Land] ||
                     thisenc[1][EncounterTypes::LandMorning] ||
                     thisenc[1][EncounterTypes::LandDay] ||
                     thisenc[1][EncounterTypes::BugContest] ||
                     thisenc[1][EncounterTypes::LandNight] ||
                     thisenc[1][EncounterTypes::WaterMorning] ||
                     thisenc[1][EncounterTypes::WaterDay] ||
                     thisenc[1][EncounterTypes::WaterNight] ||) &&
                     thisenc[1][EncounterTypes::Cave]
        raise _INTL("Can't define both Land and Cave encounters in the same area (map ID {1})",mapid)
      end
      thisenc=[[25,10,10,0,0,0,0,0,0,25,25,25,25,10,10,10],[]]
      encounters[mapid.to_i]=thisenc
      needdensity=true
      i+=1
      next
    end
    enclines=[12,12,5,5,2,3,5,8,8,12,12,12,12,5,5,5]
Code:
def pbEncounterType
    if $PokemonGlobal && $PokemonGlobal.surfing
      time=pbGetTimeNow
      enctype=EncounterTypes::Water
      enctype=EncounterTypes::WaterNight if self.hasEncounter?(EncounterTypes::WaterNight) && PBDayNight.isNight?(time)
      enctype=EncounterTypes::WaterDay if self.hasEncounter?(EncounterTypes::WaterDay) && PBDayNight.isDay?(time)
      enctype=EncounterTypes::WaterMorning if self.hasEncounter?(EncounterTypes::WaterMorning) && PBDayNight.isMorning?(time)
      return enctype
    elsif self.isCave?
      return EncounterTypes::Cave
    elsif self.isGrass?
      time=pbGetTimeNow
      enctype=EncounterTypes::Land
      enctype=EncounterTypes::LandNight if self.hasEncounter?(EncounterTypes::LandNight) && PBDayNight.isNight?(time)
      enctype=EncounterTypes::LandDay if self.hasEncounter?(EncounterTypes::LandDay) && PBDayNight.isDay?(time)
      enctype=EncounterTypes::LandMorning if self.hasEncounter?(EncounterTypes::LandMorning) && PBDayNight.isMorning?(time)
I've tried out the exact same thing, and discovered two problems which I've highlighted above. The first has the || in the wrong place, which I'm surprised doesn't cause a bigger problem, and the second wouldn't actually allow any encounters on water because no encounter method is returned. Add in the green bits, and remove the red bit.

I fixed those two things, and I got the new methods in the Editor. I didn't test what happened before I fixed those bugs, though, but that's not important.
__________________
Reply With Quote
  #3    
Old January 8th, 2013, 09:28 AM
pokehackster's Avatar
pokehackster
 
Join Date: Jan 2009
Gender:
Quote:
Originally Posted by Maruno View Post
I've tried out the exact same thing, and discovered two problems which I've highlighted above. The first has the || in the wrong place, which I'm surprised doesn't cause a bigger problem, and the second wouldn't actually allow any encounters on water because no encounter method is returned. Add in the green bits, and remove the red bit.

I fixed those two things, and I got the new methods in the Editor. I didn't test what happened before I fixed those bugs, though, but that's not important.
Well thanks for bailing me out again Maruno, and sorry for having you be a glorified code checker on the first mistake, and as for the second one.... well I suck at scripting soooo I had no idea XD
__________________
Pokémon Dual Shades

My deviantART

Sometimes you just have to ask your self "would I rather be crazy or stupid?"
Reply With Quote
Reply
Quick Reply

Sponsored Links
Thread Tools

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

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



All times are UTC -8. The time now is 10:33 PM.


Style by Nymphadora, artwork by Sa-Dui.
Like our Facebook Page Follow us on Twitter © 2002 - 2014 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2014 The PokéCommunity / PokéCommunity.com.
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator.