• Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • 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.

General Game Dev Help and Requests

Status
Not open for further replies.
Peekimon said:
Oh, Ok, but how do you show pictures using Ruby Scripting?
here:
Code:
@whatever = Sprite.new
@whatever.bitmap = RPG::Cache.picture("picture_name")
@whatever.x
@whatever.y
you can use any name instead of "whatever",
you need to set the x and y too
like: @whatever.x = 100
 
One more question, i liked the way where you could see the background in your menu, how do you do it? Is there special coding or something?
 
you'll need to add:
Code:
@spriteset = Spriteset_Map.new
and you'll need to add this 2 lines:
Code:
@spriteset.dispose
@spriteset.update
(the same way as @gold.update & @gold.dispose)
 
I've got a request.

Does anyone have a desert tileset (2 different types of grounds) and also water tilesets (the one where you dive in and the one where you can walk on, like in Lilycove and Mossdeep City) Thanks!

~Jeff
 
Does anyone know how I can change my font to a custom one? I already have the font I want in the Fonts directory of the rm2k3 and in the windows\fonts directory. But how do I apply it to the rm2k so that I can select the custom font? I only see MS Mincho and MS Gothic. Can anyone help me? Please? Thanks.
 
Does anyone has tiles for the grass wild pokemon appear in? I need the tall one and the normal one.
 
Tranitar18, I believe it's somewhere on this thread....

They're really easy to find. Hope you find it.

~Jeff
 
