PDA

View Full Version : Pokegear Script (XP)


.-'Infernal Hylian'-.
December 20th, 2005, 08:29 AM
Ok well seeing as though the starter kit comes with the pokegear i have written a very simple script that only needs to be quickly coppied and pasted Here is a screeny
http://img.photobucket.com/albums/v337/jackcharge/4.png

Now we are gonna need to have to draw out the new scene so make a new scene and call it pokegear1 and put it under Scene_skill.
Paste this in your new Pokegear1 scene
#==============================================================================
# - Scene_Pokegear1
#------------------------------------------------------------------------------
# Version 0.1 Written by Link2005 if you find an error you tell me, this is most of blizzys work fused into my pokegear script so # quite alot of credit goes to blizzy
#==============================================================================
class Scene_Pokegear1
#--------------------------------------------------------------------------
# initialize
#--------------------------------------------------------------------------
def initialize(menu_index = 0)
@menu_index = menu_index
end
#--------------------------------------------------------------------------
# main
#--------------------------------------------------------------------------
def main
# Main Menu settings you can add or change these
# コマンドウィンドウを作成
s1 = "Map"
s2 = "Radio"
s3= "Phone"
s4= "Exit"


commands = [s1,s2,s3,s4]


@command_window = Window_Command.new(160, commands)
@command_window.index = @menu_index
@command_window.x = ($width - @command_window.width) - 8
@command_window.y = 8
@card = Sprite.new
@card.bitmap = RPG::Cache.picture("pokegear")
@card.zoom_x = 2
@card.zoom_y = 2
@trainer = Sprite.new
@trainer.x = 10
@trainer.y = 150
@trainer.zoom_x = 1
@trainer.zoom_y = 1
@trainer.z = 9999
#Your going to need two trainer sprites imported into the game save the boy sprite as male and the female as female
#Below is the display of the trainer sprite if Boy or girl Gender was chosen at the start of the game
if $pkmn.gender == true
@trainer.bitmap = RPG::Cache.picture("male")
end
if $pkmn.gender == false
@trainer.bitmap = RPG::Cache.picture("female")
end

@info = Window_Help2.new
@info.height = $height / 4 + 16
@info.width = $width / 2 + 74
@info.x = 8
@info.y = $height - @info.height - 8
@info.z = 9999
@info2 = Window_Help2.new
@info2.height = $height / 4 + 16
@info2.width = $width / 2 + 74
@info2.x = 8
@info2.y = $height - @info.height - 8 + 32
@info2.z = 99999
@info2.opacity = 0
@info2.windowskin = @info.windowskin = RPG::Cache.windowskin("infosys")

@target_window = Window_Target.new
@target_window.visible = false
@target_window.active = false
#Below is the badge display replace each badge 1, badge2 ect with your badge icon name
#if you do not want badges on the pokegear screen delete from
@badge1 = Sprite.new #Here
@badge2 = Sprite.new
@badge3 = Sprite.new
@badge4 = Sprite.new
@badge5 = Sprite.new
@badge6 = Sprite.new
@badge7 = Sprite.new
@badge8 = Sprite.new
if $pkmn.badges[1] == true
@badge1.bitmap = RPG::Cache.icon("badge1")
@badge1.x = 64
@badge1.y = 170
@badge1.z = 9999
end
if $pkmn.badges[2] == true
@badge2.bitmap = RPG::Cache.icon("badge2")
@badge2.x = 64 + (48 * 1)
@badge2.y = 170
@badge2.z = 9999
end
if $pkmn.badges[3] == true
@badge3.bitmap = RPG::Cache.icon("badge3")
@badge3.x = 64 + (48 * 2)
@badge3.y = 170
@badge3.z = 9999
end
if $pkmn.badges[4] == true
@badge4.bitmap = RPG::Cache.icon("badge4")
@badge4.x = 64 + (48 * 3)
@badge4.y = 170
@badge4.z = 9999
end
if $pkmn.badges[5] == true
@badge5.bitmap = RPG::Cache.icon("badge5")
@badge5.x = 64 + (48 * 4)
@badge5.y = 170
@badge5.z = 9999
end
if $pkmn.badges[6] == true
@badge6.bitmap = RPG::Cache.icon("badge6")
@badge6.x = 64 + (48 * 5)
@badge6.y = 170
@badge6.z = 9999
end
if $pkmn.badges[7] == true
@badge7.bitmap = RPG::Cache.icon("badge7")
@badge7.x = 64 + (48 * 6)
@badge7.y = 170
@badge7.z = 9999
end
if $pkmn.badges[8] == true
@badge8.bitmap = RPG::Cache.icon("badge8")
@badge8.x = 64 + (48 * 7)
@badge8.y = 170
@badge8.z = 9999
end #to here and also delete all the badge dispose lines after graphics freeze just below

Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@command_window.dispose
@trainer.dispose
@badge1.dispose
@badge2.dispose
@badge3.dispose
@badge4.dispose
@badge5.dispose
@badge6.dispose
@badge7.dispose
@badge8.dispose
@card.bitmap.dispose
@info.dispose
@info2.dispose
end
#--------------------------------------------------------------------------
# update the scene
#--------------------------------------------------------------------------
def update
@command_window.update
@info.update
@info2.update

