Night.png);">
Apprendre


Vous êtes
nouveau sur
Oniromancie?

Visite guidée
du site


Découvrir
RPG Maker

RM 95
RM 2000/2003
RM XP
RM VX/VX Ace
RM MV/MZ

Apprendre
RPG Maker

Tutoriels
Guides
Making-of

Dans le
Forum

Section Entraide

Sorties: "Dread Mac Farlane", (...) / Tutos: Checklist de la composition (...) / Sorties: Dread Mac Farlane - episode 8 / Sorties: Dread Mac Farlane - episode 7 / Jeux: Ce qui vit Dessous / Chat

Bienvenue
visiteur !




publicité RPG Maker!

Statistiques

Liste des
membres


Contact

Mentions légales

604 connectés actuellement

29435742 visiteurs
depuis l'ouverture

1823 visiteurs
aujourd'hui



Barre de séparation

Partenaires

Indiexpo

Akademiya RPG Maker

Blog Alioune Fall

Fairy Tail Constellations

Lunae - le bazar d'Emz0

Leo-Games

Offgame

Tous nos partenaires

Devenir
partenaire



forums

Index du forum > Entraide > [VX] Deux problèmes avec le SBS.


LittleGamer - posté le 02/01/2014 à 21:14:46 (414 messages postés)

❤ 0

Domaine concerné: Script
Logiciel utilisé: VX
Bonsoir,

J'ai trouvé ce script :

Portion de code : Tout sélectionner

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_
#_/  ?          SBS Tankentai ADD-DON - [Lusitano] Cover              ? VX ?
#_/  ?                      Version 2.1                                    ?
#_/  ?                      by Flipsomel                                    ?
#_/-----------------------------------------------------------------------------
#_/  Extra credit:
#_/  - Kal, i used his way of accessing the skill user id
#_/
#_/  Features:
#_/    Defines actors that will take damage in place of an ally via state.
#_/    Does not work for monsters.
#_/
#_/  Mini-faq:
#_/  > The protector stats are used to calculate the damage when covering ally.
#_/  > Items and healing spells affect the target, not the protector
#_/
#_/
#_/----------------------------------------------------------------------------
#_/  Cover Types:
#_/    1 -> cover target from all physical attacks
#_/    2 -> cover all physical attacks, with a given chance
#_/    3 -> cover all physical attacks, if target hp percentage bellow
#_/    4 -> cover all physical and magic attacks
#_/    5 -> cover all physical and magic attacks, with a given chance
#_/    6 -> cover all physical and magic attacks, if target hp percentage bellow
#_/                                    
#_/----------------------------------------------------------------------------
#_/  How to use:  
#_/
#_/  > Add to the state notebox: <COVER cover_type cover_param>
#_/
#_/                    replace cover_type for the the desired cover type
#_/                    replace cover_param for the the desired param
#_/  Setup examples: 
#_/    
#_/    >  cover ally always : <COVER 1 0>
#_/    >  50% chance of physically cover ally: <COVER 2 50>
#_/    >  cover phys and mag damage if ally hp is at 20%: <COVER 3 20>
#_/
#_/----------------------------------------------------------------------------
#_/  Where to install:
#_/      Above Main, after the battle system.
#_/----------------------------------------------------------------------------
#_/  Compatible:
#_/      Done and tested for SBS3.4e + ATB 1.2c
#_/-----------------------------------------------------------------------------
#_/
#_/  !ATTENTION! : don't forget to check remove state at end of battle, or
#_/                bad stuff will occur!
#_/-----------------------------------------------------------------------------
#_/ 
#_/  Version Log:
#_/  1.0 - Started Script, defender takes damage for protected, pops damage
#_/  1.1 - Added sprite movement
#_/  1.2 - Corrected some bugs regarding damage and skill effects
#_/  2.0 - Added more cover types 
#_/  2.1 - Added protected battler animation
#_/
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_
 