To virtual:
In attachment, in my shop window, I got to that part, but, why aren't the rest of the options showing?
Here's the code:
Code:
# ■ Scene_Shop
#------------------------------------------------------------------------------
#  ショップ画面の処理を行うクラスです。
#==============================================================================
class Scene_Shop
  #--------------------------------------------------------------------------
  # ● メイン処理
  #--------------------------------------------------------------------------
  def main
	# ヘルプウィンドウを作成
	@spriteset = Spriteset_Map.new
	@help_window = Window_Help.new
	@help_window.active = false
	@help_window.visible = false
	# コマンドウィンドウを作成
	@command_window = Window_ShopCommand.new
	# ゴールドウィンドウを作成
	@gold_window = Window_Gold.new
	@gold_window.x = 0
	@gold_window.y = 0
	@gold_window.active = false
	@gold_window.visible = false
	# ダミーウィンドウを作成
	@dummy_window = Window_Base.new(0, 128, 650, 400)
	@dummy_window.active = false
	@dummy_window.visible = false
	# 購入ウィンドウを作成
	@buy_window = Window_ShopBuy.new($game_temp.shop_goods)
	@buy_window.active = false
	@buy_window.visible = false
	@buy_window.help_window = @help_window
	# 売却ウィンドウを作成
	@sell_window = Window_ShopSell.new
	@sell_window.active = false
	@sell_window.visible = false
	@sell_window.help_window = @help_window
	# 個数入力ウィンドウを作成
	@number_window = Window_ShopNumber.new
	@number_window.active = false
	@number_window.visible = false
	# ステータスウィンドウを作成
	@status_window = Window_ShopStatus.new
	@status_window.visible = false
	@status_window.active = false
	# トランジション実行
	Graphics.transition
	# メインループ
	loop do
	  # ゲーム画面を更新
	  Graphics.update
	  # 入力情報を更新
	  Input.update
	  # フレーム更新
	  update
	  # 画面が切り替わったらループを中断
	  if $scene != self
		break
	  end
	end
	# トランジション準備
	Graphics.freeze
	# ウィンドウを解放
	@help_window.dispose
	@command_window.dispose
	@gold_window.dispose
	@dummy_window.dispose
	@buy_window.dispose
	@sell_window.dispose
	@number_window.dispose
	@spriteset.dispose
	@status_window.dispose
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新
  #--------------------------------------------------------------------------
  def update
	# ウィンドウを更新
	@help_window.update
	@command_window.update
	@gold_window.update
	@dummy_window.update
	@buy_window.update
	@sell_window.update
	@number_window.update
	@status_window.update
	@spriteset.update
	# コマンドウィンドウがアクティブの場合: update_command を呼ぶ
	if @command_window.active
	  update_command
	  return
	end
	# 購入ウィンドウがアクティブの場合: update_buy を呼ぶ
	if @buy_window.active
	  update_buy
	  return
	end
	# 売却ウィンドウがアクティブの場合: update_sell を呼ぶ
	if @sell_window.active
	  update_sell
	  return
	end
	# 個数入力ウィンドウがアクティブの場合: update_number を呼ぶ
	if @number_window.active
	  update_number
	  return
	end
  end
  #--------------------------------------------------------------------------
  # ● when you click on "buy"
  #--------------------------------------------------------------------------
  def update_command
	# B ボタンが押された場合
	if Input.trigger?(Input::B)
	  # キャンセル SE を演奏
	  $game_system.se_play($data_system.cancel_se)
	  # マップ画面に切り替え
	  $scene = Scene_Map.new
	  return
	end
	# C ボタンが押された場合
	if Input.trigger?(Input::C)
	  # コマンドウィンドウのカーソル位置で分岐
	  case @command_window.index
	  when 0  # 購入する
		# 決定 SE を演奏
		$game_system.se_play($data_system.decision_se)
		# ウィンドウの状態を購入モードへ
		@command_window.active = false
		@dummy_window.visible = false
		@buy_window.active = true
		@buy_window.visible = true
		@buy_window.refresh
		@status_window.visible = true
	  when 1  # 売却する
		# 決定 SE を演奏
		$game_system.se_play($data_system.decision_se)
		# ウィンドウの状態を売却モードへ
		@command_window.active = false
		@dummy_window.visible = false
		@sell_window.active = true
		@sell_window.visible = true
		@sell_window.refresh
	  when 2  # やめる
		# 決定 SE を演奏
		$game_system.se_play($data_system.decision_se)
		# マップ画面に切り替え
		$scene = Scene_Map.new
	  end
	  return
	end
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新 (購入ウィンドウがアクティブの場合)
  #--------------------------------------------------------------------------
  def update_buy
	# ステータスウィンドウのアイテムを設定
	@status_window.item = @buy_window.item
	# B ボタンが押された場合
	if Input.trigger?(Input::B)
	  # キャンセル SE を演奏
	  $game_system.se_play($data_system.cancel_se)
	  # ウィンドウの状態を初期モードへ
	  @command_window.active = true
	  @dummy_window.visible = true
	  @buy_window.active = false
	  @buy_window.visible = false
	  @status_window.visible = false
	  @status_window.item = nil
	  # ヘルプテキストを消去
	  @help_window.set_text("")
	  return
	end
	# C ボタンが押された場合
	if Input.trigger?(Input::C)
	  # アイテムを取得
	  @item = @buy_window.item
	  # アイテムが無効の場合、または価格が所持金より上の場合
	  if @item == nil or @item.price > $game_party.gold
		# ブザー SE を演奏
		$game_system.se_play($data_system.buzzer_se)
		return
	  end
	  # アイテムの所持数を取得
	  case @item
	  when RPG::Item
		number = $game_party.item_number(@item.id)
	  when RPG::Weapon
		number = $game_party.weapon_number(@item.id)
	  when RPG::Armor
		number = $game_party.armor_number(@item.id)
	  end
	  # すでに 99 個所持している場合
	  if number == 99
		# ブザー SE を演奏
		$game_system.se_play($data_system.buzzer_se)
		return
	  end
	  # 決定 SE を演奏
	  $game_system.se_play($data_system.decision_se)
	  # 最大購入可能個数を計算
	  max = @item.price == 0 ? 99 : $game_party.gold / @item.price
	  max = [max, 99 - number].min
	  # ウィンドウの状態を個数入力モードへ
	  @buy_window.active = false
	  @buy_window.visible = false
	  @number_window.set(@item, max, @item.price)
	  @number_window.active = true
	  @number_window.visible = true
	end
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新 (売却ウィンドウがアクティブの場合)
  #--------------------------------------------------------------------------
  def update_sell
	# B ボタンが押された場合
	if Input.trigger?(Input::B)
	  # キャンセル SE を演奏
	  $game_system.se_play($data_system.cancel_se)
	  # ウィンドウの状態を初期モードへ
	  @command_window.active = true
	  @dummy_window.visible = true
	  @sell_window.active = false
	  @sell_window.visible = false
	  @status_window.item = nil
	  # ヘルプテキストを消去
	  @help_window.set_text("")
	  return
	end
	# C ボタンが押された場合
	if Input.trigger?(Input::C)
	  # アイテムを取得
	  @item = @sell_window.item
	  # ステータスウィンドウのアイテムを設定
	  @status_window.item = @item
	  # アイテムが無効の場合、または価格が 0 (売却不可) の場合
	  if @item == nil or @item.price == 0
		# ブザー SE を演奏
		$game_system.se_play($data_system.buzzer_se)
		return
	  end
	  # 決定 SE を演奏
	  $game_system.se_play($data_system.decision_se)
	  # アイテムの所持数を取得
	  case @item
	  when RPG::Item
		number = $game_party.item_number(@item.id)
	  when RPG::Weapon
		number = $game_party.weapon_number(@item.id)
	  when RPG::Armor
		number = $game_party.armor_number(@item.id)
	  end
	  # 最大売却個数 = アイテムの所持数
	  max = number
	  # ウィンドウの状態を個数入力モードへ
	  @sell_window.active = false
	  @sell_window.visible = false
	  @number_window.set(@item, max, @item.price / 2)
	  @number_window.active = true
	  @number_window.visible = true
	  @status_window.visible = true
	end
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新 (個数入力ウィンドウがアクティブの場合)
  #--------------------------------------------------------------------------
  def update_number
	# B ボタンが押された場合
	if Input.trigger?(Input::B)
	  # キャンセル SE を演奏
	  $game_system.se_play($data_system.cancel_se)
	  # 個数入力ウィンドウを非アクティブ・不可視に設定
	  @number_window.active = false
	  @number_window.visible = false
	  # コマンドウィンドウのカーソル位置で分岐
	  case @command_window.index
	  when 0  # 購入する
		# ウィンドウの状態を購入モードへ
		@buy_window.active = true
		@buy_window.visible = true
	  when 1  # 売却する
		# ウィンドウの状態を売却モードへ
		@sell_window.active = true
		@sell_window.visible = true
		@status_window.visible = false
	  end
	  return
	end
	# C ボタンが押された場合
	if Input.trigger?(Input::C)
	  # ショップ SE を演奏
	  $game_system.se_play($data_system.shop_se)
	  # 個数入力ウィンドウを非アクティブ・不可視に設定
	  @number_window.active = false
	  @number_window.visible = false
	  # コマンドウィンドウのカーソル位置で分岐
	  case @command_window.index
	  when 0  # 購入する
		# 購入処理
		$game_party.lose_gold(@number_window.number * @item.price)
		case @item
		when RPG::Item
		  $game_party.gain_item(@item.id, @number_window.number)
		when RPG::Weapon
		  $game_party.gain_weapon(@item.id, @number_window.number)
		when RPG::Armor
		  $game_party.gain_armor(@item.id, @number_window.number)
		end
		# 各ウィンドウをリフレッシュ
		@gold_window.refresh
		@buy_window.refresh
		@status_window.refresh
		# ウィンドウの状態を購入モードへ
		@buy_window.active = true
		@buy_window.visible = true
	  when 1  # 売却する
		# 売却処理
		$game_party.gain_gold(@number_window.number * (@item.price / 2))
		case @item
		when RPG::Item
		  $game_party.lose_item(@item.id, @number_window.number)
		when RPG::Weapon
		  $game_party.lose_weapon(@item.id, @number_window.number)
		when RPG::Armor
		  $game_party.lose_armor(@item.id, @number_window.number)
		end
		# 各ウィンドウをリフレッシュ
		@gold_window.refresh
		@sell_window.refresh
		@status_window.refresh
		# ウィンドウの状態を売却モードへ
		@sell_window.active = true
		@sell_window.visible = true
		@status_window.visible = false
	  end
	  return
	end
  end