#update command window and the info if it's active
if @command_window.active
update_command
update_info
return
end

end
#--------------------------------------------------------------------------
# update the command window
#--------------------------------------------------------------------------
def update_command
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Map.new
return
end

#Below is you scene options if you don't know what to do here just change your map phone and radio scenes
#To a map radio and Phone scene. You can get a radio script at RMXP.net in the forums
if Input.trigger?(Input::C)
case @command_window.commands[@command_window.index]
when "Map"
print "not availlable in beta 0.2"
$game_system.se_play($data_system.decision_se)
when "Radio"
$game_system.se_play($data_system.decision_se)
$scene = Scene_Radio3.new
when "Phone"
$game_system.se_play($data_system.decision_se)
$scene = Scene_Map.new
when "Exit"
$game_system.se_play($data_system.decision_se)
$scene = Scene_Map.new
end
return
end
end
def update_info
case @command_window.commands[@command_window.index]
#Below is what is going to be in the help box when you highlight a certain option you can edit what is in
# between the "" below to change what is displayed
when "Map"
@info.set_text("The Duirin Reigon map")
@info2.set_text("Shows Visited Places")
when "Radio"
@info.set_text("The Radio")
@info2.set_text("Needs Batterys To Work")
when "Phone"
@info.set_text("A Phone")
@info2.set_text("It Can Be Topped Up And Used")
when "Exit"
@info.set_text("Close this Menu window")
@info2.set_text("and return to the game.")
end
end
end


(This is just a pokegear main Menu it is not a phone radio or map system)

I am not allowed to link to other forums but in the script at the top there is some info on where you can find a radio script!

Dragon.Beat
December 20th, 2005, 09:50 AM
I could tell that's the screen from your game. Nice tut. Rather useful. XD

Tyler
December 20th, 2005, 06:09 PM
Just one question why does it have the Badges info in the coding

.-'Infernal Hylian'-.
December 21st, 2005, 06:54 AM
well i thought that a pokegear could have more flare but if you read just above the badges it says its just an option and then tells you if you choose not to have it then delete from here... to here (just look its quite easy to read)

Blizzy
December 21st, 2005, 10:39 AM
it's good, but you forgot to credit me.
i wrote some of those parts (trainersprite, badges, help_window)
this is just an easy edit of the scene_menu, but still nice ;)

what would be easier is calling methods to draw badges and such
like:

def create_badges
@badge1 = Sprite.new
@badge2 = Sprite.new
@badge3 = Sprite.new
@badge4 = Sprite.new
@badge5 = Sprite.new
@badge6 = Sprite.new
@badge7 = Sprite.new
@badge8 = Sprite.new
end

and a method to set the positions [set_badgepos]