#------------------------------------------------------------------------------
# Cover SEQUENCE
# If you know how to use takentai action sequences you can edit this one.
# Please take into account that the script places the defender in the covered
# ally position, no matter what COVER_RESET does.
# COVER_RESET is only used to make the battler stand in place for a time, and
# then return to his original start position.
#
# BUG NOTE:
# Sometimes the defender turn starts before he can execute
# "Start Pos Return", and will stay in the ally being defended spot until 
# he is called to defend again. You can add  "Start Pos Return" to your
# "COMMAND_INPUT" and this will no longer occur.
# In the next version i will adress this issue, when i have the time z.z
#------------------------------------------------------------------------------
module N01
  COVERSCRIPT_SEQUENCE = {
                "COVER_RESET" => ["30","Start Pos Return","FLEE_RESET"],
                "BE_COVERED" => ["EVADE_JUMP","20","Start Pos Return","FLEE_RESET"]
        }                
ACTION.merge!(COVERSCRIPT_SEQUENCE)
end
 
#==============================================================================
# ¦ State
#==============================================================================
class RPG::State
  attr_accessor :skill_user
end
 
#used by Scene_battle
class Spriteset_Battle
  attr_accessor :actor_sprites
    
  #returns the position of the battler in actor_sprites array
  def pos_in_sprite_array(battler_id)
    for i in 0...actor_sprites.size
      if actor_sprites[i].battler.id == battler_id
        return i
      end
    end 
      return -1
  end
      
end
#access to spriteset
class Scene_Battle < Scene_Base
    attr_accessor :spriteset
  end
