• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • 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.

-Free For All RMXP Pokémon CBS-

Status
Not open for further replies.

~Azura

Alright, purple is good.
512
Posts
18
Years
  • Seen Jun 21, 2012
I see, you're using plain text files to load data, isn't it (although I don't use rxdata extensions)? I use a method similar to that and then store the information on global variables, so I can load properly later.

However, some of the information I just input normally on RMXP's database, like battler graphic, Exp, Item held, Base Stats, etc, what saves me a lot of unnecessary work.

I have two classes to store Pokémon information: (comments are from my scripts)
Code:
#================================================================
#GAME_DATABASE
#================================================================
# This class converts values entered into RmXP's default
# database and create new variables to store those values,
# so it's more easy to read and update the code.
#
# NOTE:
#   game_id: unique ID for each Pokémon (even if they are the same kind)
#   pk_id: normal ID for each Pokémon
#
# So:
# Two Charizards have the same pk_id, but different game_id.
#
# Edit: (Build 6806)
#
# - removed setup_exp and setup_ev methods because they might
#   be unstable at the moment. They're not used.
# - created methods for returning data from database (build 3
#   directly retrieved that data to the hashes).
# - variable 'pk_id' is now a class variable.
#================================================================
class Game_Database
(...)
#==========================================================
#SETUP
#==========================================================
# This method create a hash (Hash.new) for every 'slot'
# in $database. Each slot will be accessed via 'pk_id'.
  def setup(pk_id)
    @pk_id = pk_id
    $database[@pk_id] = Hash.new(nil)
    $database[@pk_id]["Name"]         = name
    $database[@pk_id]["Type1"]         = type1
    $database[@pk_id]["Type2"]         = type2
    $database[@pk_id]["Growth Rate"]   = growth_rate
    $database[@pk_id]["Gender Ratio"]  = gender_ratio
    $database[@pk_id]["MaxHP"]         = maxhp
    $database[@pk_id]["Attack"]        = attack
    $database[@pk_id]["Defense"]       = defense
    $database[@pk_id]["Sp.Attack"]     = sp_attack
    $database[@pk_id]["Sp.Defense"]    = sp_defense
    $database[@pk_id]["Speed"]         = speed
    $database[@pk_id]["Base Exp"]      = base_exp
    $database[@pk_id]["Rareness"]      = rareness
    $database[@pk_id]["Wild Item"]     = wild_item
    $database[@pk_id]["Wild Item %"]   = wild_item_rate
    $database[@pk_id]["Battler Front"] = battler_front
    $database[@pk_id]["Battler Back"]  = battler_back
  end



Code:
#================================================================
#GAME_POKÉMON
#================================================================
# This class controls all the data that is unique
# for each Pokémon, like Nickname, Gender, Nature,
# Effort Values, Individual Values, etc.
# For Trainer's unique variables, refer to Game_Trainer class.
#
#
# Edit: (Build 6806)
#
# - removed methods and variables that might be unstable or
#   not used.
# - variable 'game_id' is now a class variable.
#================================================================
class Game_Pokemon
(...)
#==============================================================
#SETUP
#==============================================================
  def setup(pk_id, level, where, nickname)
    # Generate next unique ID:
    refresh_game_id
    # Correct level, if greater than MAX_LEVEL constant:
    level = level > MAX_LEVEL ? MAX_LEVEL : level
    # Create a hash for $game slot:
    $game[@game_id]
    $game[@game_id]["Name"]
    $game[@game_id]["Nickname"]
    $game[@game_id]["Level"]
    $game[@game_id]["Gender"]
    $game[@game_id]["Nature"]
    $game[@game_id]["Type1"]
    $game[@game_id]["Type2"]
    $game[@game_id]["Met In Where"]
    $game[@game_id]["Met In Level"]
    $game[@game_id]["Name Gender"]
    $game[@game_id]["Default ID"]
    $game[@game_id]["OT ID"]
    $game[@game_id]["OT Name"]
    $game[@game_id]["Item"]
    $game[@game_id]["Battler Front"]
    $game[@game_id]["Battler Back"]
    $game[@game_id]["Lucky Flag"]
    $game[@game_id]["Exp Now"]
    $game[@game_id]["Exp"]
    $game[@game_id]["IV"]
    $game[@game_id]["IV"]["MaxHP"]
    $game[@game_id]["IV"]["Attack"]
    $game[@game_id]["IV"]["Sp.Attack"]
    $game[@game_id]["IV"]["Defense"]
    $game[@game_id]["IV"]["Sp.Defense"]
    $game[@game_id]["IV"]["Speed"]
    $game[@game_id]["EV"]
    $game[@game_id]["EV"]["MaxHP"]
    $game[@game_id]["EV"]["Attack"]
    $game[@game_id]["EV"]["Sp.Attack"]
    $game[@game_id]["EV"]["Defense"]
    $game[@game_id]["EV"]["Sp.Defense"]
    $game[@game_id]["EV"]["Speed"]
    $game[@game_id]["Base Stat"]
    $game[@game_id]["Base Stat"]["MaxHP"]
    $game[@game_id]["Base Stat"]["Attack"]
    $game[@game_id]["Base Stat"]["Sp.Attack"]
    $game[@game_id]["Base Stat"]["Defense"]
    $game[@game_id]["Base Stat"]["Sp.Defense"]
    $game[@game_id]["Base Stat"]["Speed"]
    $game[@game_id]["Stat"]
    $game[@game_id]["Stat"]["MaxHP"]
    $game[@game_id]["Stat"]["HP"]
    $game[@game_id]["Stat"]["Attack"]
    $game[@game_id]["Stat"]["Sp.Attack"]
    $game[@game_id]["Stat"]["Defense"]
    $game[@game_id]["Stat"]["Sp.Defense"]
    $game[@game_id]["Stat"]["Speed"]
    $game[@game_id]["Move Name"] 
    $game[@game_id]["Move PP"]
    $game[@game_id]["Move PP Now"]
    $game[@game_id]["Move Critical Flag"]
    $game[@game_id]["Move Type"]
    $game[@game_id]["Move HM"]
    $game[@game_id]["Move Damage"]
    $game[@game_id]["Move Effect Type"]
    $game[@game_id]["Move Effect Rate"]
    $game[@game_id]["Move Accuracy"]
    $game[@game_id]["Move Priority"]
  end






As I write my code, I add new information to $game.
You can use that list if it helps you.
And dude... why bother using hex? To me it just makes things more complicated and your code more dirty...

And about Effort Values... they're are constant. You're mistaking with Internal Values (that are random, 0~31)
Check this:


http://www.upc.pkmn.co.uk/games/rs/guides/id.html said:
Individual Values
Individual Values range from 0 to 31. These values are important in determining the Pokemon's final stats. There are six Individual Values for HP, Attack, Defense, Speed, Special Attack, and Special Defense. They are randomly determined when you encounter a wild Pokemon or obtain a Pokemon internally.


http://www.upc.pkmn.co.uk/games/rs/guides/id.html said:
Effort Values

The Effort Values or EVs, indicate the amount of training that a Pokemon has made. Whenever a Pokemon defeats another Pokemon in an internal battle (wild or trainer), it will earn a number of EVs depending on the species of the Pokemon defeated. The limit that a Pokemon can earn is 510. A Pokemon can earn up to 255 EVs per stat (HP, Attack, Defense, Speed, Special Attack, Special Defense). The stat enhancers (HP Up, Protein, Iron, Carbos, Calcium, and Zinc, respectively) increase the EVs of the respective stat by 10. Each stat enhancer only takes effect if the EV for that stat would increase to 100 or less. In the Emerald version, certain Berries can decrease a Pokemon's effort values by 10 (Pomeg Berry, Kelpsy Berry, Qualot Berry, Tamato Berry, Hondew Berry, and Grepa Berry, respectively).

The Macho Brace and the PokeRus virus each will double the EVs that a Pokemon will earn.

Using Exp.Share gives the same amount of EVs to each participant in defeating a Pokemon. The Macho Brace and the PokeRus virus have no effect on this distribution.

When your Pokemon has earned the maximum of 510 EVs, it can receive an Effort Ribbon in Slateport's outdoor market.


~Azura.
 
89
Posts
17
Years
No I am not ::). Effort Values are training values. You can't 'set' them for a pokemon. For every pokémon they are set to zeró at the start of the game. They gain EV's. When Battling them. I guess what you DID set was the Battle EV you can gain from a pokémon, right?

