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

622 connectés actuellement

29434574 visiteurs
depuis l'ouverture

8950 visiteurs
aujourd'hui



Barre de séparation

Partenaires

Indiexpo

Akademiya RPG Maker

Blog Alioune Fall

Fairy Tail Constellations

Lumen

Zarok

Le Comptoir Du clickeur

RPG Fusion

Tous nos partenaires

Devenir
partenaire



forums

Index du forum > Entraide > [RMXP] Superposition characters et isometrie


esziaprez game - posté le 03/07/2013 à 11:08:06 (441 messages postés)

❤ 0

Je suis dans le game !

Domaine concerné: Mapping avancé
Logiciel utilisé: RMXP
Bon j'ai posté ça dans les questions connes sur RM mais personne ne me répond donc je fait un topic. Et puis je sais pas bien si on doit utiliser un script ou une programmation event ou un symbole dans le nom du character (comme dans VX) ?...




Comment peut on faire pour supprimer la superposition sur des characters sur XP ? Peut-on faire qu'un événement soit "en-dessous de tout".


Plus en détails :

Voilà j'ai un petit soucis. Pour ceux qui connaissent mes projets, mon penchant pour l'isométrique n'est plus un secret.

J'utilise donc un script qui prend en charge les events sur une carte normale et l'affichage sur une autre carte en 2D iso.

J'ai réussit à créer des portes isométriques animées en characters que je place sur la map d'event et j'ai adapté pour qu'elles s'affichent à la bonne hauteur sur la Map isométrique.

Seulement lorsque mon perso passe à coté, le haut de la porte s'affiche au dessus du héros.

Une petite image explicative :

image



Cette question a une importance capitale pour mon jeu SVP :help. Il existe une solution pour éviter la superposition mais cela me demanderai d'occuper systématiquement la case immédiatement haut dessus par un autre petit event (ainsi cela obligerait le héros à contourner la zone ou la superposition est mauvaise). Mais ça encombre les maps où il y à pas trop de place.

EDIT> Je me demandais aussi si il existe des scripts pour placer des images entre la couche de panorama et la couche primaire mais ça n'a rien à voir et c'est pas important.

Merci a ceux qui voudront bien m'aider.

Projet en cours: INRAL / En pause :NEOTORI /// Pause : L'ANKH DE KINBRA /// Pause : GRASS SHOPPER  /// GALERIE


Estheone - posté le 03/07/2013 à 11:55:58 (312 messages postés)

❤ 0

Ajoute cette ligne dans l'initialize de Game_Event après @through = true :

Portion de code : Tout sélectionner

1
@always_on_bottom = @event.name.include?("/Z")



Et ajoute cette fonction dans Game_Event :

Portion de code : Tout sélectionner

1
2
3
4
5
6
7
8
9
10
11
12
  def screen_z(height = 0)
    if @always_on_top
      return 999
    end
    return 0 if @always_on_bottom
    z = (@real_y - $game_map.display_y + 3) / 4 + 32
    if @tile_id > 0
      return z + $game_map.priorities[@tile_id] * 32
    else
      return z + ((height > 32) ? 31 : 0)
    end
  end



Pour finir tu rajoutes un /Z dans le nom de tes événements qui doivent être "en-dessous de tout".
Je suis pas sûr à 100% vu que j'ai pas testé mais un truc dans le genre devrait régler le problème.

Wandering Souls : Jeu complet / Topic sur Oniro


esziaprez game - posté le 03/07/2013 à 14:04:06 (441 messages postés)

❤ 0

Je suis dans le game !

Maintenant tout les events sont en dessous de tout je vais chercher mais le script c'est pas ma spécialité.

Projet en cours: INRAL / En pause :NEOTORI /// Pause : L'ANKH DE KINBRA /// Pause : GRASS SHOPPER  /// GALERIE


Estheone - posté le 03/07/2013 à 14:52:39 (312 messages postés)

❤ 0