#==============================================================================
# ¦ Game_Battler
#==============================================================================
class Game_Battler
 
  alias lusitano_cover_old_initialize initialize
  def initialize
    lusitano_cover_old_initialize #calls old initialize
    @covered = nil #flag, true if actor battler os being protected
    @protector = 0 # id of battler who is protecting
    @protector_spr_id = 0 # id of battler sprite in $scene.spriteset.actor_sprites
    @cover_type = 0 # type of cover (physical, magical, both, bellow %hp
    @cover_param = 0  # second param for cover ( chance, hp%, etc.)
    @is_covering = nil # flag, true if actor is covering another battler
  end
  
  
 alias cover_skill_effect skill_effect
  def skill_effect(user, skill)
    @skill_user = user
    cover_skill_effect(user, skill)
  end
  
  
  #--------------------------------------------------------------------------
  # ? check_for_state_extensions
  #    sees if the added state has extensions defined
  #    state_id : position of state in the $data_states[] array
  #--------------------------------------------------------------------------
  def LUS_COVER_check_for_state_extensions(state_id)
    
    
      return unless @states.include?(state_id)
    
      $data_states[state_id].note.each_line { |line|
          case line
          when /<(?:cover|COVER)\s*(\d+)\s*(\d+)>/i
              @cover_type = $1.to_i
              @cover_param = $2.to_i
              @covered = true
              @protector = $data_states[state_id].skill_user.id
              #$game_actors[@protector].set_covering
              @protector_spr_id = $scene.spriteset.pos_in_sprite_array(@protector)        
              return true
          end
      }
  end 
  
  
  #--------------------------------------------------------------------------
  # ? alias add_state
  #    checks for element modifiers
  #    state_id : position of state in the $data_states[] array
  #--------------------------------------------------------------------------
  alias add_state_lus_cover add_state
  def add_state(state_id)
    
    state = $data_states[state_id]
    state.skill_user = @skill_user
    
    add_state_lus_cover(state_id)
    LUS_COVER_check_for_state_extensions(state_id)
    #checks if self was selected to cover self
    remove_state_lus_cover(state_id) if @protector == self.id
  end
  
  
  #--------------------------------------------------------------------------
  # ? alias remove_state
  #    resets affliction type to 1 if state was an afliction
  #    state_id : position of state in the $data_states[] array
  #--------------------------------------------------------------------------
  alias remove_state_lus_cover remove_state
  def remove_state(state_id)
    
    #checks and reverts to the old weapon_animation_id
    if LUS_COVER_check_for_state_extensions(state_id) == true
      @cover_type = 0
      @covered = false
      @protector = nil
      @protector_spr_id = 0
      @cover_param = 0
    end
    
    remove_state_lus_cover(state_id)
  end
  
  #--------------------------------------------------------------------------
  # * Checks if type of cover allows the battler to be covered
  #  cover_type : type of cover
  #    Returns true if battler checks conditions for being covered
  #--------------------------------------------------------------------------
  def can_be_Covered
  
      # if protector is dead...
    if $game_actors[@protector].dead? && @states.size > 0
      #check wich state will be removed
      for state in @states
        if LUS_COVER_check_for_state_extensions(state.id) == true
          remove_state(state.id)
        end
      end  
      return false
    end
    
    #checks type of cover
    case @cover_type
      when 1,4 #protect physical damage
        return true
      when 2,5
        chance = rand(100) #chance of being covered
        return false unless chance >= @cover_param
        return true
      when 3,6 # if hp is bellow the setting
        return false unless ((self.hp.to_f / self.maxhp.to_f) * 100) <= @cover_param
        return true
      else
        return false
      end
  end
  
  
  
  #--------------------------------------------------------------------------
  # * Apply State Changes
  #    obj : Skill, item, or attacker
  #--------------------------------------------------------------------------
  alias lus_cover_apply_state_changes apply_state_changes
  def apply_state_changes(obj)
    
    if @covered == true
      #checks if battler can be covered
      return if can_be_Covered  
    end
    
    lus_cover_apply_state_changes(obj)
  end
  
  
  #--------------------------------------------------------------------------
  # * Calculation of Damage From Normal Attack
  #    attacker : Attacker
  #    The results are substracted added to @hp_damage
  #  @hp_damage Will be used by execute_damage
  #--------------------------------------------------------------------------
  alias lusitano_cover_mk_atk_dam make_attack_damage_value
  def make_attack_damage_value(attacker)
    
    #calculates de HP_DAMAGE the user would receive
    # this is a call to the original make_attack_damage_value
    lusitano_cover_mk_atk_dam(attacker)
    
    #checks if user is being covered
    return unless @covered == true  
    #checks if battler can be covered
    return unless can_be_Covered
    
    @hp_damage = 0 # takes no hp damage
      
    #calculates the damage value
    $game_actors[@protector].make_attack_damage_value(attacker)
    #executes hp change
    $game_actors[@protector].execute_damage(attacker)
    #pops protector damage
    #$scene.spriteset.actor_sprites[@protector_spr_id].damage_pop($game_actors[@protector].hp_damage)
    cover_sprite_movement
  end # end of method
  
    #--------------------------------------------------------------------------
  # * Calculation of Damage From OBJ
  #    user : user (game_battler)
  #    The results are substracted added to @hp_damage or @mp_damage
  #  @hp_damage Will be used by execute_damage
  #--------------------------------------------------------------------------
  alias lusitano_cover_make_obj_damage_value make_obj_damage_value
  def make_obj_damage_value(user, obj)
    lusitano_cover_make_obj_damage_value(user, obj)
    
    return unless @hp_damage > 0 && obj.is_a?(RPG::Skill)        
    return unless obj.physical_attack || @cover_type > 3
    
    #checks if user is being covered
    return unless @covered == true
    #checks if battler can be covered
    return unless can_be_Covered  
    
    @hp_damage = 0 # takes no hp damage
    
    #calculates the damage value
    $game_actors[@protector].make_attack_damage_value(user)
    #executes hp change
    $game_actors[@protector].execute_damage(user)    
    #defender sprite animation
    cover_sprite_movement
    $game_actors[@protector].apply_state_changes(obj) 
  end  
    
  #--------------------------------------------------------------------------
  # * Cover Sprite Movement
  #    Handles the sprite animation for cover event
  #--------------------------------------------------------------------------
  def cover_sprite_movement
    #$scene is Scene_Battle
    #actor_sprites is sprite_battler
      
    #makes battler do be_covered_action
    self_sprite_id = $scene.spriteset.pos_in_sprite_array(self.id)
    action = $game_actors[self.id].be_covered_action
    $scene.spriteset.set_action(true, self_sprite_id, action)
    
    #makes defender jump to spot!
    $game_actors[@protector].change_base_position(self.position_x, self.position_y)
    # $game_actors[@protector].position_y = self.position_y
    #sets return sequence
    action = $game_actors[@protector].cover_action
    $scene.spriteset.set_action(true, @protector_spr_id, action)
      
    #pops defender damage
    $scene.spriteset.actor_sprites[@protector_spr_id].damage_pop($game_actors[@protector].hp_damage)
    
    #pop alternative ( i should check this later)
    #@spriteset.set_damage_pop(actor, member.index, mp_damage)
    
    # damage_num is from the actors interpreter, it forces and pops the damage 
    # but takes a while to take place so it is not a good alternative
    # $game_actors[@protector].damage_num($game_actors[@protector].hp_damage)    
  end
  
  #returns the cover_action
  def cover_action
    return "COVER_RESET"
  end 
  
  #returns the be covered action
  def be_covered_action
    return "BE_COVERED"
  end 
 
