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

423 connectés actuellement

29418786 visiteurs
depuis l'ouverture

3010 visiteurs
aujourd'hui



Barre de séparation

Partenaires

Indiexpo

Akademiya RPG Maker

Blog Alioune Fall

Fairy Tail Constellations

Kingdom Ultimate

Lunae - le bazar d'Emz0

ConsoleFun

Tous nos partenaires

Devenir
partenaire



forums

Index du forum > Entraide > [Scripts] Petites questions connes sur les SCRIPTS!!

Aller à la page 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

Reprise du message précédent:

zou - posté le 20/04/2012 à 17:44:22 (2197 messages postés)

❤ 0

Question 1 :
Ah, tu la veux à gauche ta flèche, tu fais self.ox = blabla ;)

Question 2 :
J'avais fais ça pour mon A-RPG, pour moi il fonctionne très bien, après sur projet vièrge je ne garantis rien.
Il te renvoie un Move_Route (regarde la méthode make_move_route)

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
class Node
  
  attr_reader   :parent, :x, :y
  attr_accessor :good, :passage, :distance
  
  def initialize(parent, x, y, distance = nil)
    @parent, @x, @y = parent, x, y
    @good = true
    @passage = false
    @distance = distance
  end
  
  def pos?(x, y)
    return (@x == x and @y == y)
  end
  
end
 
class Goal
  
  attr_reader   :x, :y
  
  def initialize(x, y)
    @x, @y = x, y
  end
  
end
 
module Pathfinding
  
  def self.start(event_id, x, y, zone = 0, skippable = false)
    if event_id == 0
      @event = $game_player
    else
      return unless $game_map.events[event_id]
      @event = $game_map.events[event_id]
    end
    @goal = Goal.new(x, y)
    @path = [Node.new(nil, @event.x, @event.y, self.distance(@goal))]
    @move_route = RPG::MoveRoute.new
    @move_route.repeat = false
    @move_route.path = true
    @move_route.x = x
    @move_route.y = y
    @move_route.zone = zone
    @move_route.skippable = skippable
    @zone = zone
    self.make_path
  end
  
  def self.make_path
    begin
    @current_node = @path[0]
    if @current_node.pos?(@goal.x, @goal.y) or 
       (self.passable?(@goal.x, @goal.y) == false and @zone == 0)
      return
    end
    
    loop do
      break if @current_node.pos?(@goal.x, @goal.y)
      if @zone > 0
        break if @current_node.distance <= @zone
      end
      adjacent_nodes = get_adjacent_nodes
      if adjacent_nodes == [nil, nil, nil, nil]
        # retour en arrièrre
        @current_node.good = false
        @current_node = @current_node.parent
      else
        adjacent_nodes.compact!
        nearest = self.node_nearest(adjacent_nodes)
        @path.push(nearest)
        @current_node.passage = true
        @current_node = nearest
      end
    end # fin loop
    rescue
      # passage introuvable
      #print "passage introuvable"
      return
    end
    self.erase_useless_node
  end
  
  def self.erase_useless_node
    # Effacer des nodes mauvais
    for i in 0 ... @path.size-1
      if @path[i].good == false
        @path[i] = nil
      end
    end
    @path.compact!
    # Effacer les nodes qui ralongent le chemin
    for i in 0 ... @path.size-1
      node = @path[i]
      next if node == nil
      nodes = self.find_adjacent_node(node.x, node.y)
      nodes.compact!
      for i in 0 ... nodes.size
        if node.parent == nodes[i] or nodes[i].parent == node
          nodes[i] = nil
        end
      end
      nodes.compact!
      node2 = node_nearest(nodes)
      if node2
        self.erase_to(node,node2)
      end
    end
    @path.compact!
    self.make_move_route
  end
    
  def self.make_move_route
    @move_route.list = []
    for i in 0 ... @path.size-1
      node = @path[i]
      next_node = @path[i+1]
      sx = node.x - next_node.x
      sy = node.y - next_node.y
      if sx == 1 # bas
        @move_route.list.push(RPG::MoveCommand.new(2))
      elsif sx == -1 # gauche
        @move_route.list.push(RPG::MoveCommand.new(3))
      elsif sy == 1 # droite
        @move_route.list.push(RPG::MoveCommand.new(4))
      elsif sy == -1 # haut
        @move_route.list.push(RPG::MoveCommand.new(1))
      end
    end
    @move_route.list.delete_at(0)
    @move_route.list.push(RPG::MoveCommand.new(0))
    @event.force_move_route(@move_route)
  end
 
  def self.passable?(x, y)
    return false if @event.passable?(x, y,0) == false
    for node in @path
      return false if node.pos?(x, y) and (node.good == false or node.passage == true)
    end
    return true
  end
  
  def self.distance(node)
    return Math.hypot(node.x - @goal.x, node.y - @goal.y)
  end
  
  def self.node_at(x, y)
    for node in @path
      next unless node
      return node if node.pos?(x, y)
    end
    return nil
  end
  
  def self.node_nearest(nodes)
    nearest = nodes[0]
    for node in nodes
      if nearest.distance > node.distance
        nearest = node
      elsif nearest.distance == node.distance
        if rand(2) == 0
          nearest = node
        end
      end
    end
    return nearest
  end
  
  def self.erase_to(node,node2)
    start = false
    for i in 0 ... @path.size
      if @path[i] == node
        start = true
        next
      end
      if @path[i] == node2
        break
      end
      if start
        @path[i] = nil
      end
    end
  end
  
  def self.get_adjacent_nodes
    nodes = []
    if self.passable?(@current_node.x+1, @current_node.y)
      node = Node.new(@current_node, @current_node.x+1, @current_node.y)
      node.distance = self.distance(node)
      nodes.push(node)
    else
      nodes.push(nil)
    end
    if self.passable?(@current_node.x-1, @current_node.y)
      node = Node.new(@current_node, @current_node.x-1, @current_node.y)
      node.distance = self.distance(node)
      nodes.push(node)
    else
      nodes.push(nil)
    end
    if self.passable?(@current_node.x, @current_node.y+1)
      node = Node.new(@current_node, @current_node.x, @current_node.y+1)
      node.distance = self.distance(node)
      nodes.push(node)
    else
      nodes.push(nil)
    end
    if self.passable?(@current_node.x, @current_node.y-1)
      node = Node.new(@current_node, @current_node.x, @current_node.y-1)
      node.distance = self.distance(node)
      nodes.push(node)
    else
      nodes.push(nil)
    end
    return nodes
  end
  
  def self.find_adjacent_node(x, y)
    nodes = []
    nodes.push(node_at(x+1,y))
    nodes.push(node_at(x-1,y))
    nodes.push(node_at(x,y+1))
    nodes.push(node_at(x,y-1))
    return nodes
  end
  
end
 
module RPG
  
  class MoveRoute
    
    attr_accessor :repeat
    attr_accessor :skippable
    attr_accessor :wait
    attr_accessor :path
    attr_accessor :x
    attr_accessor :y
    attr_accessor :zone
    
    def initialize
      @repeat = true
      @skippable = false
      @wait = false
      @path = nil
      @x = nil
      @y = nil
      @zone = nil
    end
    
  end
  
end




Suite du sujet:

Tata Monos - posté le 26/04/2012 à 10:50:00 (28 messages postés)

❤ 0

Compte Non utilisé

