「rmvx脚本java」rmvx脚本

博主:adminadmin 2022-11-30 08:07:09 79

本篇文章给大家谈谈rmvx脚本java,以及rmvx脚本对应的知识点,希望对各位有所帮助,不要忘了收藏本站喔。

本文目录一览:

RPG Maker VX中如何在战斗中显示怪物的血量,用脚本吗?

功能描述:

① 战斗时让敌人显示血条,宽度可定制

② 可选功能: 显示具体生命值 显示敌人名称

使用说明:

① 脚本插入到Main之前

② 脚本第19行设定血条的默认宽度

为个别敌人指定血条宽度是"数据库-敌角色-备注栏"填写"hp_width=数值"

③ 脚本第20行选择是否显示具体生命值

④ 脚本第21行选择是否显示敌人名称

⑤ 其它参数设定详见脚本

⑥ 此脚本需要基础脚本[读取rmvx备注栏指定字段] #==============================================================================

# ■ 显示敌人血条 by 沉影不器

#------------------------------------------------------------------------------

# 功能描述:

# ① 战斗时让敌人显示血条,宽度可定制

# ② 可选功能: 显示具体生命值 显示敌人名称

# 使用说明:

# ① 脚本插入到Main之前

# ② 脚本第19行设定血条的默认宽度

# 为个别敌人指定血条宽度是"数据库-敌角色-备注栏"填写"hp_width=数值"

# ③ 脚本第20行选择是否显示具体生命值

# ④ 脚本第21行选择是否显示敌人名称

# ⑤ 其它参数设定详见脚本

# ⑥ 此脚本需要基础脚本[读取rmvx备注栏指定字段]

#==============================================================================

# ■ 参数设定

#==============================================================================

module Enemy_HP

HP_WIDTH = 64 # 血条的默认宽度

SHOW_VALUE = false # 是否显示敌人生命值

SHOW_NAME = true # 是否显示敌人名称

NAME_SIZE = 16 # 敌人名称字体大小

NAME_COLOR = 0 # 敌人名称字体颜色

end

#==============================================================================

# ■ RPG

#==============================================================================

module RPG

class Enemy

def hp_width

return self.read_note('hp_width')

end

end

end

#==============================================================================

# ■ Game_Enemy

#==============================================================================

class Game_Enemy Game_Battler

#--------------------------------------------------------------------------

# ○ 血条宽度

#--------------------------------------------------------------------------

def hp_width

return $data_enemies[@enemy_id].hp_width

end

end

#==============================================================================

# ■ Sprite_Battler

#==============================================================================

class Sprite_Battler Sprite_Base

#--------------------------------------------------------------------------

# ◎ 初始化对象

# viewport : 视区

# battler : 战斗者 (Game_Battler)

#--------------------------------------------------------------------------

def initialize(viewport, battler = nil)

super(viewport)

@battler = battler

@battler_visible = false

@effect_type = 0 # 效果种类

@effect_duration = 0 # 效果剩余时间

if @battler.is_a?(Game_Enemy)

width = hp_width + 32

height = 24 + 32

x = @battler.screen_x - width/2

y = @battler.screen_y - height/2

# 调节名称位置

if Enemy_HP::SHOW_NAME

height += Enemy_HP::NAME_SIZE + 2

y -= Enemy_HP::NAME_SIZE + 2

end

# 生成血条窗体

@enemy_hp_window = Window_Base.new(x, y, width, height)

@enemy_hp_window.opacity = 0

@enemy_hp_window.contents_opacity = 0

@enemy_hp_window.contents = Bitmap.new(width - 32, height - 32)

@enemy_hp_window.draw_enemy_info(@battler, 0, 0, width - 32)

# 保存旧血量(控制刷新)

@old_hp = -1

end

end

#--------------------------------------------------------------------------

# ◎ 释放

#--------------------------------------------------------------------------

def dispose

if self.bitmap != nil

self.bitmap.dispose

@enemy_hp_window.dispose

end

super

end

#--------------------------------------------------------------------------

# ◎ 释放敌人活动块

#--------------------------------------------------------------------------

def dispose_enemies

for sprite in @enemy_sprites

sprite.dispose

@enemy_hp_window.dispose

end

end

#--------------------------------------------------------------------------

# ◎ 更新画面

#--------------------------------------------------------------------------