end



C'est un add on pour le SBS, il permet de faire des capacités de protection d'un allié, l'allié se met devant le compagnon ciblé pour le protéger lors des attaques.
Mais ça ne fonctionne pas. Je ne comprends pas pourquoi. Le scirpt semble parler d'une "state" (un état, c'est ça ?) mais je ne sais pas lequel ni comment lui attribuer un id dans le script (j'ai pourtant fait des tests).
J'ai cru comprendre qu'il fallait utiliser l'extension ATB du SBS, que je n'inclus pas à mon projet. Est ce le problème ? En tout cas, en utilisant la capacité pour laquelle j'ai mis un commentaire correspondant, rien de spécial ne se passe.

Quelqu'un peut-il m'aider ?

Suite à des recherches, j'ai trouver ces sites avec le script :
http://www.rpgmakervx.net/index.php?showtopic=51675
http://www.forum-lepalaisdumaking.com/t1281-vx-sbs-tankentai-add-don-couverture

Je n'ai pas tout compris de celui en anglais. J'ai vu qu'il était aussi sur Oniro mais y a pas plus d'infos, en commentaires compris. Je me suis dit que j'aurai plus d'aide ici.



2eme problème.


Dans un combat en partie scripté (en event) de mon projet, un allié réglé sur Berserk est la cible de la commande "forcer une action". En gros, tout les 4 tours il fait une attaque particulière. ça fait bugger le jeu et le ferme avec le message :

Script 'Sideview 1 (3.4e)' line 299: NoMethodError occured.
undefined method for `normal' for nil:NilClass


Ce n'est pas du à la capacité, sans forcé l'action ça fonctionne.
Suite à des recherche, je crois avoir compris que le SBS est un peu en conflit avec les "forcer une action". Y a t'il moyen de ne plus avoir ce problème ?


J'espère que quelqu'un pourra m'aider ou me conseiller. Merci d'avance à qui prendra le temps de lire ce post et de bien vouloir m'aider.


Slime55 - posté le 02/01/2014 à 21:27:41 (442 messages postés)

❤ 0

Pour ta première question c'est assez facile, en fait toutes les instructions sont dans le script

Donc pour faire un sort pour protéger tes alliés, tu crées un statut et sur la notebox tu écris le template de base( plus bas dans le texte ) :
1 -> cover target from all physical attacks
2 -> cover all physical attacks, with a given chance
3 -> cover all physical attacks, if target hp percentage bellow
4 -> cover all physical and magic attacks
5 -> cover all physical and magic attacks, with a given chance
6 -> cover all physical and magic attacks, if target hp percentage bellow


<COVER cover_type cover_param> : Voilà le template de base

Alors le premier membre, en violet/rose, tu n'y touches pas
le deuxième membre en noir il faut que tu choisisses l'une des 6 propositions ci-dessus
Pour le dernier membre en bleu, c'est en fonction des propositions que tu as faits.

Voici un exemple :
<COVER 6 20>
Avec cette commande, tu couvres ( ou protège ) l'allié ciblé de TOUTES les attaques physiques ET magiques si elle est en dessous de 20% d'hp

Voilà, j'espère que j'ai pas trop compliqué l'explication


LittleGamer - posté le 02/01/2014 à 21:49:31 (414 messages postés)

❤ 0

C'est ce que j'ai fait et pourtant ça ne fonctionne pas... Le personnage défenseur ne fait rien quand l'allié se fait attaquer.


Slime55 - posté le 03/01/2014 à 16:11:01 (442 messages postés)

❤ 0

Oui mais ce statut tu l'as " appelé " d'une manière ? Un statut ne peut pas être appliqué si il n'est pas appelé avec un sort ou autre hormis une exception : le statut KO.

Jte conseillerais donc de faire un sort qui appelle ce statut si ce n'est pas déjà fait, si tu as déjà fait ça, bah alors je ne vois vraiment pas ou est le problème, en tout cas si tu n'as pas de code d'erreur c'est que ce n'est pas une question d'incompatibilité mais juste un problème d'utilisation de script. Dans ce cas-là, je ne peux que te conseiller de faire des test et cela jusqu'à ce que tu trouves le problème :-/


daheji - posté le 03/01/2014 à 16:22:34 (278 messages postés)

❤ 0

Pour la première question:

Tu dois créer une compétence qui se lance uniquement sur les alliés. Par exemple, tu crées un sort qui s'appelle Protection.
Cette compétence doit infliger un état sur l'allié. Par exemple, l'état "Protégé". Et l'état doit bien sûr être 100% efficace (il faut cocher la case Nonresistant ou truc dans le genre).

L'état en question doit avoir dans sa note box (en bas à droite) un truc comme <COVER 2 30> (a toi de voir pour les paramètres).

En gros ça fait Protection sur un allié qui a 30% de chance d'être protégé par celui qui a lancé Protection.

--

Mais ce script est buggué. Je voulais l'utiliser moi aussi pour mon projet mais il y a pas mal de trucs qui ne fonctionnent pas. Par exemple, l'affichage des dégâts ne fonctionne pas, le calcul des dommages reçu non plus etc...

C'est clairement pas un script que je te conseille. X] Vaut mieux trouver une alternative ou demander à quelqu'un de te refaire un script entier qui fonctionne correctement. D:

Site officiel de Version Fille ! | Topic de Version Fille | Mon Twitter


LittleGamer - posté le 03/01/2014 à 16:32:31 (414 messages postés)

❤ 0

Slime55 : C'est exactement ce que je faisais et ne comprenait pourquoi ça marchait pas, mais Daheji à peut-être trouvé.

Il faudrait donc que je mette le commentaire sur l'état et non le sort ? On progresse ! Je vais tester ça dans la soirée (je fais un devoir là, pause de 5 minutes).
Après je crois que le script avait reçu quelques updates. Avec un peu de chance, j'en ai pris un débuggé. (Si c'est le cas je te préviendrait au cas où tu le voudrais encore. C'est pour Version Fille ?).
Par contre j'avais déjà demander de l'aide pour un sort de ce type y a longtemps, on m'avait répondu que sur VX c'était infaisable. J'ai trouver ce script par hasard en cherchant la réponse de ma 2eme question, et me suis jeter dessus.

En tout cas merci de vos réponses ! ça devrait m'aider.



Edit Bon ça ne marche pas. J'ai chercher en modifiant deux trois trucs dans le script, il ne se passe toujours rien...

Index du forum > Entraide > [VX] Deux problèmes avec le SBS.

repondre up

Suite à de nombreux abus, le post en invités a été désactivé. 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 - Mentions légales

Plan du site

Communauté: Accueil | Forum | Chat | Commentaires | News | Flash-news | Screen de la semaine | Sorties | Tests | Gaming-Live | Interviews | Galerie | OST | Blogs | Recherche
Apprendre: Visite guidée | RPG Maker 95 | RPG Maker 2003 | RPG Maker XP | RPG Maker VX | RPG Maker MV | Tutoriels | Guides | Making-of
Télécharger: Programmes | Scripts/Plugins | Ressources graphiques / sonores | Packs de ressources | Midis | Eléments séparés | Sprites
Jeux: Au hasard | Notre sélection | Sélection des membres | Tous les jeux | Jeux complets | Le cimetière | RPG Maker 95 | RPG Maker 2000 | RPG Maker 2003 | RPG Maker XP | RPG Maker VX | RPG Maker VX Ace | RPG Maker MV | Autres | Proposer
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 | Icônes | Transitions | Fogs | Templates
Ressources RPG Maker VX: Tilesets | Charsets | Facesets | Systèmes
Ressources RPG Maker MV: Tilesets | Characters | Faces | Systèmes | Title | Battlebacks | Animations | SV/Ennemis
Archives: Palmarès | L'Annuaire | Livre d'or | Le Wiki | Divers