查看: 2948|回复: 8

[已经过期] 模擬養成遊戲腳本?

[复制链接]
梦石
0
星屑
52
在线时间
135 小时
注册时间
2011-11-5
回帖
49
发表于 2013-9-20 22:25:16 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
本帖最后由 ji3rul4coco 于 2013-9-23 23:45 编辑

2013/09/23更新  
因為我覺得自己之前的敘述好像太簡單了
詳細形況就是,我希望能夠用鼠標點選粉紅色↓的選項,讓它像橙光文字游戏制作工具的選項一樣
我想要的是那樣的效果
之前也有人問過相同的問題,不過因為上面的腳本不知為何不能用,所以才重新又問了一次
網址如下↓
http://rpg.blue/forum.php?mod=viewthread&tid=329853

為了,變量顯示的問題算是解決了,不過我想將在菜單中顯示的功能消掉,還有想把數值改成兩排(像圖片藍框中顯示的那樣),請各位幫個忙,謝謝
1.jpg
2.jpg

[pre lang="ruby" line="1"]#==============================================================================
# ■ Game_Player
#------------------------------------------------------------------------------
#  處理玩家人物的類。擁有事件啟動的判定、地圖的卷動等功能。
#   本類的實例請參考 $game_player 。
#==============================================================================

class Game_Player < Game_Character
  
  def getX
    @x
  end
  
  def getY
    @y
  end
  
end

#==============================================================================
# ■ Scene_Menu
#------------------------------------------------------------------------------
#  菜單畫面
#==============================================================================

class Scene_Menu < Scene_MenuBase

  #--------------------------------------------------------------------------
  # ● 生成窗口
  #--------------------------------------------------------------------------
  def create_gold_window
    @gold_window = Window_Gold.new
    @gold_window.x = 0
    @gold_window.y = Graphics.height - @gold_window.height
    # 生成地圖信息窗口
    @mapinfos_window = Window_MapInfo.new
    @mapinfos_window.x = 0
    @mapinfos_window.y = Graphics.height - @mapinfos_window.height - @gold_window.height
   
  end
  
end

#==============================================================================
# ■ Window_MapInfo
#------------------------------------------------------------------------------
#  顯示當前信息的窗口。 By SkyZH
#==============================================================================

class Window_MapInfo < Window_Base
  #--------------------------------------------------------------------------
  # ● 初始化對像
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0, window_width, 264)
    self.opacity = 255
    refresh
  end
  #--------------------------------------------------------------------------
  # ● 獲取窗口的寬度
  #--------------------------------------------------------------------------
  def window_width
    return 160
  end
  #--------------------------------------------------------------------------
  # ● 刷新
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    self.contents.font.color = normal_color
    @a=$game_map.width
    @b=$game_map.height
    draw_text(0, 0,             window_width-24, line_height,"智慧 " + $game_variables[1].to_s)
    draw_text(0, line_height, window_width-24, line_height,"魅力 " + $game_variables[2].to_s)
    draw_text(0, line_height*2, window_width-24, line_height,"修養 " + $game_variables[3].to_s)
    draw_text(0, line_height*3, window_width-24, line_height,"體貼 " + $game_variables[4].to_s)
    draw_text(0, line_height*4, window_width-24, line_height,"道德 " + $game_variables[5].to_s)
    draw_text(0, line_height*5, window_width-24, line_height,"自尊 " + $game_variables[6].to_s)
    draw_text(0, line_height*6, window_width-24, line_height,"勇氣 " + $game_variables[7].to_s)
    draw_text(0, line_height*7, window_width-24, line_height,"聲望 " + $game_variables[8].to_s)
  end
end

class Spriteset_Map
  #--------------------------------------------------------------------------
  # ● 初始化對象
  #--------------------------------------------------------------------------
  def initialize
    create_viewports
    create_tilemap
    create_parallax
    create_characters
    create_shadow
    create_weather
    create_pictures
    create_timer
    @MapInfoWin=Window_MapInfo.new
    update
  end
  
  def dispose
    dispose_tilemap
    dispose_parallax
    dispose_characters
    dispose_shadow
    dispose_weather
    dispose_pictures
    dispose_timer
    dispose_viewports
    @MapInfoWin.dispose
  end
  
  def update
    update_tileset
    update_tilemap
    update_parallax
    update_characters
    update_shadow
    update_weather
    update_pictures
    update_timer
    update_viewports
    if $game_switches[1]==false then #通過1號開關控制信息窗口是否顯示
      @MapInfoWin.visible=false
    else
      @MapInfoWin.visible=true
    end
    @MapInfoWin.refresh
  end

end[/pre]



