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

606 connectés actuellement

29442835 visiteurs
depuis l'ouverture

8912 visiteurs
aujourd'hui



Barre de séparation

Partenaires

Indiexpo

Akademiya RPG Maker

Blog Alioune Fall

Fairy Tail Constellations

Zarok

ConsoleFun

Tashiroworld

Tous nos partenaires

Devenir
partenaire



forums

Index du forum > Entraide > [RMVXAce] Retenir les bitmap & leur position sur une map


ThrillerProd - posté le 22/08/2015 à 12:40:11 (1121 messages postés)

❤ 0

Domaine concerné: Script
Logiciel utilisé: [RMVXAce]
Bonjour,

J'ai modifié récemment le script de particules "Arevulopapo's Particle Engine" pour mon usage personnel, j'ai ajouté plein de petites fonctionnalités. Bref. Dans tout ça, il y a une chose qui n'a pas été pensé à l'origine et je n'ai pas assez de compétence en RGSS pour implémenter.
Les particules ne disparaissent pas d'une map à l'autre, elle reste. Il n'y aucun dispose ou clean. Alors c'est plutôt cool parceque au moins quand on revient dans la map, les particules sont toujours là mais si on va sur une autre map, les particules de la maps précédentes persistes.

Bref, du coup il me faudrait la possibilité, soit de les effacé complètement (solution bof) soit de sauvegarder leur position & statut sur la map, de les dégagé si on change de map et de les restauré si on revient sur la map concerné.

J'y connais rien en sauvegarde, mais ça doit sûrement être possible !

Merci à tout ceux qui essayeront :)

Tchuss !

Actinium Studio : Youtube / (Rm2k3)(A-Rpg) Acsiosa


Terzarok - posté le 22/08/2015 à 15:05:48 (345 messages postés)

❤ 0

Je n'ai aucune compétence en RGSS et en script, mais est-ce que ce serait possible si tu ajoutes un genre de "sélection de map" pour le chargement des particules en fonction de l'ID de la map ?
Comme ça (dans la théorie), ça ferait un enregistrement en fonction de l'ID, et donc il faudra demander à recharger les particules par rapport à l'ID de la carte sur laquelle on irait.

Mais comme j'ai dit, je n'y connais rien en RGSS donc je ne peux pas t'aider plus que ça (si on peut considérer ça comme de l'aide x)).

Il y a des gens qui passeraient des heures à expliquer qu'ils sont débordés. Moi sur Deviantart


arttroy - posté le 22/08/2015 à 17:13:29 (2394 messages postés)

❤ 0

Just working

Tu pourrais donner un lien du script s'il te plaît ?

Anti-inconstructivité / Pétition pour que le mot making soit inscrit dans le dictionnaire ?


Nukidoudi - posté le 22/08/2015 à 18:22:44 (733 messages postés) -

❤ 0

yo

Un bitmap n'a pas de notion de position...

https://xvw.lol


ThrillerProd - posté le 22/08/2015 à 18:31:10 (1121 messages postés)

❤ 0

