Crash jeu avec le scripte SBS de Jet [Résolu]
Ven 1 Nov 2013 - 4:51
Bonjour,
Mon jeu crash quand mes persos utilisent certaines capacités.
J'avais crées celles ci avant d'installer la scripte SBS de JET.
il me signale une erreur vers la ligne 288.
jet2711_use_item(*args, &block)
if @subject.is_a?(Game_Actor)
if !@subject.current_action.guard? (<=== la ligne 288)
@subject.battle_sprite.move_x(11, 6)
Je n'y comprend absolument rien
Aidez moi s\'il vous plaît
Mon jeu crash quand mes persos utilisent certaines capacités.
J'avais crées celles ci avant d'installer la scripte SBS de JET.
il me signale une erreur vers la ligne 288.
jet2711_use_item(*args, &block)
if @subject.is_a?(Game_Actor)
if !@subject.current_action.guard? (<=== la ligne 288)
@subject.battle_sprite.move_x(11, 6)
Je n'y comprend absolument rien
Aidez moi s\'il vous plaît
Re: Crash jeu avec le scripte SBS de Jet [Résolu]
Ven 1 Nov 2013 - 8:28
Quelles sont et comment sont configurées tes capacités ? Apparemment, il s'agit-là quand tu utilises la commande attendre.
Utilises-tu un autre script de combat ? Jet à codé plusieurs add-on pour ce sbs, en utilises-tu un ?
Utilises-tu un autre script de combat ? Jet à codé plusieurs add-on pour ce sbs, en utilises-tu un ?
Re: Crash jeu avec le scripte SBS de Jet [Résolu]
Ven 1 Nov 2013 - 9:24
Ne pas utiliser 2 SBS en même temps.
Re: Crash jeu avec le scripte SBS de Jet [Résolu]
Ven 1 Nov 2013 - 14:11
J'utilise : "party member" de Yanfly, "atb system" de Moghunter, "SBS" de Jet.
Le script complet :
Alors j'ai crashé en mourant suite à "confu" (mon perso s'est attaqué lui même) et je crash à chaque fois que j'utilise "Frénésie" =>
https://servimg.com/view/17519052/179[url= https://servimg.com/view/17519052/180] https://servimg.com/view/17519052/180[/url]
Le script complet :
- Spoiler:
- #===============================================================================
# Side-View Battle System
# By Jet10985 (Jet)
#===============================================================================
# This script will allow you to have battle where all the actor's sprites are
# display on the right side of the screen.
# This script has: 10 customization options.
#===============================================================================
# Overwritten Methods:
# Scene_Battle: show_attack_animation
# Spriteset_Battle: update_actors
#-------------------------------------------------------------------------------
# Aliased methods:
# Spriteset_Battle: create_actors, create_enemies
# Sprite_Character: initialize, update, dispose, start_new_effect
# Scene_Battle: use_item, next_command, prior_command
# Game_Character: screen_x, screen_y
#===============================================================================
module Jet
module Sideview
#===========================================================================
# ENEMY OPTIONS
#===========================================================================
# These are the attack animations for enemies when they use a regular attack.
# It follows this format: enemy_id => animation_id
ENEMY_ATK_ANIMS = {
1 => 4,
6 => 2,
5 => 27
}
# This is the default enemy attack animation, used when they do not have a
# specific attack animation above.
ENEMY_ATK_ANIMS.default = 1
# This is a list of enemies whose portraits should be flipped in battle.
FLIPPED_ENEMIES = [2, 3, 4, 5, 8, 10, 12, 13, 14, 16, 17, 18, 19]
#===========================================================================
# ACTOR OPTIONS
#===========================================================================
# Should the player sprite have a shadow beneath them?
PLAYER_SHADOW = true
# These are sprite changes depending on state infliction.
# It follows this format: state_id => "sprite_appention"
# This means if the state is inflicted, the sprite will look for a graphic
# that is the same name as the character's sprite, plus the appended option.
# EX: Ralph's sprite's name is $ralph. Ralph gets knocked-out. This means
# state 1 was inflicted, and my below config for 1 was: 1 => "_dead"
# Now, his shown sprite will be $ralph_dead. If the sprite does not exist,
# no change will be made.
# The sprite index will be the same as the actor's.
STATE_SPRITES = {
1 => "_dead",
2 => "_poison",
3 => "_blind"
}
#===========================================================================
# GENERAL_OPTIONS
#===========================================================================
# This is the animation displayed when a skill is about to be used.
SKILL_ANIMATION = 43
# This is the animation displayed when an item is about to be used.
ITEM_ANIMATION = 43
# These are the animations played when a state is inflicted.
# It follows this format: state_id => animation_id
STATE_ANIMATIONS = {
1 => 56,
2 => 50,
3 => 51
}
#===========================================================================
# FIELD OPTIONS
#===========================================================================
# This is where the line-up begins. [x, y]. The higher the x, the further
# right and the higher the y the further down.
FIELD_POS = [400, 255]
# This is how far down, and to the right each player is from the previous
# actor. [x, y]. Same rules as above.
FIELD_SPACING = [20, 20]
end
end
#===============================================================================
# DON'T EDIT FURTHER UNLESS YOU KNOW WHAT TO DO.
#===============================================================================
($imported ||= {})[:jet] ||= {}
$imported[:jet][:Sideview] = true
class Game_Character
attr_accessor :step_anime
%w[screen_x screen_y].each {|a|
aStr = %Q{
alias jet6372_#{a} #{a}
def #{a}(*args, &block)
$BTEST ? 0 : jet6372_#{a}(*args, &block)
end
}
module_eval(aStr)
}
end
class Game_Actor
def animation_id=(t)
self.battle_sprite.start_animation($data_animations[t]) rescue nil
end
end
class Game_Battler
def battle_sprite
return nil unless SceneManager.scene_is?(Scene_Battle)
SceneManager.scene.spriteset.battler_sprites.each {|a|
return a if a.battler == self
}
return nil
end
end
class Spriteset_Battle
alias jet2847_create_enemies create_enemies
def create_enemies(*args, &block)
jet2847_create_enemies(*args, &block)
@enemy_sprites.each {|a|
a.mirror = Jet::Sideview::FLIPPED_ENEMIES.include?(a.battler.enemy.id)
}
end
alias jet3835_create_actors create_actors
def create_actors(*args, &block)
jet3835_create_actors(*args, &block)
@jet_party = $game_party.members
@actor_sprites.each {|a|
a.dispose
}
@actor_sprites = []
$game_party.members.each {|a|
f = Game_Character.new
f.set_graphic(a.character_name, a.character_index)
f.step_anime = true
f.set_direction(4)
n = Sprite_Character.new(@viewport1, f)
n.jet_x = Jet::Sideview::FIELD_POS[0] + a.index * Jet::Sideview::FIELD_SPACING[0]
n.jet_y = Jet::Sideview::FIELD_POS[1] + a.index * Jet::Sideview::FIELD_SPACING[1]
n.battler = a
n.battle_sprite = true
if Jet::Sideview::PLAYER_SHADOW
v = Sprite.new(nil)
v.bitmap = Cache.system("Shadow")
n.shadow_sprite = v
end
@actor_sprites.push(n)
}
end
def update_actors
if @jet_party != $game_party.members
@actor_sprites.each {|a|
a.dispose
}
@actor_sprites = []
create_actors
end
@actor_sprites.each {|a| a.update }
end
end
class Sprite_Character
attr_accessor :battle_sprite, :jet_x, :jet_y, :shadow_sprite, :battler
alias jet4646_initialize initialize
def initialize(*args, &block)
@battle_sprite = false
jet4646_initialize(*args, &block)
end
alias jet3645_update update
def update(*args, &block)
jet3645_update(*args, &block)
if @battle_sprite
@character.step_anime = !@battler.dead?
@character.update
self.x = @jet_x
self.y = @jet_y
if !@battler.nil?
f = @battler.states.dup
f.sort! {|a, b|
a.priority <=> b.priority
}.reverse!
for i in 0...f.size
a = Jet::Sideview::STATE_SPRITES[f[i].id]
next if a.nil?
b = (Cache.character(@character.character_name + a) rescue false)
next unless b
index = @character.character_index
@character.set_graphic(@character.character_name + a, index)
break
end
end
if !@shadow_sprite.nil?
@shadow_sprite.x = self.x - @shadow_sprite.width / 2
@shadow_sprite.y = self.y - 28
@shadow_sprite.visible = self.visible
@shadow_sprite.viewport = self.viewport
@shadow_sprite.z = self.z - 1
end
end
end
alias jet5484_dispose dispose
def dispose(*args, &block)
@shadow_sprite.dispose if !@shadow_sprite.nil?
jet5484_dispose(*args, &block)
end
def move_x(times, amount)
i = 0
until i == times
self.jet_x += amount
i += 1
[Graphics, SceneManager.scene.spriteset].each {|a| a.update }
end
end
def effect?
false
end
end
class Game_Enemy
def atk_animation_id1
return Jet::Sideview::ENEMY_ATK_ANIMS[@enemy_id]
end
def atk_animation_id2
return 0
end
end
class Scene_Battle
attr_reader :spriteset
alias jet2711_use_item use_item
def use_item(*args, &block)
if @subject.is_a?(Game_Actor)
if !@subject.current_action.guard?
@subject.battle_sprite.move_x(11, -6)
end
end
if !@subject.current_action.guard? && !@subject.current_action.attack?
if @subject.current_action.item.is_a?(RPG::Item)
n = $data_animations[Jet::Sideview::ITEM_ANIMATION]
else
n = $data_animations[Jet::Sideview::SKILL_ANIMATION]
end
@subject.battle_sprite.start_animation(n)
wait_for_animation
end
jet2711_use_item(*args, &block)
if @subject.is_a?(Game_Actor)
if !@subject.current_action.guard?
@subject.battle_sprite.move_x(11, 6)
end
end
end
def show_attack_animation(targets)
aid1 = @subject.atk_animation_id1
aid2 = @subject.atk_animation_id2
show_normal_animation(targets, aid1, false)
show_normal_animation(targets, aid2, true)
end
%w[next prior].each {|a|
aStr = %Q{
alias jet3734_#{a}_command #{a}_command
def #{a}_command(*args, &block)
f = BattleManager.actor
f.battle_sprite.move_x(6, 6) if f.is_a?(Game_Actor)
jet3734_#{a}_command(*args, &block)
f = BattleManager.actor
f.battle_sprite.move_x(6, -6) if f.is_a?(Game_Actor)
end
}
module_eval(aStr)
}
end
class Game_Action
def guard?
item == $data_skills[subject.guard_skill_id]
end
end
if $imported[:jet][:BattlePopUps]
class Sprite_Character
attr_accessor :popups
alias jet4758_initialize initialize
def initialize(*args, &block)
@popups = []
@updating_sprites = []
@popup_wait = 0
jet4758_initialize(*args, &block)
end
alias jet7467_update update
def update(*args, &block)
jet7467_update(*args, &block)
if @popup_wait == 0
if !@popups.empty?
@updating_sprites.push(@popups.pop)
@popup_wait = 30
end
else
@popup_wait -= 1
end
@updating_sprites.each {|a|
a.visible = true if !a.visible
a.update
@updating_sprites.delete(a) if a.disposed?
}
end
alias jet5483_dispose dispose
def dispose(*args, &block)
(@updating_sprites + @popups).each {|a| a.dispose }
jet5483_dispose(*args, &block)
end
alias jet3745_setup_new_effect setup_new_effect
def setup_new_effect(*args, &block)
jet3745_setup_new_effect(*args, &block)
do_sprite_popups
end
def make_popup(text, color)
@popups.unshift(Sprite_JetPopup.new(text.to_s, color, self))
end
def do_sprite_popups
return if @battler.nil?
if @battler_struct.nil?
@battler_struct = Struct.new(:hp, :mp, :tp).new(0, 0, 0)
@battler_struct.hp = @battler.hp
@battler_struct.mp = @battler.mp
@battler_struct.tp = @battler.tp
end
check_success_popup
check_hp_popup
check_mp_popup
check_tp_popup
end
def check_success_popup
if @battler.result.success
if @battler.result.critical
make_popup(Jet::BattlePopUps::CRITICAL_TEXT, Jet::BattlePopUps::CRITICAL_COLOR)
elsif @battler.result.missed
make_popup(Jet::BattlePopUps::MISSED_TEXT, Jet::BattlePopUps::MISS_COLOR)
elsif @battler.result.evaded
make_popup(Jet::BattlePopUps::EVADED_TEXT, Jet::BattlePopUps::EVADE_COLOR)
end
@battler.result.clear_hit_flags
end
end
def check_hp_popup
if @battler_struct.hp != @battler.hp
f = @battler_struct.hp - @battler.hp
if f > 0
make_popup(Jet::BattlePopUps::HURT_TEXT + f.to_s, Jet::BattlePopUps::HURT_COLOR)
elsif f < 0
make_popup(Jet::BattlePopUps::HEAL_TEXT + f.abs.to_s, Jet::BattlePopUps::HEAL_COLOR)
end
@battler_struct.hp = @battler.hp
end
end
def check_mp_popup
if @battler_struct.mp != @battler.mp
f = @battler_struct.mp - @battler.mp
if f > 0
make_popup(Jet::BattlePopUps::HURT_TEXT_MP + f.to_s, Jet::BattlePopUps::HURT_COLOR_MP)
elsif f < 0
make_popup(Jet::BattlePopUps::HEAL_TEXT_MP + f.abs.to_s, Jet::BattlePopUps::HEAL_COLOR_MP)
end
@battler_struct.mp = @battler.mp
end
end
def check_tp_popup
if @battler_struct.tp != @battler.tp
f = (@battler_struct.tp - @battler.tp).round
if f > 0
make_popup(Jet::BattlePopUps::HURT_TEXT_TP + f.to_s, Jet::BattlePopUps::HURT_COLOR_TP)
elsif f < 0
make_popup(Jet::BattlePopUps::HEAL_TEXT_TP + f.abs.to_s, Jet::BattlePopUps::HEAL_COLOR_TP)
end
@battler_struct.tp = @battler.tp
end
end
end
end
Alors j'ai crashé en mourant suite à "confu" (mon perso s'est attaqué lui même) et je crash à chaque fois que j'utilise "Frénésie" =>
https://servimg.com/view/17519052/179[url= https://servimg.com/view/17519052/180] https://servimg.com/view/17519052/180[/url]
Re: Crash jeu avec le scripte SBS de Jet [Résolu]
Ven 1 Nov 2013 - 14:37
Le party member de yanfly n'est pas hautement compatible avec les scripts de combat custom ! Essaie de tester sans ce script ! L'atb ne devrait pas poser de problème à mon avis.
Pour ton frénésie, c'est normal, vu que tu t'attaques toi-même ! Quand je regarde ton event, je vois que tu as mis utilisateur comme cible, et donc tu vas t'attaquer toi-même.
ça plante donc quand tu fais une action à toi-même, sur ton propre joueur. Combien as-tu de héros ?
En regardant le script de jet, je vois également que deux méthodes sont écrasées : scene_battle et spriteset_battle
ça doit logiquement venir de là, et entrer en confusion avec l'un des autres scripts de combat que tu possèdes.
Pour ton frénésie, c'est normal, vu que tu t'attaques toi-même ! Quand je regarde ton event, je vois que tu as mis utilisateur comme cible, et donc tu vas t'attaquer toi-même.
ça plante donc quand tu fais une action à toi-même, sur ton propre joueur. Combien as-tu de héros ?
En regardant le script de jet, je vois également que deux méthodes sont écrasées : scene_battle et spriteset_battle
ça doit logiquement venir de là, et entrer en confusion avec l'un des autres scripts de combat que tu possèdes.
Re: Crash jeu avec le scripte SBS de Jet [Résolu]
Ven 1 Nov 2013 - 17:23
3 héros max par combat, au lieu de 4.
Mais j'ai une autre compétence qui je lance sur l'utilisateur et le guérit, elle fonctionne très bien, donc je ne comprends pas trop, et frénésie fonctionne quand les mobs l'utilisent sur eux mêmes.
Je vais essayer sans le party member, mais ça m'obligerait à modifier tout l'équilibre de mon jeu ^^
Edit : le problème reste le même sans "party members" ...
Mais j'ai une autre compétence qui je lance sur l'utilisateur et le guérit, elle fonctionne très bien, donc je ne comprends pas trop, et frénésie fonctionne quand les mobs l'utilisent sur eux mêmes.
Je vais essayer sans le party member, mais ça m'obligerait à modifier tout l'équilibre de mon jeu ^^
Edit : le problème reste le même sans "party members" ...
- InvitéInvité
Re: Crash jeu avec le scripte SBS de Jet [Résolu]
Ven 1 Nov 2013 - 19:15
tu pourrais juste nous joindre une démo avec le soucis apparrant ? Ca serait beaucoup plus facile. *3*
Re: Crash jeu avec le scripte SBS de Jet [Résolu]
Ven 1 Nov 2013 - 22:25
Ok je fais ça mais c'est le bordel dans mes fichiers (c'est mon tt 1er projet :$)
Alors ça sera sans RTP et non crypté.
Le personnage ayant la capacité "frénésie" est Ginsah et n'est pas jouable dans le jeu, donc pour le tester soit incorporez le à l'équipe soit allez dans les testes de groupes d'ennemis (mais je ne vous apprends rien)
Démo : [url= http://rpgmakervx.1fr1.net/t14534-demo-30-les-chroniques-de-l-edell#177204] http://rpgmakervx.1fr1.net/t14534-demo-30-les-chroniques-de-l-edell#177204[/url]
un grand merci à vous !
Alors ça sera sans RTP et non crypté.
Le personnage ayant la capacité "frénésie" est Ginsah et n'est pas jouable dans le jeu, donc pour le tester soit incorporez le à l'équipe soit allez dans les testes de groupes d'ennemis (mais je ne vous apprends rien)
Démo : [url= http://rpgmakervx.1fr1.net/t14534-demo-30-les-chroniques-de-l-edell#177204] http://rpgmakervx.1fr1.net/t14534-demo-30-les-chroniques-de-l-edell#177204[/url]
un grand merci à vous !
- SpytjeAdministrateur
- Nombre de messages : 5935
Localisation : La terre
Distinction : Spiraliste [Korn']
Forestia : Projet du mois juillet 2014
Papy Pulkigrat [Yama']
Date d'inscription : 16/03/2008
Re: Crash jeu avec le scripte SBS de Jet [Résolu]
Ven 1 Nov 2013 - 23:38
Peut être que je me trompe mais il me semble que tu ne dois pas utiliser l'atb avec un sbs.
- GelartoGelato Della Mamma
- Nombre de messages : 2919
Age : 29
Distinction : Grand bêta-testeur de la communauté Curse
Personne avec du goût
Je ne suis pas une glace italienne, bordel de merde! [Gel']
Mon plus grand fan [Yama']
Mon ptit bichon [encore Yama']
Jeau-Paul II[Mist']
Saint-Gelato Le Frais [Mist']
Écrivain du dimanche [Amal']
FF IV Fanatic [LaCommu']
Collectionneur de distinctions de merde [Yama]
ModoGel [Un staffieux mais lequel?]
RNGel 2.0 [Zeal']
Date d'inscription : 31/07/2012
Re: Crash jeu avec le scripte SBS de Jet [Résolu]
Ven 1 Nov 2013 - 23:47
On peut, tout dépend de l'atb. Les scripts de mog sont en généraux très compatibles avec les sbs, c'est peut-être que là viens le problème, essaye sans pour voir ce que ça donne.
- SpytjeAdministrateur
- Nombre de messages : 5935
Localisation : La terre
Distinction : Spiraliste [Korn']
Forestia : Projet du mois juillet 2014
Papy Pulkigrat [Yama']
Date d'inscription : 16/03/2008
Re: Crash jeu avec le scripte SBS de Jet [Résolu]
Ven 1 Nov 2013 - 23:54
Non la je parle des méthodes qui sont utilisées simultanément par les deux scripts et ça peut créer des erreurs.
Il faudra certainement trouver un patch pour les faire fonctionner ensemble sans bugs.
Il faudra certainement trouver un patch pour les faire fonctionner ensemble sans bugs.
Re: Crash jeu avec le scripte SBS de Jet [Résolu]
Ven 1 Nov 2013 - 23:55
j'ai essayé d'en enlever l'un puis l'autre, sauf que ça à du modifier un truc, et du coup tous les combats bugs >.> je vais essayer de corriger ça, déjà.
Mwé j'ai re installer totalement l'ATB, ça fonctionne plus du tout je dois enlever et remettre tous mes scriptes :/
Mwé j'ai re installer totalement l'ATB, ça fonctionne plus du tout je dois enlever et remettre tous mes scriptes :/
- SpytjeAdministrateur
- Nombre de messages : 5935
Localisation : La terre
Distinction : Spiraliste [Korn']
Forestia : Projet du mois juillet 2014
Papy Pulkigrat [Yama']
Date d'inscription : 16/03/2008
Re: Crash jeu avec le scripte SBS de Jet [Résolu]
Sam 2 Nov 2013 - 0:04
Déplace le script "Party member" au dessus de ton script "ATB".
Re: Crash jeu avec le scripte SBS de Jet [Résolu]
Sam 2 Nov 2013 - 0:07
Ooook ! je dois mettre :spywaretof a écrit:Déplace le script "Party member" au dessus de ton script "ATB".
ATB
Party Member
SBS
et ça fonctionne !
reste mon problème de frénésie ^^
- SpytjeAdministrateur
- Nombre de messages : 5935
Localisation : La terre
Distinction : Spiraliste [Korn']
Forestia : Projet du mois juillet 2014
Papy Pulkigrat [Yama']
Date d'inscription : 16/03/2008
Re: Crash jeu avec le scripte SBS de Jet [Résolu]
Sam 2 Nov 2013 - 0:10
Oui voila je cherche d'ou vient l'erreur donne moi un moment.
Re: Crash jeu avec le scripte SBS de Jet [Résolu]
Sam 2 Nov 2013 - 0:18
Merci bcp, ça ne presse pas, je peux continuer à avancer avec mon mapping, donc prends le temps, c'est déjà très gentil de regarder
- SpytjeAdministrateur
- Nombre de messages : 5935
Localisation : La terre
Distinction : Spiraliste [Korn']
Forestia : Projet du mois juillet 2014
Papy Pulkigrat [Yama']
Date d'inscription : 16/03/2008
Re: Crash jeu avec le scripte SBS de Jet [Résolu]
Sam 2 Nov 2013 - 0:25
Remplace ton script Sbs par celui ci et si ca bug encore fais le moi savoir :
- Code:
#===============================================================================
# Jet's Viewed Battle System
# By Jet10985(Jet)
#===============================================================================
# This script will add actor sprites into the battle scene.
# This script has: 10 customization options.
#===============================================================================
# Overwritten Methods:
# Game_Actor: use_sprite?, screen_x, screen_y
# Sprite_Battler: revert_to_normal
# Scene_Battle: show_attack_animation
#-------------------------------------------------------------------------------
# Aliased methods:
# Game_Enemy: screen_x, screen_y
# Sprite_Battler: update_origin, update_bitmap
# Window_BattleEnemy: update
# Window_BattleActor: update
# Window_ActorCommand: update
#===============================================================================
=begin
Set an enemy's attack animation by using this in their notebox:
<anim: 50>
Replace 50 with the animation id.
--------------------------------------------------------------------------------
You may use a sprite for a monster instead of a regular battler by using this
notetag in the monster's notebox:
<sprite: ImageName, 0>
Replace ImageName with the name of the spritesheet, and 0 with the index on the
spritesheet you want the monster to use.
=end
module Jet
module VBS
# Which direction do actors face on the field? There are 4 options:
# :up, :down, :left, or :right. Actor's will direction chosen.
ACTOR_ORIENTATION = :left
# This will make it so actor's are centered on the screen instead of being
# placed in pre-determined lines using START_POINT and SPACE_DIFFERENCE.
CENTER_ACTORS = true
# This is the x and y starting point for actors. This option may take one of
# 2 functions. If CENTER_ACTORS is true, and ACTOR_ORIENTATION is either
# :left, or :right, then only the x value will be used as where to center
# the actors. If it is :down or :up, only the y value will be used.
# If CENTER_ACTORS is false, then this is where actor's will begin to be
# placed on screen.
START_POINT = [400, 250]
# This is how much space is between each actor on the field.
SPACE_DIFFERENCE = 50
# If you're using the :left or :right view, this will push each
# subsequent actor back by a certain number of pixels, to avoid having
# a straight line.
SIDEVIEW_PUSH_BACK = 16
# Do you want to reverse the direction and field during an ambush?
# (This is when enemies surprise the player and get the first turn)
REVERSE_FIELD_FOR_AMBUSH = true
# this is how far the actor will move forward when they are selection an
# action, as well as executing it.
SLIDE_AMOUNT = 66
# This is how far the actor will slide each frame until they reach their
# goal of SLIDE_FORWARD. Best used when this is a factor of SLIDE_FORWARD.
FRAME_SLIDE = 6
# During selecting an actor command, and during selecting an enemy target,
# would you like the selected character to flash?
DO_FLASH = true
# These are state-based sprite changes. If the actor has one of these states
# then the game will search for a sprite of the character's regular sprite
# name with the special state tag appended to it. So if Jimmy's sprite
# name was $Jimmy, and he had poison inflcted on him, and poison's id was
# listed here as ["_poison", 0], it would change Jimmy's in-battle sprite
# to $Jimmy_poison at the first sprite index.
STATE_SPRITES = {
1 => ["", 0],
2 => ["", 0]
}
# Do not touch this option.
DIR_ORIENT = {right: 6, left: 4, down: 2, up: 8}[ACTOR_ORIENTATION]
end
end
#===============================================================================
# DON'T EDIT FURTHER UNLESS YOU KNOW WHAT TO DO.
#===============================================================================
class Integer
def even?
self % 2 == 0
end
def odd?
!even?
end
end
class RPG::Enemy
def animation
(f = note.match(/<anim:[ ]*(\d+)>/i)) ? f[1].to_i : 1
end
def battle_sprite
(f = note.match(/<sprite:[ ]*(.+),[ ]*(\d+)>/i)) ? f[1..2] : false
end
end
module BattleManager
class << self
alias jet3845_on_encounter on_encounter
def on_encounter(*args, &block)
jet3845_on_encounter(*args, &block)
@true_surprise = @surprise
end
end
def self.true_surprise
@true_surprise ||= false
end
def self.player_dir
if @true_surprise && Jet::VBS::REVERSE_FIELD_FOR_AMBUSH
return 10 - Jet::VBS::DIR_ORIENT
else
return Jet::VBS::DIR_ORIENT
end
end
end
class Game_Actor
def use_sprite?
true
end
def screen_x
if [8, 2].include?(BattleManager.player_dir)
if Jet::VBS::CENTER_ACTORS
x = Graphics.width / 2
x -= 16
x += Jet::VBS::SPACE_DIFFERENCE / 2 if $game_party.members.size.even?
x -= ($game_party.members.size / 2 - index) * Jet::VBS::SPACE_DIFFERENCE
return x
else
return Jet::VBS::START_POINT[0] + Jet::VBS::SPACE_DIFFERENCE * index
end
end
return Jet::VBS::START_POINT[0]
end
alias jet3745_screen_x screen_x
def screen_x(*args, &block)
x = jet3745_screen_x(*args, &block)
case BattleManager.player_dir
when 4
x += Jet::VBS::SIDEVIEW_PUSH_BACK * index
when 6
x -= Jet::VBS::SIDEVIEW_PUSH_BACK * index
end
return x if !Jet::VBS::REVERSE_FIELD_FOR_AMBUSH
x = Graphics.width - x if BattleManager.true_surprise && [6, 4].include?(BattleManager.player_dir)
x
end
def screen_y
if [6, 4].include?(BattleManager.player_dir)
if Jet::VBS::CENTER_ACTORS
y = Graphics.height / 2
y -= 16
y += Jet::VBS::SPACE_DIFFERENCE / 2 if $game_party.members.size.even?
y -= ($game_party.members.size / 2 - index) * Jet::VBS::SPACE_DIFFERENCE
return y
else
return Jet::VBS::START_POINT[1] + Jet::VBS::SPACE_DIFFERENCE * index
end
end
return Jet::VBS::START_POINT[1]
end
alias jet3745_screen_y screen_y
def screen_y(*args, &block)
y = jet3745_screen_y(*args, &block)
return y if !Jet::VBS::REVERSE_FIELD_FOR_AMBUSH
y = Graphics.height - y if BattleManager.true_surprise && [8, 2].include?(BattleManager.player_dir)
y
end
def screen_z
101 + index
end
alias jet3745_character_name character_name
def character_name(*args, &block)
name = jet3745_character_name(*args, &block)
return name unless SceneManager.scene_is?(Scene_Battle)
states.sort {|a, b| b.priority <=> a.priority }.each {|a|
if (add = Jet::VBS::STATE_SPRITES[a.id])
return name + add[0]
end
}
return name
end
alias jet3745_character_index character_index
def character_index(*args, &block)
index = jet3745_character_index(*args, &block)
return index unless SceneManager.scene_is?(Scene_Battle)
states.sort {|a, b| b.priority <=> a.priority }.each {|a|
if (add = Jet::VBS::STATE_SPRITES[a.id])
return index + add[1]
end
}
return index
end
end
class Game_Enemy
alias jet3745_screen_x screen_x
def screen_x(*args, &block)
x = jet3745_screen_x(*args, &block)
return x if !Jet::VBS::REVERSE_FIELD_FOR_AMBUSH
x = Graphics.width - x if BattleManager.true_surprise && [6, 4].include?(BattleManager.player_dir)
x
end
alias jet3745_screen_y screen_y
def screen_y(*args, &block)
y = jet3745_screen_y(*args, &block)
return y if !Jet::VBS::REVERSE_FIELD_FOR_AMBUSH
y = Graphics.height - y if BattleManager.true_surprise && [8, 2].include?(BattleManager.player_dir)
y
end
def atk_animation_id1
enemy.animation
end
def atk_animation_id2
0
end
def bat_sprite?
!!enemy.battle_sprite
end
def character_name
enemy.battle_sprite[0]
end
def character_index
enemy.battle_sprite[1].to_i
end
alias jet3745_character_name character_name
def character_name(*args, &block)
name = jet3745_character_name(*args, &block)
return name unless SceneManager.scene_is?(Scene_Battle)
states.sort {|a, b| b.priority <=> a.priority }.each {|a|
if (add = Jet::VBS::STATE_SPRITES[a.id])
return name + add[0]
end
}
return name
end
alias jet3745_character_index character_index
def character_index(*args, &block)
index = jet3745_character_index(*args, &block)
return index unless SceneManager.scene_is?(Scene_Battle)
states.sort {|a, b| b.priority <=> a.priority }.each {|a|
if (add = Jet::VBS::STATE_SPRITES[a.id])
return index + add[1]
end
}
return index
end
end
class Sprite_Battler
alias jet3835_update_bitmap update_bitmap
def update_bitmap(*args, &block)
if @battler.actor? || @battler.bat_sprite?
actor_update_bitmap
elsif @battler.enemy?
jet3835_update_bitmap(*args, &block)
end
end
def actor_update_bitmap
@timer ||= 0
@index ||= 1
@char_index ||= @battler.character_index
@back_time ||= false
index = @index
char_index = @char_index
@timer += 1
(@index += (@back_time ? -1 : 1); @timer = 0) if @timer == 19
if @index == 3
@back_time = true
@index = 1
elsif @index == -1
@back_time = false
@index = 1
end
@char_index = @battler.character_index
bitmap = Cache.character(@battler.character_name)
return if bitmap == @bitmap && index == @index && @char_index == char_index
self.bitmap = bitmap
sign = @battler.character_name[/^[\!\$]./]
if sign && sign.include?('$')
cw = bitmap.width / 3
ch = bitmap.height / 4
else
cw = bitmap.width / 12
ch = bitmap.height / 8
end
dir = BattleManager.player_dir
dir = 10 - dir if @battler.is_a?(Game_Enemy)
sx = (@battler.character_index % 4 * 3) * cw + (cw * @index)
sy = (@battler.character_index / 4 * 4 + (dir - 2) / 2) * ch
self.src_rect.set(sx, sy, cw, ch)
end
alias jet3745_update_origin update_origin
def update_origin(*args, &block)
if @battler.actor? || @battler.bat_sprite?
actor_update_origin
elsif @battler.enemy?
jet3745_update_origin(*args, &block)
end
end
def actor_update_origin
self.ox = (@actor_ox ||= 0)
self.oy = (@actor_oy ||= 0)
end
def revert_to_normal
self.blend_type = 0
self.color.set(0, 0, 0, 0)
self.opacity = 255
if bitmap && @battler && !@battler.actor? && !@battler.bat_sprite?
self.ox = bitmap.width / 2 if bitmap
self.src_rect.y = 0
end
end
def slide_forward(amount = Jet::VBS::SLIDE_AMOUNT, frame = Jet::VBS::FRAME_SLIDE)
dir = BattleManager.player_dir
dir = 10 - dir if @battler.is_a?(Game_Enemy)
case dir
when 2
affect = :@actor_oy
frame *= -1
when 4
affect = :@actor_ox
amount *= -1
when 6
affect = :@actor_ox
frame *= -1
when 8
affect = :@actor_oy
amount *= -1
end
orig_amount = amount
until (orig_amount < 0 ? amount >= 0 : amount <= 0)
instance_variable_set(affect, instance_variable_get(affect) + frame)
amount += frame
SceneManager.scene.spriteset.update
Graphics.update
end
end
def slide_backward(amount = Jet::VBS::SLIDE_AMOUNT, frame = Jet::VBS::FRAME_SLIDE)
dir = BattleManager.player_dir
dir = 10 - dir if @battler.is_a?(Game_Enemy)
case dir
when 2
affect = :@actor_oy
amount *= -1
when 4
affect = :@actor_ox
frame *= -1
when 6
affect = :@actor_ox
amount *= -1
when 8
affect = :@actor_oy
frame *= -1
end
orig_amount = amount
until (orig_amount < 0 ? amount >= 0 : amount <= 0)
instance_variable_set(affect, instance_variable_get(affect) + frame)
amount += frame
SceneManager.scene.spriteset.update
Graphics.update
end
end
end
class Scene_Battle
attr_reader :spriteset
def show_attack_animation(targets)
show_normal_animation(targets, @subject.atk_animation_id1, false)
show_normal_animation(targets, @subject.atk_animation_id2, true)
end
alias jet3746_use_item use_item
def use_item(*args, &block)
sprite = @spriteset.battler_to_sprite(@subject)
if (@subject.actor? || @subject.bat_sprite?) && !@subject.current_action.guard?
sprite.slide_forward
end
jet3746_use_item(*args, &block)
if (@subject.actor? || @subject.bat_sprite?)
sprite.slide_backward
end
end
end
class Spriteset_Battle
def battler_to_sprite(actor)
battler_sprites.each {|a|
return a if a.battler == actor
}
return false
end
end
class Window_BattleEnemy
alias jet3745_update update
def update(*args, &block)
jet3745_update(*args, &block)
if self.active && Jet::VBS::DO_FLASH
if Object.const_defined?(:Mouse)
$game_troop.alive_members.each {|a|
img = SceneManager.scene.spriteset.battler_to_sprite(a)
x = img.x - img.ox
y = img.y - img.oy
if Mouse.area?(x, y, img.src_rect.width, img.src_rect.height)
self.index = a.index
end
}
end
active_troop = $game_troop.alive_members[@index]
sprite = SceneManager.scene.spriteset.battler_to_sprite(active_troop)
sprite.start_effect(:whiten) if !sprite.effect?
end
end
end
class Window_BattleActor
alias jet3745_update update
def update(*args, &block)
jet3745_update(*args, &block)
if self.active && Jet::VBS::DO_FLASH
if Object.const_defined?(:Mouse)
$game_party.alive_members.each {|a|
img = SceneManager.scene.spriteset.battler_to_sprite(a)
x = img.x - img.ox
y = img.y - img.oy
if Mouse.area?(x, y, img.src_rect.width, img.src_rect.height)
self.index = a.index
end
}
end
active_troop = $game_party.members[@index]
sprite = SceneManager.scene.spriteset.battler_to_sprite(active_troop)
sprite.start_effect(:whiten) if !sprite.effect?
end
end
end
class Window_ActorCommand
alias jet3745_update update
def update(*args, &block)
jet3745_update(*args, &block)
if self.active && Jet::VBS::DO_FLASH
active_troop = @actor
sprite = SceneManager.scene.spriteset.battler_to_sprite(active_troop)
sprite.start_effect(:whiten) if !sprite.effect?
end
end
end
class Game_Action
def guard?
item == $data_skills[subject.guard_skill_id]
end
end
Re: Crash jeu avec le scripte SBS de Jet [Résolu]
Sam 2 Nov 2013 - 0:29
ça fonctionne tu gères ^^
par contre le perso n'arrête pas de clignoter quand c'est à lui d'agir o_O
par contre le perso n'arrête pas de clignoter quand c'est à lui d'agir o_O
- SpytjeAdministrateur
- Nombre de messages : 5935
Localisation : La terre
Distinction : Spiraliste [Korn']
Forestia : Projet du mois juillet 2014
Papy Pulkigrat [Yama']
Date d'inscription : 16/03/2008
Re: Crash jeu avec le scripte SBS de Jet [Résolu]
Sam 2 Nov 2013 - 0:31
C'est normal et c'est surement modifiable dans le script même.
Ligne 77 mettre "false" à la place de "true"
Ligne 77 mettre "false" à la place de "true"
Re: Crash jeu avec le scripte SBS de Jet [Résolu]
Sam 2 Nov 2013 - 0:35
Rha zut oui ^^
Un grand merci à toi !
Je suis totalement perdu dès qu'il s'agit des scriptes ^^
Un grand merci à toi !
Je suis totalement perdu dès qu'il s'agit des scriptes ^^
- SpytjeAdministrateur
- Nombre de messages : 5935
Localisation : La terre
Distinction : Spiraliste [Korn']
Forestia : Projet du mois juillet 2014
Papy Pulkigrat [Yama']
Date d'inscription : 16/03/2008
Re: Crash jeu avec le scripte SBS de Jet [Résolu]
Sam 2 Nov 2013 - 0:36
Pas de soucis bonne continuation dans ce cas
Permission de ce forum:
Vous ne pouvez pas répondre aux sujets dans ce forum
|
|