Heum voila j'aimerais savoir un truc. Je suis sur Rpg Maker VX Ace.
J'ai trouvé un moyen de changer ma pelette sans faire de patch pour HF3 enfin de proposer un autre choix. (Ba oué je suis têtue et j'écoute personne suivant certain dire alors que depuis le début je cherche quand même une alternative.)

J'ai trouvé la solution pour changer le dossier graphics avec les autres palettes de couleur. (Simple finalement, un nouveau script cache et une condition de variable... )

Donc ça c'est réglé mais j'ai un autre problème. C'est que dans RM j'arrive à changer pas mal de chose pour les couleurs, mais je suis bloqué avec le flash des animations de combat.
Dans la base de donnée et l'onglet Animations, nous pouvons flasher une cible. Nativement je suis paramétré pour la palette principale mais si le joueur change de palette, ça reste ciblé sur le truc principale.

J'utilise la même couleurs pour tout les flashs des animations de combat.
L'idée serait donc suivant la valeur de variable, que la couleur du flash de toutes les animations, soit celle que je choisis et qu'il en prend plus en compte les valeurs de l'éditeur.

Merci.


jeido - posté le 26/04/2012 à 15:37:25 (52 messages postés)

❤ 0

Bonjour. Alors je vais surement demander un truc complètement fou (ou pas en fait, j'en sais rien, je suis une bille en RGSS 3, je suis complètement paumé, moi qui commençait à presque saisir le RGSS 2 >.>) Donc voilà en fait je voulais savoir si il était possible de rajouter un écran de confirmation sur 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
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
#==============================================================================
# 
# ▼ Yanfly Engine Ace - Ace Save Engine v1.02
# -- Last Updated: 2012.01.23
# -- Level: Normal
# -- Requires: n/a
# 
#==============================================================================
 
$imported = {} if $imported.nil?
$imported["YEA-SaveEngine"] = true
 
#==============================================================================
# ▼ Updates
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# 2012.01.23 - Anti-crash method added for removed maps.
# 2011.12.26 - Compatibility Update: New Game+
# 2011.12.26 - Started Script and Finished.
# 
#==============================================================================
# ▼ Introduction
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# This script provides a new save interface for the player. Along with a new
# interface, the player can also load and delete saves straight from the menu
# itself. This will in turn make the save command from the Main Menu always
# available, but the save option within the new save menu will be enabled
# depending on whether or not it is allowed or disallowed. From the interface,
# the player is given more information regarding the save file including the
# the location the player saved at, the amount of gold available, and any
# variables that you want to show the player as well.
# 
#==============================================================================
# ▼ Instructions
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# To install this script, open up your script editor and copy/paste this script
# to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
# 
# For first time installers, be warned that loading this script the first time
# may not display all information in the status window for save files made
# before the installation of this script. To remedy this, just load up the save
# and save the file again.
# 
#==============================================================================
# ▼ Compatibility
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
# it will run with RPG Maker VX without adjusting.
# 
#==============================================================================
 
module YEA
  module SAVE
    
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # - Slot Window Settings -
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # This section adjusts how the slot window appears on the left side of the
    # screen. This also adjusts the maximum number of saves a player can make,
    # the way the slot names appear, and the icons used.
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    MAX_FILES = 24         # Maximum saves a player can make. Default: 16
    SLOT_NAME = "Slot %s"  # How the file slots will be named.
    
    # These are the icons
    SAVE_ICON  = 7565       # Icon used to indicate a save is present.
    EMPTY_ICON = 157       # Icon used to indicate an empty file.
    
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # - Action Window Settings -
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # This section adjusts how the action window appears, the sound effect
    # played when deleting files, and what appears in the help window above.
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    ACTION_LOAD   = "Charger"           # Text used for loading games.
    ACTION_SAVE   = "Sauvegarder"           # Text used for saving games.
    ACTION_DELETE = "Effacer"         # Text used for deleting games.
    DELETE_SOUND  = RPG::SE.new("Collapse3", 100, 100) # Sound for deleting.
    
    # These text settings adjust what displays in the help window.
    SELECT_HELP = "Choisissez un Slot."
    LOAD_HELP   = "Charge les données depuis ce Slot.\nToutes données (du Slot actuel) non sauvegardées seront perdues."
    SAVE_HELP   = "Sauvegarde la progression dans ce Slot."
    DELETE_HELP = "Efface les données du ficher.\nAucune confirmation n'est demandée, faites attention !"
    
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # - Status Window Settings -
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # This section adjusts how the status window appears in the middle of the
    # screen (that displays the game's data) such as the total playtime, total
    # times saved, total gold, the party's current location, and the variables
    # to be displayed.
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    EMPTY_TEXT = "Aucune donnée dans ce Slot"      # Text used when no save data is present.
    PLAYTIME   = "Temps de jeu"          # Text used for total playtime.
    TOTAL_SAVE = "Sauvegardes : "     # Text used to indicate total saves.
    TOTAL_GOLD = "Or : "      # Text used to indicate total gold.
    LOCATION   = "Lieu : "        # Text used to indicate current location.
    
    # These variables will be shown in each of the two columns for those who
    # would want to display more information than just what's shown. Input the
    # variables into the arrays below to designate what data will be shown.
    COLUMN1_VARIABLES = [1, 2, 3]
    COLUMN2_VARIABLES = [4, 5, 6]
    
  end # SAVE
end # YEA
 
#==============================================================================
# ▼ Editting anything past this point may potentially result in causing
# computer damage, incontinence, explosion of user's head, coma, death, and/or
# halitosis so edit at your own risk.
#==============================================================================
 
#==============================================================================
# ■ Icon
#==============================================================================
 
module Icon
  
  #--------------------------------------------------------------------------
  # self.save_icon
  #--------------------------------------------------------------------------
  def self.save_icon; return YEA::SAVE::SAVE_ICON; end
  
  #--------------------------------------------------------------------------
  # self.empty_icon
  #--------------------------------------------------------------------------
  def self.empty_icon; return YEA::SAVE::EMPTY_ICON; end
    
end # Icon
 
#==============================================================================
# ■ Numeric
#==============================================================================
 
class Numeric
  
  #--------------------------------------------------------------------------
  # new method: group_digits
  #--------------------------------------------------------------------------
  unless $imported["YEA-CoreEngine"]
  def group; return self.to_s; end
  end # $imported["YEA-CoreEngine"]
    
end # Numeric
 
#==============================================================================
# ■ DataManager
#==============================================================================
 
module DataManager
  
  #--------------------------------------------------------------------------
  # overwrite method: savefile_max
  #--------------------------------------------------------------------------
  def self.savefile_max
    return YEA::SAVE::MAX_FILES
  end
  
  #--------------------------------------------------------------------------
  # overwrite method: self.make_save_header
  #--------------------------------------------------------------------------
  def self.make_save_header
    header = {}
    header[:characters]    = $game_party.characters_for_savefile
    header[:playtime_s]    = $game_system.playtime_s
    header[:system]        = Marshal.load(Marshal.dump($game_system))
    header[:timer]         = Marshal.load(Marshal.dump($game_timer))
    header[:message]       = Marshal.load(Marshal.dump($game_message))
    header[:switches]      = Marshal.load(Marshal.dump($game_switches))
    header[:variables]     = Marshal.load(Marshal.dump($game_variables))
    header[:self_switches] = Marshal.load(Marshal.dump($game_self_switches))
    header[:actors]        = Marshal.load(Marshal.dump($game_actors))
    header[:party]         = Marshal.load(Marshal.dump($game_party))
    header[:troop]         = Marshal.load(Marshal.dump($game_troop))
    header[:map]           = Marshal.load(Marshal.dump($game_map))
    header[:player]        = Marshal.load(Marshal.dump($game_player))
    header
  end
  
end # DataManager
 
#==============================================================================
# ■ Window_MenuCommand
#==============================================================================
 
class Window_MenuCommand < Window_Command
  
  #--------------------------------------------------------------------------
  # overwrite method: save_enabled
  #--------------------------------------------------------------------------
  def save_enabled; return true; end
  
end # Window_MenuCommand
 
#==============================================================================
# ■ Window_FileList
#==============================================================================
 
class Window_FileList < Window_Selectable
  
  #--------------------------------------------------------------------------
  # initialize
  #--------------------------------------------------------------------------
  def initialize(dx, dy)
    super(dx, dy, 128, Graphics.height - dy)
    refresh
    activate
    select(SceneManager.scene.first_savefile_index)
  end
  
  #--------------------------------------------------------------------------
  # item_max
  #--------------------------------------------------------------------------
  def item_max; return DataManager.savefile_max; end
  
  #--------------------------------------------------------------------------
  # current_item_enabled?
  #--------------------------------------------------------------------------
  def current_item_enabled?
    header = DataManager.load_header(index)
    return false if header.nil? && SceneManager.scene_is?(Scene_Load)
    return true
  end
  
  #--------------------------------------------------------------------------
  # refresh
  #--------------------------------------------------------------------------
  def refresh
    create_contents
    draw_all_items
  end
  
  #--------------------------------------------------------------------------
  # draw_item
  #--------------------------------------------------------------------------
  def draw_item(index)
    header = DataManager.load_header(index)
    enabled = !header.nil?
    rect = item_rect(index)
    rect.width -= 4
    draw_icon(save_icon?(header), rect.x, rect.y, enabled)
    change_color(normal_color, enabled)
    text = sprintf(YEA::SAVE::SLOT_NAME, (index + 1).group)
    draw_text(rect.x+24, rect.y, rect.width-24, line_height, text)
  end
  
  #--------------------------------------------------------------------------
  # save_icon?
  #--------------------------------------------------------------------------
  def save_icon?(header)
    return Icon.empty_icon if header.nil?
    return Icon.save_icon
  end
  
end # Window_FileList
 
#==============================================================================
# ■ Window_FileStatus
#==============================================================================
 
class Window_FileStatus < Window_Base
  
  #--------------------------------------------------------------------------
  # initialize
  #--------------------------------------------------------------------------
  def initialize(dx, dy, file_window)
    super(dx, dy, Graphics.width - dx, Graphics.height - dy)
    @file_window = file_window
    @current_index = @file_window.index
    refresh
  end
  
  #--------------------------------------------------------------------------
  # update
  #--------------------------------------------------------------------------
  def update
    super
    return if @file_window.index < 0
    return if @current_index == @file_window.index
    @current_index = @file_window.index
    refresh
  end
  
  #--------------------------------------------------------------------------
  # refresh
  #--------------------------------------------------------------------------
  def refresh
    contents.clear
    reset_font_settings
    @header = DataManager.load_header(@file_window.index)
    if @header.nil?
      draw_empty
    else
      draw_save_contents
    end
  end
  
  #--------------------------------------------------------------------------
  # draw_empty
  #--------------------------------------------------------------------------
  def draw_empty
    colour = Color.new(0, 0, 0, translucent_alpha/2)
    rect = Rect.new(0, 0, contents.width, contents.height)
    contents.fill_rect(rect, colour)
    text = YEA::SAVE::EMPTY_TEXT
    change_color(system_color)
    draw_text(rect, text, 1)
  end
  
  #--------------------------------------------------------------------------
  # draw_save_slot
  #--------------------------------------------------------------------------
  def draw_save_slot(dx, dy, dw)
    reset_font_settings
    change_color(system_color)
    text = sprintf(YEA::SAVE::SLOT_NAME, "")
    draw_text(dx, dy, dw, line_height, text)
    cx = text_size(text).width
    change_color(normal_color)
    draw_text(dx+cx, dy, dw-cx, line_height, (@file_window.index+1).group)
  end
  
  #--------------------------------------------------------------------------
  # draw_save_playtime
  #--------------------------------------------------------------------------
  def draw_save_playtime(dx, dy, dw)
    return if @header[:playtime_s].nil?
    reset_font_settings
    change_color(system_color)
    draw_text(dx, dy, dw, line_height, YEA::SAVE::PLAYTIME, 0)
    change_color(normal_color)
    draw_text(dx, dy, dw, line_height, @header[:playtime_s], 2)
  end
  
  #--------------------------------------------------------------------------
  # draw_save_total_saves
  #--------------------------------------------------------------------------
  def draw_save_total_saves(dx, dy, dw)
    return if @header[:system].nil?
    reset_font_settings
    change_color(system_color)
    text = YEA::SAVE::TOTAL_SAVE
    draw_text(dx, dy, dw, line_height, text)
    cx = text_size(text).width
    change_color(normal_color)
    draw_text(dx+cx, dy, dw-cx, line_height, @header[:system].save_count.group)
  end
  
  #--------------------------------------------------------------------------
  # draw_save_gold
  #--------------------------------------------------------------------------
  def draw_save_gold(dx, dy, dw)
    return if @header[:party].nil?
    reset_font_settings
    change_color(system_color)
    draw_text(dx, dy, dw, line_height, YEA::SAVE::TOTAL_GOLD)
    text = Vocab::currency_unit
    draw_text(dx, dy, dw, line_height, text, 2)
    cx = text_size(text).width
    change_color(normal_color)
    text = @header[:party].gold.group
    draw_text(dx, dy, dw-cx, line_height, text, 2)
  end
  
  #--------------------------------------------------------------------------
  # draw_save_location
  #--------------------------------------------------------------------------
  def draw_save_location(dx, dy, dw)
    return if @header[:map].nil?
    reset_font_settings
    change_color(system_color)
    draw_text(dx, dy, dw, line_height, YEA::SAVE::LOCATION)
    change_color(normal_color)
    cx = text_size(YEA::SAVE::LOCATION).width
    return if $data_mapinfos[@header[:map]].nil?
    text = @header[:map].display_name
    text = $data_mapinfos[@header[:map].map_id].name if text == ""
    draw_text(dx+cx, dy, dw-cx, line_height, text)
  end
  
  #--------------------------------------------------------------------------
  # draw_save_characters
  #--------------------------------------------------------------------------
  def draw_save_characters(dx, dy)
    return if @header[:party].nil?
    reset_font_settings
    make_font_smaller
    dw = (contents.width - dx) / @header[:party].max_battle_members
    dx += dw/2
    for member in @header[:party].battle_members
      next if member.nil?
      member = @header[:actors][member.id]
      change_color(normal_color)
      draw_actor_graphic(member, dx, dy)
      text = member.name
      draw_text(dx-dw/2, dy, dw, line_height, text, 1)
      text = member.level.group
      draw_text(dx-dw/2, dy-line_height, dw-4, line_height, text, 2)
      cx = text_size(text).width
      change_color(system_color)
      text = Vocab::level_a
      draw_text(dx-dw/2, dy-line_height, dw-cx-4, line_height, text, 2)
      dx += dw
    end
  end
  
  #--------------------------------------------------------------------------
  # draw_save_column1
  #--------------------------------------------------------------------------
  def draw_save_column1(dx, dy, dw)
    data = YEA::SAVE::COLUMN1_VARIABLES
    draw_column_data(data, dx, dy, dw)
  end
  
  #--------------------------------------------------------------------------
  # draw_save_column2
  #--------------------------------------------------------------------------
  def draw_save_column2(dx, dy, dw)
    data = YEA::SAVE::COLUMN2_VARIABLES
    draw_column_data(data, dx, dy, dw)
  end
  
  #--------------------------------------------------------------------------
  # draw_column_data
  #--------------------------------------------------------------------------
  def draw_column_data(data, dx, dy, dw)
    return if @header[:variables].nil?
    reset_font_settings
    for variable_id in data
      next if $data_system.variables[variable_id].nil?
      change_color(system_color)
      name = $data_system.variables[variable_id]
      draw_text(dx, dy, dw, line_height, name, 0)
      value = @header[:variables][variable_id].group
      change_color(normal_color)
      draw_text(dx, dy, dw, line_height, value, 2)
      dy += line_height
    end
  end
  
  #--------------------------------------------------------------------------
  # draw_save_contents
  #--------------------------------------------------------------------------
  def draw_save_contents
    draw_save_slot(4, 0, contents.width/2-8)
    draw_save_playtime(contents.width/2+4, 0, contents.width/2-8)
    draw_save_total_saves(4, line_height, contents.width/2-8)
    draw_save_gold(contents.width/2+4, line_height, contents.width/2-8)
    draw_save_location(4, line_height*2, contents.width-8)
    draw_save_characters(0, line_height*5 + line_height/3)
    draw_save_column1(16, line_height*7, contents.width/2-48)
    draw_save_column2(contents.width/2+16, line_height*7, contents.width/2-48)
  end
  
end # Window_FileStatus
 
#==============================================================================
# ■ Window_FileAction
#==============================================================================
 
class Window_FileAction < Window_HorzCommand
  
  #--------------------------------------------------------------------------
  # initialize
  #--------------------------------------------------------------------------
  def initialize(dx, dy, file_window)
    @file_window = file_window
    super(dx, dy)
    deactivate
    unselect
  end
  
  #--------------------------------------------------------------------------
  # window_width
  #--------------------------------------------------------------------------
  def window_width; Graphics.width - 128; end
  
  #--------------------------------------------------------------------------
  # col_max
  #--------------------------------------------------------------------------
  def col_max; return 3; end
  
  #--------------------------------------------------------------------------
  # update
  #--------------------------------------------------------------------------
  def update
    super
    return if @file_window.index < 0
    return if @current_index == @file_window.index
    @current_index = @file_window.index
    refresh
  end
  
  #--------------------------------------------------------------------------
  # make_command_list
  #--------------------------------------------------------------------------
  def make_command_list
    @header = DataManager.load_header(@file_window.index)
    add_load_command
    add_save_command
    add_delete_command
  end
  
  #--------------------------------------------------------------------------
  # add_load_command
  #--------------------------------------------------------------------------
  def add_load_command
    add_command(YEA::SAVE::ACTION_LOAD, :load, load_enabled?)
  end
  
  #--------------------------------------------------------------------------
  # load_enabled?
  #--------------------------------------------------------------------------
  def load_enabled?
    return false if @header.nil?
    return true
  end
  
  #--------------------------------------------------------------------------
  # add_save_command
  #--------------------------------------------------------------------------
  def add_save_command
    add_command(YEA::SAVE::ACTION_SAVE, :save, save_enabled?)
  end
  
  #--------------------------------------------------------------------------
  # save_enabled?
  #--------------------------------------------------------------------------
  def save_enabled?
    return false if @header.nil? && SceneManager.scene_is?(Scene_Load)
    return false if SceneManager.scene_is?(Scene_Load)
    return false if $game_system.save_disabled
    return true
  end
  
  #--------------------------------------------------------------------------
  # add_delete_command
  #--------------------------------------------------------------------------
  def add_delete_command
    add_command(YEA::SAVE::ACTION_DELETE, :delete, delete_enabled?)
  end
  
  #--------------------------------------------------------------------------
  # delete_enabled?
  #--------------------------------------------------------------------------
  def delete_enabled?
    return false if @header.nil?
    return true
  end
  
  #--------------------------------------------------------------------------
  # update_help
  #--------------------------------------------------------------------------
  def update_help
    case current_symbol
    when :load; @help_window.set_text(YEA::SAVE::LOAD_HELP)
    when :save; @help_window.set_text(YEA::SAVE::SAVE_HELP)
    when :delete; @help_window.set_text(YEA::SAVE::DELETE_HELP)
    end
  end
  
end # Window_FileAction
 
#==============================================================================
# ■ Scene_File
#==============================================================================
 
class Scene_File < Scene_MenuBase
  
  #--------------------------------------------------------------------------
  # overwrite method: start
  #--------------------------------------------------------------------------
  def start
    super
    create_all_windows
  end
  
  #--------------------------------------------------------------------------
  # overwrite method: terminate
  #--------------------------------------------------------------------------
  def terminate
    super
  end
  
  #--------------------------------------------------------------------------
  # overwrite method: update
  #--------------------------------------------------------------------------
  def update
    super
  end
  
  #--------------------------------------------------------------------------
  # new method: create_all_windows
  #--------------------------------------------------------------------------
  def create_all_windows
    create_help_window
    create_file_window
    create_action_window
    create_status_window
  end
  
  #--------------------------------------------------------------------------
  # overwrite method: create_help_window
  #--------------------------------------------------------------------------
  def create_help_window
    @help_window = Window_Help.new
    @help_window.set_text(YEA::SAVE::SELECT_HELP)
  end
  
  #--------------------------------------------------------------------------
  # new method: create_file_window
  #--------------------------------------------------------------------------
  def create_file_window
    wy = @help_window.height
    @file_window = Window_FileList.new(0, wy)
    @file_window.set_handler(:ok, method(:on_file_ok))
    @file_window.set_handler(:cancel, method(:return_scene))
  end
  
  #--------------------------------------------------------------------------
  # new method: create_action_window
  #--------------------------------------------------------------------------
  def create_action_window
    wx = @file_window.width
    wy = @help_window.height
    @action_window = Window_FileAction.new(wx, wy, @file_window)
    @action_window.help_window = @help_window
    @action_window.set_handler(:cancel, method(:on_action_cancel))
    @action_window.set_handler(:load, method(:on_action_load))
    @action_window.set_handler(:save, method(:on_action_save))
    @action_window.set_handler(:delete, method(:on_action_delete))
  end
  
  #--------------------------------------------------------------------------
  # new method: create_status_window
  #--------------------------------------------------------------------------
  def create_status_window
    wx = @action_window.x
    wy = @action_window.y + @action_window.height
    @status_window = Window_FileStatus.new(wx, wy, @file_window)
  end
  
  #--------------------------------------------------------------------------
  # new method: on_file_ok
  #--------------------------------------------------------------------------
  def on_file_ok
    @action_window.activate
    index = SceneManager.scene_is?(Scene_Load) ? 0 : 1
    @action_window.select(index)
  end
  
  #--------------------------------------------------------------------------
  # new method: on_action_cancel
  #--------------------------------------------------------------------------
  def on_action_cancel
    @action_window.unselect
    @file_window.activate
    @help_window.set_text(YEA::SAVE::SELECT_HELP)
  end
  
  #--------------------------------------------------------------------------
  # new method: on_action_load
  #--------------------------------------------------------------------------
  def on_action_load
    if DataManager.load_game(@file_window.index)
      on_load_success
    else
      Sound.play_buzzer
    end
  end
  
  #--------------------------------------------------------------------------
  # overwrite method: on_load_success
  #--------------------------------------------------------------------------
  def on_load_success
    Sound.play_load
    fadeout_all
    $game_system.on_after_load
    SceneManager.goto(Scene_Map)
  end
  
  #--------------------------------------------------------------------------
  # new method: on_action_save
  #--------------------------------------------------------------------------
  def on_action_save
    @action_window.activate
    if DataManager.save_game(@file_window.index)
      on_save_success
      refresh_windows
    else
      Sound.play_buzzer
    end
  end
  
  #--------------------------------------------------------------------------
  # overwrite method: on_save_success
  #--------------------------------------------------------------------------
  def on_save_success; Sound.play_save; end
  
  #--------------------------------------------------------------------------
  # new method: on_action_delete
  #--------------------------------------------------------------------------
  def on_action_delete
    @action_window.activate
    DataManager.delete_save_file(@file_window.index)
    on_delete_success
    refresh_windows
  end
  
  #--------------------------------------------------------------------------
  # new method: on_delete_success
  #--------------------------------------------------------------------------
  def on_delete_success
    YEA::SAVE::DELETE_SOUND.play
  end
  
  #--------------------------------------------------------------------------
  # new method: refresh_windows
  #--------------------------------------------------------------------------
  def refresh_windows
    @file_window.refresh
    @action_window.refresh
    @status_window.refresh
  end
  
end # Scene_File
 
#==============================================================================
# ■ Scene_Save
#==============================================================================
 
class Scene_Save < Scene_File
  
  #--------------------------------------------------------------------------
  # overwrite method: on_savefile_ok
  #--------------------------------------------------------------------------
  def on_savefile_ok; super; end
  
  #--------------------------------------------------------------------------
  # overwrite method: on_save_success
  #--------------------------------------------------------------------------
  def on_save_success; super; end
  
end # help_window_text
 
#==============================================================================
# ■ Scene_Load
#==============================================================================
 
class Scene_Load < Scene_File
  
  #--------------------------------------------------------------------------
  # overwrite method: on_savefile_ok
  #--------------------------------------------------------------------------
  def on_savefile_ok; super; end
  
  #--------------------------------------------------------------------------
  # overwrite method: on_load_success
  #--------------------------------------------------------------------------
  def on_load_success; super; end
  
end # Scene_Load
 
#==============================================================================
# 
# ▼ End of File
# 
#==============================================================================



Juste avant l'effacement de la sauvegarde (car oui, il n'ya aucune confirmation demandée, on appuie et hop ça efface), et un sur celui là :