@arttroy

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
=begin
 
 Particle Engine
 by arevulopapo
 port by PK8
 Created: 11/15/2007
 Modified: 5/9/2012 - 5/12/2012
 Ported: 5/10/2012 (VX), 5/12/2012 (Ace)
 ──────────────────────────────────────────────────────────────────────────────
 ■ Introduction
   This script lets you create particle effects in your game. Particles are
   integrated into "Spriteset_Map", so the can be displayed over/under an event.
 ──────────────────────────────────────────────────────────────────────────────
 ■ Methods Aliased
   Spriteset_Map.initialize
   Spriteset_Map.update
   Spriteset_Map.dispose
 ──────────────────────────────────────────────────────────────────────────────
 ■ Thanks
   mobychan for helping out and pointing me to Archeia's RPG Maker VX's Ace
   tips and tricks page, which talked about how events set to parallel process
   need to be put in a loop in order for them to keep animating while events
   are being interacted with.
 ──────────────────────────────────────────────────────────────────────────────
 ■ Usage
   Effects are called from "Script" command like this:
     particle_effect(EVENT_ID, EFFECT, LOCK, X, Y)
       EVENT_ID  - ID of an event the particles will flow from.
                    -7/"follower3" for Follower 3
                    -6/"follower2" for Follower 2
                    -5/"follower1" for Follower 1
                    -4/"airship" for Airship.
                    -3/"ship" for Ship.
                    -2/"boat" for Boat.
                    -1/"player" for Player.
                     1 and above for Events.
                     * Use @event_id for "This Event"
                     * Use an array to specify multiple IDs.
       EFFECT    - name of the effect to call. Names are defined in the
                   Spriteset_Map. (Find: case effect)
                     * Use an array to specify multiple effects.
       LOCK      - alignment of the particles. 'event' to align particles
                   with event's map position, 'screen' to align with event's
                   screen position.
                   For static events, like fireplaces, teleports, etc.
                    'event' alignment is recommended.
                   For moving events use 'screen' mode.
       X, Y      - number of pixels that will be added to the event's position
                   to determine the starting point of particles.
                   That's your most powerful weapon. See the demo for examples.
                    * Use an array to specify multiple X/Y coordinates.
 ──────────────────────────────────────────────────────────────────────────────
 ■ Port Modifications
   o Added shortcuts within the script calls. You can now use arrays in
     EVENT_ID, EFFECT, X, and Y to set more events, effects, and coordinates.
   o Users can now set particles onto vehicles by setting EVENT_ID to "boat",
     "ship", and "airship".
                   
=end
 
#==============================================================================
# ** Spriteset_Map
#------------------------------------------------------------------------------
#  This class brings together map screen sprites, tilemaps, etc. It's used
# within the Scene_Map class.
#==============================================================================
 
class Spriteset_Map
  #--------------------------------------------------------------------------
  # * Add Effect
  #--------------------------------------------------------------------------
  def add_effect(event=1, effect='', lock='event', x=0, y=0)
    # Case: Event
    event = event.downcase.gsub(/\s+/, "") if event.is_a?(String)
    case event
    when -20, "follower16"; object = $game_player.followers[15]
    when -19, "follower15"; object = $game_player.followers[14]
    when -18, "follower14"; object = $game_player.followers[13]
    when -17, "follower13"; object = $game_player.followers[12]
    when -16, "follower12"; object = $game_player.followers[11]
    when -15, "follower11"; object = $game_player.followers[10]
    when -14, "follower10"; object = $game_player.followers[9]
    when -13, "follower9";  object = $game_player.followers[8]
    when -12, "follower8";  object = $game_player.followers[7]
    when -11, "follower7";  object = $game_player.followers[6]
    when -10, "follower6";  object = $game_player.followers[5]
    when -9,  "follower5";  object = $game_player.followers[4]
    when -8,  "follower4";  object = $game_player.followers[3]
    when -7,  "follower3";  object = $game_player.followers[2]
    when -6,  "follower2";  object = $game_player.followers[1]
    when -5,  "follower1";  object = $game_player.followers[0]
    when -4,  "airship";    object = $game_map.airship
    when -3,  "ship";       object = $game_map.ship
    when -2,  "boat";       object = $game_map.boat
    when -1,  "player";     object = $game_player
    else
      if event.is_a?(Integer); object = $game_map.events[event]
      else; object = event
      end
    end
    object = nil if object.is_a?(Game_Follower) and $game_player.vehicle != nil
    
    #------------------------------------------------------------------------
    # Configuration
    #------------------------------------------------------------------------
    case effect
    # (sprite, acceleration[x,y], gravity[x,y], opacity[base,loss], rotation[initial, speed], size[initial, speed], blending, behind? )
    when 'blood_decal_little'
      random = rand(2)
      sprite = ''
      case random
      when 0; sprite='blood_decal1'
      when 1; sprite='blood_decal2'
      when 2; sprite='blood_decal3'
      end
      add_particles(object, x, y-12, sprite, [0,0], [0,0], [255, rand(10)/10000], [rand(360),0], [1,0], lock, 0, true)
    when 'blood_burst_little'
      sprite = 'anim_blood1'
      add_particles(object, x, y-24, sprite, [0.01,0.01], [0,-0.01], [255, (rand(5)/10)+8], [rand(360),1], [0,0.05], lock, 0, false)
      add_particles(object, x, y-24, sprite, [-0.01,-0.01], [0,-0.02], [255, (rand(5)/10)+7], [rand(360),1], [0,0.04], lock, 0, false)
    when 'bullet_impact'
      sprite = 'smoke'
      add_particles(object, x, y-12, sprite, [0,0], [0,0], [255, (rand(5)/10)+5], [rand(360),1], [0,0.03], lock, 0, false)
      
    end
  end
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_reader :particles
  #--------------------------------------------------------------------------
  # * Alias Listings
  #--------------------------------------------------------------------------
  alias :particle_ssm_init :initialize
  alias :particle_ssm_update :update
  alias :particle_ssm_dispose :dispose
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    @particles = []
    particle_ssm_init
  end
  #--------------------------------------------------------------------------
  # * Dispose
  #--------------------------------------------------------------------------
  def dispose
    @particles.each{ |d| d.dispose }
    particle_ssm_dispose
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    @particles.each_with_index{ |p,i|
      @particles[i].update
      if p.opacity == 0
        p.dispose
        @particles.delete_at(i)
      end
      }
    particle_ssm_update
  end
  #--------------------------------------------------------------------------
  # * Add Particles
  #--------------------------------------------------------------------------
  def add_particles(object = $game_player, x = 0, y = 0, sprite = '',
    acc = [0,0], grav = [0,0], opacity = [255,0], rotation = [0,0], size = [0,0], lock = 'event', blend = 0, behind = false)
    if !object.is_a?(NilClass)
      if lock == 'event'
        @particles << Particle_Event.new(@viewport1, object, x, y, sprite, acc,
          grav, opacity, rotation, size, blend, behind)
      elsif lock == 'screen'
        @particles << Particle_Screen.new(@viewport1, object, x, y, sprite, acc,
          grav, opacity, rotation, size, blend, behind)
      end
    end
  end
