aki aportare con algunos scripts
Script de plataformas estilo mario bros: Este script sirve para hacer que el juego sea en sentido lateral al estilo mario bros y ademas puedes saltar.
instrucciones:crear una nueva categoria sobre main y coloca
Spoiler
Código:
# ▼▲▼ XRXS50. Action-Maps XC. ▼▲▼ built 033010
# by 桜雅 在土
#=====================================================
# □ カスタマイズポイント
#=====================================================
class XRXS50
#
# Action-Maps を稼動させるマップIDの配列
#
ENABLE_FULL_ACTY_MAPS = [1, 2]#
# 「斜め降下」
#
ENABLE_SLIDE_DESCENT = true
#
# 向きジャンプ(true : 向いている方向へジャンプ。
# false : キーが押されている方向へジャンプ。)
#
JUMP_AS_KEY = false
end
#=======================================================
# ■ Game_Player
#=======================================================
class Game_Player < Game_Character
#-------------------------------------------------------
# ○ 公開インスタンス変数
#--------------------------------------------------------
# 既存
attr_writer :direction_fix
attr_accessor :walk_anime
# 新規
attr_accessor :now_jumps
attr_writer :xrxs50_direction_sidefix
#-------------------------------------------------------
# ○ 最大ジャンプ回数
#--------------------------------------------------------
def max_jumps
return 1
end
#--------------------------------------------------------
# ● 左を向く
#--------------------------------------------------------
alias xrxs50_turn_left turn_left
def turn_left
if @xrxs50_direction_sidefix
@direction = 4
else
xrxs50_turn_left
end
end
#-------------------------------------------------------
# ● 右を向く
#------------------------------------------------------
alias xrxs50_turn_right turn_right
def turn_right
if @xrxs50_direction_sidefix
@direction = 6
else
xrxs50_turn_right
end
end
end
#========================================================
# ■ Scene_Map
#========================================================
class Scene_Map
#--------------------------------------------------------
# ● メイン処理
#----------------------------------------------------------
alias xrxs50_main main
def main
# チェック
xrxs50_enable_check
# 呼び戻す
xrxs50_main
end
#---------------------------------------------------------
# ● フレーム更新
#---------------------------------------------------------
alias xrxs50_update update
def update
# 呼び戻す
xrxs50_update
# フレーム更新 (座標系更新)
if @xrxs50_enable
update_coordinates
end
end
#------------------------------------------------------------
# ○ フレーム更新 (座標系更新)
#------------------------------------------------------------
def update_coordinates
if $game_player.passable?($game_player.x,$game_player.y,2)
unless $game_player.moving?
if XRXS50::ENABLE_SLIDE_DESCENT and
Input.press?(Input::RIGHT) and
$game_player.passable?($game_player.x,$game_player.y+1,6)
$game_player.move_lower_right
elsif XRXS50::ENABLE_SLIDE_DESCENT and
Input.press?(Input::LEFT) and
$game_player.passable?($game_player.x,$game_player.y+1,4)
$game_player.move_lower_left
else
$game_player.move_down
end
end
else
$game_player.move_down
$game_player.walk_anime = true unless $game_player.walk_anime
$game_player.now_jumps = 0
if Input.trigger?(Input::X) and
$game_player.now_jumps < $game_player.max_jumps
if XRXS50::JUMP_AS_KEY
direction = $game_player.direction == 4 ? -1 : 1
else
if Input.press?(Input::RIGHT)
direction = 1
elsif Input.press?(Input::LEFT)
direction = -1
else
direction = 0
end
end
$game_player.jump(direction, -2)
$game_player.now_jumps += 1
$game_player.walk_anime = false
end
end
end
#-------------------------------------------------------
# ● プレイヤーの場所移動
#-------------------------------------------------------
alias xrxs50_transfer_player transfer_player
def transfer_player
# 呼び戻す
xrxs50_transfer_player
# チェック
xrxs50_enable_check
end
#--------------------------------------------------------
# ○ XRXS50 が稼動するか判定
#---------------------------------------------------------
def xrxs50_enable_check
if XRXS50::ENABLE_FULL_ACTY_MAPS.include?($game_map.map_id)
$game_player.now_jumps = 0 if $game_player.now_jumps.nil?
@xrxs50_enable = true
$game_player.direction_fix = true
$game_player.xrxs50_direction_sidefix = true
else
@xrxs50_enable = false
$game_player.direction_fix = false
$game_player.xrxs50_direction_sidefix = false
end
end
end
flechas isquierda y derecha: mover
Flecha arriba: saltar
[script]Ventana emergente antes de jugar
como su nombre lo indica, este script sirve para que al abrir el juego salga una ventana diciendo algo que tu ayas escito
instrucciones:
crear uno nuevo encima de main y coloca
Spoiler
Código:
#---Script para mensaje al principio del juego--#
begin
print "tu mensaje"
end
en donde dice 'tu mensaje' cambialo por el texto que tu quieras.
[script]resalto de opciones
si se entiende, este script sirve para que cuando uno pone el marco sobre una opcion esta resalte
solo crear uno nuevo encima de main y colocar
Spoiler
Código:
#==============================================================================
# Reruri-Chan : don't forgett the credits -.-
# Gato : 0.o it would be really better for you if you don't forgett them XD
# Carol13 : yes! >.<
#==============================================================================
# ■ Make a new event call it like you want.. for
# example RgC
# Reruri-Chan Gato Carol
# Roling Games Cops *löl*
#------------------------------------------------------------------------------
# Shouting! >.<
# By Reruri-Chan , Gato , and Carol13
#==============================================================================
class Window_Command < Window_Selectable
def initialize(width, commands)
super(0, 0, width, commands.size * 32 + 32)
@item_max = commands.size
@commands = commands
self.contents = Bitmap.new(width - 32, @item_max * 32)
@item = []
self.index = 0
refresh
@oldindex = 0
end
#--------------------------------------------------------------------------
def refresh
self.contents.clear
for i in 0...@item_max
if i != self.index
draw_item_dis(i)
else
draw_item_active(i,@item[i])
end
end
end
#--------------------------------------------------------------------------
# colors and font name etc.
#--------------------------------------------------------------------------
def draw_item_dis(index)
self.contents.font.name = "Arial"
self.contents.font.size -= 2
self.contents.font.color = disabled_color
rect = Rect.new(4+16, 32 * index, self.contents.width - 24, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
self.contents.draw_text(rect, @commands[index])
self.contents.font.size += 2
end
def draw_item_active(index, type)
self.contents.font.name = "Arial"
self.contents.font.color = Color.new(0,0,0,255)
self.contents.draw_text(5,32*index+1,self.contents.width,32, @commands[index])
if type==1
self.contents.font.color = disabled_color
else
self.contents.font.color = Color.new(255,255,220,255)
end
self.contents.draw_text(4,32*index,self.contents.width,32, @commands[index])
end
#--------------------------------------------------------------------------
# index
#--------------------------------------------------------------------------
def disable_item(index)
@item[index] = 1
end
#--------------------------------------------------------------------------
# update
#--------------------------------------------------------------------------
def update
super
#——refresh
if self.index != @oldindex
@oldindex = self.index
refresh
end
end
end
Última edición por The_Virus_X fecha: 27-abr-2008 a las 07:12.
Ubicación: vergel radiante(bastion hueco), postigo del castillo
Mensajes: 241
Re: Aportes de Scripts RPG-Maker
bueno aqui traigo otro script para XP
zoom batallas
explicacion
Spoiler
este script es para que en las batallas tenga un zoom,osea,que se acerque al enemigo al atacar haciendo un efecto muy wapo,aqui esta el script que va como siempre encima de main
script:
Spoiler
Código:
# Momo Camera Script
# Zoom battle effect
# Modificado por Soramaro para La Compañia Nodws
# 基本的に導入するだけで大丈夫です。
#
# 2005.5.18 バグ修正
# Arrow_Actor 修正
# self.enemy → self.actor
# アホなミスを犯してました。
#
# 2005.11.5 更新
# 設定項目を増やしました。
# いくつかの項目は、デフォルト(アクターがバトルフィールド上にいない)状態だと
# 変になるので、適切設定してください。
# (デフォ状態でtrueにするとマズイものには★をつけてます)
module MoMo_Camera
# カメラの移動にかけるフレーム数の初期値
MOVE_SPEED_INI = 8
# カメラのズームにかけるフレーム数の初期値
ZOOM_SPEED_INI = 8
# バトルバック引き伸ばし率追加値(0.0で引き伸ばし無し)
BATTLEBACK_ZOOM = 1.0
# アクターもカメラの影響を受けるようにする ★
# (★のついている項目を true にする場合などはこちらも true にして下さい)
CAMERA_UPDATE_ACTOR = false
# エネミー通常攻撃時、行動者を注視する
ACTIVE_LOOK_ENEMY_NOMAL_ATTACK = true
# エネミー防御時、行動者を注視する
ACTIVE_LOOK_ENEMY_GUARD = true
# エネミー逃走時、行動者を注視する
ACTIVE_LOOK_ENEMY_ESCAPE = true
# エネミースキル使用時、行動者を注視する
ACTIVE_LOOK_ENEMY_SKILL = true
# エネミー選択時、選択エネミーを注視する
ACTIVE_LOOK_ENEMY_SELECT = true
# エネミー通常攻撃時、対象者を注視する(対象がアクターの時) ★
TARGET_LOOK_ENEMY_NOMAL_ATTACK_TR_ACTOR = false
# エネミー通常攻撃時、対象者を注視する(対象がエネミーの時)
TARGET_LOOK_ENEMY_NOMAL_ATTACK_TR_ENEMY = true
# エネミースキル使用時、対象者を注視する(対象がアクターの時) ★
TARGET_LOOK_ENEMY_SKILL_TR_ACTOR = false
# エネミースキル使用時、対象者を注視する(対象がエネミーの時)
TARGET_LOOK_ENEMY_SKILL_TR_ENEMY = true
# エネミークリティカル発生時は問答無用で対象を注視する(対象がアクターの時) ★
CLITICAL_LOOK_ENEMY_TR_ACTOR = false
# エネミークリティカル発生時は問答無用で対象を注視する(対象がエネミーの時)
CLITICAL_LOOK_ENEMY_TR_ENEMY = true
# エネミークリティカル発生時のズーム倍率(ズームしたくない時は0.0を設定)
CRITICAL_ZOOM_ENEMY = 0.3
# アクター通常攻撃時、行動者を注視する ★
ACTIVE_LOOK_ACTOR_NOMAL_ATTACK = false
# アクター防御時、行動者を注視する ★
ACTIVE_LOOK_ACTOR_GUARD = false
# アクター逃走時、行動者を注視する ★
ACTIVE_LOOK_ACTOR_ESCAPE = false
# アクタースキル使用時、行動者を注視する ★
ACTIVE_LOOK_ACTOR_SKILL = false
# アクターアイテム使用時、行動者を注視する ★
ACTIVE_LOOK_ACTOR_ITEM = false
# アクター選択時、選択アクターを注視する ★
ACTIVE_LOOK_ACTOR_SELECT = false
# アクター通常攻撃時、対象者を注視する(対象がアクターの時) ★
TARGET_LOOK_ACTOR_NOMAL_ATTACK_TR_ACTOR = false
# アクター通常攻撃時、対象者を注視する(対象がエネミーの時)
TARGET_LOOK_ACTOR_NOMAL_ATTACK_TR_ENEMY = true
# アクタースキル使用時、対象者を注視する(対象がアクターの時) ★
TARGET_LOOK_ACTOR_SKILL_TR_ACTOR = false
# アクタースキル使用時、対象者を注視する(対象がエネミーの時)
TARGET_LOOK_ACTOR_SKILL_TR_ENEMY = true
# アクターアイテム使用時、対象者を注視する(対象がアクターの時) ★
TARGET_LOOK_ACTOR_ITEM_TR_ACTOR = false
# アクターアイテム使用時、対象者を注視する(対象がエネミーの時)
TARGET_LOOK_ACTOR_ITEM_TR_ENEMY = true
# アクタークリティカル発生時は問答無用で対象を注視する(対象がアクターの時) ★
CLITICAL_LOOK_ACTOR_TR_ACTOR = true
# アクタークリティカル発生時は問答無用で対象を注視する(対象がエネミーの時)
CLITICAL_LOOK_ACTOR_TR_ENEMY = true
# アクタークリティカル発生時のズーム倍率(ズームしたくない時は0.0を設定)
CRITICAL_ZOOM_ACTOR = 0.3
# エネミースリップダメージ時に注視する
LOOK_ENEMY_SLIP_DAMAGE = true
# アクタースリップダメージ時に注視する ★
LOOK_ACTOR_SLIP_DAMAGE = false
# コマンド入力時に、アクターを注視 ★
LOOK_ACTOR_COMMAND_INPUT = false
# 行動終了毎にカメラをセンタリング
EACH_ACTION_CENTERING = true
# 全体攻撃時のズーム率
ALL_ATTACK_ZOOM = 0.6
end
class Battle_Camera
attr_accessor :x
attr_accessor :y
attr_accessor :zoom
attr_accessor :new_x
attr_accessor :new_y
attr_accessor :new_zoom
def initialize
@x = 320
@y = 160
@zoom = 1.0
@new_x = @x
@new_y = @y
@dis_x = 0
@dis_y = 0
@dis_zoom = 0.0
@new_zoom = @zoom
@move_speed = MoMo_Camera::MOVE_SPEED_INI
@zoom_speed = MoMo_Camera::ZOOM_SPEED_INI
end
# 新しい移動先設定
def new_x=(newx)
@new_x = newx
@dis_x = (@x - @new_x).abs
end
def new_y=(newy)
@new_y = newy
@dis_y = (@y - @new_y).abs
end
def new_zoom=(newz)
@new_zoom = newz
@dis_zoom = (@zoom - @new_zoom).abs
end
# カメラセット
def set(x, y, zoom=nil, speed=nil)
unless speed.nil?
@move_speed = speed
@zoom_speed = speed
end
self.new_x = x
self.new_y = y
self.new_zoom = zoom unless zoom.nil?
end
# カメラを真ん中に
def center(zoom=1.0)
self.new_x = 320
self.new_y = 160
self.new_zoom = zoom
end
# バトラー注視
def battler_look(battler)
hei = get_battler_height(battler)
zoom = [160.0 / hei, 0.8].max
self.new_zoom = zoom
self.new_x = battler.screen_x
self.new_y = (battler.screen_y - hei / 2 * [[@new_zoom, 1.0].max, 1.5].min).truncate
end
# バトラーの計算色々
def battler_x_plus(battler)
dis = battler.screen_x - @x
val = dis * (@zoom - 1.0)
return val
end
def pos_battler_x(battler)
return battler.screen_x - (@x - 320)
end
def battler_x(battler)
return pos_battler_x(battler) + battler_x_plus(battler)
end
def battler_y_plus(battler)
dis = battler.screen_y - @y
val = dis * (@zoom - 1.0)
return val
end
def pos_battler_y(battler)
return battler.screen_y - (@y - 160)
end
def battler_y(battler)
return pos_battler_y(battler) + battler_y_plus(battler)
end
# 更新
def update
if @x != @new_x
if @new_x - @x > 0
@x = [@x + move_speed_x, @new_x].min
else
@x = [@x - move_speed_x, @new_x].max
end
end
if @y != @new_y
if @new_y - @y > 0
@y = [@y + move_speed_y, @new_y].min
else
@y = [@y - move_speed_y, @new_y].max
end
end
if @zoom != @new_zoom
if @new_zoom - @zoom > 0
@zoom = [@zoom + zoom_speed, @new_zoom].min
else
@zoom = [@zoom - zoom_speed, @new_zoom].max
end
end
end
# 移動距離計算
def move_speed_x
return [(@dis_x / @move_speed).to_i, 1].max
end
def move_speed_y
return [(@dis_y / @move_speed).to_i, 1].max
end
# ズーム倍率計算
def zoom_speed
return [(@dis_zoom / @zoom_speed), 0.01].max
end
def get_battler_height(battler)
bammy = get_battler_bmp(battler)
return bammy.height
end
def get_battler_bmp(battler)
return RPG::Cache.battler(battler.battler_name, battler.battler_hue)
end
def move?
return (@x != @new_x or @y != @new_y or @zoom != @new_zoom)
end
end
#==============================================================================
# ■ Spriteset_Battle
#------------------------------------------------------------------------------
# バトル画面のスプライトをまとめたクラスです。このクラスは Scene_Battle クラ
# スの内部で使用されます。
#==============================================================================
class Spriteset_Battle
attr_accessor :battle_camera
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
alias spriteset_battle_battle_camera_initialize initialize
def initialize
@battle_camera = Battle_Camera.new
spriteset_battle_battle_camera_initialize
@battleback_sprite.ox = @viewport1.rect.width / 2
@battleback_sprite.oy = @viewport1.rect.height / 2
camera_battleback_scroll
end
#--------------------------------------------------------------------------
# ● フレーム更新
#--------------------------------------------------------------------------
alias spriteset_battle_battle_camera_update update
def update
spriteset_battle_battle_camera_update
camera_update
end
# 更新するバトラーの指定
def camera_update_battlers
if MoMo_Camera::CAMERA_UPDATE_ACTOR
return @enemy_sprites + @actor_sprites
else
return @enemy_sprites
end
end
# カメラ更新
def camera_update
@battle_camera.update
camera_battleback_scroll
camera_battleback_zoom
camera_battler_update
end
# カメラ更新:バトルバックスクロール
def camera_battleback_scroll
# バトルバックの計算色々
view_width = @viewport1.rect.width / 2
view_height = @viewport1.rect.height / 2
@battleback_sprite.x = view_width + (view_width - @battle_camera.x) * @battle_camera.zoom
@battleback_sprite.y = view_height + (view_height - @battle_camera.y) * @battle_camera.zoom
end
# カメラ更新:バトルバックズーム
def camera_battleback_zoom
@battleback_sprite.zoom_x = @battle_camera.zoom + MoMo_Camera::BATTLEBACK_ZOOM
@battleback_sprite.zoom_y = @battle_camera.zoom + MoMo_Camera::BATTLEBACK_ZOOM
end
# カメラ更新:バトラースプライト更新
def camera_battler_update
for sprite in camera_update_battlers
battler_sprite_zoom(sprite)
battler_sprite_scroll(sprite)
end
end
# カメラ更新:バトラースプライト更新:バトラースプライトスクロール
def battler_sprite_scroll(sprite)
if !sprite.nil? and !sprite.battler.nil?
sprite.x = @battle_camera.battler_x(sprite.battler)
sprite.y = @battle_camera.battler_y(sprite.battler)
end
end
# カメラ更新:バトラースプライト更新:バトラースプライトズーム
def battler_sprite_zoom(sprite)
unless sprite.nil?
sprite.zoom_x = @battle_camera.zoom
sprite.zoom_y = @battle_camera.zoom
end
end
end
class Arrow_Actor < Arrow_Base
attr_accessor :camera
#--------------------------------------------------------------------------
# ● フレーム更新
#--------------------------------------------------------------------------
alias arrow_actor_battle_camera_update update
def update
arrow_actor_battle_camera_update
# スプライトの座標を再設定
if self.actor != nil and @camera != nil
self.x = @camera.battler_x(self.actor)
self.y = @camera.battler_y(self.actor)
end
end
end
class Arrow_Enemy < Arrow_Base
attr_accessor :camera
#--------------------------------------------------------------------------
# ● フレーム更新
#--------------------------------------------------------------------------
alias arrow_enemy_battle_camera_update update
def update
arrow_enemy_battle_camera_update
# スプライトの座標を再設定
if self.enemy != nil and @camera != nil
self.x = @camera.battler_x(self.enemy)
self.y = @camera.battler_y(self.enemy)
end
end
end
class Scene_Battle
def camera
return @spriteset.battle_camera
end
# 行動側アニメーション中のカメラワーク判定
def camera_action_judge_active
if @active_battler.is_a?(Game_Enemy)
case @active_battler.current_action.kind
when 0
camera_action_judge_active_basic_enemy
when 1
camera_action_judge_active_skill_enemy
when 2
camera_action_judge_active_item_enemy
end
else
case @active_battler.current_action.kind
when 0
camera_action_judge_active_basic_actor
when 1
camera_action_judge_active_skill_actor
when 2
camera_action_judge_active_item_actor
end
end
end
# 行動側アニメ中のカメラワーク(エネミー):基本
def camera_action_judge_active_basic_enemy
case @active_battler.current_action.basic
when 0
camera.battler_look(@active_battler) if MoMo_Camera::ACTIVE_LOOK_ENEMY_NOMAL_ATTACK
when 1
camera.battler_look(@active_battler) if MoMo_Camera::ACTIVE_LOOK_ENEMY_GUARD
when 2
camera.battler_look(@active_battler) if MoMo_Camera::ACTIVE_LOOK_ENEMY_ESCAPE
end
end
# 行動側アニメ中のカメラワーク(エネミー):スキル
def camera_action_judge_active_skill_enemy
camera.battler_look(@active_battler) if MoMo_Camera::ACTIVE_LOOK_ENEMY_SKILL
end
# 行動側アニメ中のカメラワーク(エネミー):アイテム(一応実装)
def camera_action_judge_active_item_enemy
camera.battler_look(@active_battler)
end
# 行動側アニメ中のカメラワーク(アクター):基本
def camera_action_judge_active_basic_actor
case @active_battler.current_action.basic
when 0
camera.battler_look(@active_battler) if MoMo_Camera::ACTIVE_LOOK_ACTOR_NOMAL_ATTACK
when 1
camera.battler_look(@active_battler) if MoMo_Camera::ACTIVE_LOOK_ACTOR_GUARD
when 2
camera.battler_look(@active_battler) if MoMo_Camera::ACTIVE_LOOK_ACTOR_ESCAPE
end
end
# 行動側アニメ中のカメラワーク(アクター):スキル
def camera_action_judge_active_skill_actor
camera.battler_look(@active_battler) if MoMo_Camera::ACTIVE_LOOK_ACTOR_SKILL
end
# 行動側アニメ中のカメラワーク(アクター):アイテム
def camera_action_judge_active_item_actor
camera.battler_look(@active_battler) if MoMo_Camera::ACTIVE_LOOK_ACTOR_ITEM
end
# 対象側アニメーション中のカメラワーク判定
def camera_action_judge_target
if @active_battler.is_a?(Game_Enemy)
case @active_battler.current_action.kind
when 0
camera_action_judge_target_basic_enemy
when 1
camera_action_judge_target_skill_enemy
when 2
camera_action_judge_target_item_enemy
end
else
case @active_battler.current_action.kind
when 0
camera_action_judge_target_basic_actor
when 1
camera_action_judge_target_skill_actor
when 2
camera_action_judge_target_item_actor
end
end
end
# 対象側アニメ中のカメラワーク(エネミー):基本
def camera_action_judge_target_basic_enemy
case @active_battler.current_action.basic
when 0
camera_action_judge_target_basic_enemy_attack
when 1
camera_action_judge_target_basic_enemy_guard
when 2
camera_action_judge_target_basic_enemy_escape
when 3
camera_action_judge_target_basic_enemy_none
end
end
# 対象側アニメ中のカメラワーク(エネミー):基本:攻撃
def camera_action_judge_target_basic_enemy_attack
if @target_battlers.size > 1
camera.center(MoMo_Camera::ALL_ATTACK_ZOOM)
else
if @target_battlers[0].is_a?(Game_Actor)
camera.battler_look(@target_battlers[0]) if MoMo_Camera::TARGET_LOOK_ENEMY_NOMAL_ATTACK_TR_ACTOR
if @target_battlers[0].critical
if MoMo_Camera::CLITICAL_LOOK_ENEMY_TR_ACTOR
camera.battler_look(@target_battlers[0])
end
camera.new_zoom = camera.new_zoom + MoMo_Camera::CRITICAL_ZOOM_ENEMY
end
elsif @target_battlers[0].is_a?(Game_Enemy)
camera.battler_look(@target_battlers[0]) if MoMo_Camera::TARGET_LOOK_ENEMY_NOMAL_ATTACK_TR_ENEMY
if @target_battlers[0].critical
if MoMo_Camera::CLITICAL_LOOK_ENEMY_TR_ENEMY
camera.battler_look(@target_battlers[0])
end
camera.new_zoom = camera.new_zoom + MoMo_Camera::CRITICAL_ZOOM_ENEMY
end
else
camera.center
end
end
end
# 対象側アニメ中のカメラワーク(エネミー):基本:防御
def camera_action_judge_target_basic_enemy_guard
end
# 対象側アニメ中のカメラワーク(エネミー):基本:逃走
def camera_action_judge_target_basic_enemy_escape
end
# 対象側アニメ中のカメラワーク(エネミー):基本:なにもしない
def camera_action_judge_target_basic_enemy_none
end
# 対象側アニメ中のカメラワーク(エネミー):スキル
def camera_action_judge_target_skill_enemy
if @target_battlers.size > 1
camera.center(MoMo_Camera::ALL_ATTACK_ZOOM)
elsif @target_battlers.size == 1
if @target_battlers[0].is_a?(Game_Actor)
camera.battler_look(@target_battlers[0]) if MoMo_Camera::TARGET_LOOK_ENEMY_SKILL_TR_ACTOR
elsif @target_battlers[0].is_a?(Game_Enemy)
camera.battler_look(@target_battlers[0]) if MoMo_Camera::TARGET_LOOK_ENEMY_SKILL_TR_ENEMY
end
else
camera.center
end
end
# 対象側アニメ中のカメラワーク(エネミー):アイテム(一応実装)
def camera_action_judge_target_item_enemy
end
# 対象側アニメ中のカメラワーク(アクター):基本
def camera_action_judge_target_basic_actor
case @active_battler.current_action.basic
when 0
camera_action_judge_target_basic_actor_attack
when 1
camera_action_judge_target_basic_actor_guard
when 2
camera_action_judge_target_basic_actor_escape
when 3
camera_action_judge_target_basic_actor_none
end
end
# 対象側アニメ中のカメラワーク(アクター):基本:攻撃
def camera_action_judge_target_basic_actor_attack
if @target_battlers.size > 1
camera.center(MoMo_Camera::ALL_ATTACK_ZOOM)
else
if @target_battlers[0].is_a?(Game_Actor)
camera.battler_look(@target_battlers[0]) if MoMo_Camera::TARGET_LOOK_ACTOR_NOMAL_ATTACK_TR_ACTOR
if @target_battlers[0].critical
if MoMo_Camera::CLITICAL_LOOK_ACTOR_TR_ACTOR
camera.battler_look(@target_battlers[0])
end
camera.new_zoom = camera.new_zoom + MoMo_Camera::CRITICAL_ZOOM_ACTOR
end
elsif @target_battlers[0].is_a?(Game_Enemy)
camera.battler_look(@target_battlers[0]) if MoMo_Camera::TARGET_LOOK_ACTOR_NOMAL_ATTACK_TR_ENEMY
if @target_battlers[0].critical
if MoMo_Camera::CLITICAL_LOOK_ACTOR_TR_ENEMY
camera.battler_look(@target_battlers[0])
end
camera.new_zoom = camera.new_zoom + MoMo_Camera::CRITICAL_ZOOM_ACTOR
end
else
camera.center
end
end
end
# 対象側アニメ中のカメラワーク(エネミー):基本:防御
def camera_action_judge_target_basic_actor_guard
end
# 対象側アニメ中のカメラワーク(エネミー):基本:逃走
def camera_action_judge_target_basic_actor_escape
end
# 対象側アニメ中のカメラワーク(エネミー):基本:なにもしない
def camera_action_judge_target_basic_actor_none
end
# 対象側アニメ中のカメラワーク(アクター):スキル
def camera_action_judge_target_skill_actor
if @target_battlers.size > 1
camera.center(MoMo_Camera::ALL_ATTACK_ZOOM)
elsif @target_battlers.size == 1
if @target_battlers[0].is_a?(Game_Actor)
camera.battler_look(@target_battlers[0]) if MoMo_Camera::TARGET_LOOK_ACTOR_SKILL_TR_ACTOR
elsif @target_battlers[0].is_a?(Game_Enemy)
camera.battler_look(@target_battlers[0]) if MoMo_Camera::TARGET_LOOK_ACTOR_SKILL_TR_ENEMY
end
else
camera.center
end
end
# 対象側アニメ中のカメラワーク(アクター):アイテム
def camera_action_judge_target_item_actor
if @target_battlers.size > 1
camera.center(MoMo_Camera::ALL_ATTACK_ZOOM)
elsif @target_battlers.size == 1
if @target_battlers[0].is_a?(Game_Actor)
camera.battler_look(@target_battlers[0]) if MoMo_Camera::TARGET_LOOK_ACTOR_ITEM_TR_ACTOR
elsif @target_battlers[0].is_a?(Game_Enemy)
camera.battler_look(@target_battlers[0]) if MoMo_Camera::TARGET_LOOK_ACTOR_ITEM_TR_ENEMY
else
end
else
camera.center
end
end
#--------------------------------------------------------------------------
# ● パーティコマンドフェーズ開始
#--------------------------------------------------------------------------
alias scene_battle_battle_camera_start_phase2 start_phase2
def start_phase2
camera.center
scene_battle_battle_camera_start_phase2
end
#--------------------------------------------------------------------------
# ● アフターバトルフェーズ開始
#--------------------------------------------------------------------------
alias scene_battle_battle_camera_start_phase5 start_phase5
def start_phase5
camera.center
scene_battle_battle_camera_start_phase5
end
#--------------------------------------------------------------------------
# ● 次のアクターのコマンド入力へ
#--------------------------------------------------------------------------
alias scene_battle_battle_camera_phase3_next_actor phase3_next_actor
def phase3_next_actor
scene_battle_battle_camera_phase3_next_actor
if @active_battler != nil and MoMo_Camera::LOOK_ACTOR_COMMAND_INPUT
camera.battler_look(@active_battler)
end
end
#--------------------------------------------------------------------------
# ● 前のアクターのコマンド入力へ
#--------------------------------------------------------------------------
alias scene_battle_battle_camera_phase3_prior_actor phase3_prior_actor
def phase3_prior_actor
scene_battle_battle_camera_phase3_prior_actor
if @active_battler != nil and MoMo_Camera::LOOK_ACTOR_COMMAND_INPUT
camera.battler_look(@active_battler)
end
end
#--------------------------------------------------------------------------
# ● アクター選択開始
#--------------------------------------------------------------------------
alias scene_battle_battle_camera_start_actor_select start_actor_select
def start_actor_select
scene_battle_battle_camera_start_actor_select
if MoMo_Camera::ACTIVE_LOOK_ACTOR_SELECT
@last_arrow_index = nil
@actor_arrow.camera = camera
elsif MoMo_Camera::LOOK_ACTOR_COMMAND_INPUT
camera.center
end
end
#--------------------------------------------------------------------------
# ● アクター選択終了
#--------------------------------------------------------------------------
alias scene_battle_battle_camera_end_actor_select end_actor_select
def end_actor_select
scene_battle_battle_camera_end_actor_select
if MoMo_Camera::LOOK_ACTOR_COMMAND_INPUT
camera.battler_look(@active_battler)
else
camera.center
end
end
#--------------------------------------------------------------------------
# ● エネミー選択開始
#--------------------------------------------------------------------------
alias scene_battle_battle_camera_start_enemy_select start_enemy_select
def start_enemy_select
scene_battle_battle_camera_start_enemy_select
if MoMo_Camera::ACTIVE_LOOK_ENEMY_SELECT
@last_arrow_index = nil
@enemy_arrow.camera = camera
elsif MoMo_Camera::LOOK_ACTOR_COMMAND_INPUT
camera.center
end
end
#--------------------------------------------------------------------------
# ● エネミー選択終了
#--------------------------------------------------------------------------
alias scene_battle_battle_camera_end_enemy_select end_enemy_select
def end_enemy_select
scene_battle_battle_camera_end_enemy_select
if MoMo_Camera::LOOK_ACTOR_COMMAND_INPUT
camera.battler_look(@active_battler)
else
camera.center
end
end
#--------------------------------------------------------------------------
# ● フレーム更新 (アクターコマンドフェーズ : アクター選択)
#--------------------------------------------------------------------------
alias scene_battle_battle_camera_update_phase3_actor_select update_phase3_actor_select
def update_phase3_actor_select
scene_battle_battle_camera_update_phase3_actor_select
if MoMo_Camera::ACTIVE_LOOK_ACTOR_SELECT
if @actor_arrow != nil and (@last_arrow_index != @actor_arrow.index)
@last_arrow_index = @actor_arrow.index
camera.battler_look(@actor_arrow.actor)
end
end
end
#--------------------------------------------------------------------------
# ● フレーム更新 (アクターコマンドフェーズ : エネミー選択)
#--------------------------------------------------------------------------
alias scene_battle_battle_camera_update_phase3_enemy_select update_phase3_enemy_select
def update_phase3_enemy_select
scene_battle_battle_camera_update_phase3_enemy_select
if MoMo_Camera::ACTIVE_LOOK_ENEMY_SELECT
if @enemy_arrow != nil and (@last_arrow_index != @enemy_arrow.index)
@last_arrow_index = @enemy_arrow.index
camera.battler_look(@enemy_arrow.enemy)
end
end
end
#--------------------------------------------------------------------------
# ● フレーム更新 (メインフェーズ ステップ 1 : アクション準備)
#--------------------------------------------------------------------------
alias scene_battle_battle_camera_update_phase4_step1 update_phase4_step1
def update_phase4_step1
unless @camera_move
if $game_temp.forcing_battler == nil and @action_battlers.size != 0 and
@action_battlers[0].slip_damage?
camera_action_judge_phase4_step1
end
@camera_move = true
end
return if camera.move?
@camera_move = false
scene_battle_battle_camera_update_phase4_step1
end
def camera_action_judge_phase4_step1
if @action_battlers[0].is_a?(Game_Enemy)
camera.battler_look(@action_battlers[0]) if MoMo_Camera::LOOK_ENEMY_SLIP_DAMAGE
elsif @action_battlers[0].is_a?(Game_Actor)
camera.battler_look(@action_battlers[0]) if MoMo_Camera::LOOK_ACTOR_SLIP_DAMAGE
end
end
#--------------------------------------------------------------------------
# ● フレーム更新 (メインフェーズ ステップ 3 : 行動側アニメーション)
#--------------------------------------------------------------------------
alias scene_battle_battle_camera_update_phase4_step3 update_phase4_step3
def update_phase4_step3
unless @camera_move
camera_action_judge_active
@camera_move = true
end
return if camera.move?
@camera_move = false
scene_battle_battle_camera_update_phase4_step3
end
#--------------------------------------------------------------------------
# ● フレーム更新 (メインフェーズ ステップ 4 : 対象側アニメーション)
#--------------------------------------------------------------------------
alias scene_battle_battle_camera_update_phase4_step4 update_phase4_step4
def update_phase4_step4
unless @camera_move
camera_action_judge_target
@camera_move = true
end
return if camera.move?
@camera_move = false
scene_battle_battle_camera_update_phase4_step4
end
#--------------------------------------------------------------------------
# ● フレーム更新 (メインフェーズ ステップ 6 : リフレッシュ)
#--------------------------------------------------------------------------
alias scene_battle_battle_camera_update_phase4_step6 update_phase4_step6
def update_phase4_step6
scene_battle_battle_camera_update_phase4_step6
camera.center if MoMo_Camera::EACH_ACTION_CENTERING
end
end
aki hay otroscript que quizas le sirva a alguno de ustedes, se trata de un menu de seleccion de niveles al clasico estilo de Megaman. Es muy personalizable asi que podrian usarlo en un juego que no sea de megaman, usenlo como quieran, es mi aporte a esta comunidad.
FICHA TECNICA
Crado por mi amigo SOULDARK
DESCRIPCION: Script que permite implementar un menu de seleccion de niveles, muy personalizable.
Spoiler
SCRIPT RGSS
MODS:
Código:
#===============================================================================
# MENU SELECCION DE NIVEL - ESTILO MEGAMAN
# DESARROLLADO POR --SOULDARK--
#-------------------------------------------------------------------------------
# MODS
#===============================================================================
class Window_Selectable < Window_Base
def setColumn_max(cm)
@column_max = cm
end
def set_Index(i)
self.index = i
end
end
class Window_Base < Window
def draw_text_outline(x, y, wid, hei, text, align = 0, line = outline_color,fore = normal_color)
self.contents.font.color = line
self.contents.draw_text(x + 1,y + 1,wid,hei,text, align)
self.contents.draw_text(x + 1,y - 1,wid,hei,text, align)
self.contents.draw_text(x - 1,y - 1,wid,hei,text, align)
self.contents.draw_text(x - 1,y + 1,wid,hei,text, align)
self.contents.draw_text(x - 1,y,wid,hei,text, align)
self.contents.draw_text(x + 1,y,wid,hei,text, align)
self.contents.draw_text(x ,y-1,wid,hei,text, align)
self.contents.draw_text(x,y+1,wid,hei,text, align)
self.contents.font.color = fore
self.contents.draw_text(x,y,wid,hei,text, align)
end
def outline_color
return Color.new(0, 0, 0, 255)
end
end
class Window_Info < Window_Base
def initialize(s, d, j)
super(100, 190, 300, 200)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "Arial"
self.contents.font.size = 18
self.opacity = 0
refresh(s, d, j)
end
def refresh(s, d, j)
self.contents.clear
escribir(s, d, j)
end
def escribir(s, d, j)
draw_text_outline(5, 5, 250, 20, "Stage: #{s}")
draw_text_outline(5, 30, 250, 20, "Dificultad: #{d}")
draw_text_outline(5, 55, 250, 20, "Jefe: #{j}")
end
def update(s, d, j)
refresh(s, d, j)
end
def clear
self.contents.clear
end
end
class Window_Desicion < Window_Selectable
def initialize
an = 250
al = 100
x = 320 - (an / 2)
y = 240 - (al / 2)
super(x, y, an, al)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "Arial"
self.contents.font.size = 18
self.contents.font.color = normal_color
@item_max = 2
@column_max = 2
@opc = ["Si", "No"]
pos_cur(1)
refresh
end
def refresh
self.contents.clear
self.contents.draw_text(4, 0, 165, 32, "¿Deseas Entrar?", 2)
draw_item(0)
draw_item(1)
end
def draw_item(index)
x = 4 + index % @column_max * ((self.width - 64)/@column_max + 25)
self.contents.draw_text(x, 40, 53, 32, @opc[index], 2)
end
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
else
x = -4 + index % @column_max * ((self.width - 64)/@column_max + 22)
self.cursor_rect.set(x, 40, 110, 32)
end
end
def pos_cur(p)
self.index = p
end
def pos_cur2
return self.index
end
end
MENU:
Código:
#===============================================================================
# MENU SELECCION DE NIVEL - ESTILO MEGAMAN
# DESARROLLADO POR --SOULDARK--
#-------------------------------------------------------------------------------
# Script que permite implementar un menu de seleccion de niveles,
# muy personalizable.
#===============================================================================
class Scene_MenuMegaman
$m = []
$m = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
def initialize(p = 0)
@p = p
end
def main
# ------------------- MODIFICABLES --------------------
@nroMounstros = 10 # Numero de Mounstros
@nroFilas = 2 # Numero de Filas
@stages = ["Bosque", "Laboratorio", "Base", "Laboratorio Parte 2", "Volcan", "Polo Norte", "Desierto", "???", "Cielo", "Termales Contaminados"]
@dificultad = [1, 5, "Ninguna", 6, 8, 4, 7, "???", 3, 2]
@jefes = ["Comander Yamark", "Gate", "Ninguno", "Colonel", "Matrrex", "FrostMan", "Anubis the Necromancer", "???", "TenguMan", "FlameMan"]
@ma = [1, 1, 1, 1, 1, 1, 1, 0, 1, 1] #Mounstros Activos
$mapa = [2, 2, 2, 1, 2, 2, 2, 2, 2, 2] #ID de Mapa en el que aparece el Mounstro
$corx = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] #Coordenada X del Mapa en el que aparece el Mounstro
$cory = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] #Coordenada Y del Mapa en el que aparece el Mounstro
@posMf = 7 #Posicion mounstro final
# -----------------------------------------------------------
@fondo = Sprite.new
@fondo.bitmap = RPG::Cache.picture("mapa")
@wc = []
for i in 0..@nroMounstros - 1
@wc[i] = ""
end
@command_window = Window_Command.new(192, @wc)
pos_cur(@p)
@command_window.opacity = 0
@command_window.setColumn_max(@nroMounstros / @nroFilas)
@command_window.visible = false
# -----------------------------------------------------------
@caras = []
dibujarCaras(true)
# -----------------------------------------------------------
@window = Window_Info.new(@stages[@p], @dificultad[@p], @jefes[@p])
# -----------------------------------------------------------
@marco = Sprite.new
@marco.bitmap = RPG::Cache.picture("marcos")
@cursor = Sprite.new
@cursor.bitmap = RPG::Cache.picture("cursor")
dibujarCursor(@p)
@flag = true
# -----------------------------------------------------------
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@command_window.dispose
if @flag
@fondo.dispose
@marco.dispose
for i in 0..@nroMounstros - 1
@caras[i + 1].dispose
end
@cursor.dispose
end
@window.dispose
end
# -------------------------------------------------------------
# METODO: UPDATE
# -------------------------------------------------------------
def update
@command_window.update
# -----------------------------------------------------------
if compruebaMounstro
@caras[@posMf + 1].bitmap = RPG::Cache.picture("m#{@posMf + 1}_v_a")
@ma[@posMf] = 1
end
# -----------------------------------------------------------
if Input.repeat?(Input::DOWN) or Input.repeat?(Input::UP) or Input.repeat?(Input::LEFT) or Input.repeat?(Input::RIGHT)
for i in 0..@nroMounstros - 1
if @command_window.index == i
dibujarCursor(i)
if @ma[i] == 1
@window.update(@stages[i], @dificultad[i], @jefes[i])
else
@window.clear
end
end
end
end
if Input.trigger?(Input::C)
for i in 0..@nroMounstros - 1
if @command_window.index == i
if @ma[i] == 1
@flag = false
$scene = Scene_Seleccion.new(@command_window.index)
end
end
end
end
end
def pos_cur(p)
@command_window.set_Index(p)
end
def dibujarCaras(f)
flag = f
for i in 0..@nroMounstros - 1
if flag
@caras[i + 1] = Sprite.new
end
if $m[i] == 1
@caras[i + 1].bitmap = RPG::Cache.picture("m#{i + 1}_v_d")
else
if $m[i] == 0
@caras[i + 1].bitmap = RPG::Cache.picture("m#{i + 1}_m_d")
end
end
if i < @nroMounstros / @nroFilas
@caras[i + 1].x = 63 + (i * 105)
@caras[i + 1].y = 23
else
@caras[i + 1].x = 63 + ((i - (@nroMounstros / 2)) * 105)
@caras[i + 1].y = 356
end
end
end
def compruebaMounstro
sum = 0
res = false
for i in 0..9
sum += $m[i]
end
if sum == 0
res = true
end
return res
end
def dibujarCursor(i)
if @command_window.index < @nroMounstros / @nroFilas
@cursor.x = 75 + (i * 105)
@cursor.y = 31
else
@cursor.x = 75 + ((i - (@nroMounstros / @nroFilas)) * 105)
@cursor.y = 362
end
end
end
VENTANA DESICION:
Código:
#===============================================================================
# MENU SELECCION DE NIVEL - ESTILO MEGAMAN
# DESARROLLADO POR --SOULDARK--
#-------------------------------------------------------------------------------
# VENTANA DESICION
#===============================================================================
class Scene_Seleccion
def initialize(p)
@p = p
end
def main
@wd = Window_Desicion.new
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@wd.dispose
end
# -------------------------------------------------------------
# METODO: UPDATE
# -------------------------------------------------------------
def update
@wd.update
if Input.trigger?(Input::C)
if @wd.pos_cur2 == 1
$scene = Scene_MenuMegaman.new(@p)
else @wd.pos_cur2 == 0
if
teletransporte($mapa[@p], $corx[@p], $cory[@p])
end
end
end
end
def teletransporte(mapa, cx, cy)
$scene = Scene_Map.new
$game_map.setup(mapa)
$game_player.moveto(cx, cy)
end
IMPORTANTE
Spoiler
Para poder usar este scripts necesitaras 4 tipos de imagenes:
Imagen de Fondo: Una imagen con un paisaje u otra cosa de 640 x 480 pixeles.
Imagen de los marcos: Una imagen con el marco que rodeara las caras de 640 x 480 pixeles(Adjuntada mas adelante).
Imagenes de Jefes: Varias imagenes de los rostros de los jefes de 105 x 103 pixeles.
Imagenes de Jefes Caidos: Varias imagenes de los rostros de los jefes en escala de grises de 105 x 103 pixeles.
NOTA:
Las imagenes de los rostros tendran un estandar para los nombres: "mX_E_d", donde X es el numero del jefe y E el estado.
Ejemplo: m2_v_d
Para el Jefe final el nombre de la imagen sera: "mX_v_a", donde X es el numero del jefe
Si desean que corriga algo, o tienen alguna duda simplemente posteen, estoy aqui para ayudar y espero que este script le sirva a alguien.
SUERTE!
Última edición por The_Virus_X fecha: 27-abr-2008 a las 22:11.
Razón: Otro script
Necesito el script de main, porque se borro, y saber como m.... agrego otros
Código:
#==============================================================================
# ■ Main
#------------------------------------------------------------------------------
# Despues de la definicion de cada clase...El proceso real empieza aqui
#==============================================================================
begin
# Fuente que usará el juego
$fontface = "Lucida Console"
# Tamaño de la fuente
$fontsize = 25
# Preparar transicion
Graphics.freeze
# Crear objeto de escena (Pantalla de Titulo)
$scene = Scene_Title.new
# Limitacion efectiva de $scene. Llamar metodo principal
while $scene != nil
$scene.main
end
# Fundido
Graphics.transition(20)
rescue Errno::ENOENT
# Complementar la exepcion con Errno::ENOENT
# Cuando no se puede abrir un archivo, mostrar un mensaje y cerrar.
filename = $!.message.sub("No se encontó el archivo o directorio - ", "")
print("Error RGSS: #{filename}")
end
Ubicación: EMUDESC, el mejor sitio de Emulación de todo Internet. Regístrate y ser parte de la Comunidad.
Mensajes: 630
Re: Aportes de Scripts RPG-Maker
The Virus: Me refiero al script de plataforma ¿Entiendes?
Bueno, 3 más del famoso MOGHUNTER:
1- Esena de salve extremadamente animado jeje: http://www.atelier-rgss.com/RGSS/Dem...Scene_File.zip
2- Esena de equipo totalmente animado: