• Anmelden

21

Mittwoch, 28. Juli 2021, 20:53

o scheiße, Mittwochabend, da bumst sich der Shabz ja immer die Birne zu :glass: :glass: :glass:

wie sieht denn dein Code aktuell aus? Ich habe jetzt mal die letzte Version genommen, die Du gepostet hast und da ein paar Edits reingeworfen. Natürlich ungetestet. Playm'21-Qualität, Leute.

Spoiler

Ruby Quellcode

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
class Bitmap
  #----------------------------------------------------------------------------
  # ** Fast Box Blur by francium (https://francium.cc), custom port by Playm
  #----------------------------------------------------------------------------
  def sweep_blur(radius = 1)
    offset = 1 # should be related to expected radius but doesn't has to be the same
    size = (width+2*offset) * (height+2*offset)
    sums_r = Array.new(size){0}
    sums_g = Array.new(size){0}
    sums_b = Array.new(size){0}
    sums_a = Array.new(size){0}
    for row in 0...height
      pixel = get_pixel(0,row)
      sums_r[calc_index(row,0,width,offset)] = pixel.red.to_i**2
      sums_g[calc_index(row,0,width,offset)] = pixel.green.to_i**2
      sums_b[calc_index(row,0,width,offset)] = pixel.blue.to_i**2
      sums_a[calc_index(row,0,width,offset)] = pixel.alpha.to_i
      for col in 1...width
        pixel = get_pixel(col,row)
        sums_r[calc_index(row,col,width,offset)] = pixel.red.to_i**2   + sums_r[calc_index(row,col-1,width,offset)]
        sums_g[calc_index(row,col,width,offset)] = pixel.green.to_i**2 + sums_g[calc_index(row,col-1,width,offset)]
        sums_b[calc_index(row,col,width,offset)] = pixel.blue.to_i**2  + sums_b[calc_index(row,col-1,width,offset)]
        sums_a[calc_index(row,col,width,offset)] = pixel.alpha.to_i    + sums_a[calc_index(row,col-1,width,offset)]
      end
    end
    for col in 0...width
      for row in 0...height
        sums_r[calc_index(row,col,width,offset)] += sums_r[calc_index(row-1,col,width,offset)]
        sums_g[calc_index(row,col,width,offset)] += sums_g[calc_index(row-1,col,width,offset)]
        sums_b[calc_index(row,col,width,offset)] += sums_b[calc_index(row-1,col,width,offset)]
        sums_a[calc_index(row,col,width,offset)] += sums_a[calc_index(row-1,col,width,offset)]
      end
    end
    # perform blur
    for row in 0...height
      for col in 0...width
        x_min = [col - radius , 0-offset       ].max
        x_max = [col + radius , width-1+offset ].min
        y_min = [row - radius , 0-offset       ].max
        y_max = [row + radius , height-1+offset].min
        number_of_pixels = (x_max - (x_min-1)) * (y_max - (y_min-1))
        # alpha
        a = y_min < 1 || x_min < 1 ? 0 : sums_a[calc_index(y_min-1, x_min-1, width, offset)]
        b = y_min < 1              ? 0 : sums_a[calc_index(y_min-1, x_max,   width, offset)]
        c = x_min < 1              ? 0 : sums_a[calc_index(y_max,   x_min-1, width, offset)]
        d = sums_a[calc_index(y_max,x_max,width,offset)]
        pixel_a = (d - (b + c - a)) / number_of_pixels
        #next if pixel_a < 1
        # red
        a = y_min < 1 || x_min < 1 ? 0 : sums_r[calc_index(y_min-1, x_min-1, width, offset)]
        b = y_min < 1              ? 0 : sums_r[calc_index(y_min-1, x_max,   width, offset)]
        c = x_min < 1              ? 0 : sums_r[calc_index(y_max,   x_min-1, width, offset)]
        d = sums_r[calc_index(y_max,x_max,width,offset)]
        pixel_r = (d - (b + c - a)) / number_of_pixels
        # green
        a = y_min < 1 || x_min < 1 ? 0 : sums_g[calc_index(y_min-1, x_min-1, width, offset)]
        b = y_min < 1              ? 0 : sums_g[calc_index(y_min-1, x_max,   width, offset)]
        c = x_min < 1              ? 0 : sums_g[calc_index(y_max,   x_min-1, width, offset)]
        d = sums_g[calc_index(y_max,x_max,width,offset)]
        pixel_g = (d - (b + c - a)) / number_of_pixels
        # blue
        a = y_min < 1 || x_min < 1 ? 0 : sums_b[calc_index(y_min-1, x_min-1, width, offset)]
        b = y_min < 1              ? 0 : sums_b[calc_index(y_min-1, x_max,   width, offset)]
        c = x_min < 1              ? 0 : sums_b[calc_index(y_max,   x_min-1, width, offset)]
        d = sums_b[calc_index(y_max,x_max,width,offset)]
        pixel_b = (d - (b + c - a)) / number_of_pixels
        # set pixel
        set_pixel(col, row, Color.new(Math.sqrt(pixel_r), Math.sqrt(pixel_g), Math.sqrt(pixel_b),pixel_a))
      end
    end
  end
  #----------------------------------------------------------------------
  #  helper function to make above code more readable
  #----------------------------------------------------------------------
  def calc_index( row, column, width, offset=0 )
    return (row+offset) * width + (column+offset)
  end
end
zum Lesen den Text mit der Maus markieren

Shabraxxx

Projekt: Ressourcenbereich & Seitenredaktion

  • »Shabraxxx« ist der Autor dieses Themas

Motto: Mein Luftkissenfahrzeug ist voller Aale.

  • Nachricht senden

22

Freitag, 30. Juli 2021, 00:14

Haben wir im Studio nicht eine Möglichkeit, den aktuellen Wochentag auszulesen? Das erschiene mir in dem Fall eher angemessen.

Die letzte Version war ein wirres Gefrickel aus meinem letzten Code und deinen Quickfixes und wurde nun durch deinen letzten ersetzt. Was ich mir da Stand des letzten playm'schen Posts aus dem Gesäß gezaubert habe, ist schlicht fort.
Dein neuer Code hat, trotz gefühlt gleicher Laufzeit, unverändert Probleme mit dem rechten und unteren Rand (Ergebnis anbei).

Ganz nebenbei, spannend ist inzwischen, da dank dir <3 ein guter Code vorliegt, die Frage, wie ich die verarbeiteten Grafiken sinnig intern hinterlegen kann. Verwendet werden sie wohl zu annähernd 100 Prozent in diesem Script; ich denke, dass ich auch in Eigenregie den Code anpassen könnte, um aus einem Pool bearbeiteter Grafiken zu schöpfen, aber – wo und wie würde ein Playm sie speichern? Der Prozess ist ja trotz allem zeitaufwendig und würde bei der kompletten Bearbeitung der betroffenen Grafiken zu Beginn des Spiels ausgesprochen lange dauern. Eine Idee wäre, dass man in passenden Momenten die Bitmaps verwurstet und die bearbeitete Version im Arbeitsspeicher hinterlegt, bei einem Mapwechsel, einer Cutscene oder ähnlichem. Oder ich baue einfach unironisch Ladebildschirme ein.
Der Spielende soll es eben nicht sonderlich merken. Masked loading time und so.
Gruß, Shabz
»Shabraxxx« hat folgendes Bild angehängt:
  • Untitled.png
„Albrecht Dürer, geboren 1471, gestorben 1530.
Der Nürnberger Maler, der ganz Europa faszinierte; mit seinem scharfen Auge, seiner Meisterschaft in Linienführung und Plastizität, sowie seiner Leihwagenfirma.“

Dieser Beitrag wurde bereits 2 mal editiert, zuletzt von »Shabraxxx« (31. Juli 2021, 00:17)


23

Samstag, 31. Juli 2021, 12:16

In meiner Küche hängt ein Kalender, da kann ich immer nachgucken, welcher (Wochen-)Tag gerade ist. Nicht nötig, eine PHP-Funktion zu bemühen.
Deswegen weiß ich auch, dass gerade Samstagmittag ist. Da schläft Shabz immer nachdem er sich Freitag ordentlich die Birne zugebimst hat. Ohje ohje.

Naja, aber zum Skript:
Mir ist noch eine Kleinigkeit aufgefallen: beim berechnen der maximalen x- und y-Koordinate muss das doppelte des Offsets drauf addiert werden. Ansonsten wird die letzte Zeile und letzte Spalte nicht berücksichtigt.

Ruby Quellcode

37
38
39
40
        x_min = [col - radius , 0-offset         ].max
        x_max = [col + radius , width-1+2*offset ].min
        y_min = [row - radius , 0-offset         ].max
        y_max = [row + radius , height-1+2*offset].min

Ansonsten machst Du immer noch den Shabz-Fix? Durch den Blur wird das Bild ja größer, weil die Farben in jede Richtung "zerlaufen". Wenn Du den Shabz-Fix mit blt auf eine größere Bitmap machst, könnte das schon funktionieren. Am Besten eine Bitmap die auf jeder Seite 2 Pixel mehr hat. Aber der Algorithmus an sich scheint auch noch ein paar Fehler zu haben. Die könnte man aber auch einfach ignorieren. Ein vorausgehendes blt auf eine (width+4, height+4) große Bitmap sollte gut aussehen. (ich habe den Mittag den Code angeguckt und nicht nachvollziehen können, warum Dinge passieren... vermutlich müsste ich das für mich mal ganz in Ruhe durch gehen... aber... uff, es ist doch Wochenende)

Zitat

um aus einem Pool bearbeiteter Grafiken zu schöpfen, aber – wo und wie würde ein Playm sie speichern?
Im verlinkten Thread sind außer deinem eigenen, alle Links und Images down. Habe mir also das unlimmited Layer Skript nicht angeguckt. Zu deiner Frage: brauchst Du denn die Images sowohl normal als auch blured, oder nur eins von beidem? Ansonsten manipuliere doch die Bilder aus dem RPG::Cache.picture mit dem blur und dann liegen die halt im Cache vor. Allerdings wird der Cache auch ab und zu mal geleert. Weiß aus dem Kopf nicht, wann Pictures disposed werden. Kannst Du aber sicher in Sprite_Picture oder so herausfinden, oder in Spriteset_Map. Ich meine mich zu erinnern, dass Tilesets beim Mapwechsel disposed werden. Wenn dies auch bei Pictures der Fall wäre, wäre RPG::Cache vermutlich nicht der richtige Ort zum cachen. Dann würde ich vermutlich was eigenes - aber nach dem gleichen Prinzip - aufbauen.

Zitat

Eine Idee wäre, dass man in passenden Momenten die Bitmaps verwurstet und die bearbeitete Version im Arbeitsspeicher hinterlegt, bei einem Mapwechsel, einer Cutscene oder ähnlichem.
Jo, können die denn "auf alle Ewigkeit" im Arbeitsspeicher liegen oder willst Du immer nur die nächsten relevanten Bilder im Arbeitsspeicher halten?
Was vermutlich auch ein guter Ort für dein masked Loading wäre, ist das Ingame-Menü. So lange Du da nicht joseyeske Menüdarstellungen eingebaut hast, ist da wenig zu berechnen und viel Zeit, wo der Spieler auch nicht mitbekommt, wenn mal ein Frame droppt.

Shabraxxx

Projekt: Ressourcenbereich & Seitenredaktion

  • »Shabraxxx« ist der Autor dieses Themas

Motto: Mein Luftkissenfahrzeug ist voller Aale.

  • Nachricht senden

24

Sonntag, 1. August 2021, 23:43

Ja kreuz dir da mal alle Tage, die mit G enden an, und die Mittwoche, dann hast Du eine halbwegs gute Vorstellung von meinem Trinkverhalten.

Auch mit dieser Neuerung bleibt das Problem bestehen, dazu werden auch die Werte der Pixelsummen an irgendeiner Stelle negativ und er wirft einen Fehler beim Wurzelziehen. Mit .abs lässt sich das fixen, aber, wie gesagt, das Ergebnis ist quasi unverändert zu meinem letzten geposteten Bild.

Zitat

vermutlich müsste ich das für mich mal ganz in Ruhe durch gehen... aber... uff, es ist doch Wochenende
Ja jetzt nicht mehr. lol

Aktuell benutze ich diesen, quasi last known good code und habe an meinem Fix ein bisschen geschraubt, der da inzwischen so ausschaut:

Ruby Quellcode

1
2
3
4
5
6
7
8
  def sweep_blur_edgesafe(radius = 1)
    buffer = Bitmap.new(width + 2*radius, height + 2*radius)
    buffer.blt(radius, radius, self, rect)
    buffer.sweep_blur(radius)
    clear
    blt(0, 0, buffer, Rect.new(radius, radius, width, height))
    buffer.dispose
  end

Das klappt dann so ungefähr bis zum Radius 4, dann fängt das Problem von vorne, also, eher von rechts und unten, lel, wieder an.
Aber genau da könnte man vielleicht auch ansetzen.

Um deine Frage zu beantworten, ich hätte schon gerne die Möglichkeit, auch auf die ursprüngliche Bitmap und am liebsten sogar ein paar unterschiedlich stark verwaschene Versionen einer einzigen Grafik zugreifen zu können, allein, weil manche Objekte je nach Map verschieden gut im "Fokus" sein könnten. Mir schwebt da sogar eine Möglichkeit vor, in einer Cutscene super cineastisch den Fokus zu wechseln, indem ich verschieden stark verwaschene Versionen zweier Grafiken miteinander verblende (hab da anbei mal was vorbereitet). Und in dem Fall könnte man ja gleich neue Bitmaps mit deutlich größeren Dimensionen im RAM anlegen, einen block transfer der Grafik im Cache draufhauen, verwischen (mit dementsprechend genügend Puffer für allerlei Radien, die die Randprobleme irrelevant machen) und diese dann eben je nach Belieben nutzen. Angefertigt werden sie entspannt bei Mapwechsel, Cutscene, oder, bei Kleinkram wie im Menü – sehr schöne Idee übrigens <3 – und im Prinzip wars das dann. Also in meinem Kopf jedenfalls.
Fühl dich nunmehr frei, meine Träume mit Argumenten des Speicherbedarfes (oder irgendeinem anderen guten Punkt) zu zerschmettern.
Gruß, Shabz


PS: Es überrascht mich, aber tatsächlich scheint der originale Code dieser Epiphanie von einem Script nicht mehr auffindbar zu sein, was wirklich eine Schande ist. Hier eine Version aus meinem Archiv, die dem originalen Code ausgesprochen nahe sein sollte; ich bin mir ziemlich sicher, nur die Parameter scroll_x und scroll_y hier in stümperhafter Eigenregie eingebaut zu haben. Alle Rechte reserviert.

Spoiler: Unlimited Graphically Layered Maps v1.0.1

Ruby Quellcode

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
=begin
 
 Unlimited Graphically Layered Maps v1.0.1
 by PK8
 Created: 5/16/2012 - 5/18/2012
 Modified: 5/19/2012
 
 Kustomizations by kopper
 ──────────────────────────────────────────────────────────────────────────────
 ■ Table of Contents
   o Author's Notes                                - Line 18-28
   o Introduction                                  - Line 30-38
   o Features                                      - Line 40-47
   o Methods Aliased                               - Line 49-52
   o Changelog                                     - Line 54-57
   o Thanks                                        - Line 59-64
   o How to Set Up                                 - Line 66-104
   o How to Use                                    - Line 106-166
 ──────────────────────────────────────────────────────────────────────────────
 ■ Author's Notes
   Giving maps "unlimited layers" was something I always wanted to see someone
   script for RPG Maker XP when I was younger, but I was so far from capable
   of pulling that off. I kind of hate how I'm scripting this 7 years a little
   too late, but I hope someone enjoys it all the same.
 
   This idea came about right after I was done porting Woratana's Picture
   Below Characters script to XP/Ace, making a script that allowed pictures
   to scroll along the map, porting Arevulopapo's Particle Engine to VX and Ace,
   and attempted to work on my own implementation of Ace's "Shadow Pen" for
   XP and VX.
 ──────────────────────────────────────────────────────────────────────────────
 ■ Introduction
   This script allows users to add "additional graphical layers" onto various
   coordinates of certain maps, allowing them to create something closer to
   "parallax mapping" without having to use an external image editor.
 
   Unfortunately/fortunately (depending on how you look at it), the data
   that's included with each tile such as priority, passability, terrain, and
   such doesn't get included here which means you might have to use the map
   editor as a way to design the base of your map.
 ──────────────────────────────────────────────────────────────────────────────
 ■ Features
   o Place graphics such as tiles, pictures, text, tiles from other tilesets,
     and rects onto your maps!
   o They will scroll as if they were a part of your map. (Unless you change
     their scrolling formula.)
   o Change certain properties of each graphic you place such as their angle,
     blend type, bush depth, color, hue, mirror flag, opacity, tone, zoom, & z.
   o Provides an alternative to the well-known Parallax Mapping technique.
 ──────────────────────────────────────────────────────────────────────────────
 ■ Methods Aliased
   Spriteset_Map.initialize
   Spriteset_Map.update
   Spriteset_Map.dispose
 ──────────────────────────────────────────────────────────────────────────────
 ■ Changelog (MM/DD/YYYY)
   v1     (05/18/2012): Initial release.
   v1.0.1 (05/19/2012): Fixed a bug where changing hues of a particular picture
                        would affect every other picture.
 ──────────────────────────────────────────────────────────────────────────────
 ■ Thanks
   If it wasn't for me porting Woratana's Pictures script to RPG Maker XP
   and RPG Maker VX Ace, as well as Arevulopapo's Particle Engine over
   to RPG Maker VX and RPG Maker VX Ace, my old dream of somehow having
   "unlimited layers," and always hearing about a technique called
   "Parallax Mapping," I wouldn't have made this script. Thanks, community!
 ──────────────────────────────────────────────────────────────────────────────
 ■ How to set up
   This is my first time attempting to write a decent tutorial, so I hope this
   helps out just a bit. Setting up additional tiles (and graphics, which is a
   bit advanced, which we'll get into later) should be for the most part,
   very easy.
 
   To set up new additional tile graphics for a particular map, you should set
   it up, like so:
     Map[map_id] = []
       * map_id: A map ID of your choosing. Look at the bottom right corner of
                 the screen to see it.
       * [] is an array, which we're going to fill up with tiles.
 
   To add your first extra tile, create an array that contains 4 items within
   the array we have set up. Like this:
     Map[map_id] = [[tile_id, x, y, attr]]
       * map_id : A map ID of your choosing. See bottom right corner.
       * tile_id: The index of the tileset. First tile starts at 0.
                  Autotiles don't count.
       * x      : X-Coordinate of the graphic. It's placed by tile.
       * y      : Y-Coordinate of the graphic. It's placed by tile
       * attr   : It's a hash of additional attributes you can add onto your
                  new graphic. Don't worry about that right now.(It's optional!)
       * All of these settings are optional and don't need to be included.
 
    Now let's place some tiles:
      Map[1] = [[1, 2, 2]]
        * This will place tileset graphic index 1 of the map's current tileset
          onto map coordinate 2,2.
 
    To add more, add a comma at the end of each item and then add another.
      Map[1] = [[1, 2, 2], [1, 2, 3, {"h" => 15}]]
        * This will add the first tile, and then add another tile with a
          changed hue onto map coordinate 2,3. You can learn more about
          attributes by scrolling down to the next section.
 
    Keep in mind that you can add multiple graphics onto the same map
    coordinate but the graphic that comes later will always have more priority
    compared to the others, though you could always adjust their z coordinate.
 ──────────────────────────────────────────────────────────────────────────────
 ■ How to use
   Assuming you figured out how to set it up, here's how to really
   customize it.
 
     Map[map_id] = [
      [tile, x, y, {attr => value, attr2 => value2}],
      [tile, x, y, {attr => value, attr2 => value2}],
      [tile, x, y, {attr => value, attr2 => value2}]
     ]
       * map_id: Map ID
       * tile  : Tile index in map's tileset.
                 * Also allows pictures, tiles from other sets, rects, text,
                   and images.
                 Picture  : "filename in pictures directory"
                 Fill     : ["fill", width, height, color]
                   width  : Width is measured in tiles.
                   height : Height is measured in tiles.
                   color  : Set color. Can be an array or color object.
                            array: [red, green, blue, alpha]
                            color: Color.new(red, green, blue, alpha)
                 Text     : ["text", string, font, size, bold, italic, color]
                   string : Set text string.
                   font   : Set font name(s) Example: ["Arial", "Verdana"]
                   size   : Set font size
                   bold   : Truth value for bold text. (true/false)
                   italic : Truth value for italicised text. (true/false)
                   color  : Set text color. Can be an array or color object.
                            array: [red, green, blue, alpha]
                            color: Color.new(red, green, blue, alpha)
                            * red/green/blue/alpha: 0 - 255
                 Tileset  : ["xt", id/name, tile]
                   id/name: Set name or ID of another tileset.
                   tile   : Tile index from another tileset.
       * x     : X coordinate measured in tiles.
       * y     : Y coordinate measured in tiles.
       * attr  : Extra attributes you can set to the graphic.
                 angle    : Set angle of graphic.
                 blend    : Set blend type of graphic. (0: Nor, 1: Pos. 2: Neg)
                 bush     : Set how much of the lower portion of the graphic
                            would become translucent.
                 color    : Set graphic color.
                 h        : Set hue of graphic.
                 m        : Graphic's mirror flag.
                 o        : Set opacity to the graphic. (0 - 255)
                 tone     : Set tone. Can be an array or tone object.
                            array: [red, green, blue, gray]
                            tone : Tone.new(red, green, blue, gray)
                            * red/green/blue: -255 - 255
                            * gray: 0 - 255
                 stretch  : Resize the bitmap. ("stretch" => [width, height])
                            * width : Bitmap's new width.
                            * height: Bitmap's new height.
                 scroll_x : Set a new formula for x-axis scrolling.
                 scroll_y : Set a new formula for y-axis scrolling.
                   * They have to be strings.
                 zoom_x   : Resize the sprite's x-axis zoom level.
                 zoom_y   : Resize the sprite's y-axis zoom level.
                   * 100 denotes actual pixel size.
                 z        : Set z coordinate of the graphic.
                   * Is multiplied by 32.
 
=end
 
#==============================================================================
# ** Configuration
#==============================================================================
 
module PK8
  class Unlimited_Graphical_Layers
    #--------------------------------------------------------------------------
    # * Do not modify
    #--------------------------------------------------------------------------
    Map = {}
    load_data("Data/MapInfos.rxdata").each { |k,v| Map[k] = [] }    
    #--------------------------------------------------------------------------
    # * General Settings
    #--------------------------------------------------------------------------
    By32 = false   # X, Y, and Z values will be multiplied by 32 if TRUE.
    #--------------------------------------------------------------------------
    # * Map Settings
    #--------------------------------------------------------------------------
  end
end
#==============================================================================
# ** Spriteset_Map
#------------------------------------------------------------------------------
#  This class brings together map screen sprites, tilemaps, etc.
#  It's used within the Scene_Map class.
#==============================================================================
 
class Spriteset_Map
  #---------------------------------------------------------------------------
  # * Alias Listings
  #---------------------------------------------------------------------------
  unless method_defined?(:pk8_uglm_initialize)
    alias_method(:pk8_uglm_initialize, :initialize)
  end
  unless method_defined?(:pk8_uglm_update)
    alias_method(:pk8_uglm_update,     :update)
  end
  unless method_defined?(:pk8_uglm_dispose)
    (alias_method :pk8_uglm_dispose,    :dispose)
  end
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :uglm
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    pk8_uglm_initialize
    @uglm, uglm_i = [], 0
    if PK8::Unlimited_Graphical_Layers::Map[$game_map.map_id].size > 0
      PK8::Unlimited_Graphical_Layers::Map[$game_map.map_id].each { | v |
        v = v.to_a if !v.is_a?(Array)
        tile, x, y, attr = v[0], v[1], v[2], v[3] if v.size == 4
        tile, x, y, attr = v[0], v[1], v[2], {} if v.size == 3
        tile, x, y, attr = v[0], v[1], 0, {} if v.size == 2
        tile, x, y, attr = v[0], 0, 0, {} if v.size == 1
        tile, x, y, attr = 0, 0, 0, {} if v.size == 0
        @uglm[uglm_i] = Sprite_LayeredTile.new(@viewport1, tile, x, y, attr)
        uglm_i += 1
      }
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    pk8_uglm_update
    @uglm.each { | tile | tile.update } if @uglm != nil
  end
  #--------------------------------------------------------------------------
  # * Dispose
  #--------------------------------------------------------------------------
  def dispose
    pk8_uglm_dispose
    @uglm.each { | tile | tile.dispose } if @uglm != nil
  end
end
 
#==============================================================================
# ** Sprite_LayeredTile
#------------------------------------------------------------------------------
#  This sprite is used to display extra tiles.
#==============================================================================
 
class Sprite_LayeredTile < RPG::Sprite
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(viewport, tile_id = 0, x = 0, y = 0, attr = { "h" => 0,
      "tone" => Tone.new(0,0,0,0), "color" => Color.new(0,0,0,0), "angle" => 0,
      "m" => false, "zoom_x" => 100.0, "zoom_y" => 100.0, "blend" => 0,
      "o" => 255, "z" => 1, "bush_depth" => 0,
      "scroll_x" => "$game_map.display_x / 4",
      "scroll_y" => "$game_map.display_y / 4"})
    super(viewport)
    PK8::Unlimited_Graphical_Layers::By32 == true ? self.x = 32*x : self.x = x
    PK8::Unlimited_Graphical_Layers::By32 == true ? self.y = 32*y : self.y = y
    # Default Tile Values
    self.angle = 0 if !attr.include?("angle")
    self.blend_type = 0 if !attr.include?("blend")
    self.bush_depth = 0 if !attr.include?("bush_depth")
    self.color = Color.new(0,0,0,0) if !attr.include?("color")
    self.mirror = false if !attr.include?("m")
    self.opacity = 255 if !attr.include?("o")
    self.tone = Tone.new(0,0,0,0) if !attr.include?("tone")
    self.zoom_x = 1.0 if !attr.include?("zoom_x")
    self.zoom_y = 1.0 if !attr.include?("zoom_y")
    self.z = 1*32 if !attr.include?("z")
    @scroll_x = "$game_map.display_x / 4" if !attr.include?("scroll_x")
    @scroll_y = "$game_map.display_y / 4" if !attr.include?("scroll_y")
    hue = 0 if !attr.include?("h")
    # Setting attributes to tile.
    attr.each { | k,v |
      k = k.downcase if k.is_a?(String)
      case k
        when "angle"; self.angle = v
        when "bush", "bush_depth"; self.bush_depth = v
        when "blend", "blend_type"; self.blend_type = v
        when "color"
          if v.is_a?(Color); self.color = v
          elsif v.is_a?(Array); self.color = Color.new(*v)
          end
        when "h"; hue = v
        when "m"; self.mirror = v
        when "o"; self.opacity = v
        when "scroll_x"; @scroll_x = v
        when "scroll_y"; @scroll_y = v
        when "tone"
          if v.is_a?(Tone); self.tone = v
          elsif v.is_a?(Array); self.tone = Tone.new(*v)
          end
        when "zoom_x"; self.zoom_x = v / 100.0
        when "zoom_y"; self.zoom_y = v / 100.0
        when "z"; self.z = 32*v
      end
    }
    # Tile? Picture? Text? Tiles from other tilesets?
    if tile_id.is_a?(Integer)
      self.bitmap=RPG::Cache.tile($game_map.tileset_name,384+tile_id,hue).clone
    elsif tile_id.is_a?(String)
      self.bitmap = RPG::Cache.picture(tile_id).clone
      self.bitmap.hue_change(hue)
    elsif tile_id.is_a?(Color)
      self.bitmap = Bitmap.new(32,32)
      self.bitmap.fill_rect(0, 0, 32, 32, tile_id)
      self.bitmap.hue_change(hue)
    elsif tile_id.is_a?(Array)
      type = tile_id[0].downcase if tile_id.size >= 1
      case type
      when "text", "txt"
        dfont, dsize = Font.default_name, Font.default_size
        dbold, ditalic = Font.default_bold, Font.default_italic
        dcolor = Font.default_color
        if tile_id.size >= 0
          string, font, size, bold, italic = "", dfont, dsize, dbold, ditalic
          color = dcolor
        end
        tile_id[1]!=nil ? string=tile_id[1].to_s: string="" if tile_id.size >= 2
        tile_id[2]!=nil ? font = tile_id[2] : font=dfont if tile_id.size >= 3
        tile_id[3]!=nil ? size = tile_id[3] : size=dsize if tile_id.size >= 4
        tile_id[4]!=nil ? bold = tile_id[4] : bold=dbold if tile_id.size >= 5
        tile_id[5]!=nil ? italic =tile_id[5]: italic=ditalic if tile_id.size>=6
        if tile_id.size >= 7
          if tile_id[6].is_a?(Color);    color = tile_id[6]
          elsif tile_id[6].is_a?(Array); color = Color.new(*tile_id[6])
          else;                          color = dcolor
          end
        end
        self.bitmap             = Bitmap.new(320,240)
        self.bitmap.font.name   = font
        self.bitmap.font.size   = size
        self.bitmap.font.bold   = bold
        self.bitmap.font.italic = italic
        self.bitmap.font.color  = color
        rect = self.bitmap.text_size(string)
        self.bitmap.dispose
        self.bitmap             = Bitmap.new(rect.width, rect.height)
        self.bitmap.font.name   = font
        self.bitmap.font.size   = size
        self.bitmap.font.bold   = bold
        self.bitmap.font.italic = italic
        self.bitmap.font.color  = color
        self.bitmap.draw_text(0,0,rect.width,rect.height,string,0)
        self.bitmap.hue_change(hue)
      when "xt", "tile"
        if tile_id.size >= 0
          tileset, tile = $game_map.tileset_name, 0
        end
        if tile_id.size >= 2
          if tile_id[1].is_a?(String)
            tileset = tile_id[1]
          elsif tile_id[1].is_a?(Integer)
            tileset = $data_tilesets[tile_id[1]].tileset_name
          end
        end
        if tile_id.size >= 3
          tile = tile_id[2] + 384 if tile_id[2].is_a?(Integer)
        end
        self.bitmap = RPG::Cache.tile(tileset, tile, hue).clone
      when "fill", "color"
        if tile_id.size >= 0
          width, height, color = 32, 32, Color.new(99, 92, 116, 128) 
        end
        (width = tile_id[1] if tile_id[1].is_a?(Integer)) if tile_id.size >= 2
        (height = tile_id[2] if tile_id[2].is_a?(Integer)) if tile_id.size >= 3
        if PK8::Unlimited_Graphical_Layers::By32 == true
          width, height = 32*width, 32*height
        end
        if tile_id.size >= 4
          if tile_id[3].is_a?(Color); color = tile_id[3]
          elsif tile_id[3].is_a?(Array); color = Color.new(*tile_id[3])
          end
        end
        self.bitmap = Bitmap.new(width,height)
        self.bitmap.fill_rect(0,0,width,height,color)
        self.bitmap.hue_change(hue)
      end
    end
    if attr.include?("stretch")
      if attr["stretch"].size >= 2 
        if attr["stretch"][0].is_a?(Integer); width = attr["stretch"][0]
        else; width = self.bitmap.width
        end
        if attr["stretch"][1].is_a?(Integer); height = attr["stretch"][1]
        else; height = self.bitmap.height
        end
        old_bitmap = self.bitmap.clone
        new_bitmap = Bitmap.new(width, height)
        new_bitmap.stretch_blt(Rect.new(0,0,width,height), old_bitmap,
          Rect.new(0,0,old_bitmap.width,old_bitmap.height))
        self.bitmap = new_bitmap.clone
        old_bitmap.dispose
        new_bitmap.dispose
      end
    end
    self.ox, self.oy = eval(@scroll_x), eval(@scroll_y)
    @olddisplay_x, @olddisplay_y = self.ox, self.oy
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    super
    if @olddisplay_x != eval(@scroll_x)
      self.ox = eval(@scroll_x)
      @olddisplay_x = self.ox
    end
    if @olddisplay_y != eval(@scroll_y)
      self.oy = eval(@scroll_y) 
      @olddisplay_y = self.oy
    end
  end
  #--------------------------------------------------------------------------
  # * Dispose
  #--------------------------------------------------------------------------
  def dispose; self.bitmap.dispose if self.bitmap.is_a?(Bitmap); super; end
end
 
#==============================================================================
# ** Scene_Map
#------------------------------------------------------------------------------
#  This class performs map screen processing.
#==============================================================================
 
class Scene_Map
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_reader :spriteset
end
zum Lesen den Text mit der Maus markieren
»Shabraxxx« hat folgendes Bild angehängt:
  • gif.gif
„Albrecht Dürer, geboren 1471, gestorben 1530.
Der Nürnberger Maler, der ganz Europa faszinierte; mit seinem scharfen Auge, seiner Meisterschaft in Linienführung und Plastizität, sowie seiner Leihwagenfirma.“

Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »Shabraxxx« (6. August 2021, 13:17)


Josey

Storyteller

Motto: "Was du nicht willst, das man dir tu', füge keinem And'ren zu!"

  • Nachricht senden

25

Freitag, 20. August 2021, 01:01

Ja kreuz dir da mal alle Tage, die mit G enden an, und die Mittwoche, dann hast Du eine halbwegs gute Vorstellung von meinem Trinkverhalten.

Wenigstens säuft er Sonnabend nicht :P
Notfalldiscord: Hier klicken


  • Joseys Wuselei

    • Meine Story - Pausiert
      Lust auf Abenteuer?
      So richtig mit Selbstbestimmung?
      Und mit was Spannendem? Zum Spielen? Ohne Schokolade?
      "Eines, das mit dem leistungsstärksten Grafikchip der Welt läuft? Deiner Vorstellungskraft?"
      Hier die Antwort:
      Bild
      Bild
      Hier könnt ihr euren Lieblingschar wählen ;D
      Und hier findet ihr das Minigame, das ab und an den Würfel ersetzt.
    • Meine Arbeiten
      Einige Ressourcen, vor allem Baby-Tiere, aber auch alle Requests, die ich erfüllt habe.
      Bild

      Bild

      In unregelmäßigen Abständen fasse ich alles Neue, was so im Studio passiert ist, zusammen. -Pausiert-
      Bild
    • Meine Fähigkeiten
      Maker: :rmxp: XP
      :rainbow: Pixeln: :star: :star: :star: :star: :star-empty: :star-empty:
      :image: Mappen: :star: :star: :star: :star: :star: :star-empty:
      :wrench-screwdriver: Eventen: :star: :star: :star: :star: :star-empty: :star-empty:
      :puzzle: Scripten: :star: :star-half: :star-empty: :star-empty: :star-empty: :star-empty:
      :music: Komponieren: :star-half: :star-empty: :star-empty: :star-empty: :star-empty: :star-empty:
    • (Mein) Autismus
      Ich bin im autistischen Sprektrum-
      sollte ich mich komisch verhalten, oder unhöflich wirken
      (oder mich zu oft entschuldigen, unaufmerksam sein, unsicher wirken, zum zehnten Mal nachfragen, blablabla),
      ist das nicht beabsichtigt.


      Josey. Epicgarantie.
      Nehmt das bloß nicht ernst! D:
    • Meine Welt
      Mein Ehemann Kain! :heart_full: :*
      Freund und Helfer in der Not, immer da, steht er mir mit Rat und Tat zur Seite. Meine andere Hälfte! : D
      Er verdient einfach einen Platz ( :medal: ) in meiner Signatur! XD
      :heart-half:
    • Mein Support
      Der In-Game-Charset-Generator!
      Erstelle Random-NPCs mit Charsetteilen!

      Diese Spiele finde ich toll und brauchen viel mehr Aufmerksamkeit!
      Bastelt mal Banner! : D

    • Meine beendeten Contests
      [Pixelcontest] Rund um den Kürbis
      Bild
      Abstimmung
      Siegerehrung

      Das Wunder der Berge
      Bild
      Abstimmung
      Siegerehrung
    • Meine Contests
      Bild Ein Schreibcontest in Arbeit! : D Bild
  • Joseys Spiele

    • Endless Ending
      :rmxp: Endless Ending
      (Arbeitstitel, "ernstes Projekt")

      Bild

      Eine Reise durch die Wüste.
      Sieben mächtige Gegenstände.
      Unendlich viele Aufgaben.

      Und die Götter haben die Würfel.
    • Scripted Desaster
      :rmxp: Scripted Desaster
      ("nicht ganz so ernstes Projekt")

      Ein verfressener Idiot und ein sarkastischer Workaholic treffen in einem dunklen Wald auf einen weißes Kaninchen...
      Ein Auftragskiller jagt einem Meisterdieb hinterher, wobei nicht ersichtlich ist, wer eigentlich wen jagt...
      Und eine "Kristallhöhle", sowie einen "Wald ohne Wiederkehr" gibts auch.

      Das bedeutet doch Spaß...
    • Pokémon EV
      :rmxp: Pokemon EV
      ("Zeitvertreib nebenbei - Kreatief-Helfer")

      Ist nur ein Pokemonspiel mit üblicher Story und nicht so üblicher Story.
      Ist inzwischen alles schonmal dagewesen. XD
    • Lost Island
      :rmxp: Harvest Moon - Lost Island
      (Arbeitstitel, "Eventtechnik-Projekt")

      Ist momentan mein Hauptprojekt, weil bei EE die Scripts einfach fehlen :<
      Das Spiel ist ein Harvest Moon Abklatsch. XD
      Felder funktionieren, Tiere auch, Grafiken sehen schon gut aus, Maps sind fast fertig. Man kann in die Miene, man kann einkaufen. Auf dem Papier ist alles schon durchgeplant, einiges muss noch umgesetzt werden.
  • Joseys Fortschritt

    • Endless Ending
      :hourglass: Story: 60%
      :foaf: Charas: 20%
      :leaf: Maps: 01%
      :ruby: Zeichnungen: 05%
      :color: Grafiken: 30%
      :clipboard: Scripte: 70%
      :music-beam-16: Musik: 00%
      ...ist nicht viel, huh? ^^°
    • Scripted Desaster
      :hourglass: Story: 10%
      :foaf: Charas: 60%
      :leaf: Maps: 30%
      :ruby: Zeichnungen: 01%
      :color: Grafiken: 60%
      :clipboard: Scripte: 70%
      :music-beam-16: Musik: 00%
      Gut Ding...
    • Pokemon EV
      :hourglass: Story: 60%
      :foaf: Charas: 10%
      :leaf: Maps: 00%
      :ruby: Zeichnungen: 00%
      :color: Grafiken: 80%
      :clipboard: Scripte: 90%
      :music-beam-16: Musik: 70%
      Nicht ernstnehmen XD Das mache ich nur, wenn woanders nix mehr geht...
    • Lost Island
      :hourglass: Story: 100%
      :foaf: Charas: 10%
      :leaf: Maps: 90%
      :ruby: Zeichnungen: 00%
      :color: Grafiken: 60%
      :clipboard: Scripte: 90%
      :music-beam-16: Musik: 00%
      Das macht richtig Spaß XD
  • Huiii

    Bitte klicken Sie weiter. Hier gibt es nichts zu sehen. Nichts. Hören Sie? Nichts.

Shabraxxx

Projekt: Ressourcenbereich & Seitenredaktion

  • »Shabraxxx« ist der Autor dieses Themas

Motto: Mein Luftkissenfahrzeug ist voller Aale.

  • Nachricht senden

26

Samstag, 28. August 2021, 10:04

Haha, Josey, der war nicht schlecht.

Ich nutze deinen Post einfach mal als Anlass, mein Problem nochmal sanft in Richtung Zauberhut zu schubsen. Abgesehen vom hinterlegen der neuen Grafiken ist das Problem ja nun absolut gut gelöst, dieser letzte Fitzel noch, dann bin ich glücklich. Nachdem ich mir dieses hübsche kleine Script angeschaut habe, dachte ich auch, irgendwie eine Idee zu haben, quasi einen Buffer basteln zu können, aber weit gefehlt.
Vielleicht hat ja ein gewisser Lieblingscoder ein bisschen Zeit und… Muße.
Gruß, Shabz



PS: Schubsi, ganz sachte.
„Albrecht Dürer, geboren 1471, gestorben 1530.
Der Nürnberger Maler, der ganz Europa faszinierte; mit seinem scharfen Auge, seiner Meisterschaft in Linienführung und Plastizität, sowie seiner Leihwagenfirma.“

Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »Shabraxxx« (23. September 2021, 16:18)


Shabraxxx

Projekt: Ressourcenbereich & Seitenredaktion

  • »Shabraxxx« ist der Autor dieses Themas

Motto: Mein Luftkissenfahrzeug ist voller Aale.

  • Nachricht senden

27

Freitag, 24. September 2021, 23:55

PS: Schubsi, ganz sachte.
„Albrecht Dürer, geboren 1471, gestorben 1530.
Der Nürnberger Maler, der ganz Europa faszinierte; mit seinem scharfen Auge, seiner Meisterschaft in Linienführung und Plastizität, sowie seiner Leihwagenfirma.“

Ähnliche Themen

Social Bookmarks