Je viens de tester ce que je t'ai proposé dans un projet vide et ça fonctionne.

J'ai pas la moindre idée de pourquoi ça ne marche pas correctement sur ton jeu par contre.

Wandering Souls : Jeu complet / Topic sur Oniro


esziaprez game - posté le 03/07/2013 à 15:49:27 (441 messages postés)

❤ 0

Je suis dans le game !

Je sais c'est lié au script de déplacement iso peut être ?

EDIT 1> Pour l'instant je vais laisser cette histoire en plan ça m’empêche d'avancer. En attendant je vais utiliser ma solution provisoire.

PS j'utilise le GTBS 1.4 un peu (mais rien qui concerne mon soucis) modifié.

Projet en cours: INRAL / En pause :NEOTORI /// Pause : L'ANKH DE KINBRA /// Pause : GRASS SHOPPER  /// GALERIE


Mack - posté le 03/07/2013 à 15:54:00 (2290 messages postés) - staff

❤ 0

Bah poste le ? xD

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


esziaprez game - posté le 03/07/2013 à 15:58:42 (441 messages postés)

❤ 0

Je suis dans le game !

OUh il est archi long parce qu'il est compris dans le GTBS !

après je crois que c'est cette partie qui est concernée.

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
#-------------------------------------------------------------------------------
# ● Script 2D_ISO, created by MGCaladtogel tranlated by GubiD
#-------------------------------------------------------------------------------
#==============================================================================
# New Variables: 
#  $game_map indicates the map of data (where you will place events)
#  $game_map_iso indicates the map into 2d-isometric view, although containing no events.
#==============================================================================
 
#==============================================================================
# ■ Game_Map
#==============================================================================
class Game_Map
  #--------------------------------------------------------------------------
  # ● The scrolling must be carried out according to dimensions of chart
  #     into isometric
  #--------------------------------------------------------------------------
  def scroll_down(distance)
    if $game_map.iso?
      if $game_map_iso == nil
        map_infos = $data_map_infos[$game_map.map_id]
        $game_map_iso = Game_Map.new #creates new iso map
        $game_map_iso.setup(map_infos.parent_id) #draws map
      end
      corr = (($game_map.height + $game_map.width)%2 == 0 ? 0 : 4*16)
      @display_y = [@display_y + distance, 128*$game_map_iso.height - 4*480 - corr].min 
    else
      @display_y = [@display_y + distance, (self.height - 15) * 128].min
    end
  end
  #--------------------------------------------------------------------------
  def scroll_right(distance)
    if $game_map.iso?
      if $game_map_iso == nil
        map_infos = $data_map_infos[$game_map.map_id]
        $game_map_iso = Game_Map.new #creates new iso map
        $game_map_iso.setup(map_infos.parent_id) #draws map
      end
      @display_x = [@display_x + distance, 128*$game_map_iso.width - 4 * 640].min 
    else
      @display_x = [@display_x + distance, (self.width - 20) * 128].min
    end
  end
end
 
#==============================================================================
# ■ Game_Character
#==============================================================================
class Game_Character
  #--------------------------------------------------------------------------
  # ● Update the position of the characters to the screen according to x,y in isometric 
  #--------------------------------------------------------------------------
  def screen_x
    if $game_map.iso?
      return  (@real_x - @real_y)/4 + 32*$game_map.height - 0 - $game_map.display_x/4
    else
      return (@real_x - $game_map.display_x + 3) / 4 + 16
    end
  end
  #--------------------------------------------------------------------------
  def screen_y
    if $game_map.iso?
      y = (@real_y + @real_x) / 8 + 24 - $game_map.display_y/4
      if @jump_count >= @jump_peak
        n = @jump_count - @jump_peak
      else
        n = @jump_peak - @jump_count
      end
      return y - (@jump_peak * @jump_peak - n * n) / 2
    else
      y = (@real_y - $game_map.display_y + 3) / 4 + 32
      # Make y-coordinate smaller via jump count
      if @jump_count >= @jump_peak
        n = @jump_count - @jump_peak
      else
        n = @jump_peak - @jump_count
      end
      return y - (@jump_peak * @jump_peak - n * n) / 2
    end
  end
  #--------------------------------------------------------------------------
  def screen_z(height = 0)
    if $game_map.iso?
      
      if @always_on_top
        return 999
      end
      z = screen_y
      if @tile_id > 0
        return z + $game_map_iso.priorities[@tile_id] * 32
      else
        return z + ((height > 32) ? 31 : 0)
      end
    else
      if @always_on_top
        # 999, unconditional
        return 999
      end
      # Get screen coordinates from real coordinates and map display position
      z = (@real_y - $game_map.display_y + 3) / 4 + 32
      # If tile
      if @tile_id > 0
        # Add tile priority * 32
        return z + $game_map.priorities[@tile_id] * 32
      # If character
      else
        # If height exceeds 32, then add 31
        return z + ((height > 32) ? 31 : 0)
      end
    end
  end