end
 
#===============================================================================​
# ** Particle_Screen
#===============================================================================​
 
class Particle_Screen < Sprite
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(viewport = Viewport.new(0,0,800,600), object = $game_player,
    x = 0, y = 0, sprite = '', acc = [0,0], grav = [0,0], opacity = [255,3],
    rotation = [0,0], size = [0,0], blend = 0, behind = false)
    if !object.is_a?(NilClass)
      super(viewport)
      self.bitmap = Cache.picture('Particles/' + sprite)
      self.x = object.screen_x + x
      self.y = object.screen_y - 16 + y
      self.ox = self.oy = self.bitmap.width/2
      self.blend_type = blend
      self.opacity = opacity[0]
      self.angle = rotation[0]
      self.zoom_x = self.zoom_y = size[0] 
      @object = object
      @origin = [self.x, self.y]
      @acceleration = acc
      @gravity = grav
      @coords = [0.00, 0.00]
      @opacity = opacity[1]
      @rotation = rotation[1]
      @size = size
      @behind = behind
      update
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    if !@object.is_a?(NilClass)
      @acceleration[0] -= @gravity[0] if @gravity[0] != 0
      @acceleration[1] -= @gravity[1] if @gravity[1] != 0
      @coords[0] += @acceleration[0]
      @coords[1] += @acceleration[1]
      self.opacity -= @opacity
      self.angle += @rotation
      self.x = @origin[0] + @coords[0]
      self.y = @origin[1] + @coords[1]
      self.zoom_x += @size[1] 
      self.zoom_y += @size[1]
      if @behind == true
        self.z = 0
      else
        if self.y > (@object.screen_y - 16)
          self.z = @object.screen_z + 32
        else
          if @object == $game_map.airship; self.z = @object.screen_z + 120
          elsif @object.is_a?(Game_Follower); self.z = @object.screen_z + 1
          else
            self.z = @object.screen_z - 32
          end
        end
      end
    end
  end
end
 
#===============================================================================​
# ** Particle_Event
#===============================================================================​
 