For the data I first write everything done in RMXP. I use a module, so I do not need to do a global (the data is not going to change, so I go for less memory_usage). When I am done with a 'thing' like all base stats, I write it to a file in binmode. This means it will be saved as computer language. And at last I encrypt the files with my encryption tool that also can be used to encrypt music.

The site you used is good. I use it too, however... some things seem to differ from Ruby And Sapphire, I noticed... Either way... Like I said I used a module with Constants rather then a very big hash. So.. I guess Ill stick with that ;p...

http://www.upc.pkmn.co.uk/games/gs/guides/detervalues.html
DVs are based on a 16-digit scale of 0-15. There are four different stats a Pokémon has DVs for--Attack DV, Defense DV, Speed DV, and Special DV. The Special DV determines the Special Attack and Special Defense stats. There is a fifth kind of DV -- the HP DV -- which is determined by using all four of the other DVs.

The Deter Value comes in many different names - the Diversification Value, the Determination Value, the gene, the eigenvalue, and the Individual Value. There are many other names, but I prefer the Deter Value.


And dude... why bother using hex? To me it just makes things more complicated and your code more dirty...
^
It is equally fast for RMXP (from octals to haxadeciamls is one step, from octals to deciamals too). And If you want, you could just convert tha numbers ^^. It are hexadecimals because It is pulles out of the pokemon game, with a hack hex editor... XP
 
Last edited:

~Azura

Alright, purple is good.
512
Posts
18
Years
  • Seen Jun 21, 2012
p.s. - Effort Values << That is stupid. EV's are not constant

Of course EV's are constant, that's what I'm talking about. Growlithe always gives you 1 attack ev, Nidorino gives you 2 points, etc.

the data is not going to change

Wth, what do you mean by not going to change? Stats change all the time, and when your pokémon evolves? You're not thinking ahead...

In my 'big' hash ($pokemon) almost all the values are changed when the Pokémon battles or evolves.

The one that is fix is $database, that is not big at all.


It is equally fast for RMXP (from octals to haxadeciamls is one step, from octals to deciamals too).

Really fast. (...)

DVs are based on a 16-digit scale of 0-15. There are four different stats a Pokémon has DVs for--Attack DV, Defense DV, Speed DV, and Special DV. The Special DV determines the Special Attack and Special Defense stats. There is a fifth kind of DV -- the HP DV -- which is determined by using all four of the other DVs.

That's GS DV's (That is the same as the RS IV's, except that is ranges from 0 to 31)

They're NOT constant, so or you couldn't explain yourself right or you really did mistake them ;)
 

Dawson

The Rebirth Is Upon Us
9,727
Posts
20
Years
AzuraBR & Me™, this thead has kind of run it's course since the thread starter has quit the project, so I'm going to have to close this. By all means, continue your discussion in this thread to keep it all in one place. Thanks. Anyway..

-Closed-
 
Status
Not open for further replies.
Back
Top