end
 
#==============================================================================
# ■ Game_Player
#==============================================================================
class Game_Player < Game_Character
  #--------------------------------------------------------------------------
  # ● Sets up use for directions using 1,3,7,9 coordinated to up/down/left/right
  #     so that the scrolling occurs cleaner.
  #--------------------------------------------------------------------------
  alias gmpl_iso_update update
  def update
    if $game_map.iso?
      last_moving = moving?
      unless moving? or $game_system.map_interpreter.running? or
             @move_route_forcing or $game_temp.message_window_showing
        case Input.dir8
        when 1..2
          move_down
        when 3
          move_right
        when 4
          move_left
        when 7
          move_left
        when 6
          move_right
        when 8..9
          move_up
        end
      end
      last_real_x = @real_x
      last_real_y = @real_y
      super
      disp_y = screen_y + $game_map.display_y/4
      disp_x = screen_x + $game_map.display_x/4
      if CENTER_Y - (4*disp_y - $game_map.display_y) < 0
        $game_map.scroll_down(4*disp_y - $game_map.display_y - CENTER_Y)
      end
      if CENTER_X - (4*disp_x - $game_map.display_x) > 0
        $game_map.scroll_left(CENTER_X - (4*disp_x - $game_map.display_x))
      end
      if CENTER_X - (4*disp_x - $game_map.display_x) < 0
        $game_map.scroll_right(4*disp_x - $game_map.display_x - CENTER_X)
      end
      if CENTER_Y - (4*disp_y - $game_map.display_y) > 0
        $game_map.scroll_up(CENTER_Y - (4*disp_y - $game_map.display_y))
      end
      unless moving?
        if last_moving
          result = check_event_trigger_here([1,2])
          if result == false
            unless $DEBUG and Input.press?(Input::CTRL)
              if @encounter_count > 0
                @encounter_count -= 1
              end
            end
          end
        end
        if Input.trigger?(Input::C)
          check_event_trigger_here([0])
          check_event_trigger_there([0,1,2])
        end
      end
    else
      gmpl_iso_update
    end
  end
  
  alias gmpl_iso_center center
  def center(x,y)
    if $game_map.iso?
      disp_y = screen_y + $game_map.display_y/4
      disp_x = screen_x + $game_map.display_x/4
      if CENTER_Y - (4*disp_y - $game_map.display_y) < 0
        $game_map.scroll_down(4*disp_y - $game_map.display_y - CENTER_Y)
      end
      if CENTER_X - (4*disp_x - $game_map.display_x) > 0
        $game_map.scroll_left(CENTER_X - (4*disp_x - $game_map.display_x))
      end
      if CENTER_X - (4*disp_x - $game_map.display_x) < 0
        $game_map.scroll_right(4*disp_x - $game_map.display_x - CENTER_X)
      end
      if CENTER_Y - (4*disp_y - $game_map.display_y) > 0
        $game_map.scroll_up(CENTER_Y - (4*disp_y - $game_map.display_y))
      end
    else
      gmpl_iso_center(x,y)
    end
  end
