设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
楼主: 冰舞蝶恋
打印 上一主题 下一主题

[推荐问答] 【<菜鸟问题收容所> 】

   关闭 [复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
26 小时
注册时间
2010-12-30
帖子
29
261
发表于 2011-1-4 13:17:05 | 只看该作者
回复 冰舞蝶恋 的帖子

就像是一般武器白色
      再上等绿色
      再上等蓝色
      再往上紫色、橙色、红色
      六个品级
  不需要前缀  只更改物品装备名字的色彩

you are my destiny
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
518 小时
注册时间
2010-6-16
帖子
1073
262
发表于 2011-1-4 15:08:25 | 只看该作者
回复 a55666aaa 的帖子
  1. #==============================================================================
  2. # ** [ERZVX] Enhanced Bitmap#draw_text (by ERZENGEL at 27-April-2008 at 19:53)
  3. #------------------------------------------------------------------------------
  4. #  Bitmap#draw_text is able to convert control characters.
  5. #==============================================================================
  6. =begin
  7. ###############################################################################

  8. Default control characters:

  9. \V[n]    Replaced by the value of variable n (n = ID of a variable).
  10. \N[n]    Replaced by the name of actor n (n = ID of an actor).
  11. \C[n]    Change the color of the following text(n = 0 til 31).
  12. \G       Replaced by the current gold amount.
  13. \\       Replaced by the '\' character.

  14. Control characters from woratanas NMS (v2.52):

  15. \MAP      Replaced by the current map name.
  16. \NC[n]    Replaced by the class of actor n (n = ID of an actor).
  17. \NP[n]    Replaced by the name of actor n in the party (n = integer between 1 and 4).
  18. \NM[n]    Replaced by the name of enemy n (n = ID of an enemy).
  19. \NT[n]    Replaced by the name of troop n (n = ID of a troop).
  20. \NI[n]    Replaced by the name of item n (n = ID of an item).
  21. \NW[n]    Replaced by the name of weapon n (n = ID of a weapon).
  22. \NA[n]    Replaced by the name of armor n (n = ID of an armor).
  23. \NS[n]    Replaced by the name of skill n (n = ID of a skill).
  24. \PRICE[n] Replaced by the price of the item n (n = ID of an item).
  25. \IC[n]    Replaced by the icon with the index n (n = Index of icon in the Iconset).
  26. \DW[n]    Replaced by the icon and name of weapon n (n = ID of a weapon).
  27. \DI[n]    Replaced by the icon and name of item n (n = ID of an item).
  28. \DA[n]    Replaced by the icon and name of armor n (n = ID of an armor).
  29. \DS[n]    Replaced by the icon and name of skill n (n = ID of a skill).
  30. \FN[str]  Following text is in font str (str = name of a font).
  31. \FS[n]    Following text is in fontsize n (n = integer. Standard is 20).

  32. Other control characters:

  33. \BO       Following text is or isn't bold.
  34. \IT       Following text is or isn't italic.
  35. \SH       Folling text is or isn't shadowed.
  36. \AL[n]    Align text (n = integer between 0 and 2 (0 = left, 1 = center, 2 = right)).

  37. ###############################################################################
  38. =end
  39. #==============================================================================
  40. # ** Bitmap
  41. #==============================================================================
  42. class Bitmap
  43.   #--------------------------------------------------------------------------
  44.   # * Draw text
  45.   #--------------------------------------------------------------------------
  46.   alias :erzvx_draw_text :draw_text unless $@
  47.   def draw_text(*args)
  48.     # Falls erstes Argument ein Rectobjekt ist
  49.     if args[0].is_a?(Rect)
  50.       if args.size > 3 then raise(ArgumentError) end
  51.       x, y, width, height = args[0].x, args[0].y, args[0].width, args[0].height
  52.       str = args[1]
  53.       align = args[2]
  54.     else
  55.       if args.size > 6 then raise(ArgumentError) end
  56.       x, y, width, height, str, align = args[0..5]
  57.     end
  58.     # Links ausrichten, falls Wert von align nil oder größer als 2 ist
  59.     align = 0 if align.nil? || align > 2
  60.     # Standardeigenschaften in Variablen speichern
  61.     name, size,   color  = self.font.name, self.font.size,   self.font.color
  62.     bold, italic, shadow = self.font.bold, self.font.italic, self.font.shadow
  63.     # Temporäre Variablen erstellen
  64.     tstr = (str.is_a?(String) ? str : str.to_s) + "\n";  tc = '';  tx = 0
  65.     begin
  66.       lasttstr = tstr.clone
  67.       tstr = convert_special_characters(tstr)
  68.     end until tstr == lasttstr
  69.     while (!(c = tstr.slice!(/./m)).nil?)
  70.       case c
  71.       when "\x01"  # \C[n]
  72.         tstr.sub!(/\[([0-9]+)\]/, "")
  73.         tcolor = $1.to_i
  74.         self.font.color = text_color(tcolor) if tcolor >= 0 && tcolor <= 31
  75.       when "\x02"  # \C[n]
  76.         tstr.sub!(/\[([0-2]+)\]/, "")
  77.         align = $1.to_i        
  78.       when "\x83"  # \IC[n]
  79.         tstr.sub!(/\[([0-9]+)\]/, "")
  80.         icon_index = $1.to_i
  81.         draw_icon(icon_index, x, y)
  82.         tx += 24
  83.       when "\x84"  # \FN[*]
  84.         tstr.sub!(/\[(.*?)\]/, "")
  85.         self.font.name = $1.to_s
  86.       when "\x85"  # \FS[n]
  87.         tstr.sub!(/\[([0-9]+)\]/, "")
  88.         self.font.size = $1.to_i
  89.       when "\x88"  # \BO
  90.         self.font.bold = !self.font.bold
  91.       when "\x89"  # \IT
  92.         self.font.italic = !self.font.italic
  93.       when "\x93"  # \SH
  94.         self.font.shadow = !self.font.shadow
  95.       when "\n"    # Neue Zeile
  96.         if align == 1     # Zentriert
  97.           tx = width - tx
  98.           tx = tx / 2
  99.           erzvx_draw_text((x + tx), y, (width - tx), height, tc)
  100.         elsif align == 2  # Rechts
  101.           tx = width - tx
  102.           erzvx_draw_text((x + tx), y, (width - tx), height, tc)
  103.         end
  104.         # Temporäre Variablen zurücksetzen
  105.         tc = tstr = '';  tx = 0
  106.       else         # Normal text character
  107.         # Ausrichtungsabfrage (Links)
  108.         if align == 0
  109.           erzvx_draw_text((x + tx), y, width, height, c, align)
  110.           tx += text_size(c).width
  111.         else
  112.           tc += c
  113.           tx += text_size(c).width
  114.         end
  115.       end
  116.     end
  117.     # Standardeigenschaften wiederherstellen
  118.     self.font.name, self.font.size,   self.font.color  = name, size,   color
  119.     self.font.bold, self.font.italic, self.font.shadow = bold, italic, shadow
  120.   end
  121.   #--------------------------------------------------------------------------
  122.   # * Convert Special Characters
  123.   #--------------------------------------------------------------------------
  124.   def convert_special_characters(str)
  125.     # Mit Wert einer Variable ersetzen
  126.     str.gsub!(/\\V\[([0-9]+)\]/i) { $game_variables[$1.to_i] }
  127.     # Mit Namen eines Heldens ersetzen
  128.     str.gsub!(/\\N\[([0-9]+)\]/i) { $game_actors[$1.to_i].name }
  129.     # Nachfolgenden Text in anderer Farbe anzeigen
  130.     str.gsub!(/\\C\[([0-9]+)\]/i) { "\x01[#{$1}]" }
  131.     # Mit dem aktuellen Goldbetrag ersetzen
  132.     str.gsub!(/\\G/) { $game_party.gold.to_s }
  133.     # Backslash anzeigen
  134.     str.gsub!(/\\\\/) { "\\" }
  135.     # Ausrichtung ändern
  136.     str.gsub!(/\\AL\[([0-2]+)\]/i) { "\x02[#{$1}]" }
  137.     # Woratana's :: Map Name
  138.     str.gsub!(/\\MAP/i) { get_map_name }
  139.     # Woratana's :: Actor Class Name
  140.     str.gsub!(/\\NC\[([0-9]+)\]/i) {
  141.       $data_classes[$data_actors[$1.to_i].class_id].name }
  142.     # Woratana's :: Party Actor Name
  143.     str.gsub!(/\\NP\[([0-9]+)\]/i) { $game_party.members[($1.to_i - 1)].name }
  144.     # Woratana's :: Monster Name
  145.     str.gsub!(/\\NM\[([0-9]+)\]/i) { $data_enemies[$1.to_i].name }
  146.     # Woratana's :: Troop Name
  147.     str.gsub!(/\\NT\[([0-9]+)\]/i) { $data_troops[$1.to_i].name }
  148.     # Woratana's :: Item Name
  149.     str.gsub!(/\\NI\[([0-9]+)\]/i) { $data_items[$1.to_i].name }
  150.     # Woratana's :: Weapon Name
  151.     str.gsub!(/\\NW\[([0-9]+)\]/i) { $data_weapons[$1.to_i].name }
  152.     # Woratana's :: Armor Name
  153.     str.gsub!(/\\NA\[([0-9]+)\]/i) { $data_armors[$1.to_i].name }
  154.     # Woratana's :: Skill Name
  155.     str.gsub!(/\\NS\[([0-9]+)\]/i) { $data_skills[$1.to_i].name }
  156.     # Woratana's :: Item Price
  157.     str.gsub!(/\\PRICE\[([0-9]+)\]/i) { $data_items[$1.to_i].price.to_s }
  158.     # Woratana's :: Draw Icon
  159.     str.gsub!(/\\IC\[([0-9]+)\]/i) { "\x83[#{$1}]" }
  160.     # Woratana's :: Draw Weapon Name + Icon
  161.     str.gsub!(/\\DW\[([0-9]+)\]/i) {
  162.       "\x83[#{$data_weapons[$1.to_i].icon_index}]\\NW[#{$1.to_i}]" }
  163.     # Woratana's :: Draw Item Name + Icon
  164.     str.gsub!(/\\DI\[([0-9]+)\]/i) {
  165.       "\x83[#{$data_items[$1.to_i].icon_index}]\\NI[#{$1.to_i}]" }
  166.     # Woratana's :: Draw Armor Name + Icon
  167.     str.gsub!(/\\DA\[([0-9]+)\]/i) {
  168.       "\x83[#{$data_armors[$1.to_i].icon_index}]\\NA[#{$1.to_i}]" }
  169.     # Woratana's :: Draw Skill Name + Icon
  170.     str.gsub!(/\\DS\[([0-9]+)\]/i) {
  171.       "\x83[#{$data_skills[$1.to_i].icon_index}]\\ns[#{$1.to_i}]" }
  172.     # Woratana's :: Font Name Change
  173.     str.gsub!(/\\FN\[(.*?)\]/i) { "\x84[#{$1}]" }
  174.     # Woratana's :: Font Size Change
  175.     str.gsub!(/\\FS\[([0-9]+)\]/i) { "\x85[#{$1}]" }
  176.     # Woratana's :: BOLD Text
  177.     str.gsub!(/\\BO/i) { "\x88" }
  178.     # Woratana's :: ITALIC Text
  179.     str.gsub!(/\\IT/i) { "\x89" }
  180.     # Woratana's :: SHADOW Text
  181.     str.gsub!(/\\SH/i) { "\x93" }
  182.     return str
  183.   end
  184.   #--------------------------------------------------------------------------
  185.   # * Get Text Color
  186.   #--------------------------------------------------------------------------
  187.   def text_color(n)
  188.     x = 64 + (n % 8) * 8
  189.     y = 96 + (n / 8) * 8
  190.     windowskin = Cache.system('Window')
  191.     return windowskin.get_pixel(x, y)
  192.   end
  193.   #--------------------------------------------------------------------------
  194.   # * Get Map Name
  195.   #--------------------------------------------------------------------------
  196.   def get_map_name
  197.     $data_mapinfos = load_data('Data/MapInfos.rvdata') if $data_mapinfos.nil?
  198.     map_id = $game_map.map_id
  199.     return $data_mapinfos[map_id].name
  200.   end
  201.   #--------------------------------------------------------------------------
  202.   # * Draw Icon
  203.   #--------------------------------------------------------------------------
  204.   def draw_icon(icon_index, x, y)
  205.     bitmap = Cache.system('Iconset')
  206.     rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
  207.     self.blt(x, y, bitmap, rect)
  208.   end
  209. end
复制代码
在道具名称前放\c[X]X为自定义颜色,类似对话颜色~
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
26 小时
注册时间
2010-12-30
帖子
29
263
发表于 2011-1-4 17:37:12 | 只看该作者
回复 Rion幻音 的帖子

万岁谢谢前辈

点评

叫我前辈压力蛮大的……=w=|||  发表于 2011-1-4 17:40

you are my destiny
回复 支持 反对

使用道具 举报

Lv2.观梦者

花开堪折直须折

梦石
0
星屑
671
在线时间
943 小时
注册时间
2010-7-17
帖子
4963

贵宾

264
 楼主| 发表于 2011-1-4 17:45:48 | 只看该作者
回复 a55666aaa 的帖子

别叫她前辈。。此人对年龄特别敏感。。。。
嗯,叫大神好了!

点评

额 原来如此  发表于 2011-1-4 18:15
大家好,我叫节操,有一天,我被吃了。
http://forever-dream.5d6d.com
永恒の梦制作组论坛

129993099
永恒の梦制作组QQ群
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
133 小时
注册时间
2010-12-25
帖子
130
265
发表于 2011-1-4 19:19:33 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
4221
在线时间
1879 小时
注册时间
2010-12-21
帖子
2334
266
发表于 2011-1-4 19:49:18 | 只看该作者
本帖最后由 黄亦天 于 2011-1-4 19:50 编辑

回复 skulldownz 的帖子

表示帖子空间和眼睛没啥关系,字小看着是真累眼睛……(话说怎么一会功夫连回复都改字号了?)
并且点评是分行,而且还是倒序,我等因为不习惯于是就思维混乱了……
脚本什么的仅仅是依样画葫芦,还没有达到真正意义上的改动……
另外,点评系统限制字数,习惯于一气呵成的表示很痛苦
(以上内容其实本来是想写在点评里的,因为字数限制就改成回复了)

以上是牢骚
以下是正题
关于这句完全理解不能:
$scene.spriteset.viewport2.visible =! $scene.spriteset.viewport2.visible
=! 不是判定用的么?
而且左右都是一样的?=! 能为true么?

(我是牢骚帝,牢骚可54之)
绿坝娘素材库企划

素材库获取方法:暂时中止,需求者私聊。
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
133 小时
注册时间
2010-12-25
帖子
130
267
发表于 2011-1-4 19:56:42 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
回复 支持 反对

使用道具 举报

Lv2.观梦者

花开堪折直须折

梦石
0
星屑
671
在线时间
943 小时
注册时间
2010-7-17
帖子
4963

贵宾

268
 楼主| 发表于 2011-1-4 20:13:12 | 只看该作者
高人啊,高人!

吾辈这个菜鸟来自己的帖子发个提问。。。
问题名称:脚本if,when,elsif的区分?
问题状况:貌似if,when都是当...的时候,也就是判断。。elsif貌似是当不符合的情况下,再判断?梦魇对此一头雾水。。

点评

所以一般用来判断when 的值(域)不相交..  发表于 2011-1-4 21:33
when ...有点像事件页中的 变量判断.哦..  发表于 2011-1-4 21:21
如果你要本质等级的回答..我就不行了..因为毕竟我没有实际编写语言的资料...一切都来自课本...我只能敷衍的回答你..效率用途有点不一样...  发表于 2011-1-4 21:19
我也想问一下,假如后面的when的条件可以包含了前面when的条件,是不是后面when的条件就会覆盖前面的when的条件?  发表于 2011-1-4 21:10
if ... elseif ... elseif ... else ...end 是这样的关系  发表于 2011-1-4 20:59
大家好,我叫节操,有一天,我被吃了。
http://forever-dream.5d6d.com
永恒の梦制作组论坛

129993099
永恒の梦制作组QQ群
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
133 小时
注册时间
2010-12-25
帖子
130
269
发表于 2011-1-4 20:48:59 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
34 小时
注册时间
2010-6-19
帖子
5
270
发表于 2011-1-6 22:49:34 | 只看该作者
问题名称:帧对应事件
问题状况:如何让每一帧或者每十几帧对应事件?
求解
还有论坛的脚本手册在哪里?
回复 支持 反对

使用道具 举报

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

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-9-26 12:28

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表