Day.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

386 connectés actuellement

29412278 visiteurs
depuis l'ouverture

4817 visiteurs
aujourd'hui



Barre de séparation

Partenaires

Indiexpo

Akademiya RPG Maker

Blog Alioune Fall

Fairy Tail Constellations

Alex d'Or

Le Comptoir Du clickeur

Le Temple de Valor

New RPG Maker

Tous nos partenaires

Devenir
partenaire



Gestion d'alchimie simplifié 1.08

Ce script a pour but d'ajouter une gestion d'alchimie paramétrable très simplement.

Script pour RPG Maker VX Ace
Ecrit par Tonyryu (site de l'auteur)
Publié par tonyryu (lui envoyer un message privé)
Signaler un script cassé

❤ 0

Auteur : Tonyryu
Logiciel : RPG Maker VX Ace
Nombre de scripts : 1
Source : https://web.archive.org/web/20190701072732/http://www.tonyryudev.com/joomla3/index.php/menu-mes-developpements/menu-script-rpgmaker/45-vx-ace-gestion-alchimie-simplifiee et https://www.rpgmakervx-fr.com/t12959-gestion-alchimie-simplifiee#155277
Script rajouté avec l'autorisation de l'auteur.

Installation
A placer au-dessus de Main.

Instructions
Pour paramétrer une recette, il suffit de simplement ajouter la liste des ingrédients dans la note d'un objet, en englobant cette liste dans une format reconnaissable par le programme.

Trés souvent, il n'y a rien de noté dans les notes, je vais maintenant, lui définir une recette :
\AL[2I17,1I18]

Il est vrai qu'a première vue, c'est pas très parlant, on va donc décomposer le paramétrage de la recette :
\AL[] : permet de préciser que le contenu est du paramétrage pour alchimie
2I17 : 2 "I"tem ID 17
2I18 : 2 "I"tem ID 18

Si vous souhaitez spécifier plusieurs recettes pour un même objet, il suffit de séparer les différentes recettes par un ;
exemple :
\AL[2I17,1I18;1I7,1I18]
Ce qui équivaut à une recette avec 2I17,1I18, et une recette avec 1I7,1I18

Pour utiliser des ingrédients de type Armes, il faudra utiliser la lettre W, et pour utiliser les armures, la lettre A

L'intégration dans le menu est automatisée depuis la version 1.03, si la constante DANS_LE_MENU vaut true

Pour ouvrir l'alchimie depuis un PNJ, ajouter cette commande script dans l'événement :

Portion de code : Tout sélectionner

1
SceneManager.call(Scene_Alchimie)



La constante TOUT_AFFICHER, permet d'afficher ou non les recettes si l'on contient l'un des ingrédients, les valeurs possibles sont true ou false

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
    #==============================================================================
    # ■ Systeme de gestion d'alchimie simplifiée
    #------------------------------------------------------------------------------
    #  Ce script a pour but d'ajouter un système d'alchimie très simple d'utilisation
    #
    #  Version  Date          Auteur        Commentaires
    #  1.00      06/09/2012    Tonyryu      Première release
    #  1.01      07/09/2012    Tonyryu      Modification pour prendre en charge le parametrage sur la note et non la description
    #  1.02      07/09/2012    Tonyryu      Changement de position de la fenêtre d'aide
    #  1.03      08/09/2012    Tonyryu      Intégration au menu
    #  1.04      08/09/2012    Tonyryu      Suppression du bug si pas d'objet craftable
    #  1.05      08/09/2012    Tonyryu      Correction du bug non desactivation des objets n'ayant plus assez de composants
    #  1.06      19/09/2012    Tonyryu      Ajout de l'option pour afficher ou non tout la liste même si aucun ingrédients n'est possédé
    #  1.07      23/09/2012    Tonyryu      Ajout de la possibilité de spécifier plusieurs recettes pour un même objet / Ajout d'une constante pour choisir de l'ajouter dans le menu
    #  1.08      12/03/2013    Tonyryu      Correction du bug de non-dégrisage d'une recette disponible suite à un craft d'un de ces ingrédients / sauvegarde postionnement curseur
    #
    # Attention : Ce script est ma propriété en tant que création et il est donc
    # soumis au droit de la propriété intellectuelle.
    # En aucun cas, il ne doit être copié ou publié vers un autre forum sans en
    # avoir reçu mon accord au préalable.
    #
    #==============================================================================
 
    # Constante
    ALCHIMIE = "Alchimie"
    TOUT_AFFICHER = true
    DANS_LE_MENU = true
 
 
    #==============================================================================
    # ** RPG::BaseItem
    #------------------------------------------------------------------------------
    #  class RPG::BaseItem
    #==============================================================================
    class RPG::BaseItem
      def note(pAlchimie = false)
        r_note = @note.clone
        r_alchi = ""
       
        r_note.gsub!(/\\/) { "\e" }
        r_note.gsub!(/\e\e/) { "\\" }
        r_note.gsub!(/\eAL\[(.*)\]/i) do
          r_alchi = $1
          ""
        end
        return (pAlchimie ? r_alchi : r_note)
      end
    end
 
 
    #==============================================================================
    # ** Window_ItemCategory_Al
    #------------------------------------------------------------------------------
    #  This window is for selecting a category of normal items and equipment
    # on the item screen or shop screen.
    #==============================================================================
    class Window_ItemCategory_Al < Window_Command
      #--------------------------------------------------------------------------
      # * Object Initialization
      #--------------------------------------------------------------------------
      def initialize(pY)
        super(0, pY)
      end
     
      #--------------------------------------------------------------------------
      # * Get Window Width
      #--------------------------------------------------------------------------
      def window_width
        return 200
      end
     
      #--------------------------------------------------------------------------
      # * Get Digit Count
      #--------------------------------------------------------------------------
      def col_max
        return 1
      end
 
      #--------------------------------------------------------------------------
      # * Create Command List
      #--------------------------------------------------------------------------
      def make_command_list
        add_command(Vocab::item,    :item)
        add_command(Vocab::weapon,  :weapon)
        add_command(Vocab::armor,    :armor)
        add_command(Vocab::key_item, :key_item)
      end
      #--------------------------------------------------------------------------
      # * Frame Update
      #--------------------------------------------------------------------------
      def update
        super
        @item_window.category = current_symbol if @item_window
      end
      #--------------------------------------------------------------------------
      # * Set Item Window
      #--------------------------------------------------------------------------
      def item_window=(item_window)
        @item_window = item_window
        update
      end
    end
 
 
    #==============================================================================
    # ** Window_ItemList_Al
    #------------------------------------------------------------------------------
    #  This window displays a list of recipe items on the Alchimie screen.
    #==============================================================================
    class Window_ItemList_Al < Window_Selectable
      #--------------------------------------------------------------------------
      # * Object Initialization
      #--------------------------------------------------------------------------
      def initialize(x, y, width, height)
        super
        @category = :none
        @data = []
        @save_index = 0
      end
     
      #--------------------------------------------------------------------------
      # * Set Category
      #--------------------------------------------------------------------------
      def category=(category)
        return if @category == category
        @category = category
        make_item_list
        refresh
        self.oy = 0
      end
      #--------------------------------------------------------------------------
      # * Get Digit Count
      #--------------------------------------------------------------------------
      def col_max
        return 1
      end
      #--------------------------------------------------------------------------
      # * Get Number of Items
      #--------------------------------------------------------------------------
      def item_max
        @data ? @data.size : 0
      end
      #--------------------------------------------------------------------------
      # * Get Item
      #--------------------------------------------------------------------------
      def item
        @data && index >= 0 ? @data[index] : nil
      end
      #--------------------------------------------------------------------------
      # * Get Activation State of Selection Item
      #--------------------------------------------------------------------------
      def current_item_enabled?
        (@data[index] ? @data[index][1] : false)
      end
 
      #--------------------------------------------------------------------------
      # * Create Item List
      #--------------------------------------------------------------------------
      def make_item_list
        @data.clear
        # parcourir la liste des item de la catégories
        case @category
        when :item
          tabItem = $data_items
        when :weapon
          tabItem = $data_weapons
        when :armor
          tabItem = $data_armors
        when :key_item
          tabItem = $data_items
        else
          tabItem = []
        end
       
        tabItem.each do |item|
          if item
            validItem = true
            if @category == :item
              validItem = !item.key_item?
            elsif @category == :key_item
              validItem = item.key_item?
            end
           
            if validItem and item.note(true) != ""
             
 
             
              recipe = item.note(true)
             
              listRecipe = recipe.split(';')
              listRecipe.each do |aListRecipe|
             
              tabRecipe = aListRecipe.split(',')
             
                b_r_item = false
                b_valid = true
                tabRecipeFinish = []
             
                tabRecipe.each do |element|
                  number = 0
                  type = ""
                  id = 0
                  r_item = nil
                  element.gsub(/(.*)I(.*)/) do
                    number = $1.to_i
                    id = $2.to_i
                    r_item = $data_items[id]
                  end
                  element.gsub(/(.*)W(.*)/) do
                    number = $1.to_i
                    id = $2.to_i
                    r_item = $data_weapons[id]
                  end
                  element.gsub(/(.*)A(.*)/) do
                    number = $1.to_i
                    id = $2.to_i
                    r_item = $data_armors[id]
                  end
                 
                  tabRecipeFinish.push([r_item, number])
                 
                  r_number = $game_party.item_number(r_item)
                  b_r_item = true if (r_number > 0 or TOUT_AFFICHER)
                  b_valid = false if r_number < number
                end
               
                if b_r_item
                  @data.push([item.clone, b_valid, tabRecipeFinish.clone])
                end
              end
            end
          end
        end
     
      end
      #--------------------------------------------------------------------------
      # * Restore Previous Selection Position
      #--------------------------------------------------------------------------
      def select_last
        select((@data.size == 0 ? nil : (@data.size > @save_index) ? @save_index : @data.size - 1))
      end
      #--------------------------------------------------------------------------
      # * Draw Item
      #--------------------------------------------------------------------------
      def draw_item(index)
 
        recipe = @data[index]
        if recipe
          rect = item_rect(index)
          rect.width -= 4
          draw_item_name(recipe[0], rect.x, rect.y, recipe[1])
        end
 
      end
 
     
      #--------------------------------------------------------------------------
      # * Set Alchi Window
      #--------------------------------------------------------------------------
      def alchi_window=(alchi_window)
        @alchi_window = alchi_window
        update
      end
 
      #--------------------------------------------------------------------------
      # * Refresh
      #--------------------------------------------------------------------------
      def refresh
        create_contents
        draw_all_items
      end
     
      #--------------------------------------------------------------------------
      # * Frame Update
      #--------------------------------------------------------------------------
      def update
        super
        @alchi_window.set_item(@data[index]) if index >= 0
      end
     
      #--------------------------------------------------------------------------
      # * Update Help Text
      #--------------------------------------------------------------------------
      def update_help
        @help_window.set_item(@data[index][0]) if @data[index]
      end
     
      #--------------------------------------------------------------------------
      # * Desactivate
      #--------------------------------------------------------------------------
      def update_data
        @data.each do |recipe|
          valid = true
          recipe[2].each do |ingredient|
            p_number = $game_party.item_number(ingredient[0])
            valid = false if p_number < ingredient[1]
          end
          recipe[1] = valid
        end
        @save_index = index
        refresh
      end
    end
 
 
    #==============================================================================
    # ** Window_Alchimie
    #------------------------------------------------------------------------------
    #  This window shows items detail and recipe
    #==============================================================================
    class Window_Alchimie < Window_Base
      #--------------------------------------------------------------------------
      # * Object Initialization
      #--------------------------------------------------------------------------
      def initialize(pY)
        super(200, pY, Graphics.width - 200, Graphics.height - pY)
        @item = nil
      end
      #--------------------------------------------------------------------------
      # * Set Item
      #--------------------------------------------------------------------------
      def set_item(pItem)
        if pItem != @item
          @item = pItem
          refresh
        end
      end
 
      #--------------------------------------------------------------------------
      # * Refresh
      #--------------------------------------------------------------------------
      def refresh
        clean(false)
        item = @item[0]
       
        change_color(normal_color)
        y = 10
        x = 0
        draw_param(x, y, 2, item)
        draw_param(x, y + line_height, 3, item)
        draw_param(x, y + (line_height * 2), 4, item)
        x = (contents.width / 2)
        draw_param(x, y, 5, item)
        draw_param(x, y + line_height, 6, item)
        draw_param(x, y + (line_height * 2), 7, item)
       
        y = y + (line_height * 3) + 16
       
        contents.fill_rect(0, y, contents.width, 1, Color.new(255,255,255,255))
       
        y += 16
        x = 30
        @item[2].each do | ingredient |
          i_item = ingredient[0]
          i_number = ingredient[1]
          draw_ingredient(x, y, i_item, i_number)
          y += line_height
        end
 
      end
     
      #--------------------------------------------------------------------------
      # * clean
      #--------------------------------------------------------------------------
      def clean(pForce = true)
        contents.clear
        @item = nil if pForce
      end
     
      #--------------------------------------------------------------------------
      # * Draw Param Equip
      #--------------------------------------------------------------------------
      def draw_param(x, y, param_id, item)
        change_color(system_color)
        draw_text(x, y, 90, line_height, Vocab::param(param_id))
        change_color(normal_color)
       
        if item.is_a?(RPG::Weapon) or item.is_a?(RPG::Armor)
          draw_text(x+ 100, y, 32, line_height, item.params[param_id])
        end
      end
     
      #--------------------------------------------------------------------------
      # * Draw Ingredient
      #--------------------------------------------------------------------------
      def draw_ingredient(x, y, item, number)
        p_number = $game_party.item_number(item)
        draw_icon(item.icon_index, x, y, (p_number >= number))
        change_color(normal_color, (p_number >= number))
        draw_text(x + 24, y, 190, line_height, item.name )
        draw_text(x + 220, y, 100, line_height, "#{p_number}/#{number}" )
      end
     
      #--------------------------------------------------------------------------
      # * Draw Number of Items
      #--------------------------------------------------------------------------
      def draw_item_number(rect, item)
        draw_text(rect, sprintf(":%2d", $game_party.item_number(item)), 2)
      end
    end
 
 
 
    #==============================================================================
    # ** Scene_Alchimie
    #------------------------------------------------------------------------------
    #  This Scene performs alchimie
    #==============================================================================
    class Scene_Alchimie < Scene_MenuBase
      #--------------------------------------------------------------------------
      # * Start Processing
      #--------------------------------------------------------------------------
      def start
        super
        create_help_window
        create_category_window
        create_item_window
        create_alchimie_window
      end
     
      #--------------------------------------------------------------------------
      # * Create Category Window
      #--------------------------------------------------------------------------
      def create_category_window
        wy = @help_window.height
        @category_window = Window_ItemCategory_Al.new(wy)
        @category_window.viewport = @viewport
        @category_window.set_handler(:ok,    method(:on_category_ok))
        @category_window.set_handler(:cancel, method(:return_scene))
      end
 
      #--------------------------------------------------------------------------
      # * Create Item Window
      #--------------------------------------------------------------------------
      def create_item_window
        wy = @category_window.height + @help_window.height
        wh = Graphics.height - wy
        @item_window = Window_ItemList_Al.new(0, wy, 200, wh)
        @item_window.viewport = @viewport
        @item_window.set_handler(:ok,    method(:on_item_ok))
        @item_window.set_handler(:cancel, method(:on_item_cancel))
        @category_window.item_window = @item_window
        @item_window.help_window = @help_window
      end
 
      #--------------------------------------------------------------------------
      # * Create Alchimie Window
      #--------------------------------------------------------------------------
      def create_alchimie_window
        wy = @help_window.height
        @alchimie_window = Window_Alchimie.new(wy)
        @alchimie_window.viewport = @viewport
        @item_window.alchi_window = @alchimie_window
      end
     
      #--------------------------------------------------------------------------
      # * Category [OK]
      #--------------------------------------------------------------------------
      def on_category_ok
        if @item_window.item_max > 0
          @item_window.activate
          @item_window.select_last
        else
          @category_window.activate
        end
      end
     
      #--------------------------------------------------------------------------
      # * Item [OK]
      #--------------------------------------------------------------------------
      def on_item_ok
        recipe = @item_window.item
        $game_party.gain_item(recipe[0], 1)
        valid = true
        recipe[2].each do |ingredient|
          $game_party.gain_item(ingredient[0], -ingredient[1])
        end
        @item_window.update_data
        @alchimie_window.refresh
        on_category_ok
      end
      #--------------------------------------------------------------------------
      # * Item [Cancel]
      #--------------------------------------------------------------------------
      def on_item_cancel
        @item_window.unselect
        @category_window.activate
        @alchimie_window.clean
        @help_window.clear
      end
       
    end
 
    #==============================================================================
    # ** Window_MenuCommand
    #------------------------------------------------------------------------------
    #  This command window appears on the menu screen.
    #==============================================================================
    class Window_MenuCommand < Window_Command
     
      #--------------------------------------------------------------------------
      # * add_main_commands
      #--------------------------------------------------------------------------
      alias al_add_main_commands add_main_commands
      def add_main_commands
        al_add_main_commands
        add_command(ALCHIMIE, :alchimie, main_commands_enabled) if DANS_LE_MENU
      end
    end
 
    #==============================================================================
    # ** Scene_Menu
    #------------------------------------------------------------------------------
    #  This class performs the menu screen processing.
    #==============================================================================
    class Scene_Menu < Scene_MenuBase
 
      #--------------------------------------------------------------------------
      # * create_command_window
      #--------------------------------------------------------------------------
      alias al_create_command_window create_command_window
      def create_command_window
        al_create_command_window
        @command_window.set_handler(:alchimie, method(:command_alchimie)) if DANS_LE_MENU
      end
     
      #--------------------------------------------------------------------------
      # * command_alchimie
      #--------------------------------------------------------------------------
      def command_alchimie
        SceneManager.call(Scene_Alchimie)
      end
    end





Aucun commentaire n'a été posté pour le moment.

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