想找一個模擬養成的腳本
其效果如下
我有用滑鼠操作的腳本(來自90個超級腳本)
未命名.png
梦石
0
星屑
54
在线时间
1208 小时
注册时间
2011-1-23
回帖
881

贵宾

发表于 2013-9-20 23:38:41 | 显示全部楼层
繁体字……
还叫鼠标“滑鼠”……
香港人吗?

点评

我是台灣人沒錯...  发表于 2013-9-21 13:03
滑鼠就是滑鼠 我們才覺得鼠標奇怪  发表于 2013-9-21 07:28
貌似只有台湾同胞才会这样说.....  发表于 2013-9-21 00:56
→→→牛排的小黑屋←←←
回复

使用道具 举报

梦石
0
星屑
266
在线时间
2355 小时
注册时间
2009-3-13
回帖
2257

贵宾

发表于 2013-9-21 10:04:32 | 显示全部楼层
完全可以用事件做。设置一些NPC来执行这些指令,各种数据用变量记录就就可以了。

点评

...呃..不是很統,可否請做個範例?謝謝  发表于 2013-9-21 14:36

评分

参与人数 1星屑 +100 收起 理由
一瞬间的幻觉 + 100 啊不要泄露天机

查看全部评分

回复

使用道具 举报

梦石
0
星屑
266
在线时间
2355 小时
注册时间
2009-3-13
回帖
2257

贵宾

发表于 2013-9-21 16:13:45 | 显示全部楼层
设置一个NPC,里面可以选打工什么的,选了之后等待 X 帧,然后对应的变量增加就可以了。
如果你要做成菜单的话,就搜索一下事件菜单好了。

点评

選項解決了,不過請問要怎樣才能將變量的數值呈現在畫面上?或是另外在菜單中增加一個[目前能力]的功能?  发表于 2013-9-21 22:01
回复

使用道具 举报

火烧大神

梦石
0
星屑
1916
在线时间
954 小时
注册时间
2012-1-1
回帖
1767
发表于 2013-9-21 20:10:48 | 显示全部楼层
目测LZ接触RM不久

纯事件可行。

或者,

使用扩展选项的脚本吧,LZ需要的功能完全可以通过选项的方法来实现。

火兔游戏官网上线啦!!
戳 >>> www.huotuyouxi.com <<<戳
回复

使用道具 举报

梦石
0
星屑
52
在线时间
135 小时
注册时间
2011-11-5
回帖
49
 楼主| 发表于 2013-9-21 22:09:37 | 显示全部楼层
本帖最后由 ji3rul4coco 于 2013-9-21 22:11 编辑
Sion 发表于 2013-9-21 16:13
设置一个NPC,里面可以选打工什么的,选了之后等待 X 帧,然后对应的变量增加就可以了。
如果你要做成菜单 ...



類似像這樣↓
1.png

2.png

点评