def update

super

if @battler == nil

self.bitmap = nil

else

@use_sprite = @battler.use_sprite?

if @use_sprite

self.x = @battler.screen_x

self.y = @battler.screen_y

self.z = @battler.screen_z

update_battler_bitmap

end

setup_new_effect

update_effect

# 更新血条窗体

if @enemy_hp_window != nil and @old_hp != @battler.hp

@enemy_hp_window.contents.clear

@enemy_hp_window.draw_enemy_info(@battler, 0, 0, hp_width)

@old_hp = @battler.hp

end

end

end

#--------------------------------------------------------------------------

# ◎ 更新出现效果

#--------------------------------------------------------------------------

def update_appear

self.blend_type = 0

self.color.set(0, 0, 0, 0)

self.opacity = (16 - @effect_duration) * 16

# 对象非敌人时返回

return unless @battler.is_a?(Game_Enemy)

@enemy_hp_window.contents_opacity = self.opacity

end

#--------------------------------------------------------------------------

# ◎ 更新消失效果

#--------------------------------------------------------------------------

def update_disappear

self.blend_type = 0

self.color.set(0, 0, 0, 0)

self.opacity = 256 - (32 - @effect_duration) * 10

# 对象非敌人时返回

return unless @battler.is_a?(Game_Enemy)

@enemy_hp_window.contents_opacity = self.opacity

end

#--------------------------------------------------------------------------

# ◎ 更新崩溃效果

#--------------------------------------------------------------------------

def update_collapse

self.blend_type = 1

self.color.set(255, 128, 128, 128)

self.opacity = 256 - (48 - @effect_duration) * 6

# 对象非敌人时返回

return unless @battler.is_a?(Game_Enemy)

@enemy_hp_window.contents_opacity = self.opacity

end

#--------------------------------------------------------------------------

# ○ 血条宽度

#--------------------------------------------------------------------------

def hp_width

result = Enemy_HP::HP_WIDTH

if @battler.is_a?(Game_Enemy)

if @battler.hp_width.to_i == 0

result = Enemy_HP::HP_WIDTH

else

result = @battler.hp_width.to_i

end

end

return result

end

end

#==============================================================================

# ■ Window_Base

#==============================================================================

class Window_Base Window

#--------------------------------------------------------------------------

# ○ 描绘敌人信息

# enemy : 角色

# x : 描绘目标 X 坐标

# y : 描绘目标 Y 坐标

# width : 宽

#--------------------------------------------------------------------------

def draw_enemy_info(enemy, x, y, width = 64)

# 为字体阴影内缩1像素

width -= 1

# 显示名称

if Enemy_HP::SHOW_NAME

self.contents.font.color = text_color(Enemy_HP::NAME_COLOR)

self.contents.font.size = Enemy_HP::NAME_SIZE

self.contents.draw_text(x, y, width, WLH, enemy.name, 1)

self.contents.font.size = Font.default_size

y += Enemy_HP::NAME_SIZE + 2

end

# 描绘血槽

draw_actor_hp_gauge(enemy, x, y, width)

# 描绘生命符号

self.contents.font.color = system_color

self.contents.draw_text(x, y, 30, WLH, Vocab::hp_a)

# 描绘具体生命值

return unless Enemy_HP::SHOW_VALUE

self.contents.font.color = hp_color(enemy)

xr = x + width

self.contents.draw_text(xr - 40, y, 40, WLH, enemy.hp, 2)

end

end

RPG Maker VX和RPG Maker XP脚本最大的区别在哪里?

RMVX和RMXP在脚本(RGSS)上的区别

Enterbrain官方把RMVX使用的脚本称为RGSS2,原来的RMXP脚本则称为RGSS1。

那么RGSS2和RGSS1相比主要有哪些不同呢?请看官方帮助文件的说法:

1,画面解析度从 640×480 变成 544×416,刷新率从每秒 40 帧变成了每秒 60 帧,原来XP的『平滑模式』被废止。

2,新增全屏模式,改成双缓存技术描绘画面。满足推荐配置的情况下,滚动等处理会非常的顺畅。

3,画面长时间不更新会备份脚本,强制终了程序的设定被废除了。即使画面长时间不更新,也能正常处理Windows消息,大多数场合可以用 Alt+F4 关闭RMVX。

4,增加了 Graphics.fadeout、 Graphics.fadein 方法来简单的实现画面的淡入淡出效果。

5,增加了 Graphics.snap_to_bitmap 方法把当前游戏画面转化成位图保存。(用于存盘画面)

6,地图元 (Tilemap) 类为了配合 RPGVX 的标准做了大幅度的变更。

7,位图 (Bitmap) 可以产生模糊、放射性模糊的效果。

8,精灵 (Sprite) 支持波形描画(光栅滚动)的效果。

9,游戏目录下增加了一个Fonts文件夹,里面用来放置游戏中使用的字体文件。可以解决对方系统由于没有安装相应的字体而无法运行游戏的问题。

10,字体 (Font) 显示支持阴影描绘的功能。一些初期值的设定被变更了。

11,视口 (Viewport) 的关联可以在设定后再次进行变更,视口关联的精灵等可以被自动解放。

12,改善了 ME 播放后、恢复播放 BGM 的时机 (Audio.me_play) 。

除了上述以外,还有增加了不少细小的变化。

VX帮助文件中对 RGSS2 新追加,变更的机能都打上了 (RGSS2) 这样的标记。

如果以上文字你看上去还比较爽的话,那么接下来的话可能XP的脚本制作者就要受到一定打击了。

以下文字来自RGSS2脚本素材添加的官方建议

●对脚本素材的用户

 *使用网络上发布的脚本素材时候,请在本处增加一个新的页面并粘贴。

(在左边脚本列表框按鼠标右键选择『插入』)

 *其他,请遵从脚本制作者的特别指示(如果有的话)。

 *原则上,RMXP的脚本和RMVX的脚本没有互换性!

请先确定是针对RMVX开发的脚本素材后再使用。

●对脚本素材的制作者

 开发针对不定用户使用的脚本时,请尽量不要使用再定义,重命名(alias)等方法。建议新开发的脚本只需要添加在本位置就能正常运行。

rmvx脚本使用方法

在脚本编辑器中按ins或者在任何脚本上单击右键有一个插入新脚本

急求一个rpgmaker的脚本

你说的要脚本哈,别后悔:

两个脚本,先新建一个空白的

粘贴一下内容:

#==============================================================================

# 本脚本来自,使用和转载请保留此信息

#==============================================================================

#==============================================================================

# ■ Interpreter (分割定义 4)

#------------------------------------------------------------------------------

# 执行事件命令的解释器。本类在 Game_System 类

# 和 Game_Event 类的内部使用。

#==============================================================================

class Interpreter

#--------------------------------------------------------------------------

# ● 角色的替换

#--------------------------------------------------------------------------

def command_129

# 获取角色

actor = $game_actors[@parameters[0]]

# 角色有效的情况下

if actor != nil

# 操作分支

if @parameters[1] == 0

if @parameters[2] == 1

$game_actors[@parameters[0]].setup(@parameters[0])

end

if $game_party.actors.size == 4

$game_party.add_actor(@parameters[0],2)

else

$game_party.add_actor(@parameters[0])

end

else

$game_party.remove_actor(@parameters[0],3)

end

end

# 继续

return true

end

end

#==============================================================================

# 本脚本来自,使用和转载请保留此信息

#==============================================================================

再新建一个粘贴以下内容

再新建一个粘贴以下内容

再新建一个粘贴以下内容

再新建一个粘贴以下内容

再新建一个粘贴以下内容

再新建一个粘贴以下内容

再新建一个粘贴以下内容

再新建一个粘贴以下内容

再新建一个粘贴以下内容

再新建一个粘贴以下内容

注意:这个脚本放在前面一个上面

#==============================================================================

# 本脚本来自,使用和转载请保留此信息

#==============================================================================

#==============================================================================

# ■ chaochao的人物仓库ver1.02正式版

# 修改了Game_Party

# 功能:

# 用来存放角色的仓库……

# 召唤画面用$scene = Chaochao_Scene_Party.new

# 其它使用说明在代码里已经备注。

#------------------------------------------------------------------------------

# 作者:chaochao

#

#==============================================================================

class Chaochao_Window_PartyLeft Window_Selectable

def initialize

super(0, 0, 320, 224)

self.contents = Bitmap.new(width - 32, height - 32)

self.index = 0

refresh

end

def actor