end
 
#==============================================================================
# ■ Scene_Title
#==============================================================================
class Scene_Title
  alias main_orig main
  #--------------------------------------------------------------------------
  # ● Loads MapInfos so that Iso map id's can be loaded according to the current map.
  #--------------------------------------------------------------------------
  def main
    $data_map_infos        = load_data("Data/MapInfos.rxdata")
    main_orig
  end
end
 
#==============================================================================
# ■ Spriteset_Map
#==============================================================================
class Spriteset_Map
  #--------------------------------------------------------------------------
  # ● Generates the map, then lays the iso view map (parent map) over it, but uses
  #      $game_map for data
  #--------------------------------------------------------------------------
  def initialize
    @viewport1 = Viewport.new(0, 0, 640, 480)
    @viewport2 = Viewport.new(0, 0, 640, 480)
    @viewport3 = Viewport.new(0, 0, 640, 480)
    @viewport2.z = 200
    @viewport3.z = 5000
    @tilemap = Tilemap.new(@viewport1) #creates standard 2d map
    if $game_map.iso?
      map_infos = $data_map_infos[$game_map.map_id]
      $game_map_iso = Game_Map.new #creates new iso map
      $game_map_iso.setup(map_infos.parent_id) #draws map
      @tilemap.tileset = RPG::Cache.tileset($game_map_iso.tileset_name) #sets correct tileset
      for i in 0..6 #draws autotiles
        autotile_name = $game_map.autotile_names[i]
        @tilemap.autotiles[i] = RPG::Cache.autotile(autotile_name)
      end
      @tilemap.map_data = $game_map_iso.data #reads terrain tags and else
      @tilemap.priorities = $game_map_iso.priorities #sets iso map priorities
    else
      @tilemap.tileset = RPG::Cache.tileset($game_map.tileset_name)
      for i in 0..6
        autotile_name = $game_map.autotile_names[i]
        @tilemap.autotiles[i] = RPG::Cache.autotile(autotile_name)
      end
      @tilemap.map_data = $game_map.data
      @tilemap.priorities = $game_map.priorities
    end
    @panorama = Plane.new(@viewport1) #create pan plane
    @panorama.z = -1000
    @fog = Plane.new(@viewport1)  #creates fog plane
    @fog.z = 3000
    @character_sprites = []#initializes character update thread
    for i in $game_map.events.keys.sort #add events to map from $game_map, NOT ISO
      sprite = Sprite_Character.new(@viewport1, $game_map.events[i])
      @character_sprites.push(sprite)
    end
    @character_sprites.push(Sprite_Character.new(@viewport1, $game_player)) #add player to map
    @weather = RPG::Weather.new(@viewport1) #draw weather
    @picture_sprites = [] 
    for i in 1..50 #draw setup pictures
      @picture_sprites.push(Sprite_Picture.new(@viewport2,
        $game_screen.pictures[i]))
    end
    @timer_sprite = Sprite_Timer.new #start timer
    $game_player.center($game_player.x, $game_player.y)
    update
  end
  #--------------------------------------------------------------------------
  # ● Caution: Updated the panorama to draw in the same fashion and update according to 
  #                iso view settings
  #     Get the original displacement settings and expand them:
  #       @panorama.ox = $game_map.display_x / 4
  #       @panorama.oy = $game_map.display_y / 4
  #     to :
  #       @panorama.ox = $game_map.display_y / 8
  #       @panorama.oy = $game_map.display_y / 8
  #--------------------------------------------------------------------------
  alias upd_iso_map update
  def update(map_id = $game_map.map_id)
    #if pan settings changed.. update pan info
    if $game_map.iso?
      if @panorama_name != $game_map_iso.panorama_name or
         @panorama_hue != $game_map_iso.panorama_hue
        @panorama_name = $game_map_iso.panorama_name
        @panorama_hue = $game_map_iso.panorama_hue
        if @panorama.bitmap != nil
          @panorama.bitmap.dispose
          @panorama.bitmap = nil
        end
        if @panorama_name != ""
          @panorama.bitmap = RPG::Cache.panorama(@panorama_name, @panorama_hue)
        end
        Graphics.frame_reset #reset frame count to 0
      end
      #if fog settings changed.. update fog info
      if @fog_name != $game_map_iso.fog_name or @fog_hue != $game_map_iso.fog_hue
        @fog_name = $game_map_iso.fog_name
        @fog_hue = $game_map_iso.fog_hue
        if @fog.bitmap != nil
          @fog.bitmap.dispose
          @fog.bitmap = nil
        end
        if @fog_name != ""
          @fog.bitmap = RPG::Cache.fog(@fog_name, @fog_hue)
        end
        Graphics.frame_reset #reset frame count to 0
      end
      #update tilemap offset
      @tilemap.ox = $game_map.display_x / 4
      @tilemap.oy = $game_map.display_y / 4
      #redraw tilemap to current offset
      @tilemap.update
      #update pan and fog offsets.
      @panorama.ox = $game_map.display_x / 4
      @panorama.oy = $game_map.display_y / 4
      @fog.zoom_x = $game_map_iso.fog_zoom / 100.0
      @fog.zoom_y = $game_map_iso.fog_zoom / 100.0
      @fog.opacity = $game_map_iso.fog_opacity
      @fog.blend_type = $game_map_iso.fog_blend_type
      @fog.ox = $game_map.display_x / 4 + $game_map.fog_ox
      @fog.oy = $game_map.display_y / 4 + $game_map.fog_oy
      @fog.tone = $game_map.fog_tone
      #update event and character sprites
      for sprite in @character_sprites
        sprite.update
      end
      #update weather
      @weather.type = $game_screen.weather_type
      @weather.max = $game_screen.weather_max
      @weather.ox = $game_map.display_x / 4
      @weather.oy = $game_map.display_y / 4
      @weather.update
      #update pictures
      for sprite in @picture_sprites
        sprite.update
      end
      @timer_sprite.update
      #update screen tone/shake/flash
      @viewport1.tone = $game_screen.tone
      @viewport1.ox = $game_screen.shake
      @viewport3.color = $game_screen.flash_color
      @viewport1.update
      @viewport3.update
    else
      upd_iso_map
    end
  end