:( 显示变量这类问题,用论坛的搜索功能便可以找到  发表于 2013-9-21 23:33
留下你的详细想法,我会在我有空的情况下给你写一个。 当然,如果最近忙起来就抱歉了,  发表于 2013-9-21 22:53
回复

使用道具 举报

梦石
0
星屑
85
在线时间
40 小时
注册时间
2012-7-3
回帖
82
发表于 2013-9-21 22:16:24 | 显示全部楼层
脚本有爱,不过最近忙成球了。
回复

使用道具 举报

梦石
0
星屑
239
在线时间
2399 小时
注册时间
2008-4-11
回帖
11727

贵宾第6届短篇游戏比赛季军

发表于 2013-9-22 01:41:51 | 显示全部楼层
我感觉这个问题你要是继续缠着SION,他应该能帮你解决
回复

使用道具 举报

梦石
0
星屑
52
在线时间
135 小时
注册时间
2011-11-5
回帖
49
 楼主| 发表于 2013-9-22 21:35:45 | 显示全部楼层
ji3rul4coco 发表于 2013-9-21 22:09
類似像這樣↓

就是在菜單裡新增一個選項,選進去後會有數值:xxx

之前找過一個,不過我不會用= =
  1. module WhiteSnow
  2.   CONTENTS_SIZE = 6
  3.     # 表示する変数の数
  4.    
  5.   CONTENTS      = [
  6.     [ { "\\i[10]" => 0 } , {"\\v[15]" => 2} ],
  7.     [ { "\\i[11]" => 0 } , {"\\v[16]" => 2} ],
  8.     [ { "\\i[13]" => 0 } , {"\\v[17]" => 2} ],
  9.     [ { "\\i[14]" => 0 } , {"\\v[18]" => 2} ],
  10.     [ { "\\i[12]" => 0 } , {"\\v[19]" => 2} ],
  11.     [ { "\\i[15]" => 0 } , {"\\v[20]" => 2} ],
  12.                   ]
  13.     # 表示テキスト
  14.     # \\i[n]でn番のアイコンを描画、\\v[n]でn番の変数の値を描画します
  15. end
  16.                
  17. #==============================================================================
  18. # ■ Window_VariablesView
  19. #==============================================================================

  20. class Window_VariablesView < Window_Selectable
  21.   #--------------------------------------------------------------------------
  22.   # ● オブジェクト初期化
  23.   #--------------------------------------------------------------------------
  24.   def initialize
  25. #~     super(0,0, window_width, fitting_height(WhiteSnow::CONTENTS_SIZE))
  26.     super(0,0, window_width, fitting_height(item_max))
  27.     refresh
  28.   end
  29.   #--------------------------------------------------------------------------
  30.   # ● ウィンドウ幅の取得
  31.   #--------------------------------------------------------------------------
  32.   def window_width
  33.     return 160
  34.   end
  35.   #--------------------------------------------------------------------------
  36.   # ● 項目数の取得
  37.   #--------------------------------------------------------------------------
  38.   def item_max
  39. #~     return WhiteSnow::CONTENTS_SIZE
  40.     WhiteSnow::CONTENTS_SIZE - (WhiteSnow::CONTENTS_SIZE / 2)
  41.   end
  42.   #--------------------------------------------------------------------------
  43.   # ● リフレッシュ
  44.   #--------------------------------------------------------------------------
  45.   def refresh
  46.     contents.clear

  47.     WhiteSnow::CONTENTS_SIZE.times do |i|
  48.       WhiteSnow::CONTENTS[i].each do |content|
  49.         t = content.keys.pop
  50.         text = t.dup
  51.         unless text.scan(/\\v\[(\d+)\]/).empty?
  52.           text_v =  text.gsub(/\\v\[(\d+)\]/) { "#{$game_variables[$1.to_i]}" }
  53.           text.nil?
  54.           text = "" if text.nil?
  55.         end
  56.         flag = true if text.scan(/\\i\[(\d+)\]/)
  57.         icon_index = $1.to_i
  58.         text_p = text.dup
  59.         text.gsub!(/\\i\[\d+\]/) { "" }
  60.         
  61.         # 座標計算追加----------------------
  62.         item_width_x = item_width / 2
  63.         x = (i % 2) * item_width_x
  64.         y = (i / 2) * item_height
  65.         # ------------------------------------
  66.         
  67.         if flag
  68.           case content[text_p]
  69.           when 0
  70. #~             draw_icon(icon_index, 0, i * 24)
  71.             draw_icon(icon_index, x, y)
  72.           when 1
  73. #~             draw_icon(icon_index, item_width / 2 - 12, i * 24)
  74.             draw_icon(icon_index, x + item_width_x / 2 - 12, y)
  75.           when 2
  76. #~             draw_icon(icon_index, item_width, i * 24)
  77.             draw_icon(icon_index, x + item_width_x, y)
  78.           end
  79.         end
  80.         if text_v
  81. #~           draw_text(0, i * 24, item_width, item_height, text_v, content[text])
  82.           draw_text(x, y, item_width_x, item_height, text_v, content[text])
  83.         else
  84. #~           draw_text(0, i * 24, item_width, item_height, text, content[text]) unless text.empty?
  85.           draw_text(x, y, item_width_x, item_height, text, content[text]) unless text.empty?
  86.         end
  87.       end
  88.     end
  89.   end
  90.   #--------------------------------------------------------------------------
  91.   # ● ウィンドウを開く
  92.   #--------------------------------------------------------------------------
  93.   def open
  94.     refresh
  95.     super
  96.   end
  97. end

  98. #==============================================================================
  99. # ■ Scene_Menu
  100. #------------------------------------------------------------------------------
  101. #  メニュー画面の処理を行うクラスです。
  102. #==============================================================================

  103. class Scene_Menu < Scene_MenuBase
  104.   #--------------------------------------------------------------------------
  105.   # ● 開始処理
  106.   #--------------------------------------------------------------------------
  107.   alias variables_view_start start
  108.   def start
  109.     variables_view_start
  110.     create_variables_window
  111.   end
  112.   #--------------------------------------------------------------------------
  113.   # ● 変数ウィンドウの作成
  114.   #--------------------------------------------------------------------------
  115.   def create_variables_window
  116.     @variables_window = Window_VariablesView.new
  117.     @variables_window.x = 0
  118.     #@variables_window.y = Graphics.height - @gold_window.height - @variables_window.height
  119.     @variables_window.y = @command_window.height
  120.   end
  121. end
复制代码
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部