return @actors[self.index]

end

def refresh

if self.contents != nil

self.contents.dispose

self.contents = nil

end

@actors = []

for i in 0...$game_party.actors.size

@actors.push($game_party.actors[i])

end

@item_max = 4

if @item_max 0

self.contents = Bitmap.new(width - 32, (row_max+1) * 32)

for i in 0...@item_max

draw_item(i)

end

end

end

def draw_item(index)

if @actors[index] != nil

actor = @actors[index]

text = @actors[index].name

lv = @actors[index].level.to_s + " "

if $game_party.chaochao.include?(actor.id) or $game_party.actors.size = 1

self.contents.font.color = Color.new(255, 0, 0) #不能被移动的颜色

else

self.contents.font.color = Color.new(0, 255, 0) #可以被移动的颜色

end

self.contents.draw_text(4, index * 32 + 32, 288, 32, text)

self.contents.font.color = normal_color

self.contents.font.size = 16

self.contents.draw_text(4, index * 32 + 36, 288, 32, "Level: ", 2)

colorx = [255.0000 - 255.0000/60 * @actors[index].level,0].max

colory = [255.0000 / 60 * @actors[index].level,255].min

self.contents.font.color = Color.new(colorx, colory, 0)

self.contents.draw_text(4, index * 32 + 36, 288, 32, lv, 2)

self.contents.font.color = normal_color

self.contents.font.size = 22

else

self.contents.draw_text(4, index * 32 + 32, 288, 32, "米有人物!")

end

end

def update_cursor_rect

if @index 0

self.cursor_rect.empty

return

end

row = @index / @column_max

if row self.top_row

self.top_row = row

end

if row self.top_row + (self.page_row_max - 1)

self.top_row = row - (self.page_row_max - 1)

end

cursor_width = self.width / @column_max - 32

x = @index % @column_max * (cursor_width + 32)

y = @index / @column_max * 32 - self.oy + 32

self.cursor_rect.set(x, y, cursor_width, 32)

end

def item_max

return @item_max

end

def actor?(index)

return @actors[index] == nil ? false : true

end

def set_index(x)

@index = x

end

end

#------------------------------------------------------------------------------

class Chaochao_Window_PartyRight Window_Selectable

def initialize

super(320, 0, 320, 224)

self.contents = Bitmap.new(width - 32, height - 32)

self.index = -1

refresh

end

def actor

return @actors[self.index]

end

def refresh

if self.contents != nil

self.contents.dispose

self.contents = nil

end

@actors = []

for i in 0...$game_party.actors2.size

@actors.push($game_party.actors2[i])

end

@item_max = $game_party.actors2.size

if @item_max 0

self.contents = Bitmap.new(width - 32, row_max * 32)

for i in 0...@item_max

draw_item(i)

end

elsif @item_max == 0

end

end

def draw_item(index)

actor = @actors[index]

text = @actors[index].name

lv = @actors[index].level.to_s + " "

if $game_party.chaochao2.include?(actor.id) or $game_party.actors.size = 4

self.contents.font.color = Color.new(255, 0, 0) #不能被移动的颜色

else

self.contents.font.color = Color.new(0, 255, 0) #可以被移动的颜色

end

self.contents.draw_text(4, index * 32, 288, 32, text)

self.contents.font.color = normal_color

self.contents.font.size = 16

self.contents.draw_text(4, index * 32 + 4, 288, 32, "Level: ", 2)

colorx = [255.0000 - 255.0000/60 * @actors[index].level,0].max

colory = [255.0000 / 60 * @actors[index].level,255].min

self.contents.font.color = Color.new(colorx, colory, 0)

self.contents.draw_text(4, index * 32 + 4, 288, 32, lv, 2)

self.contents.font.color = normal_color

self.contents.font.size = 22

end

def update_cursor_rect

if @index 0

self.cursor_rect.empty

return

end

row = @index / @column_max

if row self.top_row

self.top_row = row

end

if row self.top_row + (self.page_row_max - 1)

self.top_row = row - (self.page_row_max - 1)

end

cursor_width = self.width / @column_max - 32

x = @index % @column_max * (cursor_width + 32)

y = @index / @column_max * 32 - self.oy

self.cursor_rect.set(x, y, cursor_width, 32)

end

def item_max

return @item_max

end

def actor?(index)

return @actors[index] == nil ? false : true

end

def set_index(x)

@index = x

end

end

#------------------------------------------------------------------------------

class Chaochao_Window_PartyData Window_Base

def initialize

super(0, 224, 640, 256)

self.contents = Bitmap.new(width - 32, height - 32)

@actor = nil

end

def set_actor(actor)

self.contents.clear

draw_actor_name(actor, 4, 0)

draw_actor_state(actor, 140, 0)

draw_actor_hp(actor, 284, 0)

draw_actor_sp(actor, 460, 0)

@actor = actor

self.visible = true

end

def clear

self.contents.clear

end

end

#------------------------------------------------------------------------------

class Game_Party

attr_reader :actors2

attr_reader :chaochao#不能从队伍向备用角色移动的角色ID

attr_reader :chaochao2#不能从备用角色向队伍移动的角色ID

def initialize

@actors = []

@gold = 0

@steps = 0

@items = {}

@weapons = {}

@armors = {}

@actors2 = []

@chaochao = []

@chaochao2 = []

end

def add_actor(actor_id,type=1)#type为1是向队伍中添加,为2则相反。

case type

when 1

if $game_actors[actor_id] != nil

actor = $game_actors[actor_id]

#如果队伍没有满和队伍中没有此角色

if @actors.size 4 and not @actors.include?(actor) and not @actors2.include?(actor)

@actors.push(actor)

$game_player.refresh

end

end

when 2

if $game_actors[actor_id] != nil

actor = $game_actors[actor_id]

#如果角色不在队伍中和不在备用角色队伍中的情况下

#向备用角色中添加角色

if not @actors.include?(actor) and not @actors2.include?(actor)

@actors2.push(actor)

$game_player.refresh

end

end

end

end

def huanren(index,type=1)#type为1是从备用角色向队伍中移动,为2则相反。

case type

when 1

id = @actors2[index].id

actor = $game_actors[id]

if @actors.size 4 and not @chaochao2.include?(index) #and not @actors.include?(actor)

@actors.push(actor)

#@actors2.delete(actor)

@actors2.each do |i|

@actors2.delete(i) if i.id == actor.id

end

$game_system.se_play($data_system.decision_se)

$game_player.refresh

end

when 2

id = @actors[index].id

actor = $game_actors[id]

if actor != nil and not @chaochao.include?(index)

@actors2.push(actor)

@actors.each do |i|

@actors.delete(i) if i.id == actor.id

end

$game_system.se_play($data_system.decision_se)

$game_player.refresh

end

end

end

#type1,1是操作队伍中的角色能否向备用队伍移动,2则相反。

#type2,1是添加不能移动的,2是删除不能移动的。

def yidong(actor_id,type1,type2=1)

case type2

when 1

case type1

when 1

@chaochao.push(actor_id)

when 2

@chaochao2.push(actor_id)

end

when 2

case type1

when 1

@chaochao.delete(actor_id)

when 2

@chaochao2.delete(actor_id)

end

end

end

#type,1从队伍中离开,2从备用角色中离开,3从队伍和备用角色中离开。

def remove_actor(actor_id,type=1)

actor = $game_actors[actor_id]

case type

when 1

@actors.delete(actor)

$game_player.refresh

when 2

@actors2.delete(actor)

$game_player.refresh

when 3

@actors.delete(actor)

@actors2.delete(actor)

$game_player.refresh

end

end

def refresh

new_actors = []

new_actors2 = []

for i in 0...@actors.size

if $game_actors[@actors[i].id] != nil

new_actors.push($game_actors[@actors[i].id])

end

end

@actors = new_actors

for i in 0...@actors2.size

if $game_actors[@actors2[i].id] != nil

new_actors2.push($game_actors[@actors2[i].id])

end

end

@actors2 = new_actors2

end

end

#------------------------------------------------------------------------------

class Chaochao_Scene_Party

def main

@left_temp_command = 0

@right_temp_command = 0

@temp = 0

@left_window = Chaochao_Window_PartyLeft.new

@left_window.active = true

@right_window = Chaochao_Window_PartyRight.new

@right_window.active = false

@data_window = Chaochao_Window_PartyData.new

update_data

Graphics.transition

loop do

Graphics.update

Input.update

update

if $scene != self

break

end

end

Graphics.freeze