end
 
Peekimon said:
To virtual:
In attachment, in my shop window, I got to that part, but, why aren't the rest of the options showing?
Here's the code:
Code:
# ■ Scene_Shop
#------------------------------------------------------------------------------
#  ショップ画面の処理を行うクラスです。
#==============================================================================
class Scene_Shop
  #--------------------------------------------------------------------------
  # ● メイン処理
  #--------------------------------------------------------------------------
  def main
	# ヘルプウィンドウを作成
	@spriteset = Spriteset_Map.new
	@help_window = Window_Help.new
	@help_window.active = false
	@help_window.visible = false
	# コマンドウィンドウを作成
	@command_window = Window_ShopCommand.new
	# ゴールドウィンドウを作成
	@gold_window = Window_Gold.new
	@gold_window.x = 0
	@gold_window.y = 0
	@gold_window.active = false
	@gold_window.visible = false
	# ダミーウィンドウを作成
	@dummy_window = Window_Base.new(0, 128, 650, 400)
	@dummy_window.active = false
	@dummy_window.visible = false
	# 購入ウィンドウを作成
	@buy_window = Window_ShopBuy.new($game_temp.shop_goods)
	@buy_window.active = false
	@buy_window.visible = false
	@buy_window.help_window = @help_window
	# 売却ウィンドウを作成
	@sell_window = Window_ShopSell.new
	@sell_window.active = false
	@sell_window.visible = false
	@sell_window.help_window = @help_window
	# 個数入力ウィンドウを作成
	@number_window = Window_ShopNumber.new
	@number_window.active = false
	@number_window.visible = false
	# ステータスウィンドウを作成
	@status_window = Window_ShopStatus.new
	@status_window.visible = false
	@status_window.active = false
	# トランジション実行
	Graphics.transition
	# メインループ
	loop do
	  # ゲーム画面を更新
	  Graphics.update
	  # 入力情報を更新
	  Input.update
	  # フレーム更新
	  update
	  # 画面が切り替わったらループを中断
	  if $scene != self
		break
	  end
	end
	# トランジション準備
	Graphics.freeze
	# ウィンドウを解放
	@help_window.dispose
	@command_window.dispose
	@gold_window.dispose
	@dummy_window.dispose
	@buy_window.dispose
	@sell_window.dispose
	@number_window.dispose
	@spriteset.dispose
	@status_window.dispose
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新
  #--------------------------------------------------------------------------
  def update
	# ウィンドウを更新
	@help_window.update
	@command_window.update
	@gold_window.update
	@dummy_window.update
	@buy_window.update
	@sell_window.update
	@number_window.update
	@status_window.update
	@spriteset.update
	# コマンドウィンドウがアクティブの場合: update_command を呼ぶ
	if @command_window.active
	  update_command
	  return
	end
	# 購入ウィンドウがアクティブの場合: update_buy を呼ぶ
	if @buy_window.active
	  update_buy
	  return
	end
	# 売却ウィンドウがアクティブの場合: update_sell を呼ぶ
	if @sell_window.active
	  update_sell
	  return
	end
	# 個数入力ウィンドウがアクティブの場合: update_number を呼ぶ
	if @number_window.active
	  update_number
	  return
	end
  end
  #--------------------------------------------------------------------------
  # ● when you click on "buy"
  #--------------------------------------------------------------------------
  def update_command
	# B ボタンが押された場合
	if Input.trigger?(Input::B)
	  # キャンセル SE を演奏
	  $game_system.se_play($data_system.cancel_se)
	  # マップ画面に切り替え
	  $scene = Scene_Map.new
	  return
	end
	# C ボタンが押された場合
	if Input.trigger?(Input::C)
	  # コマンドウィンドウのカーソル位置で分岐
	  case @command_window.index
	  when 0  # 購入する
		# 決定 SE を演奏
		$game_system.se_play($data_system.decision_se)
		# ウィンドウの状態を購入モードへ
		@command_window.active = false
		@dummy_window.visible = false
		@buy_window.active = true
		@buy_window.visible = true
		@buy_window.refresh
		@status_window.visible = true
	  when 1  # 売却する
		# 決定 SE を演奏
		$game_system.se_play($data_system.decision_se)
		# ウィンドウの状態を売却モードへ
		@command_window.active = false
		@dummy_window.visible = false
		@sell_window.active = true
		@sell_window.visible = true
		@sell_window.refresh
	  when 2  # やめる
		# 決定 SE を演奏
		$game_system.se_play($data_system.decision_se)
		# マップ画面に切り替え
		$scene = Scene_Map.new
	  end
	  return
	end
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新 (購入ウィンドウがアクティブの場合)
  #--------------------------------------------------------------------------
  def update_buy
	# ステータスウィンドウのアイテムを設定
	@status_window.item = @buy_window.item
	# B ボタンが押された場合
	if Input.trigger?(Input::B)
	  # キャンセル SE を演奏
	  $game_system.se_play($data_system.cancel_se)
	  # ウィンドウの状態を初期モードへ
	  @command_window.active = true
	  @dummy_window.visible = true
	  @buy_window.active = false
	  @buy_window.visible = false
	  @status_window.visible = false
	  @status_window.item = nil
	  # ヘルプテキストを消去
	  @help_window.set_text("")
	  return
	end
	# C ボタンが押された場合
	if Input.trigger?(Input::C)
	  # アイテムを取得
	  @item = @buy_window.item
	  # アイテムが無効の場合、または価格が所持金より上の場合
	  if @item == nil or @item.price > $game_party.gold
		# ブザー SE を演奏
		$game_system.se_play($data_system.buzzer_se)
		return
	  end
	  # アイテムの所持数を取得
	  case @item
	  when RPG::Item
		number = $game_party.item_number(@item.id)
	  when RPG::Weapon
		number = $game_party.weapon_number(@item.id)
	  when RPG::Armor
		number = $game_party.armor_number(@item.id)
	  end
	  # すでに 99 個所持している場合
	  if number == 99
		# ブザー SE を演奏
		$game_system.se_play($data_system.buzzer_se)
		return
	  end
	  # 決定 SE を演奏
	  $game_system.se_play($data_system.decision_se)
	  # 最大購入可能個数を計算
	  max = @item.price == 0 ? 99 : $game_party.gold / @item.price
	  max = [max, 99 - number].min
	  # ウィンドウの状態を個数入力モードへ
	  @buy_window.active = false
	  @buy_window.visible = false
	  @number_window.set(@item, max, @item.price)
	  @number_window.active = true
	  @number_window.visible = true
	end
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新 (売却ウィンドウがアクティブの場合)
  #--------------------------------------------------------------------------
  def update_sell
	# B ボタンが押された場合
	if Input.trigger?(Input::B)
	  # キャンセル SE を演奏
	  $game_system.se_play($data_system.cancel_se)
	  # ウィンドウの状態を初期モードへ
	  @command_window.active = true
	  @dummy_window.visible = true
	  @sell_window.active = false
	  @sell_window.visible = false
	  @status_window.item = nil
	  # ヘルプテキストを消去
	  @help_window.set_text("")
	  return
	end
	# C ボタンが押された場合
	if Input.trigger?(Input::C)
	  # アイテムを取得
	  @item = @sell_window.item
	  # ステータスウィンドウのアイテムを設定
	  @status_window.item = @item
	  # アイテムが無効の場合、または価格が 0 (売却不可) の場合
	  if @item == nil or @item.price == 0
		# ブザー SE を演奏
		$game_system.se_play($data_system.buzzer_se)
		return
	  end
	  # 決定 SE を演奏
	  $game_system.se_play($data_system.decision_se)
	  # アイテムの所持数を取得
	  case @item
	  when RPG::Item
		number = $game_party.item_number(@item.id)
	  when RPG::Weapon
		number = $game_party.weapon_number(@item.id)
	  when RPG::Armor
		number = $game_party.armor_number(@item.id)
	  end
	  # 最大売却個数 = アイテムの所持数
	  max = number
	  # ウィンドウの状態を個数入力モードへ
	  @sell_window.active = false
	  @sell_window.visible = false
	  @number_window.set(@item, max, @item.price / 2)
	  @number_window.active = true
	  @number_window.visible = true
	  @status_window.visible = true
	end
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新 (個数入力ウィンドウがアクティブの場合)
  #--------------------------------------------------------------------------
  def update_number
	# B ボタンが押された場合
	if Input.trigger?(Input::B)
	  # キャンセル SE を演奏
	  $game_system.se_play($data_system.cancel_se)
	  # 個数入力ウィンドウを非アクティブ・不可視に設定
	  @number_window.active = false
	  @number_window.visible = false
	  # コマンドウィンドウのカーソル位置で分岐
	  case @command_window.index
	  when 0  # 購入する
		# ウィンドウの状態を購入モードへ
		@buy_window.active = true
		@buy_window.visible = true
	  when 1  # 売却する
		# ウィンドウの状態を売却モードへ
		@sell_window.active = true
		@sell_window.visible = true
		@status_window.visible = false
	  end
	  return
	end
	# C ボタンが押された場合
	if Input.trigger?(Input::C)
	  # ショップ SE を演奏
	  $game_system.se_play($data_system.shop_se)
	  # 個数入力ウィンドウを非アクティブ・不可視に設定
	  @number_window.active = false
	  @number_window.visible = false
	  # コマンドウィンドウのカーソル位置で分岐
	  case @command_window.index
	  when 0  # 購入する
		# 購入処理
		$game_party.lose_gold(@number_window.number * @item.price)
		case @item
		when RPG::Item
		  $game_party.gain_item(@item.id, @number_window.number)
		when RPG::Weapon
		  $game_party.gain_weapon(@item.id, @number_window.number)
		when RPG::Armor
		  $game_party.gain_armor(@item.id, @number_window.number)
		end
		# 各ウィンドウをリフレッシュ
		@gold_window.refresh
		@buy_window.refresh
		@status_window.refresh
		# ウィンドウの状態を購入モードへ
		@buy_window.active = true
		@buy_window.visible = true
	  when 1  # 売却する
		# 売却処理
		$game_party.gain_gold(@number_window.number * (@item.price / 2))
		case @item
		when RPG::Item
		  $game_party.lose_item(@item.id, @number_window.number)
		when RPG::Weapon
		  $game_party.lose_weapon(@item.id, @number_window.number)
		when RPG::Armor
		  $game_party.lose_armor(@item.id, @number_window.number)
		end
		# 各ウィンドウをリフレッシュ
		@gold_window.refresh
		@sell_window.refresh
		@status_window.refresh
		# ウィンドウの状態を売却モードへ
		@sell_window.active = true
		@sell_window.visible = true
		@status_window.visible = false
	  end
	  return
	end
  end
end
ok, i don't exactly know what you mean...
and there's no attachement?
 
Oh, I'm so stupid....
I forgot to add the attachment. *bangs head on wall*
Here's it *hopes that I don't forget, this time*
 
Peekimon said:
Oh, I'm so stupid....
I forgot to add the attachment. *bangs head on wall*
Here's it *hopes that I don't forget, this time*
i'm not quite sure...
i think you could try:

@"window_name".z = 999
 
Peekimon said:
where do i put the:
"@"window_name".z = 999" ?
woops, srry, forgot about that.
you need to add it like this:
Code:
@gold_window = Window_Gold.new
@gold_window.x = 0
@gold_window.y = 0
@gold_window.z = 999
this might help.
 
Can anyone help me still? Here's the question if anyone forgets:

Does anyone have a desert tileset (2 different types of grounds) and also water tilesets (the one where you dive in and the one where you can walk on, like in Lilycove and Mossdeep City) Thanks!
 
Status
Not open for further replies.
Back
Top