end
 
#==============================================================================
# ■ Interpreter
#==============================================================================
class Interpreter
  #--------------------------------------------------------------------------
  # ● Change Map Settings
  #--------------------------------------------------------------------------
  def command_204
    case @parameters[0]
    when 0 #change panorama
      if $game_map.iso?
        $game_map_iso.panorama_name = @parameters[1]
        $game_map_iso.panorama_hue = @parameters[2]
      else
        $game_map.panorama_name = @parameters[1]
        $game_map.panorama_hue = @parameters[2]
      end
    when 1 #change fog settings
      if $game_map.iso?
        $game_map_iso.fog_name = @parameters[1]
        $game_map_iso.fog_hue = @parameters[2]
        $game_map_iso.fog_opacity = @parameters[3]
        $game_map_iso.fog_blend_type = @parameters[4]
        $game_map_iso.fog_zoom = @parameters[5]
        $game_map_iso.fog_sx = @parameters[6]
        $game_map_iso.fog_sy = @parameters[7]
      else
        $game_map.fog_name = @parameters[1]
        $game_map.fog_hue = @parameters[2]
        $game_map.fog_opacity = @parameters[3]
        $game_map.fog_blend_type = @parameters[4]
        $game_map.fog_zoom = @parameters[5]
        $game_map.fog_sx = @parameters[6]
        $game_map.fog_sy = @parameters[7]
      end
    when 2 #change battleback
      if $game_map.iso?
        $game_map_iso.battleback_name = @parameters[1]
        $game_temp_iso.battleback_name = @parameters[1]
      else
        $game_map.battleback_name = @parameters[1]
        $game_temp.battleback_name = @parameters[1]
      end
    end
    return true
  end
  #--------------------------------------------------------------------------
  # ● Change fog tone
  #--------------------------------------------------------------------------
  def command_205
    if $game_map.iso?
      $game_map_iso.start_fog_tone_change(@parameters[0], @parameters[1] * 2)
    else
      $game_map.start_fog_tone_change(@parameters[0], @parameters[1] * 2)
    end
    return true
  end
  #--------------------------------------------------------------------------
  # ● Change fog opacity
  #--------------------------------------------------------------------------
  def command_206
    if $game_map.iso?
      $game_map_iso.start_fog_opacity_change(@parameters[0], @parameters[1] * 2)
    else
      $game_map.start_fog_opacity_change(@parameters[0], @parameters[1] * 2)
    end
    return true
  end
end



Projet en cours: INRAL / En pause :NEOTORI /// Pause : L'ANKH DE KINBRA /// Pause : GRASS SHOPPER  /// GALERIE


Mack - posté le 03/07/2013 à 16:01:59 (2290 messages postés) - staff

❤ 0

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
class Game_Character
def screen_z(height = 0)
    if $game_map.iso?
      if @always_on_bottom
        return 0
      end
      if @always_on_top
        return 999
      end
      z = screen_y
      if @tile_id > 0
        return z + $game_map_iso.priorities[@tile_id] * 32
      else
        return z + ((height > 32) ? 31 : 0)
      end
    else
      if @always_on_top
        # 999, unconditional
        return 999
      end
      # Get screen coordinates from real coordinates and map display position
      z = (@real_y - $game_map.display_y + 3) / 4 + 32
      # If tile
      if @tile_id > 0
        # Add tile priority * 32
        return z + $game_map.priorities[@tile_id] * 32
      # If character
      else
        # If height exceeds 32, then add 31
        return z + ((height > 32) ? 31 : 0)
      end
    end
  end
end
end



A vu de nez ça devrait aller.

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


esziaprez game - posté le 03/07/2013 à 16:37:23 (441 messages postés)

❤ 0

Je suis dans le game !

Je le met où ?

Projet en cours: INRAL / En pause :NEOTORI /// Pause : L'ANKH DE KINBRA /// Pause : GRASS SHOPPER  /// GALERIE


Mack - posté le 03/07/2013 à 16:45:27 (2290 messages postés) - staff

❤ 0

Bah, dans un nouveau script entre main et ton script d'iso.

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


esziaprez game - posté le 03/07/2013 à 17:27:58 (441 messages postés)

❤ 0

Je suis dans le game !

Ca ne fonctionne pas :leure3

Il y a peut etre un probleme dans ce script aussi je suppose ?

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
#==============================================================================
# o Sprite_Character add-on : Fix Pic
#------------------------------------------------------------------------------
# Script curtisy of Siegfried use base from MGCaladtogel's iso script
#------------------------------------------------------------------------------
# Updates passability to check height changes
#------------------------------------------------------------------------------
# Rules for the map passabilities :
# -Apply the numbered tileset
# -Each number is equivalent to a height (tileset infinite, infinite height)
# -For the nonpassable tiles, put an inaccessible height.
#==============================================================================
# o ISO_LVL2_Config
#============================================================================== 
module ISO_LVL2_Config
  # Passable height from one tile to another
  DIFF_N = 2
  # Passable height from one tile to another: stairs, height change
  DIFF_L = 2
  # Falling speed
  FALLING_SPEED = 0.5
end
 
#==============================================================================
# o Game_Map
#==============================================================================
class Game_Map
#--------------------------------------------------------------------------
# o Attributes
#--------------------------------------------------------------------------
  attr_accessor   :map
  #is iso map?
  def iso?
    return false if !GTBS::ISO_MAPS
    if $data_map_infos[@map_id].name.include?("ISO")
      return true
    else
      return false
    end
  end
end
 
