查看: 2975|回复: 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

  1. #==============================================================================
  2. # ■ Game_Player
  3. #------------------------------------------------------------------------------
  4. #  處理玩家人物的類。擁有事件啟動的判定、地圖的卷動等功能。
  5. #   本類的實例請參考 $game_player 。
  6. #==============================================================================

  7. class Game_Player < Game_Character
  8.   
  9.   def getX
  10.     @x
  11.   end
  12.   
  13.   def getY
  14.     @y
  15.   end
  16.   
  17. end

  18. #==============================================================================
  19. # ■ Scene_Menu
  20. #------------------------------------------------------------------------------
  21. #  菜單畫面
  22. #==============================================================================

  23. class Scene_Menu < Scene_MenuBase

  24.   #--------------------------------------------------------------------------
  25.   # ● 生成窗口
  26.   #--------------------------------------------------------------------------
  27.   def create_gold_window
  28.     @gold_window = Window_Gold.new
  29.     @gold_window.x = 0
  30.     @gold_window.y = Graphics.height - @gold_window.height
  31.     # 生成地圖信息窗口
  32.     @mapinfos_window = Window_MapInfo.new
  33.     @mapinfos_window.x = 0
  34.     @mapinfos_window.y = Graphics.height - @mapinfos_window.height - @gold_window.height
  35.    
  36.   end
  37.   
  38. end

  39. #==============================================================================
  40. # ■ Window_MapInfo
  41. #------------------------------------------------------------------------------
  42. #  顯示當前信息的窗口。 By SkyZH
  43. #==============================================================================

  44. class Window_MapInfo < Window_Base
  45.   #--------------------------------------------------------------------------
  46.   # ● 初始化對像
  47.   #--------------------------------------------------------------------------
  48.   def initialize
  49.     super(0, 0, window_width, 264)
  50.     self.opacity = 255
  51.     refresh
  52.   end
  53.   #--------------------------------------------------------------------------
  54.   # ● 獲取窗口的寬度
  55.   #--------------------------------------------------------------------------
  56.   def window_width
  57.     return 160
  58.   end
  59.   #--------------------------------------------------------------------------
  60.   # ● 刷新
  61.   #--------------------------------------------------------------------------
  62.   def refresh
  63.     self.contents.clear
  64.     self.contents.font.color = normal_color
  65.     @a=$game_map.width
  66.     @b=$game_map.height
  67.     draw_text(0, 0,             window_width-24, line_height,"智慧 " + $game_variables[1].to_s)
  68.     draw_text(0, line_height, window_width-24, line_height,"魅力 " + $game_variables[2].to_s)
  69.     draw_text(0, line_height*2, window_width-24, line_height,"修養 " + $game_variables[3].to_s)
  70.     draw_text(0, line_height*3, window_width-24, line_height,"體貼 " + $game_variables[4].to_s)
  71.     draw_text(0, line_height*4, window_width-24, line_height,"道德 " + $game_variables[5].to_s)
  72.     draw_text(0, line_height*5, window_width-24, line_height,"自尊 " + $game_variables[6].to_s)
  73.     draw_text(0, line_height*6, window_width-24, line_height,"勇氣 " + $game_variables[7].to_s)
  74.     draw_text(0, line_height*7, window_width-24, line_height,"聲望 " + $game_variables[8].to_s)
  75.   end
  76. end

  77. class Spriteset_Map
  78.   #--------------------------------------------------------------------------
  79.   # ● 初始化對象
  80.   #--------------------------------------------------------------------------
  81.   def initialize
  82.     create_viewports
  83.     create_tilemap
  84.     create_parallax
  85.     create_characters
  86.     create_shadow
  87.     create_weather
  88.     create_pictures
  89.     create_timer
  90.     @MapInfoWin=Window_MapInfo.new
  91.     update
  92.   end
  93.   
  94.   def dispose
  95.     dispose_tilemap
  96.     dispose_parallax
  97.     dispose_characters
  98.     dispose_shadow
  99.     dispose_weather
  100.     dispose_pictures
  101.     dispose_timer
  102.     dispose_viewports
  103.     @MapInfoWin.dispose
  104.   end
  105.   
  106.   def update
  107.     update_tileset
  108.     update_tilemap
  109.     update_parallax
  110.     update_characters
  111.     update_shadow
  112.     update_weather
  113.     update_pictures
  114.     update_timer
  115.     update_viewports
  116.     if $game_switches[1]==false then #通過1號開關控制信息窗口是否顯示
  117.       @MapInfoWin.visible=false
  118.     else
  119.       @MapInfoWin.visible=true
  120.     end
  121.     @MapInfoWin.refresh
  122.   end

  123. end
复制代码




想找一個模擬養成的腳本
其效果如下
我有用滑鼠操作的腳本(來自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.

在本版发帖返回顶部