Bienvenue visiteur !
|
Statistiques
Liste des membres
Contact
Mentions légales
299 connectés actuellement
30945821 visiteurs depuis l'ouverture
1859 visiteurs aujourd'hui
Partenaires
Tous nos partenaires
Devenir partenaire
|
Cortez -
posté le 10/07/2013 à 21:39:19 (524 messages postés)
| | Domaine concerné: [Script]
Logiciel utilisé: [Rpg maker XP]
Bonjour je viens vous poser des questions dans le but d'en apprendre plus sur
les scripts.
Je sais que les scripts Interpreter 1 à 7 gèrent les commandes en évent dans XP.
Question 1 :
Je que je souhaite savoir c'est quelle partie de ces scripts gèrent les commandes
des groupes de monstres ? (la partie évènementielle paramétrable)
Question 2 :
Quelle est la signification des fréquences de déclanchement de cette partie évent
des groupes ?
Question 3 : (en lien avec la Q1)
Quelle partie des Scene_Battle 1 à 4 vérifie et interprète les commandes d'évent
des groupes de monstres ?
Ces questions vont me permettre de corriger un bug sur des script qui ne gèrent
pas du tout ces commandes (cela m'empêche de créer des groupes de monstres
avec des stratégies.)
Edit 11 juillet :
Toujours personne ?
|
le_colosse -
posté le 12/07/2013 à 02:01:54 (66 messages postés)
| Rush FTW | Je viens de fouiller un peu dans la doc de XP et c'est dans la classe RPG::Troop que se trouve les informations reliées aux événements des commandes des groupes de monstres. De plus, dans les classes internes Page et Condition, tu as peut-être les informations que tu cherches aussi.
Ensuite, je crois que c'est la méthode setup_battle_event dans Scene_Battle1 qui s'occupe de l'interprétation des événements de combat. En fait, il délègue la job d'interprétation à un interpréteur dans la classe Game_System, mais qui est une référence à une instance de la classe Interpreter.
Je sais pas si tu vas trouver les infos que tu cherches là dedans. Si y'a de quoi, je regarderais plus. Mais je ne travaille pas avec XP, donc je ne suis pas au courant de la structure du code.
|
Cortez -
posté le 12/07/2013 à 18:03:04 (524 messages postés)
| | Afin que tu ais plus de précision, mon problème se situe dans ce
morceau de script :
C'est une partie d'un script ATB, il utilise beaucoup d'Alias et de
redéfinition de méthode.
Et lors du jeu, il bloque la bataille dès qu'un évènement de combat
est déclenché.
Je me suis dit qu'en comprenant un peu mieux le code originel des
combats je pourrais en venir à bout, mais non...
Il manque une chose afin que les commandes évent soit fonction-
nelles, j'ai donc réécrit la def setup_battle_event et j'ai
placé un morceau d'update au bon endroit.
Les ajouts que j'ai fait ne fond pas planter le code mais cela ne
change rien à l'affaire.
T'aurais pas une idée ? (je suis certain que c'est ce script qui foire
car sans lui tout marche. Mais je tient absolument à l'utiliser.)
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
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
| #==============================================================================
# ■ Scene_Battle
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
include N01
#--------------------------------------------------------------------------
alias acbs_main_atb main
def main
turn_count_speed
@escape_ratio = 40
$game_temp.escape_count = 0
@escape_type, @escape_name = Escape_Type, Escape_Name
@input_battlers, @action_battlers = [], []
@input_battler, @action_battler = nil, nil
@escaped = @update_turn_end = @action_phase = false
acbs_main_atb
end
#--------------------------------------------------------------------------
alias acbs_start_atb start
def start
acbs_start_atb
add_bars
for battler in $game_party.actors + $game_troop.enemies
battler.turn_count = 0
battler.atb = 0
battler.atb_preset
battler.cast_action = nil
battler.cast_target = nil
battler.defense_pose = false
end
for actor in $game_party.actors
actor.atb = actor.max_atb - 1 if $preemptive
actor.atb = 0 if $back_attack
end
for enemy in $game_troop.enemies
enemy.atb = 0 if $preemptive
enemy.atb = enemy.max_atb - 1 if $back_attack
end
update_meters
end
#--------------------------------------------------------------------------
alias acbs_terminate_atb terminate
def terminate
acbs_terminate_atb
remove_bars
end
#--------------------------------------------------------------------------
def add_bars
@atb_meters = ATB_Meters.new if Meters
@atb_meters_enemy = ATB_Meters_Enemy.new if Enemy_Meter != 0 and Meters
@atb_bars = ATB_Bars.new if Bars
end
#--------------------------------------------------------------------------
def remove_bars
@atb_meters.dispose if Meters
@atb_bars.dispose if Bars
@atb_meters_enemy.dispose if Enemy_Meter != 0 and Meters
end
#--------------------------------------------------------------------------
alias acbs_update_atb update
def update
if @phase == 1
$game_temp.battle_main_phase = true
@actor_command_window.opacity = 0
@phase = 0
elsif @phase != 5
@phase = 0
end
@event_running = true if $game_system.battle_interpreter.running?
acbs_update_atb
if $game_system.battle_interpreter.running?
return
elsif @event_running
@status_window.refresh
@event_running = false
end
return $scene = Scene_Gameover.new if $game_temp.gameover
return update_phase5 if @phase == 5
@event_running = true if $game_system.battle_interpreter.running?
if @update_turn_end
turn_ending
@update_turn_end = false
end
if Input.press?(Escape_Input) and @escape_type > 0
if $game_temp.battle_can_escape
$game_temp.max_escape_count = update_phase2_escape_rate
$game_temp.escape_count += 2 unless @wait_on
@escaping = true
if !@help_window.visible and @escape_type == 1
@help_window.set_text('')
@help_window.set_text(Escape_Message, 1)
end
if @escape_type == 2
if @escape_atb_meters.nil?
@escape_atb_meters = Escape_Meters.new
@escape_meter_opacity = 0
@escape_atb_meters.visible = true
else @escape_atb_meters != nil
@escape_atb_meters.opacity = 15 * @escape_meter_opacity
@escape_meter_opacity = [@escape_meter_opacity + 1, 17].min
@escape_atb_meters.refresh
end
end
if $game_temp.escape_count >= $game_temp.max_escape_count
$game_temp.escape_count = 0
update_phase2_escape unless $game_party.all_dead?
end
else
@help_window.set_text(Cant_Escape_Message, 1) if @escape_type == 1
if @escape_type == 2
if @escape_atb_meters.nil?
@escape_atb_meters = Escape_Meters.new
@escape_meter_opacity = 0
@escape_atb_meters.visible = true
else @escape_atb_meters != nil
@escape_atb_meters.opacity = 15 * @escape_meter_opacity
@escape_meter_opacity = [@escape_meter_opacity + 1, 17].min
@escape_atb_meters.refresh
end
end
end
elsif @escape_type > 0
if @escaping
@escaping = false
@help_window.visible = false
end
$game_temp.escape_count = [$game_temp.escape_count - 1, 0].max unless @wait_on
if @escape_atb_meters != nil and $game_temp.escape_count == 0
@escape_atb_meters.opacity = 15 * @escape_meter_opacity
@escape_meter_opacity = [@escape_meter_opacity - 1, 0].max
if @escape_meter_opacity == 0
@escape_atb_meters.dispose
@escape_atb_meters = nil
end
end
@escape_atb_meters.refresh if @escape_atb_meters != nil
end
return if @escaped
atb_update
input_battler_update(false)
if @action_battlers[0] != nil && @action_battler.nil?
@action_battlers.flatten!
@action_battler = @action_battlers[0]
if @action_battler.dead?
@action_battler.atb = 0
@action_battler = nil
else
start_phase4
end
end
if @action_battler != nil && !@spriteset.effect?
@active_battler = @action_battler
update_phase4
end
end
#--------------------------------------------------------------------------
alias acbs_judge_atb judge
def judge
@end_battle = acbs_judge_atb
return @end_battle
end
#--------------------------------------------------------------------------
alias acbs_update_basic_atb update_basic
def update_basic
atb_update unless @battle_start
input_battler_update(true)
acbs_update_basic_atb
end
#--------------------------------------------------------------------------
def input_battler_update(basic)
for battler in $game_troop.enemies + $game_party.actors
if battler.atb_full? and battler != @action_battler and not
@action_battlers.include?(battler)
battler_turn(battler)
break if Wait_Act_End and not battler.actor?
end
end
if @input_battlers[0] != nil && @input_battler.nil? && !@wait_on
@input_battlers.flatten!
@input_battler = @input_battlers[0]
if @input_battler.current_action.forcing || @input_battler.restriction == 2 ||
@input_battler.restriction == 3
if @input_battler.restriction == 2 || @input_battler.restriction == 3
@input_battler.current_action.kind = 0
@input_battler.current_action.basic = 0
end
@input_battler.defense_pose = false
@action_battlers << @input_battler
@input_battlers.shift
@input_battler = nil
elsif @input_battler.inputable?
@actor_index = $game_party.actors.index(@input_battler)
@input_battler.current_action.clear
@input_battler.blink = true
else
@input_battler.atb_update
@input_battlers.shift
@input_battler = nil
end
end
if @input_battler != nil
@input_action = true if basic
@now_battler = @active_battler
@active_battler = @input_battler
@input_battler.defense_pose = false
phase3_setup_command_window if @actor_command_window.opacity == 0
update_phase3
@active_battler = @now_battler
@input_action = false if basic
end
for battler in $game_party.actors + $game_troop.enemies
if battler.dead? or not battler.exist?
@input_battlers.delete(battler)
@action_battlers.delete(battler)
end
end
end
#--------------------------------------------------------------------------
def battler_turn(battler)
battler.turn_count += 1
if battler.is_a?(Game_Actor)
if battler.inputable? and battler.cast_action.nil?
@input_battlers << battler
else
if battler.restriction == 2 || battler.restriction == 3
battler.current_action.kind = 0
battler.current_action.basic = 0
end
battler.defense_pose = false
@action_battlers << battler
end
else
battler.make_action
@action_battlers << battler
end
end
#==========================================================================
#Ajout de def Battle event Setup + update
#==========================================================================
#--------------------------------------------------------------------------
# * Battle Event Setup
#--------------------------------------------------------------------------
def setup_battle_event
# If battle event is running
if $game_system.battle_interpreter.running?
return
end
# Search for all battle event pages
for index in 0...$data_troops[@troop_id].pages.size
# Get event pages
page = $data_troops[@troop_id].pages[index]
# Make event conditions possible for reference with c
c = page.condition
# Go to next page if no conditions are appointed
unless c.turn_valid or c.enemy_valid or
c.actor_valid or c.switch_valid
next
end
# Go to next page if action has been completed
if $game_temp.battle_event_flags[index]
next
end
# Confirm turn conditions
if c.turn_valid
n = $game_temp.battle_turn
a = c.turn_a
b = c.turn_b
if (b == 0 and n != a) or
(b > 0 and (n < 1 or n < a or n % b != a % b))
next
end
end
# Confirm enemy conditions
if c.enemy_valid
enemy = $game_troop.enemies[c.enemy_index]
if enemy == nil or enemy.hp * 100.0 / enemy.maxhp > c.enemy_hp
next
end
end
# Confirm actor conditions
if c.actor_valid
actor = $game_actors[c.actor_id]
if actor == nil or actor.hp * 100.0 / actor.maxhp > c.actor_hp
next
end
end
# Confirm switch conditions
if c.switch_valid
if $game_switches[c.switch_id] == false
next
end
end
# Set up event
$game_system.battle_interpreter.setup(page.list, 0)
# If this page span is [battle] or [turn]
if page.span <= 1
# Set action completed flag
$game_temp.battle_event_flags[index] = true
end
return
end
end
#==========================================================================
# Fin de l'ajout
#==========================================================================
#--------------------------------------------------------------------------
def atb_update
@wait_on = wait_on
return if @wait_on
@atb_turn_count += 1 if Custom_Turn_Count == 2
if @atb_turn_count >= @abt_turn_speed
@update_turn_end = true
$game_temp.battle_turn += 1
turn_count_speed
for battler in $game_party.actors + $game_troop.enemies
battler.remove_states_auto if battler.exist?
end
#========================================================================
# Ajout d'update pour les event de combat
#========================================================================
if $game_system.battle_interpreter.running?
# Update interpreter
$game_system.battle_interpreter.update
# If a battler which is forcing actions doesn't exist
if $game_temp.forcing_battler == nil
# If battle event has finished running
unless $game_system.battle_interpreter.running?
# Rerun battle event set up if battle continues
unless judge
setup_battle_event
end
end
if @phase != 5
# Refresh status window
@status_window.refresh
end
end
end
# If battler forcing an action doesn't exist,
# and battle event is running
if $game_temp.forcing_battler == nil and
$game_system.battle_interpreter.running?
return
end
#========================================================================
# Fin de l'ajout
#========================================================================
#setup_battle_event # Désactivé car redondant
end
for battler in $game_party.actors + $game_troop.enemies
unless battler == @action_battler or
(@escaping and battler.actor? and @escape_type > 0)
battler.atb_update if battler.exist? and not battler.restriction == 4
end
end
update_meters
end
#--------------------------------------------------------------------------
def wait_on
return true if $game_system.wait_mode == 1 and (@skill_window != nil or @item_window != nil)
return true if $game_system.wait_mode == 0 and @input_battler != nil
return true if $game_system.action_wait and @action_battler != nil
return true if @force_wait or @battle_end or @escaped
return false
end
#--------------------------------------------------------------------------
def start_phase2
end
#--------------------------------------------------------------------------
def update_meters
@atb_meters.refresh if Meters
@atb_meters_enemy.refresh if Enemy_Meter != 0 and Meters
@atb_bars.refresh if Bars
end
#--------------------------------------------------------------------------
def turn_count_speed
@atb_turn_count = @abt_turn_speed = 0
case Custom_Turn_Count
when 0
for battler in $game_party.actors + $game_troop.enemies
@abt_turn_speed += 1 if battler.exist?
end
when 1
@abt_turn_speed = Action_Turn_Count
when 2
@abt_turn_speed = Time_Tunr_Count
end
end
#--------------------------------------------------------------------------
def update_phase2_escape
windows_dispose
update_phase2_escape_type1 if @escape_type == 0
update_phase2_escape_type2 if @escape_type > 0
end
#--------------------------------------------------------------------------
def update_phase2_escape_type1
enemies_agi = enemies_number = 0
for enemy in $game_troop.enemies
if enemy.exist?
enemies_agi += enemy.agi
enemies_number += 1
end
end
enemies_agi /= [enemies_number, 1].max
actors_agi = actors_number = 0
for actor in $game_party.actors
if actor.exist?
actors_agi += actor.agi
actors_number += 1
end
end
actors_agi /= [actors_number, 1].max
@success = rand(100) < @escape_ratio * actors_agi / enemies_agi
if @success
@battle_end = true
$game_system.se_play($data_system.escape_se)
$game_system.bgm_play($game_temp.map_bgm)
battle_end(1)
else
@escape_ratio += 3
phase3_next_actor
end
end
#--------------------------------------------------------------------------
def update_phase2_escape_type2
@escaped = true
@party_command_window.visible = false
@party_command_window.active = false
@actor_command_window.visible = false if @actor_command_window != nil
@actor_command_window.active = false if @actor_command_window != nil
wait(1)
@battle_end = true
$game_system.se_play($data_system.escape_se)
$game_system.bgm_play($game_temp.map_bgm)
if @escape_atb_meters != nil
@escape_atb_meters.dispose
@escape_atb_meters = nil
end
battle_end(1)
end
#--------------------------------------------------------------------------
def update_phase2_escape_rate
enemies_agi = enemies_number = 0
for enemy in $game_troop.enemies
if enemy.exist?
enemies_agi += enemy.agi
enemies_number += 1
end
end
enemies_agi /= [enemies_number, 1].max
actors_agi = actors_number = 0
for actor in $game_party.actors
if actor.exist?
actors_agi += actor.agi
actors_number += 1
end
end
actors_agi /= [actors_number, 1].max
escape_rate = Escape_Time * enemies_agi / (actors_agi * Speed)
return escape_rate
end
#--------------------------------------------------------------------------
alias acbs_start_phase5_atb start_phase5
def start_phase5
if @input_battler != nil
@help_window.visible = false if @help_window != nil
windows_dispose
@input_battler.blink = false if @input_battler != nil
end
@atb_meters.opacity = 0 if Meter_Pos_Style == 3
update_meters
acbs_start_phase5_atb
end
#--------------------------------------------------------------------------
alias acbs_update_phase5_atb update_phase5
def update_phase5
windows_dispose
acbs_update_phase5_atb
end
#--------------------------------------------------------------------------
def phase3_setup_command_window
return if @escaped
if @active_battler != nil && @active_battler.cast_action != nil
@active_battler.blink = false
return
end
Audio.se_play('Audio/SE/' + Command_Up_SE)
@party_command_window.active = false
@party_command_window.visible = false
@actor_command_window.dispose if @actor_command_window != nil
s1 = $data_system.words.attack
s2 = $data_system.words.skill
s3 = $data_system.words.item
s4 = $data_system.words.guard
s5 = @escape_name
if @escape_type == 0
@actor_command_window = Window_Command.new(160, [s1, s2, s3, s4, s5])
else
@actor_command_window = Window_Command.new(160, [s1, s2, s3, s4])
end
@actor_command_window.x = COMMAND_WINDOW_POSITION[0]
@actor_command_window.y = COMMAND_WINDOW_POSITION[1]
@actor_command_window.back_opacity = COMMAND_OPACITY
@actor_command_window.z = 4500
@active_battler_window.refresh(@active_battler)
@active_battler_window.visible = BATTLER_NAME_WINDOW
@active_battler_window.x = COMMAND_WINDOW_POSITION[0]
@active_battler_window.y = COMMAND_WINDOW_POSITION[1] - 64
@active_battler_window.z = 4500
end
#--------------------------------------------------------------------------
alias acbs_start_enemy_select_atb start_enemy_select
def start_enemy_select
@teste = true
acbs_start_enemy_select_atb
@atb_meters.visible = true if Meters
update_meters unless Wait_Mode == 2
end
#--------------------------------------------------------------------------
alias acbs_update_phase3_skill_select_atb update_phase3_skill_select
def update_phase3_skill_select
@atb_meters.visible = false if Meters and Meter_Pos_Style < 3 and HIDE_WINDOW
acbs_update_phase3_skill_select_atb
update_meters unless Wait_Mode == 2
end
#--------------------------------------------------------------------------
alias acbs_update_phase3_item_select_atb update_phase3_item_select
def update_phase3_item_select
@atb_meters.visible = false if Meters and Meter_Pos_Style < 3 and HIDE_WINDOW
acbs_update_phase3_item_select_atb
update_meters unless Wait_Mode == 2
end
#--------------------------------------------------------------------------
alias acbs_start_actor_select_atb start_actor_select
def start_actor_select
acbs_start_actor_select_atb
@atb_meters.visible = true if Meters
update_meters unless Wait_Mode == 2
end
#--------------------------------------------------------------------------
alias acbs_start_skill_select_atb start_skill_select
def start_skill_select
acbs_start_skill_select_atb
@atb_meters.visible = false if Meters and Meter_Pos_Style < 3 and HIDE_WINDOW
update_meters unless Wait_Mode == 2
end
#--------------------------------------------------------------------------
alias acbs_end_skill_select_atb end_skill_select
def end_skill_select
acbs_end_skill_select_atb
@atb_meters.visible = true if Meters
update_meters unless Wait_Mode == 2
end
#--------------------------------------------------------------------------
alias acbs_start_item_select_atb start_item_select
def start_item_select
acbs_start_item_select_atb
@atb_meters.visible = false if Meters and Meter_Pos_Style < 3 and HIDE_WINDOW
update_meters unless Wait_Mode == 2
end
#--------------------------------------------------------------------------
alias acbs_end_item_select_atb end_item_select
def end_item_select
acbs_end_item_select_atb
@atb_meters.visible = true if Meters
update_meters unless Wait_Mode == 2
end
#--------------------------------------------------------------------------
def phase3_next_actor
@input_battler.blink = false
action_battler = @input_battlers.shift
@action_battlers << action_battler
command_input_cancel
@input_battler = nil
@actor_index = nil
@active_battler = nil
end
#--------------------------------------------------------------------------
def phase3_prior_actor
@input_battler.current_action.kind = 0
@input_battler.current_action.basic = 3
@input_battler.blink = false
action_battler = @input_battlers.shift
@action_battlers << action_battler
@input_battler = nil
@actor_index = nil
@active_battler = nil
windows_dispose
end
#--------------------------------------------------------------------------
alias acbs_update_phase3_atb update_phase3
def update_phase3
if cancel_command?
if can_act?
if [2, 3].include?(@input_battler.restriction)
@input_battler.current_action.kind = 0
@input_battler.current_action.basic = 0
end
@action_battlers << @input_battler
end
command_input_cancel
return
end
acbs_update_phase3_atb
end
#--------------------------------------------------------------------------
def cancel_command?
return false if @input_battler.nil?
return true if @input_battler.current_action.forcing
return true if [2, 3, 4].include?(@input_battler.restriction)
return true if not $game_party.actors.include?(@input_battler)
return false
end
#--------------------------------------------------------------------------
def can_act?
return true if @input_battler.current_action.forcing
return true if [2, 3].include?(@input_battler.restriction)
return false
end
#--------------------------------------------------------------------------
alias acbs_update_phase3_basic_command_atb update_phase3_basic_command
def update_phase3_basic_command
if Input.trigger?(Input::C)
case @actor_command_window.commands[@actor_command_window.index]
when @escape_name
if $game_temp.battle_can_escape == false
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
update_phase2_escape
return
end
end
if Input.trigger?(Input::UP) and @input_action
$game_system.se_play($data_system.cursor_se)
@actor_command_window.index -= 1
if @actor_command_window.index <= -1
@actor_command_window.index = @actor_command_window.commands_size - 1
end
return
end
if Input.trigger?(Input::DOWN) and @input_action
$game_system.se_play($data_system.cursor_se)
@actor_command_window.index += 1
if @actor_command_window.index >= @actor_command_window.commands_size - 1
@actor_command_window.index = 0
end
return
end
if Input.trigger?(Input::B)
$game_system.se_play($data_system.decision_se)
phase3_next_actor
return
end
if Input.trigger?(Input::A)
$game_system.se_play($data_system.decision_se)
@input_battler.passed = true
phase3_next_actor
return
end
acbs_update_phase3_basic_command_atb
end
#--------------------------------------------------------------------------
def command_input_cancel
windows_dispose
@input_battler.blink = false
@input_battlers.delete(@input_battler)
@input_battler = nil
end
#--------------------------------------------------------------------------
def windows_dispose
@help_window.visible = false if !@escaping
if @enemy_arrow != nil
@enemy_arrow.dispose
@enemy_arrow = nil
end
if @actor_arrow != nil
@actor_arrow.dispose
@actor_arrow = nil
end
if @actor_arrow != nil
@actor_arrow.dispose
@actor_arrow = nil
end
if @skill_window != nil
@skill_window.dispose
@skill_window = nil
end
if @item_window != nil
@item_window.dispose
@item_window = nil
end
if @enemy_arrow_all != nil
@enemy_arrow_all.dispose_multi_arrow
@enemy_arrow_all = nil
end
if @actor_arrow_all != nil
@actor_arrow_all.dispose_multi_arrow
@actor_arrow_all = nil
end
if @battler_arrow_all != nil
@battler_arrow_all.dispose_multi_arrow
@battler_arrow_all = nil
end
if @actor_command_window != nil
@actor_command_window.active = false
@actor_command_window.visible = false
@active_battler_window.visible = false
@actor_command_window.opacity = 0
end
@status_window.visible = true
end
#--------------------------------------------------------------------------
alias acbs_update_phase4_step1_atb update_phase4_step1
def update_phase4_step1
if @action_battlers.size == 0
@input_battlers.clear
@action_battlers.clear
@action_battler.atb = 0
@action_battler = nil
end
acbs_update_phase4_step1_atb
end
#--------------------------------------------------------------------------
alias acbs_update_phase4_step2_atb update_phase4_step2
def update_phase4_step2
@active_battler.defense_pose = false
if @active_battler.cast_action != nil
active_cast = @active_battler.cast_action
if active_cast.scope == 1 or active_cast.scope == 3 or active_cast.scope == 5
@active_battler.current_action.target_index = @active_battler.cast_target
end
if active_cast.is_a?(RPG::Skill)
@active_battler.current_action.kind = 1
@active_battler.current_action.skill_id = @active_battler.cast_action.id
elsif active_cast.is_a?(RPG::Item)
@active_battler.current_action.kind = 2
@active_battler.current_action.item_id = @active_battler.cast_action.id
end
end
for state in @active_battler.battler_states
@active_battler.remove_state(state.id) if state.extension.include?("ZEROTURNLIFT")
end
acbs_update_phase4_step2_atb
end
#--------------------------------------------------------------------------
alias make_skill_action_result_atb_n01 make_skill_action_result
def make_skill_action_result
skill = $data_skills[@action_battler.current_action.skill_id]
if @action_battler.cast_action == nil
@active_battler.cast_action = skill
@active_battler.cast_target = @active_battler.current_action.target_index
@cast_speed = skill.cast_speed(@active_battler)
@active_battler.cast_action = nil if @cast_speed == 0
@spriteset.set_stand_by_action(@active_battler.actor?, @active_battler.index)
return unless @cast_speed == 0
end
make_skill_action_result_atb_n01
@active_battler.cast_action = nil
end
#--------------------------------------------------------------------------
alias make_item_action_result_atb_n01 make_item_action_result
def make_item_action_result
item = $data_items[@action_battler.current_action.item_id]
if @action_battler.cast_action == nil
@active_battler.cast_action = item
@active_battler.cast_target = @active_battler.current_action.target_index
@cast_speed = item.cast_speed(@active_battler)
@active_battler.cast_action = nil if @cast_speed == 0
@spriteset.set_stand_by_action(@active_battler.actor?, @active_battler.index)
return unless @cast_speed == 0
end
make_item_action_result_atb_n01
@active_battler.cast_action = nil
end
#--------------------------------------------------------------------------
alias acbs_action_end_atb action_end
def action_end
acbs_action_end_atb
@active_battler.cast_action = nil
end
#--------------------------------------------------------------------------
def start_phase4
@phase4_step = 1
@action_phase = true
end
#--------------------------------------------------------------------------
alias acbs_update_phase4_step6_atb update_phase4_step6
def update_phase4_step6
acbs_update_phase4_step6_atb
@atb_turn_count += 1 unless Custom_Turn_Count == 2
@active_battler.atb = 0 unless @active_battler.passed
@active_battler.passed = false
@input_battlers.delete(@active_battler)
@action_battlers.delete(@active_battler)
@action_battler = nil
@action_phase = false
update_meters
judge
end
end |
|
le_colosse -
posté le 13/07/2013 à 00:01:17 (66 messages postés)
| Rush FTW | Hmm, je ne comprends tellement rien du code :/
Il faudrait que je sois capable de le tester par moi-même dans un projet vide, mais il y a des dépendences avec d'autres scripts qui m'en empêche. Si tu pouvais me donner les autres scripts qui viennent avec (ou au moins la librairie N01) ça m'avancerait.
Ça ne fait que quelques semaines que je travaille avec Ruby, alors il se peut que ton problème soit au-delà de mes capacités, mais je vais faire mon possible pour t'aider.
|
Cortez -
posté le 13/07/2013 à 11:48:12 (524 messages postés)
| | ok pourquoi pas, je vais faire plus simple, donner le lien de la
démo du système de combat. (il y a une dizaine de script mais
seul le script ATB est en cause.) Pas de panique, si tu essayes au
moins, je pourrais avoir quelques indices, puisque ton 1er post m'a
permis de cerner la partie que j'ai copié/collé.
http://www.gdunlimited.net/ajax.php/manager/download/script/436/enu-sbs-tanketai-xp-1/.zip
Et si tu veux test, il faut que tu places un évent de combat pour le
groupe de fantôme (moi j'ai crée un système pour qu'ils de soignent
entre-eux)
|
le_colosse -
posté le 13/07/2013 à 18:06:04 (66 messages postés)
| Rush FTW | D'accord, je vais regarder ça. Je vais commencer par simplement faire un print depuis les événements de combat. Une fois ce problème réglé, le reste devrait tomber en place facilement.
EDIT: Je n'ai aucun problème avec les événements de combat de mon côté. C'est bien le script Atoa ATB que tu parlais? Je l'ai activé et tout fonctionne. Je suis capable de faire des print avec conditions durant le combat. Peut-être que le problème vient de ta condition elle-même, ou je n'ai pas du tout compris ce que tu cherches :P
|
Cortez -
posté le 14/07/2013 à 16:39:14 (524 messages postés)
| | Les évènements de combats marchent (dialogue et autre)
Cependant dès que la condition de déclanchement est :
si pv monstre "machin01" < ou égal à XX %
<commande> forcer monstre "machin02" utiliser soin immédiatement
Le combat freeze et il est impossible de continuer je pense donc
que le monstre ne peux pas lancer la compétence puisque sa jauge
d'ATB n'est pas pleine.
De plus si je force l'action à se résoudre "à la place de sa prochaine
action." la commande est ignorée...
Il faut donc forcer le monstre à agir même si c'est pas son tour.
(se pencher sur le script Interpreter 7 pour modifier la commande
forcer action.)
Merci de ton aide.
|
le_colosse -
posté le 14/07/2013 à 23:38:34 (66 messages postés)
| Rush FTW | Je suis désolé, je n'ai pas été capable de trouver de solution.
J'avais retrouvé par hasard une autre version du script Atoa_ATB sur mon ordinateur. Avec ce script, j'arrive à faire healer le monstre quand c'est à son tour. J'ai tenté d'appliquer les modifications que je considérais pertinentes à ton script, mais l'organisation des deux codes est tellement différente que j'avais plein d'incompatibilité.
J'ai regardé autour de l'usage des attributs et méthodes battler.current_action.forcing et $game_temp.forcing_battler
Je le laisse le lien du démo du script que j'avais, peut-être que tu y trouveras la solution.
http://save-point.org/thread-2136.html
|
yuri -
posté le 20/07/2013 à 16:25:02 (3801 messages postés)
| Humeur Nutella | Domaine concerné: [Graphisme : battle chara]
Logiciel utilisé: [Rpg maker XP]
Thème: ninja
Description: Un battler animé d'un ninja aux cheveux noirs et portant un habit rouge.
Voilà...
|
Je me sens sournoise aujourd'hui, hystérique, abominable, agressive, enfin bref...insupportable!! | Index du forum > Entraide > [[Rpg maker XP]] Gestion du combat de base
|
|
|