CONNEXION
  • RetourJeux
    • Sorties
    • Hit Parade
    • Les + populaires
    • Les + attendus
    • Soluces
    • Tous les Jeux
    • Gaming
  • RetourActu Gaming
    • News
    • Astuces
    • Tests
    • Previews
    • Toute l'actu gaming
  • RetourBons plans
    • Bons plans
    • Bons plans Smartphone
    • Bons plans Hardware
    • Bons plans Image et Son
    • Bons plans Amazon
    • Bons plans Cdiscount
    • Bons plans Decathlon
    • Bons plans Fnac
    • Tous les Bons plans
  • RetourJVTech
    • Actus High-Tech
    • Intelligence Artificielle
    • Smartphones
    • Mobilité urbaine
    • Hardware
    • Image et son
    • Tutoriels
    • Tests produits High-Tech
    • Guides d'achat High-Tech
    • JVTech
  • RetourCulture
    • Actus Culture
    • Culture
  • RetourVidéos
    • A la une
    • Gaming Live
    • Vidéos Tests
    • Vidéos Previews
    • Gameplay
    • Trailers
    • Chroniques
    • Replay Web TV
    • Toutes les vidéos
  • RetourForums
    • Hardware PC
    • PS5
    • Switch 2
    • Xbox Series
    • Switch
    • Pokemon pocket
    • FC 25 Ultimate Team
    • League of Legends
    • Tous les Forums
  • PC
  • PS5
  • Xbox Series
  • Switch 2
  • PS4
  • One
  • Switch
  • iOS
  • Android
  • MMO
  • RPG
  • FPS
En ce moment Genshin Impact Valhalla Breath of the wild Animal Crossing GTA 5 Red dead 2
Liste des sujets

Modifier un script

chronos666
chronos666
Niveau 10
14 janvier 2009 à 11:09:04

