Oniromancie: Scripts - Script: vue camera pendant le combat


Comment a marche?

Ademphia
Par Sylvanor

Fighting Robots Quest
Par Boulon

Forstale
Par dd Clock

Geex
Par roys

Inexistence
Par Falco

La Lgende d'Ibabou
Par Zaitan

Lije
Par Gaetz

LoveMaster
Par Cuddlefox

Sarcia
Par Kalar

Super Mario RPG - Lost Souls
Par Omegabowser

Tests: Alterra 0.1.1 / News: Des jeux partout ! Le Making (...) / Guides: [RGSS] Accs aux donnes de la (...) / Jeux: The Sword / News: Smile Game Builder : crez un RPG (...) /

Chat  (77 connects)

Bienvenue
visiteur !




publicit RPG Maker!

Statistiques

Liste des
membres


Contact

52 connects actuellement

9541025 visiteurs
depuis l'ouverture

1103 visiteurs
aujourd'hui

Groupe Facebook

Barre de sparation

Partenaires




TOP
GAMEMAKING


Les 5 plus
visits

Lunae, le baz'arts d'Emz0

Le studio du chat vert

Pixelandgame

Tashiroworld

HeyMakeGames

Au hasard

Lo-Games

Rpg maker dtente

RPG Land

Les deux derniers

Famas

Lunae, le baz'arts d'Emz0

Nos autres partenaires

Devenir
partenaire


Barre de sparation

Un site du rseau
War Paradise

Annuaires rfrenceurs




Script: vue camera pendant le combat
Script pour RPG Maker XP
Ecrit par soho

Script de camra, crer un script qui ce nomme Camra a mettre au dessus de Main


Portion de code:



# ??? XRXS_BP 8. ogobN?EFull-View?{?J? ver..05d ???