def set_badgepos
if $pkmn.badges[1] == true
@badge1.bitmap = RPG::Cache.icon("badge1")
@badge1.x = 64
@badge1.y = 170
@badge1.z = 9999
end
if $pkmn.badges[2] == true
@badge2.bitmap = RPG::Cache.icon("badge2")
@badge2.x = 64 + (48 * 1)
@badge2.y = 170
@badge2.z = 9999
end
if $pkmn.badges[3] == true
@badge3.bitmap = RPG::Cache.icon("badge3")
@badge3.x = 64 + (48 * 2)
@badge3.y = 170
@badge3.z = 9999
end
if $pkmn.badges[4] == true
@badge4.bitmap = RPG::Cache.icon("badge4")
@badge4.x = 64 + (48 * 3)
@badge4.y = 170
@badge4.z = 9999
end
if $pkmn.badges[5] == true
@badge5.bitmap = RPG::Cache.icon("badge5")
@badge5.x = 64 + (48 * 4)
@badge5.y = 170
@badge5.z = 9999
end
if $pkmn.badges[6] == true
@badge6.bitmap = RPG::Cache.icon("badge6")
@badge6.x = 64 + (48 * 5)
@badge6.y = 170
@badge6.z = 9999
end
if $pkmn.badges[7] == true
@badge7.bitmap = RPG::Cache.icon("badge7")
@badge7.x = 64 + (48 * 6)
@badge7.y = 170
@badge7.z = 9999
end
if $pkmn.badges[8] == true
@badge8.bitmap = RPG::Cache.icon("badge8")
@badge8.x = 64 + (48 * 7)
@badge8.y = 170
@badge8.z = 9999
end
end

and in main just put

create_badges
set_badgepos

so disabling badges is much easier

.-'Infernal Hylian'-.
December 22nd, 2005, 07:03 AM
Blizzy i edited the badge positions so they didn't appear on top of the help window they appear along next to the trainer. and can also make it so that wach badge is pefect grapchic. just change the zooms that are two to one.

OverTheBelow
December 22nd, 2005, 09:09 AM
I need a picture named "Pokegear".

Atleast thats what I read in the script.

@command_window = Window_Command.new(160, commands)
@command_window.index = @menu_index
@command_window.x = ($width - @command_window.width) - 8
@command_window.y = 8
@card = Sprite.new
@card.bitmap = RPG::Cache.picture("pokegear")
@card.zoom_x = 2
@card.zoom_y = 2
@trainer = Sprite.new
@trainer.x = 10
@trainer.y = 150
@trainer.zoom_x = 1
@trainer.zoom_y = 1
@trainer.z = 9999

.-'Infernal Hylian'-.
December 23rd, 2005, 06:56 AM
Yep your gonna need a picture background thats the size of your game screen so take a printscreen in game play, paste it into paint,cut the exact size of the screen (not the blue frame) write down the width and height then make you background using the width and height save it as pokegear and upload it into RMXP and there you have it its done.

Minorthreat0987
December 23rd, 2005, 11:48 AM
nice script its just liek the one i made exept mine doenst have the trainer card features....and i have a realy time box......

OverTheBelow.....
you could also remove that piece of script and add
@spriteset = Spriteset_Map.new

that will make it so you see the map behind the gear......instead of a back ground

agentalexandre12
December 29th, 2005, 01:15 PM
how do you call this from the menu?

OverTheBelow
December 30th, 2005, 02:59 PM
Simply replace the call part with this:

$game_system.se_play($data_system.decision_se)
$scene = Scene_Pokegear1.new

Under when "Pokegear"

Btw, what do you think of my pokegear?

http://i25.photobucket.com/albums/c64/pokemonoverdabelow/X1.png

agentalexandre12
December 31st, 2005, 02:04 AM
woooooow thats real sweet

.-'Infernal Hylian'-.
December 31st, 2005, 03:12 PM
i hope i have helped. its a good script although i am working on a full pokegear script a pokenav script and a contest script at the moment they should be ready all capmplete by september next year.

kaihachi_mishima
January 2nd, 2006, 03:39 PM
I tried it but when I test it out it wont show...I placed it below Scene_Skill (I had to make a new script thing). But it still wouldnt work...what do i do?

.-'Infernal Hylian'-.
January 3rd, 2006, 01:06 PM
Have you replaced the picture names right? What exactly do you mean "don't work?" you need to be more specific.