Bonjour tout le monde.
J'ai trouvé un script de combat pour rpg maker XP sur le net afin d'avoir des combats vu sur le coté avec les "characters" qui avance d'un pas lorsqu'ils attaquent.
Mais j'aimerais savoir si c'est possible de le modifier pour que l'icône de l'arme qu'il possède s'affiche sur le personnage qui combat. (j'ai vu une image d'un script qui utilise cette méthode.

Merci d'avance

Voila le script

  1. =================================================

=============================

  1. Script combat de coté
  2. version 2 par Skylight
  1. =================================================

=============================
module SDVA

X_LINE = 100 # positionnement horizontal
Y_LINE = 200 # positionnement vertical
X_SPACE = 15 # écartement horizontal
Y_SPACE = 40 # écartement vertical
X_POSITION = 25 #
Y_POSITION = 0 #

# mouvement en attaquant?( true / false )
ATTACK_MOVE = true # alliés
ATTACK_MOVE_E = true # ennemis

# mouvement en lançant une tech?( true / false )
SKILL_MOVE = false # alliés
SKILL_MOVE_E = false # ennemis

# mouvement en uttilisant un objet?( true / false )
ITEM_MOVE = false # alliés

# nombre de pas
MOVE_STEP = 5 # alliés
MOVE_STEP_E = 5 # ennemis

# pixel par pas
MOVE_PIXEL = 10 #alliés
MOVE_PIXEL_E = 10 # ennemis

PARTY_POS = 1 # 1:alliés à droite / 2:alliés à gauche

WINDOWPOS_CHANGE = true

end

  1. =================================================

=============================

  1. Game_Actor
  1. =================================================

=============================
class Game_Actor < Game_Battler

  1. -------------------------------------------------

-------------------------

  1. gère le positionnement horizontal des heros
  1. -------------------------------------------------

-------------------------
def screen_x
if self.index != nil
# Positionde la classe, si uttilisée dans le jeux
pos = $data_classes[self.class_id].position
x_pos = pos *( SDVA::X_POSITION)
if SDVA::PARTY_POS ==1
line=500-SDVA::X_LINE
elsif SDVA::PARTY_POS ==2
line=SDVA::X_LINE
end
scr_x = self.index * SDVA::X_SPACE + line + x_pos
if self.current_action.move_action == true
scr_x += @shift_x
end
return scr_x
else
return 0
end
end

  1. -------------------------------------------------

-------------------------

  1. gère le positionnement vertical des heros
  1. -------------------------------------------------

-------------------------
def screen_y
if self.index != nil
# Position de la classe, si uttilisée dans le jeux
pos = $data_classes[self.class_id].position
y_pos = pos * SDVA::Y_POSITION
scr_y = self.index * SDVA::Y_SPACE + SDVA::Y_LINE + y_pos
# ??????????
if self.current_action.move_action == true
# ????
scr_y += @shift_y
end
return scr_y
else
return 0
end
end

  1. -------------------------------------------------

-------------------------

  1. gère le calque des heros
  1. -------------------------------------------------

-------------------------
def screen_z
if self.index != nil
return self.index
else
return 0
end
end
end

  1. =================================================

=============================

  1. Game_Enemy
  1. =================================================

=============================
class Game_Enemy < Game_Battler

  1. -------------------------------------------------

-------------------------

  1. ? ????? X ?????
  1. -------------------------------------------------

-------------------------
def screen_x
if self.index != nil

base_screen_x=$data_troops[@troop_id].members[@mem
ber_index].x
scr_x = SDVA::PARTY_POS ==1 ? base_screen_x : 500- base_screen_x

  1. ??????????

if self.current_action.move_action == true

  1. ????

scr_x += @shift_x
end
return scr_x
else
return 0
end
end
end

  1. =================================================

=============================

  1. ? Game_Battler (???? 1)
  1. =================================================

=============================
class Game_Battler

  1. -------------------------------------------------

-------------------------

  1. ? ??????????
  1. -------------------------------------------------

-------------------------
attr_reader :pattern # ??????
attr_reader :trans_x # X???????
attr_reader :moving # ??????

  1. -------------------------------------------------

-------------------------

  1. ? ?????????
  1. -------------------------------------------------

-------------------------
alias initialize_sdv initialize
def initialize
initialize_sdv
move_reset
end

  1. -------------------------------------------------

-------------------------

  1. ? ??????
  1. -------------------------------------------------

-------------------------
def move
@moving = 1
if @step < SDVA::MOVE_STEP
# ??????????
@pattern = (@pattern + 1) % 4
@step += 1
move_step
else
# ????
@pattern = 1
@moving = 2
end
end

def move_e
@moving = 1
if @step < SDVA::MOVE_STEP_E
# ??????????
@pattern = (@pattern + 1) % 4
@step += 1
move_step_e
else
# ????
@pattern = 1
@moving = 2
end
end

  1. -------------------------------------------------

-------------------------

  1. ? ????
  1. -------------------------------------------------

-------------------------
def move_step
# ???????????????????
case SDVA::PARTY_POS
when 1
@shift_x = -(@step * SDVA::MOVE_PIXEL)
when 2
@shift_x = @step * SDVA::MOVE_PIXEL
end
end

def move_step_e
# ???????????????????
case SDVA::PARTY_POS
when 1
@shift_x = @step * SDVA::MOVE_PIXEL_E
when 2
@shift_x = -(@step * SDVA::MOVE_PIXEL_E)
end
end

  1. -------------------------------------------------

-------------------------

  1. ? ???????
  1. -------------------------------------------------

-------------------------
def move_reset
@moving = 0
@pattern = 0
@step = 0
@shift_x = 0
@shift_y = 0
end
end

  1. =================================================

=============================

  1. ? Game_BattleAction
  1. =================================================

=============================

class Game_BattleAction

  1. -------------------------------------------------

-------------------------

  1. ? ??????????
  1. -------------------------------------------------

-------------------------
attr_accessor :move_action # ??????????

  1. -------------------------------------------------

-------------------------

  1. ? ???
  1. -------------------------------------------------

-------------------------
alias clear_sdv clear
def clear
clear_sdv
@move_action = false
end

end

  1. =================================================

=============================

  1. Sprite_Battler
  2. transforme les battlers en petits spritesqui peuvent bouger et ainsi de suite
  1. =================================================

=============================

class Sprite_Battler < RPG::Sprite

  1. -------------------------------------------------

-------------------------

  1. ? ??????
  1. -------------------------------------------------

-------------------------
alias update_sdv update
def update
# ????????????????
if @battler.is_a?(Game_Actor)
# ????????????????????
# ??????
if @battler.battler_name != @battler_name or
@battler.battler_hue != @battler_hue or
@battler.current_action.basic == 0 or
@battler.current_action.kind != 3
# ????????????
@character_name = @battler.character_name#+"_c"
@character_hue = @battler.character_hue
# gère le sprite. TRES IMPORTANT
self.bitmap = RPG::Cache.character(@character_name, @character_hue)
cw = self.bitmap.width / 4
ch = self.bitmap.height / 4
@width = cw
@height = ch
if @battler.current_action.move_action == true
# ????
@battler.move
else
@battler.move_reset
end
# ?????????
sx = @battler.pattern * cw
sy = SDVA::PARTY_POS * ch
self.src_rect.set(sx, sy, cw, ch)
self.ox = @width / 2
self.oy = @height
# ??????????? 0 ???
if @battler.hidden
self.opacity = 0
end
end
end

if @battler.is_a?(Game_Enemy)
# ????????????????????
# ??????
if @battler.battler_name != @battler_name or
@battler.battler_hue != @battler_hue or
@battler.current_action.basic == 0 or
@battler.current_action.kind != 3
# ????????????
@character_name = $data_enemies[@battler.id].battler_name
@character_hue = $data_enemies[@battler.id].battler_hue
# ???????????
self.bitmap = RPG::Cache.character(@character_name, @character_hue)
cw = self.bitmap.width / 4
ch = self.bitmap.height / 4
@width = cw
@height = ch
if @battler.current_action.move_action == true
# ????
@battler.move_e
else
@battler.move_reset
end
# ?????????
sx = @battler.pattern * cw
sy = (3-SDVA::PARTY_POS) * ch
self.src_rect.set(sx, sy, cw, ch)
self.ox = @width / 2
self.oy = @height
# ??????????? 0 ???
if @battler.hidden
self.opacity = 0
end
end
end
update_sdv
end
end

  1. =================================================

=============================

  1. ? Scene_Battle
  1. =================================================

=============================

class Scene_Battle

  1. -------------------------------------------------

-------------------------

  1. ? ????????????????????
  1. -------------------------------------------------

-------------------------
alias phase3_setup_command_window_sdv phase3_setup_command_window
def phase3_setup_command_window
phase3_setup_command_window_sdv

if SDVA::WINDOWPOS_CHANGE
# ???????????????????
case SDVA::PARTY_POS
when 0
x_pos = @active_battler.screen_x - (@actor_command_window.width/2)
y_pos = @active_battler.screen_y
when 1
x_pos = @active_battler.screen_x - @actor_command_window.width - 16
y_pos = @active_battler.screen_y - @actor_command_window.height
when 2
x_pos = @active_battler.screen_x + 16
y_pos = @active_battler.screen_y - @actor_command_window.height
when 3
x_pos = @active_battler.screen_x - (@actor_command_window.width/2)
y_pos = @active_battler.screen_y - @actor_command_window.height - 48
end
@actor_command_window.x = x_pos >= 0 ? x_pos : 0
@actor_command_window.x = x_pos+@actor_command_window.width <= 640 ? x_pos : 640-@actor_command_window.width
@actor_command_window.y = y_pos >= 0 ? y_pos : 0
@actor_command_window.y = y_pos+@actor_command_window.height <= 480 ? y_pos : 480-@actor_command_window.height
# ??????????????????
@actor_command_window.z = 9999
end
end

  1. -------------------------------------------------

-------------------------

  1. ? ?????? (??????? ???? 3 : ??????????)
  1. -------------------------------------------------

-------------------------
alias update_phase4_step3_sdv update_phase4_step3
def update_phase4_step3

if @active_battler.is_a?(Game_Actor)
if SDVA::ATTACK_MOVE
if @active_battler.current_action.basic == 0
@active_battler.current_action.move_action = true
end
end
if SDVA::SKILL_MOVE
if @active_battler.current_action.kind == 1
@active_battler.current_action.move_action = true
end
end
if SDVA::ITEM_MOVE
if @active_battler.current_action.kind == 2
@active_battler.current_action.move_action = true
end
end
elsif @active_battler.is_a?(Game_Enemy)
if SDVA::ATTACK_MOVE_E
if @active_battler.current_action.basic == 0
@active_battler.current_action.move_action = true
end
end
if SDVA::SKILL_MOVE_E
if @active_battler.current_action.kind == 1
@active_battler.current_action.move_action = true
end
end
end
# ??????????????????????
if @active_battler.current_action.move_action
# ?????
if @active_battler.moving == 2
update_phase4_step3_sdv
end
elsif @active_battler.moving == 0
update_phase4_step3_sdv
end
end

  1. -------------------------------------------------

-------------------------

  1. ? ?????? (??????? ???? 6 : ??????)
  1. -------------------------------------------------

-------------------------
alias update_phase4_step6_sdv update_phase4_step6
def update_phase4_step6
@active_battler.current_action.move_action = false
@active_battler.move_reset
update_phase4_step6_sdv
end
end

  1. =================================================

=============================

  1. ? Spriteset_Battle
  1. =================================================

=============================

class Spriteset_Battle

  1. -------------------------------------------------

-------------------------

  1. ? ?????????
  1. -------------------------------------------------

-------------------------
alias initialize_sdv initialize
def initialize
initialize_sdv
@viewport2.z = 1
end
end

  1. =================================================

=============================

  1. ? Arrow_Actor
  1. =================================================

=============================

class Arrow_Actor < Arrow_Base

  1. -------------------------------------------------

-------------------------

  1. ? ??????
  1. -------------------------------------------------

-------------------------
alias update_sdv update
def update
update_sdv
# ?????
if Input.repeat?(Input::DOWN)
$game_system.se_play($data_system.cursor_se)
@index += 1
@index %= $game_party.actors.size
end
# ?????
if Input.repeat?(Input::UP)
$game_system.se_play($data_system.cursor_se)
@index += $game_party.actors.size - 1
@index %= $game_party.actors.size
end
end
end

  1. =================================================

=============================

  1. ? Arrow_Enemy
  1. =================================================

=============================

class Arrow_Enemy < Arrow_Base

  1. -------------------------------------------------

-------------------------

  1. ? ??????
  1. -------------------------------------------------

-------------------------
alias update_sdv update
def update
update_sdv
# ?????
if Input.repeat?(Input::DOWN)
$game_system.se_play($data_system.cursor_se)
$game_troop.enemies.size.times do
@index += 1
@index %= $game_troop.enemies.size
break if self.enemy.exist?
end
end
# ?????
if Input.repeat?(Input::UP)
$game_system.se_play($data_system.cursor_se)
$game_troop.enemies.size.times do
@index += $game_troop.enemies.size - 1
@index %= $game_troop.enemies.size
break if self.enemy.exist?
end
end
end
end

Sous forums
  • Aide à l'achat Mac
  • Steam Deck
  • Création de sites web
  • Création de Jeux
  • Linux
  • Programmation
  • Internet
  • Macintosh
  • Hardware
La vidéo du moment