class Particle_Event < Sprite
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(viewport = Viewport.new(0,0,800,600), object = $game_player,
    x = 0, y = 0, sprite = '', acc = [0,0], grav = [0,0], opacity = [255,3],
    rotation = [0,0], size = [0,0], blend = 0, behind = false)
    if !object.is_a?(NilClass)
      super(viewport)
      self.bitmap = Cache.picture('Particles/' + sprite)
      self.x = object.x*32 + 16 - $game_map.display_x * 32 + x
      self.y = object.y*32 + 32 - $game_map.display_y * 32 + y
      self.ox = self.oy = self.bitmap.width/2
      self.blend_type = blend
      self.opacity = opacity[0]
      self.angle = rotation[0]
      self.zoom_x = self.zoom_y = size[0]
      @object = object
      @origin = [object.x*32 + x + 16, object.y*32 + y + 32]
      @acceleration = acc
      @gravity = grav
      @coords = [0.00, 0.00]
      @opacity = opacity[1]
      @rotation = rotation[1]
      @size = size
      @behind = behind
      update
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    if !@object.is_a?(NilClass)
      @acceleration[0] -= @gravity[0] if @gravity[0] != 0
      @acceleration[1] -= @gravity[1] if @gravity[1] != 0
      @coords[0] += @acceleration[0]
      @coords[1] += @acceleration[1]
      self.opacity -= @opacity
      self.angle += @rotation
      self.x = @origin[0] + @coords[0] - $game_map.display_x * 32
      self.y = @origin[1] + @coords[1] - $game_map.display_y * 32 - 16
      self.zoom_x += @size[1] 
      self.zoom_y += @size[1]
      if @behind == true
        self.z = 0
      else
        if self.y > (@object.screen_y - 16)
          self.z = @object.screen_z + 40
        else
          self.z = @object.screen_z - 40
        end
      end
    end
  end
end
 
#==============================================================================
# ** Scene_Map
#------------------------------------------------------------------------------
#  This class performs the map screen processing.
#==============================================================================
 
class Scene_Map < Scene_Base
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_reader :spriteset
end
 
#==============================================================================
# ** Game_Interpreter
#------------------------------------------------------------------------------
#  An interpreter for executing event commands. This class is used within the
# Game_Map, Game_Troop, and Game_Event classes.
#==============================================================================
 
class Game_Interpreter
  #--------------------------------------------------------------------------
  # * Add effect
  #--------------------------------------------------------------------------
  def particle_effect(event=@event_id, effect='', lock='event', x=0, y=0)
    event, effect, x, y = Array(event), Array(effect), Array(x), Array(y)
    event.each{ |event_i| effect.each{ |effect_i| x.each{ |x_i| y.each{ |y_i|
      SceneManager.scene.spriteset.add_effect(event_i, effect_i, lock, x_i, y_i)
    } } } }
  end
end



@Nuki

Comment ça ? parceque ya clairement une position x & y.
EDIT : ah, c'est parceque c'est un sprite, pas bitmap désolé ^^

Actinium Studio : Youtube / (Rm2k3)(A-Rpg) Acsiosa


arttroy - posté le 22/08/2015 à 20:27:13 (2394 messages postés)

❤ 0

Just working

Ben désolé mais moi je vois pas... En même temps il y a beaucoup de tableaux et c'est pas un truc que je maîtrise du tout en ruby...

Si je comprends bien le script, ça affiche les particules par rapport au screen et non par rapport à la map en elle même (enfin en tout cas il n'y a rien de défini ou de redéfini pour ça).

Anti-inconstructivité / Pétition pour que le mot making soit inscrit dans le dictionnaire ?


ThrillerProd - posté le 22/08/2015 à 21:16:09 (1121 messages postés)

❤ 0

Il affiche les particules sur un evènement (chose qu'il faut que je modifie d'ailleurs, j'ai besoin de pouvoir en afficher où bon me semble)
Et il y a 2 possibilité soit, c'est fixé à la map soit ça bouge avec l'écran.

La variable 'object' que je ne comprend pas vraiment encore se base sur la $game_map pour récuperer l'event choisi.

Actinium Studio : Youtube / (Rm2k3)(A-Rpg) Acsiosa

Index du forum > Entraide > [RMVXAce] Retenir les bitmap & leur position sur une map

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