#==============================================================================
# o Game_Character
#==============================================================================
class Game_Character
#--------------------------------------------------------------------------
# o Attributes
#--------------------------------------------------------------------------
  attr_accessor   :x
  attr_accessor   :y
  attr_accessor   :h
  attr_accessor   :th
  
#--------------------------------------------------------------------------
# o Initialize
#--------------------------------------------------------------------------
  alias sieg_iso_initialize initialize
  def initialize
    @h = 0
    @th = 0
    sieg_iso_initialize
  end
#--------------------------------------------------------------------------
# o Screen_th : height of the ground
#--------------------------------------------------------------------------
  def screen_th
    tile_id = $game_map.map.data[self.x,self.y,0]
    t_x = (tile_id - 384) % 8     
    t_y = (tile_id - 384) / 8
    th = t_x + t_y * 8
    return th
  end
#--------------------------------------------------------------------------
# o Screen_h : height of the character
#--------------------------------------------------------------------------
  def screen_h
    return @h 
  end
  
#--------------------------------------------------------------------------
# Update character/event rise/fall according to position on map.
#--------------------------------------------------------------------------
  alias iso_gm_update update
  def update
    if $game_map.iso?
      if screen_h < screen_th
        @h = screen_th
      elsif screen_h > screen_th
        if (screen_h - screen_th) > 1.5
          @h -= [ISO_LVL2_Config::FALLING_SPEED * 3, 1].min
        else
          @h -= ISO_LVL2_Config::FALLING_SPEED
        end
      end 
    end
    iso_gm_update
  end
#--------------------------------------------------------------------------
# o Screen_x
#--------------------------------------------------------------------------
  alias iso_screen_x screen_x
  def screen_x
    return  iso_screen_x if !$game_map.iso?
    return  (@real_x - @real_y)/4 + 32 * $game_map.height - 0 - $game_map.display_x / 4
  end
#--------------------------------------------------------------------------
# o Screen_y
#--------------------------------------------------------------------------
  alias iso_screen_y screen_y
  def screen_y
    return iso_screen_y if !$game_map.iso?
    y = (@real_y + @real_x) / 8 + 24 - $game_map.display_y / 4 - (self.screen_h) * 8
    if @jump_count >= @jump_peak
      n = @jump_count - @jump_peak
    else
      n = @jump_peak - @jump_count
    end
    return y - (@jump_peak * @jump_peak - n * n) / 2
  end
#--------------------------------------------------------------------------
# o Screen_z
#--------------------------------------------------------------------------
  alias iso_screen_z screen_z
  def screen_z(height = 0)
    return iso_screen_z if !$game_map.iso?
    if @always_on_top
      return 999
    end
    z = screen_y
    if @tile_id > 0
      return z + $game_map_iso.priorities[@tile_id] * 32
    else
      return z + ((height > 32) ? 31 : 0)
    end
  end
end
 