# Fait par FTB
#==============================================================================
# ? Game_Battler
#==============================================================================
class Game_Battler
#--------------------------------------------------------------------------
# ? ???E?JCX^X??
#--------------------------------------------------------------------------
attr_accessor :x_pos # ogtB?[h?@?@?u(+׉E?@)
attr_accessor :y_pos # ogtB?[h ? ?u(+???@)
attr_accessor :z_pos # ogtB?[h?s?u(+׎?O)
attr_accessor :zoom # ???Y?[{[
end
#==============================================================================
# ? Game_Actor
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# ? ???E?JCX^X??
#--------------------------------------------------------------------------
attr_reader :actor_in_battlefield # AN^?[?tB?[h?
#--------------------------------------------------------------------------
# ? ZbgAbv
#--------------------------------------------------------------------------
alias xrxs_bp8_setup setup
def setup(actor_id)
xrxs_bp8_setup(actor_id)
# @\"AN^?[?tB?[h?"
# true?D???
@actor_in_battlefield = false if @actor_in_battlefield != true
end
end
#==============================================================================
# ? Game_Enemy
#==============================================================================
class Game_Enemy < Game_Battler
#--------------------------------------------------------------------------
# ? ???E?JCX^X??
#--------------------------------------------------------------------------
attr_reader :actor_in_battlefield # AN^?[?tB?[h?
#--------------------------------------------------------------------------
# ? IuWFNg??
#--------------------------------------------------------------------------
alias xrxs_bp8_initialize initialize
def initialize(troop_id, member_index)
@actor_in_battlefield = false
@x_pos = $data_troops[troop_id].members[member_index].x - 320
@y_pos = -($data_troops[troop_id].members[member_index].y - 304)
@field_x_offset = -192
@field_y_offset = -144
@z_pos = 0
@zoom = 1.00
xrxs_bp8_initialize(troop_id, member_index)
end
#--------------------------------------------------------------------------
# ? og?? X ??W??
#--------------------------------------------------------------------------
def screen_x
$xcam_x = 0 if $xcam_x == nil
return 320 - @field_x_offset + (@x_pos.to_i - $xcam_x) * @zoom
end
#--------------------------------------------------------------------------
# ? og?? Y ??W??
#--------------------------------------------------------------------------
def screen_y
$xcam_y = 0 if $xcam_y == nil
return 240 - @field_y_offset + (-@y_pos.to_i + 64 + $xcam_y) * @zoom
end
end
#==============================================================================
# ? Sprite_Battler
#==============================================================================
class Sprite_Battler < RPG::Sprite
#--------------------------------------------------------------------------
# ? t?[?X?V
#--------------------------------------------------------------------------
alias xrxs_bp8_update update
def update
# ??
@z_offset = 0
# ?
xrxs_bp8_update
# og?[ nil ??????
return if @battler == nil
# G???J?׉e?B
# ??ogtB?[h?????? if ?O?B
if (@battler.is_a?(Game_Actor) and @battler.actor_in_battlefield) or @battler.is_a?(Game_Enemy)
# Y?[[
zoom = 1.00 * 185 / (($xcam_z != nil ? $xcam_z : 185) - @z_offset)
self.zoom_x = zoom
self.zoom_y = zoom
@battler.zoom = zoom
# XvCg???W????
self.x = @battler.screen_x
self.y = @battler.screen_y
self.z = @battler.screen_z
end
end
end
#==============================================================================
# ? Spriteset_Battle
#==============================================================================
class Spriteset_Battle
#--------------------------------------------------------------------------
# ? IuWFNg??
#--------------------------------------------------------------------------
alias xrxs_bp8_initialize initialize
def initialize
# ??
@now_bg_x = -1
@now_bg_y = -1
@now_bg_z = -1
# ??????s
xrxs_bp8_initialize
# r?[|?[g????
@viewport1 = Viewport.new(-192, -144, 1024, 768)
# ogobNXvCg????
@battleback_sprite = Sprite.new(@viewport1)
@battleback_name = ""
# Gl~?[XvCg????
@enemy_sprites = []
for enemy in $game_troop.enemies.reverse
@enemy_sprites.push(Sprite_Battler.new(@viewport1, enemy))
end
# V?????
@weather = RPG::Weather.new(@viewport1)
# t?[?X?V
update
end
#--------------------------------------------------------------------------
# ? t?[?X?V
#--------------------------------------------------------------------------
alias xrxs_bp8_update update
def update
# ogobN?t@C׌???????????
if @battleback_name != $game_temp.battleback_name
@battleback_name = $game_temp.battleback_name
if @battleback_sprite.bitmap != nil
@battleback_sprite.bitmap.dispose
end
bg_bitmap = RPG::Cache.battleback(@battleback_name)
bg_bitmap_stretch = Bitmap.new(1024, 768)
bg_bitmap_stretch.stretch_blt(Rect.new(0, 0, 1024, 768), bg_bitmap, bg_bitmap.rect)
@battleback_sprite.bitmap = bg_bitmap_stretch
end
# J??uד???
if @now_bg_x != $xcam_x or @now_bg_y != $xcam_y or @now_bg_z != $xcam_z
# Y?[[
zoom = 1.00 * 185 / $xcam_z
@battleback_sprite.zoom_x = zoom
@battleback_sprite.zoom_y = zoom
# J?z????u??C?
maximum = 192 * (296 - $xcam_z) / 111
$xcam_x = [[$xcam_x, -maximum].max, maximum].min
# wi?u?X?V
@battleback_sprite.x = -$xcam_x * zoom - 512 * (zoom - 1)
@battleback_sprite.y = $xcam_y * zoom - 384 * (zoom - 1)
# l?X?V
@now_bg_x = $xcam_x
@now_bg_y = $xcam_y
@now_bg_z = $xcam_z
end
# ?
xrxs_bp8_update
end
end
#==============================================================================
# ? Scene_Battle
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
# ? ?C??
#--------------------------------------------------------------------------
alias xrxs_bp8_main main
def main
# J????u?
$xcam_x = 0
$xcam_y = 0
$xcam_z = 295
# J???????Il
@xcam_x_destination = 0
@xcam_y_destination = 0
@xcam_z_destination = 185
# ??A??og?[??B
@xcam_watch_battler = nil
# ??
@wait_count_xcam = 0
# ?
xrxs_bp8_main
end
#--------------------------------------------------------------------------
# ? t?[?X?V
#--------------------------------------------------------------------------
alias xrxs_bp8_update update
def update
# J??u??X?V?B
if @wait_count_xcam > 0
# EFCgJEg??
@wait_count_xcam -= 1
else
# J?: Z ??W
if $xcam_z != @xcam_z_destination
if $xcam_z < @xcam_z_destination
distance = [(@xcam_z_destination - $xcam_z)/8, 1].max
else
distance = [(@xcam_z_destination - $xcam_z)/8, -1].min
end
$xcam_z = [[$xcam_z + distance, 74].max, 296].min
end
# J?: X ??W
if @xcam_watch_battler != nil
if $xcam_x != @xcam_watch_battler.x_pos
if ($xcam_x - @xcam_watch_battler.x_pos).abs < 8
distance = @xcam_watch_battler.x_pos - $xcam_x
elsif $xcam_x < @xcam_watch_battler.x_pos
distance = [(@xcam_watch_battler.x_pos - $xcam_x)/8, 8].max
else
distance = [(@xcam_watch_battler.x_pos - $xcam_x)/8, -8].min
end
maximum = 192 * (296 - $xcam_z) / 111
$xcam_x = [[$xcam_x + distance, -maximum].max, maximum].min
end
elsif $xcam_x != @xcam_x_destination
if ($xcam_x - @xcam_x_destination).abs < 8
distance = @xcam_x_destination - $xcam_x
elsif $xcam_x < @xcam_x_destination
distance = [(@xcam_x_destination - $xcam_x)/8, 8].max
else
distance = [(@xcam_x_destination - $xcam_x)/8, -8].min
end
maximum = 192 * (296 - $xcam_z) / 111
$xcam_x = [[$xcam_x + distance, -maximum].max, maximum].min
end
# J?: Y ??W
if @xcam_watch_battler != nil
y = @xcam_watch_battler.y_pos/2
if $xcam_y != y
if ($xcam_y - y).abs < 8
distance = y - $xcam_y
elsif $xcam_y < y
distance = [(y - $xcam_y)/8, 8].max
else
distance = [(y - $xcam_y)/8, -8].min
end
maximum = 144 * (296 - $xcam_z) / 111
$xcam_y = [[$xcam_y + distance, -maximum].max, maximum].min
end
elsif $xcam_y != @xcam_y_destination
if $xcam_y < @xcam_y_destination
distance = [(@xcam_y_destination - $xcam_y)/8, 1].max
else
distance = [(@xcam_y_destination - $xcam_y)/8, -1].min
end
maximum = 164 * (296 - $xcam_z) / 111
$xcam_y = [[$xcam_y + distance, -maximum].max, maximum].min
end
end
# ?????s
xrxs_bp8_update
end
#--------------------------------------------------------------------------
# ? p?[eBR}htF?[YJn
#--------------------------------------------------------------------------
alias xrxs_bp8_start_phase2 start_phase2
def start_phase2
# J??FZ^O
@xcam_watch_battler = nil
@xcam_x_destination = 0
@xcam_z_destination = 185
# ?
xrxs_bp8_start_phase2
end
#--------------------------------------------------------------------------
# ? t?[?X?V (AN^?[R}htF?[Y)
#--------------------------------------------------------------------------
alias xrxs_bp8_update_phase3 update_phase3
def update_phase3
# J??L?u?
if @active_battler != nil and @active_battler.actor_in_battlefield
@xcam_x_destination = @active_battler.x_pos
@xcam_z_destination = 175
end
xrxs_bp8_update_phase3
end
#--------------------------------------------------------------------------
# ? t?[?X?V (AN^?[R}htF?[Y : Gl~?[I?)
#--------------------------------------------------------------------------
alias xrxs_bp8_update_phase3_enemy_select update_phase3_enemy_select
def update_phase3_enemy_select
# J??FG^?[Qbg?Y?[Abv
@xcam_x_destination = $game_troop.enemies[@enemy_arrow.index].x_pos * $game_troop.enemies[@enemy_arrow.index].zoom
@xcam_z_destination = 175
# ?
xrxs_bp8_update_phase3_enemy_select
end
#--------------------------------------------------------------------------
# ? Gl~?[I??I
#--------------------------------------------------------------------------
alias xrxs_bp8_end_enemy_select end_enemy_select
def end_enemy_select
# J??F?S?
@xcam_x_destination = 0
@xcam_z_destination = 185
# ?
xrxs_bp8_end_enemy_select
end
#--------------------------------------------------------------------------
# ? t?[?X?V (?CtF?[Y Xebv 2 : ANVJn)
#--------------------------------------------------------------------------
alias xrxs_bp8_update_phase4_step2 update_phase4_step2
def update_phase4_step2
# ?
xrxs_bp8_update_phase4_step2
# Xebv 3 ???s????
if @phase4_step == 3
if @active_battler.is_a?(Game_Enemy) or @active_battler.actor_in_battlefield
# J??F?sog?[??Y?[Abv?\?
@xcam_x_destination = @active_battler.x_pos * @active_battler.zoom if @active_battler.x_pos != nil
@xcam_z_destination = 175
end
# ??? 20 t?[??
@wait_count = 20
end
end
#--------------------------------------------------------------------------
# ? t?[?X?V (?CtF?[Y Xebv 3 : ?s?Aj??[V)
#--------------------------------------------------------------------------
alias xrxs_bp8_update_phase4_step3 update_phase4_step3
def update_phase4_step3
# ?
xrxs_bp8_update_phase4_step3
if @target_battlers.size > 0 and
(@target_battlers[0].is_a?(Game_Enemy) or @target_battlers[0].actor_in_battlefield)
# J??F^?[Qbg??Y?[Abv?\?
@xcam_x_destination = @target_battlers[0].x_pos * @target_battlers[0].zoom if @target_battlers[0] != nil
@xcam_z_destination = 185
# ????Aj??u?u?F???v???????
if @animation2_id > 0 and $data_animations[@animation2_id].position == 3
# J??Z^O
@xcam_x_destination = 0
# Y?[AEg??????w
@xcam_z_destination = 222
end
end
# ??? 20 t?[??
@wait_count = 20
end
#--------------------------------------------------------------------------
# ? At^?[ogtF?[YJn
#--------------------------------------------------------------------------
alias xrxs_bp8_start_phase5 start_phase5
def start_phase5
@xcam_z_destination = 185
xrxs_bp8_start_phase5
end
end
#==============================================================================
# ? RPG::???`?u???"??"Aj???u?C??v
#==============================================================================
module RPG
class Sprite < ::Sprite
def animation_set_sprites(sprites, cell_data, position)
for i in 0..15
sprite = sprites
pattern = cell_data[i, 0]
if sprite == nil or pattern == nil or pattern == -1
sprite.visible = false if sprite != nil
next
end
sprite.visible = true
sprite.src_rect.set(pattern % 5 * 192, pattern / 5 * 192, 192, 192)
if position == 3
if self.viewport != nil
if $scene.is_a?(Scene_Battle)
sprite.x = self.viewport.rect.width / 2
sprite.y = 304
else
sprite.x = self.viewport.rect.width / 2
sprite.y = self.viewport.rect.height - 160
end
else
sprite.x = 320
sprite.y = 240
end
else
sprite.x = self.x - self.ox + self.src_rect.width / 2
sprite.y = self.y - self.oy + self.src_rect.height / 2
sprite.y -= self.src_rect.height / 4 if position == 0
sprite.y += self.src_rect.height / 4 if position == 2
end
sprite.x += cell_data[i, 1]
sprite.y += cell_data[i, 2]
sprite.z = 2000
sprite.ox = 96
sprite.oy = 96
sprite.zoom_x = cell_data[i, 3] / 100.0
sprite.zoom_y = cell_data[i, 3] / 100.0
sprite.angle = cell_data[i, 4]
sprite.mirror = (cell_data[i, 5] == 1)
sprite.opacity = cell_data[i, 6] * self.opacity / 255.0
sprite.blend_type = cell_data[i, 7]
end
end
end
end