@left_window.dispose

@right_window.dispose

@data_window.dispose

end

def update

@left_window.update

@right_window.update

@data_window.update

update_command

update_data

end

def update_command

if Input.trigger?(Input::B)

$game_system.se_play($data_system.cancel_se)

#画面切换

$scene = Scene_Map.new

return

end

if @left_window.active

update_left

return

end

if @right_window.active

update_right

return

end

end

def update_left

if Input.trigger?(Input::RIGHT)

if @right_window.item_max 0

@left_temp_command = @left_window.index

@left_window.set_index(-1)

$game_system.se_play($data_system.cursor_se)

@left_window.active = false

@right_window.active = true

@left_window.refresh

@right_window.refresh

@right_window.set_index(@right_temp_command)

return

else

$game_system.se_play($data_system.buzzer_se)

return

end

end

if Input.trigger?(Input::C)

if @left_window.active and @left_window.actor?(@left_window.index) and $game_party.actors.size 1 and not $game_party.chaochao.include?($game_party.actors[@left_window.index].id)

$game_party.huanren(@left_window.index,2)#type为1是从备用角色向队伍中移动,为2则相反。

@left_window.refresh

@right_window.refresh

else

$game_system.se_play($data_system.buzzer_se)

end

end

return

end

def update_right

if Input.trigger?(Input::LEFT)

if @left_window.item_max 0

@right_temp_command = @right_window.index

@right_window.set_index(-1)

$game_system.se_play($data_system.cursor_se)

@left_window.active = true

@right_window.active = false

@left_window.refresh

@right_window.refresh

@left_window.set_index(@left_temp_command)

return

else

$game_system.se_play($data_system.buzzer_se)

return

end

end

if Input.trigger?(Input::C)

if $game_party.actors.size = 4

$game_system.se_play($data_system.buzzer_se)

return

end

if @right_window.active and @right_window.actor?(@right_window.index) and not $game_party.chaochao2.include?($game_party.actors2[@right_window.index].id)

$game_party.huanren(@right_window.index,1)#type为1是从备用角色向队伍中移动,为2则相反。

if $game_party.actors2.size == 0

@right_temp_command = @right_window.index

@right_window.set_index(-1)

$game_system.se_play($data_system.cursor_se)

@left_window.active = true

@right_window.active = false

@left_window.refresh

@right_window.refresh

@left_window.set_index(@left_temp_command)

end

if @right_window.index 0

@right_window.set_index(@right_window.index-1)

end

@left_window.refresh

@right_window.refresh

else

$game_system.se_play($data_system.buzzer_se)

end

end

return

end

def update_data

if @left_window.active

if $game_party.actors[@left_window.index] != nil

@data_window.set_actor($game_party.actors[@left_window.index])

else

@data_window.clear

end

return

end

if @right_window.active

if $game_party.actors2[@right_window.index] != nil

@data_window.set_actor($game_party.actors2[@right_window.index])

else

@data_window.clear

end

return

end

end

end

#==============================================================================

# 本脚本来自,使用和转载请保留此信息

#==============================================================================

运行次脚本:$scene = Chaochao_Scene_Party.new

66rpg脚本怎么用,那么一大堆乱七八糟的代码是怎么用的?

66rpg是基于RMXP或RMVX框架,不能说成是:“66rpg脚本”;

如:工程量不大的话,就直接在对应的脚本名下找到对应行数写就行了

如:添加一个大的功能类的话,那只要打开工具——脚本编辑器,看看左边的脚本名列表,最下面有个“外来脚本插于此处”什么的,右键点一下,插一个,命个名,OK,把你要写的代码文本粘到右边的大编辑框里就行了,

补充:脚本(script)是使用一种特定的描述性语言,依据一定的格式编写的可执行文件,又称作宏或批处理文件。脚本是批处理文件的延伸,是一种纯文本保存的程序,一般来说的计算机脚本程序是确定的一系列控制计算机进行运算操作动作的组合,在其中可以实现一定的逻辑分支等。

关于rmvx脚本java和rmvx脚本的介绍到此就结束了,不知道你从中找到你需要的信息了吗 ?如果你还想了解更多这方面的信息,记得收藏关注本站。

The End

发布于:2022-11-30,除非注明,否则均为首码项目网原创文章,转载请注明出处。