PDA

View Full Version : [Essentials script] Diamond And Pearl Battle System-CNG


nmorr
August 10th, 2010, 10:20 AM
This is a dual screen system created by CNG for his game, here's a quote from him.

Well due to the shutdown of Pokemon Twilight, i've decided to release the first version of the battle system.
It's a Diamond/Pearl battle system, fully mouse controlled.

Demo Video:

http://www.youtube.com/watch?v=Vh-eL7gKBgI&feature=player_embedded

Just put the scripts in new script sections above main, and the pictures into the Graphics/Pictures folder. And give credit if used!

Must be used with my dual screen system, found here:http://www.planetdev.net/index.php?showtopic=148

Battle System-
http://www.mediafire.com/?hgbay2h3dmi

EXSCLUSIVELY FOR PLANETDEV.

Remember to give credit to CNG, and here's the official thread,
http://www.planetdev.net/index.php?showtopic=448

Crazyninjaguy
August 10th, 2010, 10:56 AM
Please read the last line that you quoted.
I don't like to say things like this, but i said exclusively for PlanetDev as i wanted my members to get it first.

carmaniac
August 10th, 2010, 11:08 AM
Lmao, is this not the second time now that nmorr has posted a script from planet dev exclusives?

nmorr
August 10th, 2010, 11:58 AM
Seriously, dang...emarassing. Alright, I'll remove it.

@Carmaniac: No, this is the first time...I think lol.

Crazyninjaguy
August 10th, 2010, 01:01 PM
Nono it's fine now, people already have it, but next time just read the post a little more carefully :)

I usually release all of my scripts to my website only, and then others after a week or so.

nmorr
August 11th, 2010, 10:35 AM
Oh, Okay, srry. I'll let u do it from now on.

Meowth
August 11th, 2010, 11:58 AM
Well, since it's up... can we ask questions about it? :O Like, make an official thread or something maybe..?

Crazyninjaguy
August 11th, 2010, 12:06 PM
Well there's not much point making a whole new thread lol, just ask away in here and i'll try my best to answer.

Meowth
August 11th, 2010, 01:02 PM
I see. Well I'm noticing it isn't working with my version of Essentials... D;

nmorr
August 12th, 2010, 08:26 AM
I'm using the may 7 version and it works perfectly fine for me. What version r u using?

ashthebest10
August 12th, 2010, 12:09 PM
I get this error when the battle starts. I am using Luka's animated pokemon script so I dont know if this may be causing the error, but I would appriciate some help. Thanks!

Exception: NoMethodError
Message: undefined method `bitmap' for #<BitmapWrapper:0x72af890>
DP Battle:343:in `setPokemonBitmap'
DP Battle:1545:in `pbStartBattle'
PokeBattle_Battle:585:in `pbStartBattleCore'
PokeBattle_Battle:493:in `pbStartBattle'
PokemonField:766:in `pbWildBattle'
PokemonField:765:in `pbSceneStandby'
PokemonField:767:in `pbWildBattle'
PokemonField:764:in `pbBattleAnimation'
PokemonField:764:in `pbWildBattle'
PokemonField:1103:in `pbBattleOnStepTaken'

EDIT: Okay I removed the Animation script and it works great! Any suggestions on how to add Luka's Animation script? Maybe try adding it now?

EDIT AGAIN!: Sorry, but i readded the animation script after the DP PT battle and it works now. I'm having trouble with the dual screen. sometimes when I move a certain way parts of the top screen will appear on the bottom or the bottom screen shows the below map all together. IDK whats wrong but if anyone has had this problem please help me. Thanks!

Yuoaman
August 12th, 2010, 12:14 PM
Moving this to the Resource Center, where it might fit a little better.

pokemad
August 15th, 2010, 04:49 AM
Great.
Any way to stop the cursor from freezing in position while not battling

zingzags
August 15th, 2010, 12:25 PM
Great.
Any way to stop the cursor from freezing in position while not battling

thats more advance stuff, you need to learn about the updates and etc....
For example

Graphics.update
Input.update
Mouse.update

its required for CNG Dual Screen and Mouse Module.

DarkDragonn
August 15th, 2010, 06:20 PM
Great script Crazyninjaguy, this will be usefull for alot of people including me xD

Crazyninjaguy
August 16th, 2010, 01:24 AM
Np :)

If you're having trouble with this script, please do not use it until i've made it work with the newest version of essentials.

zingzags
August 16th, 2010, 05:43 AM
This script is working perfectly with the new essentials im using the may 7th, and the only problem is the icon remove delay on the pokemon. Other than that it is working fine.

nmorr
August 16th, 2010, 06:15 AM
I agree, though the icon remove delay isn't really such a big deal. In the actual Pokemon Diamond and Pearl, after you tapped attack, the screen delayed for a second.

zingzags
August 16th, 2010, 07:37 AM
Well i found something else, I seen the double battle, and I was wondering how do you move the double battle command box that came with piccol.
http://i37.tinypic.com/2dt6p89.png

nmorr
August 16th, 2010, 08:46 AM
Well i found something else, I seen the double battle, and I was wondering how do you move the double battle command box that came with piccol.
http://i37.tinypic.com/2dt6p89.png

Yeah, I noticed that too. Except I can't find a way to change it. Any help CNG?

Crazyninjaguy
August 16th, 2010, 09:21 AM
As i said four posts above,

If you're having trouble with this script, please do not use it until i've made it work with the newest version of essentials.

zingzags
August 16th, 2010, 09:38 AM
LMao sorry i didnt notice :P, ill try to fix it brb looking throught 5000 line + of code

lark125
August 18th, 2010, 11:41 AM
heey can anyone please help me with somthing i crasyninjaguy's dualscreen and mous input script and now i want to make a touchable menu but its not working for me if i use his tutorial for a touchable menu and this is how it the scripts looks like class PokemonMenu_Scene
def pbShowCommands(commands)
ret=-1
cmdwindow=@sprites["cmdwindow"]
cmdwindow.viewport=@viewport
cmdwindow.index=$PokemonTemp.menuLastChoice
cmdwindow.resizeToFit(commands)
cmdwindow.commands=commands
cmdwindow.x=Graphics.width-cmdwindow.width
cmdwindow.y=0
cmdwindow.visible=true
loop do
cmdwindow.update
Graphics.update
Input.update
pbUpdateSceneMap
Mouse.update
$mouse.x = Mouse.pos_x
$mouse.y = Mouse.pos_y
if Input.trigger?(Input::B)
ret=-1
break
end
if Input.trigger?(Input::C)
ret=cmdwindow.index
$PokemonTemp.menuLastChoice=ret
break
end
end
return ret
end
def pbShowInfo(text)
@sprites["infowindow"].resizeToFit(text,Graphics.height)
@sprites["infowindow"].text=text
@sprites["infowindow"].visible=true
@infostate=true
end
def pbShowHelp(text)
@sprites["helpwindow"].resizeToFit(text,Graphics.height)
@sprites["helpwindow"].text=text
@sprites["helpwindow"].visible=true
@helpstate=true
pbBottomLeft(@sprites["helpwindow"])
end
def pbStartScene
@viewport=Viewport.new(0,0,Graphics.width,Graphics.height)
@viewport.z=99999
@sprites={}
@sprites["cmdwindow"]=Window_CommandPokemon.new([])
@sprites["menu-bag"]=IconSprite.new(0, 360)
@sprites["menu-bag"].setBitmap("Graphics/Pictures/menu-bag.png")
@sprites["infowindow"]=Window_UnformattedTextPokemon.newWithSize("",0,0,32,32,@viewport)
@sprites["infowindow"].visible=false
@sprites["helpwindow"]=Window_UnformattedTextPokemon.newWithSize("",0,0,32,32,@viewport)
@sprites["helpwindow"].visible=false
@sprites["cmdwindow"].visible=false
@infostate=false
@helpstate=false
pbSEPlay("menu")
end
def pbHideMenu
@sprites["cmdwindow"].visible=false
@sprites["infowindow"].visible=false
@sprites["helpwindow"].visible=false
end
def pbShowMenu
@sprites["cmdwindow"].visible=true
@sprites["infowindow"].visible=@infostate
@sprites["helpwindow"].visible=@helpstate
end
def pbEndScene
pbDisposeSpriteHash(@sprites)
@viewport.dispose
end
def pbRefresh
end
end

class PokemonMenu
def initialize(scene)
@scene=scene
end
def pbShowMenu
@scene.pbRefresh
@scene.pbShowMenu
end
def pbStartPokemonMenu
@scene.pbStartScene
endscene=true
commands=[]
cmdPokedex=-1
cmdPokemon=-1
cmdBag=-1
cmdTrainer=-1
cmdSave=-1
cmdOption=-1
cmdPokegear=-1
cmdDebug=-1
cmdQuit=-1
if !$Trainer
if $DEBUG
Kernel.pbMessage(_INTL("The player trainer was not defined, so the menu can't be displayed."))
Kernel.pbMessage(_INTL("Please see the documentation to learn how to set up the trainer player."))
end
return
end
commands[cmdPokedex=commands.length]=_INTL("POKéDEX") if $Trainer.pokedex
commands[cmdPokemon=commands.length]=_INTL("POKéMON") if $Trainer.party.length>0
commands[cmdBag=commands.length]=_INTL("BAG") if !pbInBugContest?
commands[cmdPokegear=commands.length]=_INTL("POKéGEAR") if $Trainer.pokegear
commands[cmdTrainer=commands.length]=$Trainer.name
if pbInSafari?
@scene.pbShowInfo(_INTL("STEPS: {1}/600\nBALLS: {2}",pbSafariState.steps,pbSafariState.ballcount))
commands[cmdQuit=commands.length]=_INTL("QUIT")
elsif pbInBugContest?
if pbBugContestState.lastPokemon
@scene.pbShowInfo(_INTL("CAUGHT: {1}\nLEVEL: {2}\nBALLS: {3}",
PBSpecies.getName(pbBugContestState.lastPokemon.species),
pbBugContestState.lastPokemon.level,
pbBugContestState.ballcount))
else
@scene.pbShowInfo(_INTL("CAUGHT: None\nBALLS: {1}",pbBugContestState.ballcount))
end
commands[cmdQuit=commands.length]=_INTL("QUIT")
else
commands[cmdSave=commands.length]=_INTL("SAVE") if !$game_system || !$game_system.save_disabled
end
commands[cmdOption=commands.length]=_INTL("OPTION")
commands[cmdDebug=commands.length]=_INTL("DEBUG") if $DEBUG
commands[commands.length]=_INTL("EXIT")
loop do
if Mouse.mouse_in_area?(0, 360, 60, 39)
if Mouse.click?(1)
pbFadeOutIn(99999) {
scene=PokemonPokedexScene.new
screen=PokemonPokedex.new(scene)
screen.pbStartScreen
@scene.pbRefresh
}
end
end
command=@scene.pbShowCommands(commands)
if cmdPokedex>=0 && command==cmdPokedex
pbFadeOutIn(99999) {
scene=PokemonPokedexScene.new
screen=PokemonPokedex.new(scene)
screen.pbStartScreen
@scene.pbRefresh
}
elsif cmdPokegear>=0 && command==cmdPokegear
pbLoadRpgxpScene(Scene_Pokegear.new)
elsif cmdPokemon>=0 && command==cmdPokemon
sscene=PokemonScreen_Scene.new
sscreen=PokemonScreen.new(sscene,$Trainer.party)
hiddenmove=nil
pbFadeOutIn(99999) {
hiddenmove=sscreen.pbPokemonScreen
if hiddenmove
@scene.pbEndScene
else
@scene.pbRefresh
end
}
if hiddenmove
Kernel.pbUseHiddenMove(hiddenmove[0],hiddenmove[1])
return
end
elsif cmdBag>=0 && command==cmdBag
item=0
scene=PokemonBag_Scene.new
screen=PokemonBagScreen.new(scene,$PokemonBag)
pbFadeOutIn(99999) {
item=screen.pbStartScreen
if item>0
@scene.pbEndScene
else
@scene.pbRefresh
end
}
if item>0
Kernel.pbUseKeyItemInField(item)
return
end
elsif cmdTrainer>=0 && command==cmdTrainer
PBDebug.logonerr {
scene=PokemonTrainerCardScene.new
screen=PokemonTrainerCard.new(scene)
pbFadeOutIn(99999) {
screen.pbStartScreen
@scene.pbRefresh
}
}
elsif cmdQuit>=0 && command==cmdQuit
@scene.pbHideMenu
if pbInSafari?
if Kernel.pbConfirmMessage(_INTL("Would you like to leave the Safari Game right now?"))
@scene.pbEndScene
pbSafariState.decision=1
pbSafariState.pbGoToStart
return
else
pbShowMenu
end
else
if Kernel.pbConfirmMessage(_INTL("Would you like to end the Contest now?"))
@scene.pbEndScene
pbBugContestState.pbStartJudging
return
else
pbShowMenu
end
end
elsif cmdSave>=0 && command==cmdSave
@scene.pbHideMenu
scene=PokemonSaveScene.new
screen=PokemonSave.new(scene)
if screen.pbSaveScreen
@scene.pbEndScene
endscene=false
break
else
pbShowMenu
end
elsif cmdDebug>=0 && command==cmdDebug
pbFadeOutIn(99999) {
pbDebugMenu
@scene.pbRefresh
}
elsif cmdOption>=0 && command==cmdOption
scene=PokemonOptionScene.new
screen=PokemonOption.new(scene)
pbFadeOutIn(99999) {
screen.pbStartScreen
pbUpdateSceneMap
@scene.pbRefresh
}
else
break
end
end
@scene.pbEndScene if endscene
end
endit doesn't work when i click on it does nothing so can anyone help me please

thanks

Jefelin
August 19th, 2010, 11:34 AM
Good, I have the pokestarter 2008 and modified some scripts (and current pokebattle battle scene, I think) to get movement in the pokes (recommended by Luka) maybe that's why it gives me this error:


I fix it, thank you very much for your scripts are amaizing
I tried it in the version of May 7 and it worked perfect, please do a bit of help and sorry for my English :(

lark125
August 20th, 2010, 07:35 AM
please someone can you anser my question


heey can anyone please help me with somthing i crasyninjaguy's dualscreen and mous input script and now i want to make a touchable menu but its not working for me if i use his tutorial for a touchable menu and this is how it the scripts looks like class PokemonMenu_Scene
def pbShowCommands(commands)
ret=-1
cmdwindow=@sprites["cmdwindow"]
cmdwindow.viewport=@viewport
cmdwindow.index=$PokemonTemp.menuLastChoice
cmdwindow.resizeToFit(commands)
cmdwindow.commands=commands
cmdwindow.x=Graphics.width-cmdwindow.width
cmdwindow.y=0
cmdwindow.visible=true
loop do
cmdwindow.update
Graphics.update
Input.update
pbUpdateSceneMap
Mouse.update
$mouse.x = Mouse.pos_x
$mouse.y = Mouse.pos_y
if Input.trigger?(Input::B)
ret=-1
break
end
if Input.trigger?(Input::C)
ret=cmdwindow.index
$PokemonTemp.menuLastChoice=ret
break
end
end
return ret
end
def pbShowInfo(text)
@sprites["infowindow"].resizeToFit(text,Graphics.height)
@sprites["infowindow"].text=text
@sprites["infowindow"].visible=true
@infostate=true
end
def pbShowHelp(text)
@sprites["helpwindow"].resizeToFit(text,Graphics.height)
@sprites["helpwindow"].text=text
@sprites["helpwindow"].visible=true
@helpstate=true
pbBottomLeft(@sprites["helpwindow"])
end
def pbStartScene
@viewport=Viewport.new(0,0,Graphics.width,Graphics.height)
@viewport.z=99999
@sprites={}
@sprites["cmdwindow"]=Window_CommandPokemon.new([])
@sprites["menu-bag"]=IconSprite.new(0, 360)
@sprites["menu-bag"].setBitmap("Graphics/Pictures/menu-bag.png")
@sprites["infowindow"]=Window_UnformattedTextPokemon.newWithSize("",0,0,32,32,@viewport)
@sprites["infowindow"].visible=false
@sprites["helpwindow"]=Window_UnformattedTextPokemon.newWithSize("",0,0,32,32,@viewport)
@sprites["helpwindow"].visible=false
@sprites["cmdwindow"].visible=false
@infostate=false
@helpstate=false
pbSEPlay("menu")
end
def pbHideMenu
@sprites["cmdwindow"].visible=false
@sprites["infowindow"].visible=false
@sprites["helpwindow"].visible=false
end
def pbShowMenu
@sprites["cmdwindow"].visible=true
@sprites["infowindow"].visible=@infostate
@sprites["helpwindow"].visible=@helpstate
end
def pbEndScene
pbDisposeSpriteHash(@sprites)
@viewport.dispose
end
def pbRefresh
end
end

class PokemonMenu
def initialize(scene)
@scene=scene
end
def pbShowMenu
@scene.pbRefresh
@scene.pbShowMenu
end
def pbStartPokemonMenu
@scene.pbStartScene
endscene=true
commands=[]
cmdPokedex=-1
cmdPokemon=-1
cmdBag=-1
cmdTrainer=-1
cmdSave=-1
cmdOption=-1
cmdPokegear=-1
cmdDebug=-1
cmdQuit=-1
if !$Trainer
if $DEBUG
Kernel.pbMessage(_INTL("The player trainer was not defined, so the menu can't be displayed."))
Kernel.pbMessage(_INTL("Please see the documentation to learn how to set up the trainer player."))
end
return
end
commands[cmdPokedex=commands.length]=_INTL("POKéDEX") if $Trainer.pokedex
commands[cmdPokemon=commands.length]=_INTL("POKéMON") if $Trainer.party.length>0
commands[cmdBag=commands.length]=_INTL("BAG") if !pbInBugContest?
commands[cmdPokegear=commands.length]=_INTL("POKéGEAR") if $Trainer.pokegear
commands[cmdTrainer=commands.length]=$Trainer.name
if pbInSafari?
@scene.pbShowInfo(_INTL("STEPS: {1}/600\nBALLS: {2}",pbSafariState.steps,pbSafariState.ballcount))
commands[cmdQuit=commands.length]=_INTL("QUIT")
elsif pbInBugContest?
if pbBugContestState.lastPokemon
@scene.pbShowInfo(_INTL("CAUGHT: {1}\nLEVEL: {2}\nBALLS: {3}",
PBSpecies.getName(pbBugContestState.lastPokemon.species),
pbBugContestState.lastPokemon.level,
pbBugContestState.ballcount))
else
@scene.pbShowInfo(_INTL("CAUGHT: None\nBALLS: {1}",pbBugContestState.ballcount))
end
commands[cmdQuit=commands.length]=_INTL("QUIT")
else
commands[cmdSave=commands.length]=_INTL("SAVE") if !$game_system || !$game_system.save_disabled
end
commands[cmdOption=commands.length]=_INTL("OPTION")
commands[cmdDebug=commands.length]=_INTL("DEBUG") if $DEBUG
commands[commands.length]=_INTL("EXIT")
loop do
if Mouse.mouse_in_area?(0, 360, 60, 39)
if Mouse.click?(1)
pbFadeOutIn(99999) {
scene=PokemonPokedexScene.new
screen=PokemonPokedex.new(scene)
screen.pbStartScreen
@scene.pbRefresh
}
end
end
command=@scene.pbShowCommands(commands)
if cmdPokedex>=0 && command==cmdPokedex
pbFadeOutIn(99999) {
scene=PokemonPokedexScene.new
screen=PokemonPokedex.new(scene)
screen.pbStartScreen
@scene.pbRefresh
}
elsif cmdPokegear>=0 && command==cmdPokegear
pbLoadRpgxpScene(Scene_Pokegear.new)
elsif cmdPokemon>=0 && command==cmdPokemon
sscene=PokemonScreen_Scene.new
sscreen=PokemonScreen.new(sscene,$Trainer.party)
hiddenmove=nil
pbFadeOutIn(99999) {
hiddenmove=sscreen.pbPokemonScreen
if hiddenmove
@scene.pbEndScene
else
@scene.pbRefresh
end
}
if hiddenmove
Kernel.pbUseHiddenMove(hiddenmove[0],hiddenmove[1])
return
end
elsif cmdBag>=0 && command==cmdBag
item=0
scene=PokemonBag_Scene.new
screen=PokemonBagScreen.new(scene,$PokemonBag)
pbFadeOutIn(99999) {
item=screen.pbStartScreen
if item>0
@scene.pbEndScene
else
@scene.pbRefresh
end
}
if item>0
Kernel.pbUseKeyItemInField(item)
return
end
elsif cmdTrainer>=0 && command==cmdTrainer
PBDebug.logonerr {
scene=PokemonTrainerCardScene.new
screen=PokemonTrainerCard.new(scene)
pbFadeOutIn(99999) {
screen.pbStartScreen
@scene.pbRefresh
}
}
elsif cmdQuit>=0 && command==cmdQuit
@scene.pbHideMenu
if pbInSafari?
if Kernel.pbConfirmMessage(_INTL("Would you like to leave the Safari Game right now?"))
@scene.pbEndScene
pbSafariState.decision=1
pbSafariState.pbGoToStart
return
else
pbShowMenu
end
else
if Kernel.pbConfirmMessage(_INTL("Would you like to end the Contest now?"))
@scene.pbEndScene
pbBugContestState.pbStartJudging
return
else
pbShowMenu
end
end
elsif cmdSave>=0 && command==cmdSave
@scene.pbHideMenu
scene=PokemonSaveScene.new
screen=PokemonSave.new(scene)
if screen.pbSaveScreen
@scene.pbEndScene
endscene=false
break
else
pbShowMenu
end
elsif cmdDebug>=0 && command==cmdDebug
pbFadeOutIn(99999) {
pbDebugMenu
@scene.pbRefresh
}
elsif cmdOption>=0 && command==cmdOption
scene=PokemonOptionScene.new
screen=PokemonOption.new(scene)
pbFadeOutIn(99999) {
screen.pbStartScreen
pbUpdateSceneMap
@scene.pbRefresh
}
else
break
end
end
@scene.pbEndScene if endscene
end
endit doesn't work when i click on it does nothing so can anyone help me please

thanks

carmaniac
August 20th, 2010, 08:12 AM
please someone can you anser my question

Really am starting to get sick of people posting about how they can't get a touchable menu working so here's an idea, find out what you have to do, learn how to script, then put them together and try scripting a menu then before jumping right in without any knowledge of scripting.

thepsynergist
August 20th, 2010, 01:23 PM
Or better yet, just use what you've got. If you can't make an interesting game with the features already in the starter kit, unless you are good at scripting, then don't bother. We've enough games in this forum that never get completed because people don't want to take the time to make a game that's worth playing.

Poeman
August 20th, 2010, 01:28 PM
I made a "touchable menu" from using mouse input and eventing before :P it just wasn't with two screens :P

Guys just put some effort in and read, I mean CNG even said he isn't helping.

zingzags
August 20th, 2010, 06:47 PM
I made a "touchable menu" from using mouse input and eventing before :P it just wasn't with two screens :P

Guys just put some effort in and read, I mean CNG even said he isn't helping.

LOL thankyou!, I guess no one can read these days.

lark125
August 21st, 2010, 08:23 AM
look i used his tutorials but it wont work so please can anyone help thats just wat iam asking not to make a whole script its just not working thats is all

zingzags
August 21st, 2010, 01:25 PM
look i used his tutorials but it wont work so please can anyone help thats just wat iam asking not to make a whole script its just not working thats is all

OKay you need more than his tutorials, you also need to learn how to code.

lark125
August 21st, 2010, 02:04 PM
look i can code a little bit but i realy want to make my game dualscreen with a touch menu so if anyone could help me there are threads for i thougt so you can help people or am i wrong ??

carmaniac
August 21st, 2010, 04:14 PM
look i can code a little bit but i realy want to make my game dualscreen with a touch menu so if anyone could help me there are threads for i thougt so you can help people or am i wrong ??
I'll give you a few pointers here and there just because you seem like you're making an effort unlike most who have tried using cng's script.

lark125
August 22nd, 2010, 03:01 AM
thanks i guess :P, but back to the subject can you help me or not becouse my game is slowing down like this so.

KingCharizard
August 26th, 2010, 02:41 PM
I found an error in the script, when you go to the bag, select cancel or an item and use it, during the transfer back to the pokebattle this happens..
http://img94.imageshack.us/img94/7978/errorscreens.png

EDIT: I believe I found out the reason, Its because I edited the screen size and I think I missed a few lines of code that needed to be edited, but I still haven't fixed the error