http://dl.dropbox.com/u/49701990/YEA/Ace_Battle_Engine.rb
(le script doit être trop long ou des caractères pas bon dedans car la balise code marche pas dessus, d'où le lien (à ouvrir avec le Bloc Note))
Juste avant que le Tour ne démarre (le joueur entre les actions a effectuer, et après avoir entrer les commandes du dernier perso, une petite fenêtre apparait et demande confirmation (en cas de mauvaise manip par exemple, le joueur peut toujours changer les actions a faire (oui, ça m'est arrivé >.>)) Ce système est utilisé dans Suikoden V (et sûrement dans les autres aussi) pour ceux qui connaissent.

Monos => J'ai bien une idée mais je pense pas que ce soit le plus rapide et le plus simple, et en plus c\'est long ^^" En gros, faire une classe de perso par palette, et faire chaque compétence en autant de version que de palette, avec a chaque fois le flash de la bonne couleur. Tes classes tu les nomme pareil, et tu en fait une ou tu mets les compétences de la palette 1, une autre les compétences de la palette 2 etc... Et quand tu le joueur change de palette, tu mets que la classe change avec, comme ça le joueur aura l'impression que c\'est toujours la même, mais en fait c'est une autre avec exactement les mêmes compétences mais pas les même flashs. Après comme dit, c'est surement pas la solution la plus pratique, doit y'avoir une magouille faisable par script mais alors là faut pas me demander x)


Maxadona - posté le 29/04/2012 à 22:37:50 (146 messages postés)

❤ 0

Drawing my dreams on sheets of paper ...

Logiciel : Vx Ace

Bonsoir.
Etant donné que certaines maps de mon projet comportent plusieurs météos possibles, je me suis empressé donc de vouloir une tempête de sable pour mon désert.

...

Mais que vois-je ? Enfers et damnation ! Il n'y a pas d'effet de tempête sur Ace ! J'ai bien essayé un neige + changement de ton, mais c'est foireux. J'aimerais savoir si il existe des scripts qui permettent ce genre de choses.

Merci d'avance.

Notre imagination ne serait-elle pas la folie de notre génie ? - Last Chance Projet (Site à mettre à jour) ... Présentation bientôt - Chaine Youtube


crackerwood - posté le 29/04/2012 à 23:06:07 (176 messages postés)

❤ 0

Temps total recherche 20 secs en tapant weather rmvxa
http://planetarpg.com.ar/foro/showthread.php?tid=3101

CMS event--PHS--Blackjack--PHS event VX


KF2Y - posté le 09/05/2012 à 21:18:10 (3 messages postés)

❤ 0

Yoshii Powaa!!

Coucou tout le monde!
Alors voila, j'aimerais modifier l'animation par défaut d'un seul héros. Je voudrais changer l'animation de coup de poing par un coup de griffe.
Merci d'avance!! =)
Et désolé d'avance si la question à déjà été posée.


Ephy - posté le 09/05/2012 à 21:33:36 (30084 messages postés) - honor

❤ 0

[BIG SHOT]

Quel RM? Je sais que sur 2003 y'a moyen de définir l'animation de base d'un héros. C'est pas possible sur VX/XP?

Power Level: 1 148 355,38|Mystic Slayer (Value!+)|Le monde d'Adélaïde|Reikon no Yume|★ H-Project|Toho Danmaku Arena|Loli versus Ponies|Mes vidéos|Ma galerie|Débuter sur VX:10, 11|Tuto: Importation de ressources|Mapper avec les RTP VX|Touhou|Fan de Omenides|Fan de Estheone|Eph'ille: 14


crackerwood - posté le 09/05/2012 à 21:34:45 (176 messages postés)

❤ 0

Citation:

Alors voila, j'aimerais modifier l'animation par défaut d'un seul héros. Je voudrais changer l'animation de coup de poing par un coup de griffe.

.

J'en ai déduis que c'était pour RMVX ACE parce que c'est le dernier. J'ai trouvé un script qui permet d'afficher une animation lorsque tu choisis attaque.
http://rmrk.net/index.php/topic,44514.0.html

CMS event--PHS--Blackjack--PHS event VX


KF2Y - posté le 10/05/2012 à 18:17:21 (3 messages postés)

❤ 0

Yoshii Powaa!!

Désolé, j'ai pas précisé. Mais c'est bien pour RMVXAce.
Merci pour le script!:sourit


Naféria - posté le 16/05/2012 à 15:56:00 (35 messages postés)

❤ 0

Aujourd’hui tu mourras dans un ascenseur, assures-toi d'appuyer sur le bouton haut.

Support : RMXP
Question 1 : [Impossible (?)]
Bonjour, je ne suis pas sur que c'est possible mes je demande quand même.
Est t'il possible d'utiliser le lien d'une image sur internet dans RPG Maker XP ?
un peux comme si je fais:

@test1 = Sprite.new
lien = "http://lien-de-mon-image.png"
@test1.bitmap = Bitmap.new(system("url "+lien))

pour afficher l'image.
Merci d'avance.

C'est ma signature, elle est sympa et originale et l'avantage, c'est que je ne suis pas aller la chercher loin !


Mack - posté le 16/05/2012 à 17:19:13 (2290 messages postés) - staff

❤ 0

Pas sur que ça soit possible ...
Pis faudra une connexion internet pour jouer, donc c'pas top ...


Support : Ace

Question 1 :
Comment gérer le "zoom" d'un bitmap ?
En faite, j'aimerais remplacer le fond des barres traditionnelles par des images de 12*4.
L'image serait en faite coupé en trois bouts de 4*4 chacun.
Le premier bout serait la partie de gauche le deuxième celui du milieu, et le troisième celui de droite.
Le problème, c'est que je sais pas comment faire pour gérer la largeur de la barre, sans devoir faire des dizaines d'images ....

Quelqu'un aurait une idée ?

( Je prend note de tout les commentaires, même si je n'y répond pas )


zou - posté le 16/05/2012 à 20:15:56 (2197 messages postés)

❤ 0

Naféria : C'est pas possible, du moins de cette manière

Mack :

Portion de code : Tout sélectionner

1
2
bitmap.stretch_blt(dest_rect, src_bitmap, src_rect[, opacity])
 


Tu prends un morceau de bitmap avec un rect, puis tu le replaces dans un autre bitmap dans un rect, le bitmap extracté s'adapte aux dimensions du rect du bitmap de destination, donc zoom.
bitmap : bitmap receveur
dest_rect : rectangle du bitmap receveur
src_bitmap : bitmap à copier
src_rect : rectangle de src_bitmap à copier
opacity : facultatif


cortez - posté le 16/05/2012 à 20:32:50 (523 messages postés)

❤ 0

Support : Rm2003

image
Question 1 : Résolu
C'est pas un script que je veux mais pourquoi l'UHD de combat s'affiche comme ça ?
Je voudrais que des barres avec des chiffes et pas ce truc superposé.
De plus il manque la fin des chiffres pour les Mp.

Ok sur Rmxp j'aurais bidouillé les script mais là je suis perdu.
Je n'ais pas mis de patch pour Rm2003.
Pour info c'est la version que l'on trouve sur le site (version 1.09b)


Ephy - posté le 16/05/2012 à 20:38:18 (30084 messages postés) - honor

❤ 0

[BIG SHOT]

C'est juste cet affichage qui est foireux. Faut utiliser un des deux autres. Tu peux changer ça dans la BDD, onglet option de combat, rectangle interface.

Power Level: 1 148 355,38|Mystic Slayer (Value!+)|Le monde d'Adélaïde|Reikon no Yume|★ H-Project|Toho Danmaku Arena|Loli versus Ponies|Mes vidéos|Ma galerie|Débuter sur VX:10, 11|Tuto: Importation de ressources|Mapper avec les RTP VX|Touhou|Fan de Omenides|Fan de Estheone|Eph'ille: 14


cortez - posté le 16/05/2012 à 20:49:47 (523 messages postés)

❤ 0

Ok en effet j'avais zappé cette partie de la BDD.
En tout cas merci, si j'ai d'autres soucis on me retrouvera sur ce sujet.


Mack - posté le 16/05/2012 à 20:56:36 (2290 messages postés) - staff

❤ 0

Effectivement, merci Zou !

( Sinon, c'est pas censé être que pour les scripts ici ? >< )

( Je prend note de tout les commentaires, même si je n'y répond pas )


Naféria - posté le 16/05/2012 à 21:50:04 (35 messages postés)

❤ 0

Aujourd’hui tu mourras dans un ascenseur, assures-toi d'appuyer sur le bouton haut.

Citation:

Naféria : C'est pas possible, du moins de cette manière


Ha dommage, enfin c'est pas trop grave, merci pour la réponse.

C'est ma signature, elle est sympa et originale et l'avantage, c'est que je ne suis pas aller la chercher loin !


cortez - posté le 16/05/2012 à 22:04:34 (523 messages postés)

❤ 0

Mack a dit:


( Sinon, c'est pas censé être que pour les scripts ici ? >< )



Peut-être mais je vais pas créer trousemille sujet à chaque fois que j'ai un petit souci.
Et puis y marqué "Petites questions connes" donc c'est bien la rubrique d'entraide pour les questions connes qui sont résolue en 5 min , non ?

En tous les cas ce sujet est très utile.


zou - posté le 17/05/2012 à 00:25:35 (2197 messages postés)

❤ 0

"Petites questions connes", il y a aussi marqué
"[scripts] Petites questions connes" :clindoeil2


Maxadona - posté le 20/05/2012 à 11:54:58 (146 messages postés)

❤ 0

Drawing my dreams on sheets of paper ...

Log utilisé : VX Ace

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
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
#==============================================================================#
# ♥ Craft System
#==============================================================================#
# // • Created By    : IceDragon (rpgmakervxace.com)
# // • Modified By   : IceDragon (rpgmakervxace.com)
# // • Data Created  : 03/12/2012
# // • Data Modified : 03/12/2012
# // • Version       : 0.9
# // • IEI ID        : 20
#==============================================================================#
# ● Change Log
#     ♣ 03/12/2012 V0.9
#         Started & Finished
#         The reason this isnt 1.0, is that some methods need to be moved
#         to the IEI Core, but until then, this is what its gonna be.
#
#==============================================================================#
# ● How To Use
#     In an Item, Weapon, or Armor notebox use this tag:
#     <crafting: Nid>
#     <crafting: Nid, Nid, Nid..>
#     Replace N with:
#       A - For Armor
#       W - For Weapon
#       I - For Item
#     Replace id with well the object's Id
#
#     EG:
#     <crafting: W1, I1>
#        That creates a healing axe, using Weapon 1 and Item 1
#     You can add as many crafting tags as you like, so you can have
#     several recipes and 1 outcome
#
#     Pressing L/R in the input window will switch to the output window
#    
#==============================================================================#
module IEI
  module CraftSystem  
    # // (JUMP:MaterialCount) find that if you need to change the material count
    # // Craft functions
    def self.item2craft(item)
      return [IEI.item_sym(item), item ? item.id : nil]
    end
    def self.craft2item(craft)
      return nil unless(craft)
      sym, id = craft
      case(sym)
      when :item   ; $data_items[id]
      when :skill  ; $data_skills[id]  # // Still not used
      when :weapon ; $data_weapons[id]
      when :armor  ; $data_armors[id]
      else         ; nil  
      end  
    end  
    def self.sort_recipe(recipe)
      return recipe.sort_by{|a|craft2item(a).db_id}
    end    
    def self.mk_recipe_list!(items)
      @recipe_list = mk_recipe_list_abs(items) unless(@recipe_list)
    end  
    def self.mk_recipe_list_abs(items)
      recipe_list = {}
      pc = nil # // Forward Dec.
      items.each do |item| pc = item2craft(item) # // Convert2Craft
        item.craft_recipes.each do |r|recipe_list[sort_recipe(r)]=pc ; end
      end  
      return recipe_list
    end # // mk_recipe_list
    def self.item_from_recipe(recipe)
      return craft2item(@recipe_list[sort_recipe(recipe)])
    end  
    def self.items2recipe(items)
      return items.collect{|i|item2craft(i)}
    end  
  end # // Craft System
  module REGEXP
    module BaseItem
      # // <crafting: i1, w2, a7>
      CRAFT_MATERIAL = /<CRAFTING:[ ]*((?:I|W|A)\d+(?:\s*,\s*(?:I|W|A)\d+)*)>/i
      CRAFT_ID       = /(I|W|A)(\d+)/i
    end  
  end
  # // Core
  def self.item_sym(item)
    case(item)
    when RPG::Item  ; :item
    when RPG::Skill ; :skill # // Not used for craft
    when RPG::Weapon; :weapon
    when RPG::Armor ; :armor
    else            ; :nil
    end  
  end
  # // Array to Count Hash
  def self.a2count_hash(array)
    array.inject(Hash.new){|hash,element|hash[element]=(hash[element]||0)+1;hash}
  end  
end  
module DataManager
  class << self
    alias :iei020_load_database :load_database
    def load_database(*args,&block)
      iei020_load_database(*args,&block)
      IEI::CraftSystem.mk_recipe_list!(
        (
        $data_items   + # // Support Items
        $data_weapons + # // Support Weapons
        $data_armors    # // Support Armors
        ).compact
      )
    end  
  end  
end  
class RPG::BaseItem
  # // Core
  def db_id()
    # // Database ID - Used to sort items
    unless(@db_id)
      @db_id = case(self)
      # // Since the database has a limit of 999 items, you can use 1000 intervals
      when RPG::Item   ; 0    
      when RPG::Skill  ; 1000
      when RPG::Weapon ; 2000
      when RPG::Armor  ; 3000
      else             ; 9000 # // Massive Offset D:
      end  
      @db_id += self.id # // Add the item's id to the offset
    end
    return @db_id
  end  
  attr_writer :db_id
  # // Craft
  def craft_recipes()
    unless(@craft_recipes)
      @craft_recipes = []
      reg = IEI::REGEXP::BaseItem
      # // Forward Declaration
      recipe = []
      crft = nil
      self.note.scan(reg::CRAFT_MATERIAL).each do |n|
        # // I should have made an recipe object instead of nested arrays...
        recipe = [] # // Make a new recipe
        n[0].scan(reg::CRAFT_ID).each do |cid|
          l, id = cid.join("").match(reg::CRAFT_ID)[1,2]
          id = id.to_i
          # // The regex patterns(nID) are converted to craft arrays [:symbol, id]
          crft = case(l.upcase)
          when "I" ; [:item  ,id] # // Item
          when "W" ; [:weapon,id] # // Weapon
          when "A" ; [:armor ,id] # // Armor
          when "S" ; [:skill ,id] # // Skill # // Not supported but whatever.
          else     ; raise "Unknown type #{l}" # // Now how the hell did you do that?
          end  
          recipe << crft # // Push this craft unto the list
        end
        @craft_recipes << recipe # // Add the new recipe to the list
      end  
    end  
    # // Array[Recipe[Crafts[:symbol, id]..]..]
    return @craft_recipes
  end  
  attr_writer :craft_recipes
end  
class Game_Party
  def recipe2items(recipe)
    recipe.collect{|c|IEI::CraftSystem.craft2item(c)}
  end  
  def items2recipe(items)
    IEI::CraftSystem.items2recipe(items)
  end  
  def item_from_recipe(recipe)
    IEI::CraftSystem.item_from_recipe(recipe)
  end  
  def has_these?(*items)
    hsh = IEI.a2count_hash(items)
    return hsh.keys.all?{|i|hsh[i]<=item_number(i)}
  end
  def crafted?(item)
    return (@crafted ||= {})[IEI::CraftSystem.item2craft(item)] == true
  end  
  def correct_recipe?(target_item,recipe)
    item_from_recipe(recipe) == target_item
  end  
  def craft(recipe,item=item_from_recipe(recipe))
    return false unless(item)
    return false unless(item_number(item)<max_item_number(item))
    return false unless(has_these?(*recipe2items(recipe)))
    craft!(recipe,item)
  end  
  # // Dont care if its impossible, just DO IT
  def craft!(recipe,item=item_from_recipe(recipe))
    @crafted[IEI::CraftSystem.item2craft(item)] = true
    gain_item(item,1)
    recipe2items(recipe).each{|m|lose_item(m,1)}
    return true
  end  
end  
class Window::CraftItemList < Window_ItemList
  def col_max()
    1
  end
  def item_max()
    super + 1
  end  
end  
class Window::CraftOutput < Window_Selectable
  def initialize(x,y,w,h)
    super(x,y,w,h)
    select(0)
  end  
  def craft!()
    return Sound.play_buzzer unless($game_party.craft(@recipe))
    @input_window.craft!() if(@input_window)
  end  
  attr_reader :input_window
  def input_window=(n)
    @input_window = n
    refresh()
  end
  attr_reader :item
  def change_recipe(recipe)
    @recipe = recipe.compact
    @item   = IEI::CraftSystem.item_from_recipe(@recipe)
    refresh()
  end  
  def refresh()
    contents.clear()
    return unless(@item)
    if($game_party.crafted?(@item))
      draw_item_name(@item,0,0)
    else
      rect = item_rect_for_text(0); rect.x += 24;rect.width-=24
      draw_text(rect,"?"*10)
    end  
  end  
  def item_max
    1
  end
  def col_max
    1
  end  
  def update_help
    @help_window.set_item(item)
  end
end  
class Window::CraftInput < Window_Selectable
  attr_reader :items
  def initialize(x,y,w,h)
    @items = []
    super(x,y,w,h)
    refresh()
    select(0)
  end
  def craft!()
    adjust_items()
  end  
  attr_reader :output_window
  def output_window=(n)
    @output_window = n
    refresh()
  end
  def item(index=self.index)
    @items[index]
  end  
  def change_item(index,n)
    @items[index] = n
    redraw_item(index)
    update_recipe()
  end  
  def change_current_item(n)
    change_item(self.index,n)
    call_update_help()
  end
  def clear_items()
    clear_items!()
    update_recipe()
  end  
  def clear_items!()
    @items.clear()
    refresh()
    call_update_help()
  end  
  def draw_item(index)
    rect = item_rect(index)
    item = @items[index]
    if(item)
      draw_item_name(item,rect.x,rect.y)
    else
      rect = item_rect_for_text(index)
      draw_text(rect.x+24,rect.y,rect.width-24,rect.height,"-"*10)
    end  
  end  
  def adjust_items()
    hsh = IEI.a2count_hash(@items)
    @items.clear()
    hsh.each_pair do |key,value|
      @items += [key] * [[0,value].max,$game_party.item_number(key)].min
    end  
    update_recipe()
  end  
  def update_recipe()
    if(@output_window)
      @output_window.change_recipe(IEI::CraftSystem.items2recipe(@items))
    end  
  end  
  def item_max()
    5 # // (JUMP:MaterialCount)
  end
  def col_max()
    1
  end
  def update_help()
    @help_window.set_item(item)
  end
end
class Scene_Craft < Scene_MenuBase
  def start()
    super()
    create_all_windows()
  end  
  def create_all_windows()
    create_help_window()
    create_category_window()
    create_item_window()
    create_output_window()
    create_input_window()
  end  
  def create_category_window
    @category_window = Window_ItemCategory.new
    @category_window.viewport = @viewport
    @category_window.help_window = @help_window
    @category_window.y = @help_window.height
    @category_window.set_handler(:ok,     method(:on_category_ok))
    #@category_window.set_handler(:cancel, method(:on_category_cancel))
    #@category_window.deactivate()
  end
  def create_item_window()
    wx = @category_window.width / 2
    wy = @category_window.y+@category_window.height
    ww = @category_window.width / 2
    wh = Graphics.height - wy - 48
    @item_window             = Window::CraftItemList.new(wx,wy,ww,wh)
    @item_window.viewport    = @viewport
    @item_window.help_window = @help_window
    @item_window.set_handler(:ok      , method(:on_item_ok))
    @item_window.set_handler(:cancel  , method(:on_item_cancel))
    @item_window.set_handler(:pageup  , method(:change_to_input))
    @item_window.set_handler(:pagedown, method(:change_to_input))
    @category_window.item_window = @item_window
  end  
  def create_output_window()
    wx = 0
    wy = @item_window.y + @item_window.height
    ww = @category_window.width
    wh = 24+24
    @coutput_window = Window::CraftOutput.new(wx,wy,ww,wh)
    @coutput_window.viewport    = @viewport
    @coutput_window.help_window = @help_window
    @coutput_window.set_handler(:ok      , method(:on_coutput_ok))
    @coutput_window.set_handler(:cancel  , method(:on_coutput_cancel))
    @coutput_window.set_handler(:pageup  , method(:change_to_input))
    @coutput_window.set_handler(:pagedown, method(:change_to_input))
  end  
  def create_input_window()
    wx = 0
    wy = @category_window.y+@category_window.height
    ww = @category_window.width / 2
    wh = @item_window.height
    @cinput_window               = Window::CraftInput.new(wx,wy,ww,wh)
    @cinput_window.viewport      = @viewport
    @cinput_window.help_window   = @help_window
    #@cinput_window.set_handler(:ok      , method(:on_cinput_ok))
    @cinput_window.set_handler(:cancel  , method(:on_cinput_cancel))
    @cinput_window.set_handler(:pageup  , method(:change_to_output))
    @cinput_window.set_handler(:pagedown, method(:change_to_output))
    @cinput_window.output_window = @coutput_window
    @coutput_window.input_window = @cinput_window
    @cinput_window.activate()
  end
  def change_to_item()
    @category_window.activate()
  end  
  def change_to_output()
    @coutput_window.activate()
    @category_window.deactivate()
  end
  def change_to_input()
    @cinput_window.activate()
    @category_window.activate()
  end
  def on_category_ok()
    @cinput_window.deactivate()
    @item_window.activate()
    @item_window.select_last()
  end  
  def on_category_cancel()
    @cinput_window.activate()
  end  
  def on_item_ok()
    @cinput_window.change_current_item(@item_window.item)
    on_item_cancel()
  end  
  def on_item_cancel()
    @cinput_window.activate()
    @category_window.activate()
  end
  def on_coutput_ok()
    @coutput_window.craft!()
    @cinput_window.refresh()
    @coutput_window.refresh()
    @item_window.refresh()
    @coutput_window.activate()
  end  
  def on_coutput_cancel()
    change_to_input()
    #@cinput_window.activate()
  end
  def on_cinput_ok()
    @coutput_window.activate()
  end  
  def on_cinput_cancel()
    return_scene()
  end
end  
#=■==========================================================================■=#
#                           // ● End of File ● //                              #
#=■==========================================================================■=#



Bonjour. J'ai trouvé ce script de IceDragon pour Ace qui permet l'ajout d'un système de craft. J'aimerais cependant savoir si il est possible de n'activer qu'une portion du script en fonction de la personne à qui on parle (forgeron, alchimiste, ...).

Merci d'avance =)

Notre imagination ne serait-elle pas la folie de notre génie ? - Last Chance Projet (Site à mettre à jour) ... Présentation bientôt - Chaine Youtube


KF2Y - posté le 20/05/2012 à 19:14:30 (3 messages postés)

❤ 0

Yoshii Powaa!!

Coucou, alors voila, j'utilise RPGMaker2003, et j'ai un petit problème.
A l'utilisation de l'attaque avec une arme ou d'une compétence avec comme mouvement d'attaque "se dirige vers la cible", pourquoi sur certain ennemis l'animation du héros est maquée derrière l'ennemi?
imageimage
A gauche, l'animation est derrière l'ennemi alors qu'a droite l'animation est devant

Mercii! :youpi


Exemples - posté le 20/05/2012 à 20:04:19 (2021 messages postés)

❤ 0

Pff.

Je sais que la question a été posée trouzmilliards de fois, mais j'arrive pas a retrouver la réponse: ou faut-il placer le character sur le template pour que le personnage soit bien positionné une fois en jeu quand on fait du custom?

Bouh.


Mack - posté le 20/05/2012 à 20:08:29 (2290 messages postés) - staff

❤ 0

Citation:

[Scripts]



Faut vraiment ouvrir un second post-it pour les autres questions connes, ou virer le filtre du titre ...

( Je prend note de tout les commentaires, même si je n'y répond pas )


Exemples - posté le 20/05/2012 à 20:10:18 (2021 messages postés)

❤ 0

Pff.

Trompé de topic.
Sorry.
image

Bouh.


SimultaneitySmith - posté le 20/05/2012 à 23:36:02 (444 messages postés)

❤ 0

Jazzeux et maker... Ca existe ça?

Question: [Résolu]

Bonjour, bonjour!

Une question vraiment toute bête je pense pour ceux qui maîtrisent le ruby... Malheureusement, ce n'est pas mon cas!
Je tourne sur RMXP
Je cherche simplement a faire en sorte que lorsque un ennemi meurt en combat, j'ajoute un a une variable que j'ai appelée $ames...

Je suis un gros débutant en Ruby et donc ca fait 5 ou 6 heures que je cherche un moyen sans trop de résultats :leure2 (On m'avait conseillé quelque chose sur un autre forum mais la formule était pas très stable et il arrivait que la variable augmente plusieurs fois sur le même monstre)

Voili, voilou,

Merci d'avance! :flaco

Unbelivabledaze! Mon Touitère || Mes mousiques || Ma chaine Twitch (live gamedev/pixel art tous les aprem de semaine a 14h) || Mon sitoueb


Naféria - posté le 21/05/2012 à 01:13:01 (35 messages postés)

❤ 0

Aujourd’hui tu mourras dans un ascenseur, assures-toi d'appuyer sur le bouton haut.

Pour ajouter 1 dans la variable tu doit l'initialiser:
$ames = 0 (ou une autre valeur).
- en suite pour ajouter 1: $ames += 1
C'est comme les maths on utilise les signes * / + - ** etc...
(par contre les variables globale '$' c'est le mal)

C'est ma signature, elle est sympa et originale et l'avantage, c'est que je ne suis pas aller la chercher loin !

Aller à la page 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

Index du forum > Entraide > [Scripts] Petites questions connes sur les SCRIPTS!!

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