Merci FTP. Trouv sur RPG MAKER XP-FACTORY.net


denisdu31 - post le 25/10/2009 20:26:38. (4 messages posts)

If Lien_signature_cliqu = @Denis_content End

Ce script est génial!:sonic Je le garde:joint.
Mais j'ai une suggestion :

Peut-être que le zoom devrait être un peu plus accentué:cig (je ne peux pas le faire moi même, mes connaissances en ruby sont assez limitées :F)

Un jeu super : http://australis.eu2.looki.fr/spiel.php?u=1409737


Zaryel - post le 29/06/2010 11:37:06. (45 messages posts)

Est ce que c'est possible de le rendre compatible avec le script combat sur le coté?
Je m'y connais pas beaucoup en script mais ça serait cool x)


citrouil0 - post le 03/08/2010 12:01:27. (17 messages posts)

Vous pouvez m'appeler "Lykrast" !

Ce script est très bien, sauf qu'il pixélise un peu le joli fond de combat... :(

Chocobo !

Suite de nombreux abus, le post en invits a t dsactiv. Veuillez vous inscrire si vous souhaitez participer la conversation.

Haut de page

Merci de ne pas reproduire le contenu de ce site sans autorisation.
Contacter l'quipe

Plan du site:

Activit: Accueil | News | Forum | Flash-news | Chat | Commentaires | Galerie | Blogs | Screen de la semaine | Sorties | Articles perso | Livre d'or | Recherche
Tlcharger: Jeux | Programmes | Scripts | Packs de ressources | Midis | Elments spars | Sprites
Jeux: Index jeux spars | Top Classiques | Top Originaux | Les autres | RPG Maker 95 | RPG Maker 2000 | RPG Maker 2003 | RPG Maker XP | RPG Maker VX | RPG Maker VX Ace | RPG Maker MV | Autres | Jeux complets | Proposer
Rubriques: Le Wiki | Collection Oniro | Tutoriaux | Guides | Gaming-Live | Tests | Making-of | Interviews | Articles perso | OST | L'Annuaire | Divers | Palmars
Hbergs: Ademphia | Fighting Robots Quest | Forstale | Geex | Inexistence | La Lgende d'Ibabou | Lije | LoveMaster | Sarcia | Super Mario RPG - Lost Souls
Ressources RPG Maker 2000/2003: Chipsets | Charsets | Panoramas | Backdrops | Facesets | Battle anims | Battle charsets | Monstres | Systems | Templates
Ressources RPG Maker XP: Tilesets | Autotiles | Characters | Battlers | Window skins | Icnes | Transitions | Fogs | Templates
Ressources RPG Maker VX: Tilesets | Charsets | Facesets | Systmes
Ressources RPG Maker MV: Tilesets | Characters | Faces | Systèmes | Title | Battlebacks | Animations | SV/Ennemis