Go Back   The PokéCommunity Forums > Creative Discussions > Game Development > Scripts & Tutorials
Reload this Page [Essentials script] Pokemon editing script for beginners

Notices
For all updates, view the main page.

Scripts & Tutorials This forum is for scripts and code, as well as all kinds of tutorials, software, tools and so forth. Remember to give credit!
The thread revival limit does not apply here.



Reply
 
Thread Tools
  #1    
Old October 24th, 2011 (08:17 AM). Edited October 26th, 2011 by PinkCatDragon.
PinkCatDragon's Avatar
PinkCatDragon PinkCatDragon is offline
The 17 year old programer. Now byte off
 
Join Date: Dec 2009
Location: 5cm meters from somthink with an IDE
Gender: Female
Nature: Calm
Posts: 320
Pokemon editing script for beginners
for essentals
Spoiler:
Code:
class PokeBattle_Pokemon
def moves
  return @moves
end
def moves=(val)
  @moves=val
end
# Time object specifying the time egg hatched.
def attack=(val)
@attack=val
end
def defense=(val)  
@defense=val
end
def speed=(val)
@speed=val
end         
def spatk=(val)
@spatk=val
end
def spdef=(val)
@spdef=val
end    
end
class Pokemon
  # Version 0.4 debug prints remove debug file write added
  def createpokemon(sp,lv,shiny=false,egg=false,steps=0)
    a=1
    sp1=sp+1 rescue  a=0
    if a==1
      sp1-=1
      else
      sp1=eval("PBSpecies::"+sp)
    end
    poke=PokeBattle_Pokemon.new(sp1,lv,$Trainer)
    if shiny==true
      poke.makeshiny
    end
    if egg==true
      egg=poke
      egg.calcStats
      egg.name=_INTL("EGG")
      egg.eggsteps=steps
      egg.makeshiny
      a=$Trainer.party.size
      if not a==6
      i=a-1
      $Trainer.party[i]=egg
      return "egg"
      end
    else
      return poke
    end
  end
  def createmoveset(move1=nil,move2=nil,move3=nil,move4=nil)
    moveset=[]
    if not move1==nil
    a=eval("PBMoves"+move1)
    moveset.push(a)
    end
    if not move2==nil
    a=eval("PBMoves"+move1)
    moveset.push(a)
    end
    if not move3==nil
    a=eval("PBMoves"+move1)
    moveset.push(a)
    end
    if not move4==nil
    a=eval("PBMoves"+move1)
    moveset.push(a)
    end
  return moveset
  end
  def createstatset(maxhp=nil,atk=nil,def1=nil,speed=nil,spatk=nil,spdef=nil)
    statset=[]
    statset.push(maxhp)
    statset.push(atk)
    statset.push(def1)
    statset.push(speed)
    statset.push(spatk)
    statset.push(spdef)
  end
  def complepokemon(pokemon,auto="add",moveset=[],statset=[])
    poke=pokemon
    a=moveset[0]
    if not a==nil
    pbAutolearnMove(poke,a)
    end
    a=moveset[1]
    if not a==nil
    pbAutolearnMove(poke,a)
    end
    a=moveset[2]
    if not a==nil
    pbAutolearnMove(poke,a)
    end
    a=moveset[3]
    if not a==nil
    pbAutolearnMove(poke,a)
    end
    if not statset[0]==nil
    poke.totalhp=statset[0]
    end
    if not statset[1]==nil
    poke.attack=statset[1]
    end
    if not statset[2]==nil
    poke.defense=statset[2]
    end
    if not statset[3]==nil
    poke.speed=statset[3]
    end
    if not statset[4]==nil
    poke.spatk=statset[4]
    end
    if not statset[5]==nil
    poke.spdef=statset[5]
    end
    if auto=="add"
      pbAddPokemon(poke)
      if $DEBUG
      make_pokey_file(poke)
      end
    elsif auto=="battle"
      pbWildBattle(poke,1)
    else
      return poke
    end
  end
  def make_pokey_file(poke)
    s1="name:"+poke.name+"\n"
    s2="hp:"+poke.totalhp.to_s+"\n"
    s3="atk:"+poke.attack.to_s+"\n"
    s4="def:"+poke.defense.to_s+"\n"
    s5="spatk:"+poke.spatk.to_s+"\n"
    s6="spdef:"+poke.spdef.to_s+"\n"
    s7="moves("
    s71=poke.moves[0].id.to_s+", "
    s72=poke.moves[1].id.to_s+", "
    s73=poke.moves[2].id.to_s+", "
    s74=poke.moves[3].id.to_s+") "
    s=s1+s2+s3+s4+s5+s6+s7+s71+s72+s73+s74
    File.open(poke.name+".pkm","wb"){|f|
    f.write(s)
    }
  end
end

This Has Bin remade and untested So i would like to request feedback
And ideas for new fetures
Exmple of use
  1. Script: $Pokemon=Pokemon.new poke=$pokemon.createpokemon("DRAKRAI",100)
  2. stats=createstatset(999,999,999,999,999,999)
  3. complepokemon(poke,"add",[],stats)
FUNchions
Createing a pokemon
Spoiler:
  1. createpokemon(sp,lv,shiny,egg,steps)
  2. shiny,egg and step have defaults so dont need to add
  3. eg createpokemon(sp,lv)
  4. eg2 createpokemon(sp,lv,shiny)
  5. eg3 createpokemon(sp,lv,shiny,egg,steps)
  6. sp=pokemon name or number DRAKRAI=491
  7. lv=pokemon level

Createing a moveset
Spoiler:

  1. createmoveset(move1,move2,move3,move4)
  2. all have defaults
  3. eg createmoveset(move1,move2,move3,move4)
  4. eg2 createmoveset(move1,move2,move3)
  5. eg3 createmoveset(move1,move2)
  6. eg4 createmoveset(move1)
  7. eg5 createmoveset
exmple use
  1. Script: $Pokemon=Pokemon.new poke=$pokemon.createpokemon("DRAKRAI",100)
  2. stats=createstatset(999,999,999,999,999,999)
  3. moves=createmoveset("HYDROPUMP","FLAMETHOWER","THUNDER")
  4. complepokemon(poke,"add",moves,stats)

Creadit not requed but not to be claimed as yours apples to versions 0.4 and up
Reply With Quote
  #2    
Old October 25th, 2011 (09:56 AM).
PinkCatDragon's Avatar
PinkCatDragon PinkCatDragon is offline
The 17 year old programer. Now byte off
 
Join Date: Dec 2009
Location: 5cm meters from somthink with an IDE
Gender: Female
Nature: Calm
Posts: 320
UPDATE
new complete rebuild
edit not yet made
Reply With Quote
  #3    
Old October 25th, 2011 (10:06 AM).
Lord Varion's Avatar
Lord Varion Lord Varion is offline
Guess who's back?
 
Join Date: Feb 2009
Age: 20
Gender: Other
Nature: Naughty
Posts: 2,648
This is for Essentials, yes?
I would be nice to have that in the first post, In case someone ''new'' comes along.
__________________
gone.
Reply With Quote
  #4    
Old October 25th, 2011 (10:11 AM). Edited October 25th, 2011 by PinkCatDragon.
PinkCatDragon's Avatar
PinkCatDragon PinkCatDragon is offline
The 17 year old programer. Now byte off
 
Join Date: Dec 2009
Location: 5cm meters from somthink with an IDE
Gender: Female
Nature: Calm
Posts: 320
edit done
thanks for the tip
new update the v0.2 would not load so its has a fix and a auto install pokemon stat edit
makeing it more or less plug in and play v0.3
contains stat editors but edits are only do able on createion

So how is this thing working for the beginers ask me questions you move edits stats edits

from exmple redidit and got my debug test result
filedebug
new pokemon 1
name:DARKRAI
hp:999
atk:999
def:999
spatk:999
spdef:999
moves(464, 417, 138, 399)
Reply With Quote
  #5    
Old October 26th, 2011 (03:44 AM).
PinkCatDragon's Avatar
PinkCatDragon PinkCatDragon is offline
The 17 year old programer. Now byte off
 
Join Date: Dec 2009
Location: 5cm meters from somthink with an IDE
Gender: Female
Nature: Calm
Posts: 320
Update Moveediting explend debug systems removed(err1,err2,err3)
debug file write
Reply With Quote
  #6    
Old November 26th, 2011 (07:03 AM).
PinkCatDragon's Avatar
PinkCatDragon PinkCatDragon is offline
The 17 year old programer. Now byte off
 
Join Date: Dec 2009
Location: 5cm meters from somthink with an IDE
Gender: Female
Nature: Calm
Posts: 320
Update script download:a
inculdes
editing
Reply With Quote
  #7    
Old November 26th, 2011 (12:52 PM).
IceGod64's Avatar
IceGod64 IceGod64 is offline
My imagination.
 
Join Date: Oct 2008
Location: Castelia City
Age: 27
Gender: Male
Nature: Naive
Posts: 604
The examples Darkrai's stats would reset to normal Darkrai stats if it was ever put in the PC or given a vitamin such as Calcium, HP up, etc. Anything that recalculates stats.

You shouldn't give the ability to edit stats directly, it's too faulty. Manipulation of IV's, EV's, and natures are what stays consistent.
__________________

Reply With Quote
Reply
Quick Reply

Sponsored Links

You may also like.. (Beta)
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

Forum Jump


All times are UTC -8. The time now is 03:10 AM.