#==============================================================================
# o Passabilities and interactions with events
#==============================================================================
#==============================================================================
# o Game_Character
#==============================================================================
class Game_Character
#--------------------------------------------------------------------------
# o Passable?
#--------------------------------------------------------------------------
  alias sieg_gc_passable? passable?
  def passable?(x, y, d)
    if !$game_map.iso?
      return sieg_gc_passable?(x, y, d)
    end
    @diff_n = ISO_LVL2_Config::DIFF_N
    @diff_l = ISO_LVL2_Config::DIFF_L
    
    new_x = x + (d == 6 ? 1 : d == 4 ? -1 : d == 1 ? -1 : d == 3 ? 1 : d == 7 ? -1 : d == 9 ? 1 : 0)
    new_y = y + (d == 2 ? 1 : d == 8 ? -1 : d == 1 ? 1 : d == 3 ? 1 : d == 7 ? -1 : d == 9 ? -1 : 0)
    
    
    tile_id = $game_map.map.data[x, y, 0]
    t_x= (tile_id - 384)%8     
    t_y= (tile_id - 384)/8
    h = t_x + t_y * 8
    
    new_tile_id = $game_map.map.data[new_x, new_y,0]
    new_t_x= (new_tile_id - 384)%8     
    new_t_y= (new_tile_id - 384)/8
    new_h = new_t_x + new_t_y * 8
    
    tile_tag = $game_map.terrain_tag(x, y)
    tile_tag_new = $game_map.terrain_tag(new_x, new_y)
    
    if tile_tag == 1
      @diff = @diff_l
    else
      @diff = @diff_n
    end
    
    unless $game_map.valid?(new_x, new_y) and (new_h - h) <= @diff and (new_h - h) >= -@diff
      return false
    end
    
    if @through
      return true
    end
    
    unless $game_map.passable?(x, y, d, self) and (new_h - h) <= @diff and (new_h - h) >= -@diff
      return false
    end
    
    unless $game_map.passable?(new_x, new_y, 10 - d) and (new_h - h) <= @diff and (new_h - h) >= -@diff
      return false
    end
    
    for event in $game_map.events.values
      if event.x == new_x and event.y == new_y and (new_h - h) <= @diff and (new_h - h) >= -@diff
        unless event.through and (new_h - h) <= @diff_n
          if self != $game_player
            return false
          end
          if event.character_name != ""
            return false
          end
        end
      end
    end
    
    if $game_player.x == new_x and $game_player.y == new_y and (new_h - h) <= @diff and (new_h - h) >= -@diff
      unless $game_player.through
        if @character_name != ""
          return false
        end
      end
    end
    
    return true
  end
end
 
#==============================================================================
# o Game_Event
#==============================================================================
class Game_Event < Game_Character
#--------------------------------------------------------------------------
# o Start
#--------------------------------------------------------------------------
  alias iso_evnt_start start
  def start
    if !$game_map.iso?
      iso_evnt_start
      return
    end
    @diff_n = 1
   # Dialogue 
    tile_id = $game_map.map.data[$game_player.x,$game_player.y,0]
    t_x = (tile_id - 384) % 8     
    t_y = (tile_id - 384) / 8
    h = t_x + t_y * 8
    
    ev_tile_id = $game_map.map.data[self.x,self.y,0]
    ev_t_x = (ev_tile_id - 384) % 8     
    ev_t_y = (ev_tile_id - 384) / 8
    ev_h = ev_t_x + ev_t_y * 8
    
    if @list.size > 1 and (ev_h - h).abs <= @diff_n
      @starting = true
    end
  end
end



Merci de votre aide en tout cas je suis pas vraiment un as en script.

Projet en cours: INRAL / En pause :NEOTORI /// Pause : L'ANKH DE KINBRA /// Pause : GRASS SHOPPER  /// GALERIE


Mack - posté le 03/07/2013 à 17:29:36 (2290 messages postés) - staff

❤ 0

Le code que je t'ai donné, t'as essayer de le mettre juste au dessus de Main ?

Sinon, file nous une démo avec tout les scripts, ça sera mieux.

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


esziaprez game - posté le 03/07/2013 à 17:35:37 (441 messages postés)

❤ 0

Je suis dans le game !

Bon je file une demo demain parceque là je dois converitr des son weve en mp3 sinon mon jeu est trop lourd

Projet en cours: INRAL / En pause :NEOTORI /// Pause : L'ANKH DE KINBRA /// Pause : GRASS SHOPPER  /// GALERIE


Estheone - posté le 03/07/2013 à 18:27:15 (312 messages postés)

❤ 0

Ligne 126 du dernier morceau de script que tu montres tu mets ça :

Portion de code : Tout sélectionner

1
return 0 if @always_on_bottom



C'est sûr que si t'as 10000 scripts qui redéfinissent ou ajoutent des trucs à la méthode screen_z ça complique les choses. :F

Wandering Souls : Jeu complet / Topic sur Oniro

Index du forum > Entraide > [RMXP] Superposition characters et isometrie

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