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

321 connectés actuellement

29423989 visiteurs
depuis l'ouverture

8216 visiteurs
aujourd'hui



Barre de séparation

Partenaires

Indiexpo

Akademiya RPG Maker

Blog Alioune Fall

Fairy Tail Constellations

Zarok

Eclipso

Lunae - le bazar d'Emz0

RPG Maker Détente

Tous nos partenaires

Devenir
partenaire



Objet au sol 1.02

Le héros peut poser des objets par terre et les ramasser.

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/20190916100730/http://tonyryudev.com/joomla3/index.php/menu-mes-developpements/menu-script-rpgmaker/42-vx-ace-objet-au-sol et https://www.rpgmakervx-fr.com/t13262-objet-au-sol
Script posté avec l'autorisation de son auteur.

Principe
Ce script a pour but de donner la possibilité de poser des objets au sol et de les ramasser quant on veut

Installation
A placer au-dessus de Main.

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
    #==============================================================================
    # ■ Systeme de gestion de dépot d'objet sur la map
    #------------------------------------------------------------------------------
    #  Ce script a pour but de rajouter un système de dépot d'objet sur la map.
    #  Les emplacements des objets sont conservés dans la sauvegarde du joueur.
    #
    #
    #  Version  Date          Auteur        Commentaires
    #  1.00      24/11/2012    Tonyryu      Création du script
    #  1.01      25/11/2012    Tonyryu      Correction du positionnement
    #  1.02      06/12/2012    Tonyryu      Correction afin de ne faire apparaitre l'option dépot que sur Scene_Item
    #
    # Attention : Ce script est ma propriété en tant que création et il est donc
    # soumis au droit de la propriété intellectuelle ( http://www.irpi.ccip.fr/ ).
    # En aucun cas, il ne doit être copié ou publié vers un autre forum sans en
    # avoir reçu mon accord au préalable.
    #
    #==============================================================================
 
 
    module AOS
      Depot = "Déposer"
      Son = "./Audio/SE/Blow2.ogg"
    end
 
 
 
    #==============================================================================
    # ** Game_Party
    #------------------------------------------------------------------------------
    #  This class handles parties. Information such as gold and items is included.
    # Instances of this class are referenced by $game_party.
    #==============================================================================
    class Game_Party
      #--------------------------------------------------------------------------
      # * initialize
      #--------------------------------------------------------------------------
      alias oas_initialize initialize
      def initialize
        oas_initialize
        @ListeObjetsSol = {}
      end
     
      #--------------------------------------------------------------------------
      # * oas_prendre_objet
      #--------------------------------------------------------------------------
      def oas_prendre_objet(pIdMap, pTileX, pTileY)
        return nil if !@ListeObjetsSol[pIdMap]["#{pTileX}-#{pTileY}"]
       
        defItem = @ListeObjetsSol[pIdMap]["#{pTileX}-#{pTileY}"].clone
       
        case defItem[0]
        when 0
          item = $data_items[defItem[1]]
        when 1
          item = $data_weapons[defItem[1]]
        when 2
          item = $data_armors[defItem[1]]
        end
       
        @ListeObjetsSol[pIdMap].delete("#{pTileX}-#{pTileY}")
        @ListeObjetsSol.delete(pIdMap) if @ListeObjetsSol[pIdMap].size == 0
        gain_item(item,defItem[2])
      end
     
      #--------------------------------------------------------------------------
      # * oas_deposer_objet
      #--------------------------------------------------------------------------
      def oas_deposer_objet(pIdMap, pTileX, pTileY, pItem, pQuantity = 1)
       
        @ListeObjetsSol[pIdMap] = {} if !@ListeObjetsSol[pIdMap]
        if @ListeObjetsSol[pIdMap]["#{pTileX}-#{pTileY}"]
          Sound.play_buzzer
          return false
        end
       
        idItem = pItem.id
       
        if pItem.is_a?(RPG::Item)
          typeItem = 0
        elsif pItem.is_a?(RPG::Weapon)
          typeItem = 1
        elsif pItem.is_a?(RPG::Armor)
          typeItem = 2
        end
        gain_item(pItem, -pQuantity)
        @ListeObjetsSol[pIdMap]["#{pTileX}-#{pTileY}"] = [typeItem, idItem, pQuantity]
        Audio.se_play(AOS::Son)
        return true
      end
     
      #--------------------------------------------------------------------------
      # * oas_lister_objet_map
      #--------------------------------------------------------------------------
      def oas_lister_objet_map(pIdMap)
        return @ListeObjetsSol[pIdMap]
      end
 
    end
 
    #==============================================================================
    # ** Spriteset_Map
    #------------------------------------------------------------------------------
    #  This class brings together map screen sprites, tilemaps, etc. It's used
    # within the Scene_Map class.
    #==============================================================================
 
    class Spriteset_Map
     
      #--------------------------------------------------------------------------
      # * Object Initialization
      #--------------------------------------------------------------------------
      alias oas_initialize initialize
      def initialize
        @tabSpriteItem = {}
        oas_initialize
      end
     
      #--------------------------------------------------------------------------
      # * oas_update
      #--------------------------------------------------------------------------
      alias oas_update update
      def update
        oas_update
        oas_update_item
      end
 
      #--------------------------------------------------------------------------
      # * update_item_icon
      #--------------------------------------------------------------------------
      def oas_update_item
        # Pour chaque item posé sur la map
        tabObjetMap = $game_party.oas_lister_objet_map($game_map.map_id)
       
        if tabObjetMap
         
          tabObjetMap.each do | key, value |
            # Vérifier si un sprite existe
            if !@tabSpriteItem[key]
              @tabSpriteItem[key] = Sprite.new(@viewport1)
              @tabSpriteItem[key].bitmap = Cache.system("Iconset")
             
              case tabObjetMap[key][0]
              when 0
                item = $data_items[tabObjetMap[key][1]]
              when 1
                item = $data_weapons[tabObjetMap[key][1]]
              when 2
                item = $data_armors[tabObjetMap[key][1]]
              end
             
              @tabSpriteItem[key].src_rect = Rect.new(item.icon_index % 16 * 24, item.icon_index / 16 * 24, 24, 24)
              @tabSpriteItem[key].x = $game_map.adjust_x(key.split('-')[0].to_i) * 32 + 4
              @tabSpriteItem[key].y = $game_map.adjust_y(key.split('-')[1].to_i) * 32 + 4
            end
          end
        end
       
        @tabSpriteItem.each do | key, value |
          if !tabObjetMap
            oas_dispose_item(key)
            @tabSpriteItem.delete(key)
          elsif !tabObjetMap[key]
            oas_dispose_item(key)
            @tabSpriteItem.delete(key)
          else
            @tabSpriteItem[key].x = $game_map.adjust_x(key.split('-')[0].to_i) * 32 + 4
            @tabSpriteItem[key].y = $game_map.adjust_y(key.split('-')[1].to_i) * 32 + 4
          end
        end
      end
     
      #--------------------------------------------------------------------------
      # * oas_dispose_item
      #--------------------------------------------------------------------------
      def oas_dispose_item(pKey)
        @tabSpriteItem[pKey].bitmap.dispose
        @tabSpriteItem[pKey].dispose
      end
     
    end
 
    #==============================================================================
    # ** Game_Map
    #------------------------------------------------------------------------------
    #  This class handles maps. It includes scrolling and passage determination
    # functions. The instance of this class is referenced by $game_map.
    #==============================================================================
    class Game_Map
      #--------------------------------------------------------------------------
      # * update_interpreter
      #--------------------------------------------------------------------------
      alias oas_update_interpreter update_interpreter
      def update_interpreter
        launchInterpreter = true
        tabItemMap = $game_party.oas_lister_objet_map($game_map.map_id)
       
        if tabItemMap
          if Input.trigger?(:C)
            d = $game_player.direction
            if tabItemMap["#{$game_player.x + (d == 6 ? 1 : d == 4 ? -1 : 0)}-#{$game_player.y + (d == 2 ? 1 : d == 8 ? -1 : 0)}"]
              $game_party.oas_prendre_objet($game_map.map_id, $game_player.x + (d == 6 ? 1 : d == 4 ? -1 : 0), $game_player.y + (d == 2 ? 1 : d == 8 ? -1 : 0))
              launchInterpreter = false
            elsif tabItemMap["#{$game_player.x}-#{$game_player.y}"]
              $game_party.oas_prendre_objet($game_map.map_id, $game_player.x, $game_player.y)
              launchInterpreter = false
            end
          end
        end
       
        oas_update_interpreter if launchInterpreter
      end
    end
 
 
    #==============================================================================
    # ** Window_ItemCategory
    #------------------------------------------------------------------------------
    #  This window is for selecting a category of normal items and equipment
    # on the item screen or shop screen.
    #==============================================================================
    class Window_ItemCategory
     
      #--------------------------------------------------------------------------
      # * Object Initialization
      #--------------------------------------------------------------------------
      alias aos_initialize initialize
      def initialize(pSceneItem = false)
        @nbColMax = 4
        @sceneItem = pSceneItem
        aos_initialize
      end
     
      #--------------------------------------------------------------------------
      # * Get Digit Count
      #--------------------------------------------------------------------------
      def col_max
        return @nbColMax
      end
     
      #--------------------------------------------------------------------------
      # * Create Command List
      #--------------------------------------------------------------------------
      alias aos_make_command_list make_command_list
      def make_command_list
        aos_make_command_list
        if @sceneItem
          add_command(AOS::Depot, :depot)
          @nbColMax = 5
        end
      end
     
    end
 
    #==============================================================================
    # ** Window_ItemList
    #------------------------------------------------------------------------------
    #  This window displays a list of party items on the item screen.
    #==============================================================================
    class Window_ItemList
      attr_reader :category
      #--------------------------------------------------------------------------
      # * Include in Item List?
      #--------------------------------------------------------------------------
      alias aos_include? include?
      def include?(item)
        if @category == :depot
          return !item.nil?
        else
          return aos_include?(item)
        end
      end
     
      #--------------------------------------------------------------------------
      # * Display in Enabled State?
      #--------------------------------------------------------------------------
      alias aos_enable? enable?
      def enable?(item)
        if @category == :depot
          return !item.nil?
        else
          return $game_party.usable?(item)
        end
      end
    end
 
    #==============================================================================
    # ** Scene_Item
    #------------------------------------------------------------------------------
    #  This class performs the item screen processing.
    #==============================================================================
    class Scene_Item
     
      #--------------------------------------------------------------------------
      # * Create Category Window
      #--------------------------------------------------------------------------
      def create_category_window
        @category_window = Window_ItemCategory.new(true)
        @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(:return_scene))
      end
     
      #--------------------------------------------------------------------------
      # * Item [OK]
      #--------------------------------------------------------------------------
      alias aos_determine_item determine_item
      def determine_item
        if @item_window.category == :depot
          if item
            $game_party.oas_deposer_objet($game_map.map_id, $game_player.x, $game_player.y, item)
          end
          activate_item_window
        else
          aos_determine_item
        end
      end
    end



Instructions
Copier le script dans Material, une nouvelle option est disponible dans le menu objet



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