• Anmelden

1

Sonntag, 30. Dezember 2007, 10:32

Kreditkarte zu Izzy's Bank

Hey leute,

wieder einmal nerve ich euch mit meinen blöden fragen^^. Also vllt kennt ja einer von euch Izzy's Geld- und Itembank. Ich habe mir überlegt, das es doch
auch mal geschickt wäre, wenn man mit Kreditkarte zahlen könnte. Denn mal angenommen man hat kein Geld bei sich und weit und breit ist keine Bank
und nun will man sich nen Trank kaufen. Also wäre nett, wenn einer mir sagen könnte wie es geht und/oder das Skript umschreibt. Ein Crediteintrag ist
verständlicherweise auch für die person drinne^^

PS: Wenn man im Shop skript ändern muss sollte ich noch dazu sagen, dass ich das standart-skript benutze.

Hier noch das Skript von Izzy, wer es nicht hat.
Spoiler

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
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
#==============================================================================
#Izzy's Geld und Itembank script
#==============================================================================
 
module KGC
 
  DEPOSITORY_COMMAND = [
    "Geld Anlegen", 
          "Geld Abheben", 
        "Item Ablegen", 
      "Item Mitnehmen" 
   ]
 
  DEPOSITORY_HELP = [
    "Hier kannst du dein Geld ablegen und sparen !", 
                "Hier kannst du dein gespartes Geld abheben !", 
        "Hier kannst du Gegenstände aufbewaren !", 
              "Hier kannst du aufbewarte Gegestände wieder mitnehmen !" 
   ]
 
  DEPOSITORY_GOLD_DIGITS = 7
  DEPOSIT_GOLD = "Ablegen"
  WDEPOSIT_GOLD = "Mitnehmen"
  DEPOSIT_ITEM = "Ablegen"
  WDEPOSIT_ITEM = "Mitnehmen"
end
 
$imported = {} if $imported == nil
$imported["Aufbewahrungsort"] = true
 
def call_depository(type = 0)
  $game_player.straighten
  $scene = Scene_Depository.new(type)
end
 
class Game_Party
 
  alias initialize_KGC_Depository initialize
  def initialize
 
    initialize_KGC_Depository
 
    @deposit_gold = 0
    @deposit_item, @deposit_weapon, @deposit_armor = [], [], []
  end
 
  def deposit_gold
    @deposit_gold = 0 if @deposit_gold == nil
    return @deposit_gold
  end
 
  def gain_deposit_gold(number)
    @deposit_gold = 0 if @deposit_gold == nil
    @deposit_gold += number
  end
 
  def lose_deposit_gold(number)
    self.gain_deposit_gold(-number)
  end
 
  def deposit_item_number(id)
    @deposit_item = [] if @deposit_item == nil
    return @deposit_item[id] != nil ? @deposit_item[id] : 0
  end
 
  def gain_deposit_item(id, number)
    @deposit_item = [] if @deposit_item == nil
    @deposit_item[id] = 0 if @deposit_item[id] == nil
    @deposit_item[id] += number
  end
 
  def lose_deposit_item(id, number)
    self.gain_deposit_item(id, -number)
  end
 
  def deposit_weapon_number(id)
    @deposit_weapon = [] if @deposit_weapon == nil
    return @deposit_weapon[id] != nil ? @deposit_weapon[id] : 0
  end
 
  def gain_deposit_weapon(id, number)
    @deposit_weapon = [] if @deposit_weapon == nil
    @deposit_weapon[id] = 0 if @deposit_weapon[id] == nil
    @deposit_weapon[id] += number
  end
 
  def lose_deposit_weapon(id, number)
    self.gain_deposit_weapon(id, -number)
  end
 
  def deposit_armor_number(id)
    @deposit_armor = [] if @deposit_armor == nil
    return @deposit_armor[id] != nil ? @deposit_armor[id] : 0
  end
 
  def gain_deposit_armor(id, number)
    @deposit_armor = [] if @deposit_armor == nil
    @deposit_armor[id] = 0 if @deposit_armor[id] == nil
    @deposit_armor[id] += number
  end
 
  def lose_deposit_armor(id, number)
    self.gain_deposit_armor(id, -number)
  end
end
 
class Window_DepositoryCommand < Window_Selectable
 
  def initialize(type)
    super(0, 64, 640, 64)
    self.y = 128 if $imported["Hilfe"]
    self.contents = Bitmap.new(width - 32, height - 32)
 
    case type
    when 1 
       @commands = KGC::DEPOSITORY_COMMAND[0, 2]
      @help_text = KGC::DEPOSITORY_HELP[0, 2]
    when 2 
       @commands = KGC::DEPOSITORY_COMMAND[2, 2]
      @help_text = KGC::DEPOSITORY_HELP[2, 2]
    else 
         @commands = KGC::DEPOSITORY_COMMAND
      @help_text = KGC::DEPOSITORY_HELP
    end
    @item_max = @commands.size
    @column_max = @commands.size
    @item_width = (width - 32) / @commands.size
    self.back_opacity = 160
    self.index = 0
    refresh
  end
 
  def refresh
    for i in 0...@commands.size
      rect = Rect.new(@item_width * i, 0, @item_width, 32)
      self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
      self.contents.font.color = system_color
      self.contents.draw_text(rect, @commands[i], 1)
    end
  end
 
  def update_cursor_rect
    if index != -1
      self.cursor_rect.set(@item_width * index, 0, @item_width, 32)
    end
  end
 
  def update_help
    @help_window.set_text(@help_text[self.index])
  end
end
 
class Window_DepositoryGold < Window_Base
 
  def initialize
    super(0, 128, 640, 352)
    if $imported["Hilfe"]
      self.y = 192
      self.height = 288
    end
    @digits_max = KGC::DEPOSITORY_GOLD_DIGITS
    dummy_bitmap = Bitmap.new(32, 32)
    @cursor_width = dummy_bitmap.text_size("0").width + 8
    dummy_bitmap.dispose
    self.contents = Bitmap.new(width - 32, height - 32)
    self.back_opacity = 160
    self.active = false
    self.visible = false
    @cursor_position = 0
    @max = 0
    @price = 0
    @index = 0
  end
 
  def price
    return @price
  end
 
  def price=(np)
    @price = [[np, 0].max, @max].min
    redraw_price
  end
 
  def reset(type)
    @price = 0
    @index = @digits_max - 1
    refresh(type)
  end
 
  def refresh(type)
 
    self.contents.clear
    domination = $data_system.words.gold
    cx = contents.text_size(domination).width
    @cursor_position = 332 - cx - @cursor_width * @digits_max
    self.contents.font.color = system_color
    self.contents.draw_text(0, 0, 608, 32, "Geld im Rucksack")
    self.contents.draw_text(0, 64, 608, 32, "Geld auf Bank")
    if type == 0
      self.contents.draw_text(0, 128, 608, 32, "Geld ablegen")
      @max = $game_party.gold
    else
      self.contents.draw_text(0, 128, 608, 32, "Geld mitnehmen")
      @max = [10 ** @digits_max - $game_party.gold - 1, $game_party.deposit_gold].min
    end
    self.contents.font.color = normal_color
    self.contents.draw_text(4, 32, 326 - cx, 32, $game_party.gold.to_s, 2)
    self.contents.font.color = system_color
    self.contents.draw_text(332 - cx, 32, cx, 32, domination, 2)
    self.contents.font.color = normal_color
    self.contents.draw_text(4, 96, 326 - cx, 32, $game_party.deposit_gold.to_s, 2)
    self.contents.font.color = system_color
    self.contents.draw_text(332 - cx, 96, cx, 32, domination, 2)
    redraw_price
  end
 
  def redraw_price
    domination = $data_system.words.gold
    cx = contents.text_size(domination).width
    self.contents.fill_rect(0, 160, 608, 32, Color.new(0, 0, 0, 0))
    self.contents.font.color = normal_color
    text = sprintf("%0#{@digits_max}d", self.price)
    for i in 0...text.length
      x = @cursor_position + (i - 1) * @cursor_width
      self.contents.draw_text(x, 160, 32, 32, text[i, 1], 2)
    end
    self.contents.font.color = system_color
    self.contents.draw_text(332 - cx, 160, cx, 32, domination, 2)
  end
 
  def update_cursor_rect
    x = @cursor_position + @index * @cursor_width
    self.cursor_rect.set(x, 160, @cursor_width, 32)
  end
 
  def update
    super
    return unless self.active
 
    if Input.repeat?(Input::UP) || Input.repeat?(Input::DOWN)
      $game_system.se_play($data_system.cursor_se)
 
      place = 10 ** (@digits_max - 1 - @index)
      n = self.price / place % 10
      self.price -= n * place
        n = (n + 1) % 10 if Input.repeat?(Input::UP)
      n = (n + 9) % 10 if Input.repeat?(Input::DOWN)
 
      self.price += n * place
    end
     if Input.repeat?(Input::RIGHT)
      if @digits_max >= 2
        $game_system.se_play($data_system.cursor_se)
        @index = (@index + 1) % @digits_max
      end
    end
     if Input.repeat?(Input::LEFT)
      if @digits_max >= 2
        $game_system.se_play($data_system.cursor_se)
        @index = (@index + @digits_max - 1) % @digits_max
      end
    end
    update_cursor_rect
  end
end
 
class Window_DepositoryItem < Window_Selectable
 
  def initialize
    super(0, 128, 640, 352)
    if $imported["Hilfe"]
      self.y = 192
      self.height = 288
    end
    self.back_opacity = 160
    self.active = false
    self.visible = false
    @column_max = 2
    self.index = 0
  end
 
  def item
    return @data[self.index]
  end
 
  def refresh(type, reset = false)
    if self.contents != nil
      self.contents.dispose
      self.contents = nil
    end
    @data = []
    last_index = self.index
       case type
    when 0
      for i in 1...$data_items.size
        if $game_party.item_number(i) > 0
          @data.push($data_items[i])
        end
      end
      for i in 1...$data_weapons.size
        if $game_party.weapon_number(i) > 0
          @data.push($data_weapons[i])
        end
      end
      for i in 1...$data_armors.size
        if $game_party.armor_number(i) > 0
          @data.push($data_armors[i])
        end
      end
    when 1
      for i in 1...$data_items.size
        if $game_party.deposit_item_number(i) > 0
          @data.push($data_items[i])
        end
      end
      for i in 1...$data_weapons.size
        if $game_party.deposit_weapon_number(i) > 0
          @data.push($data_weapons[i])
        end
      end
      for i in 1...$data_armors.size
        if $game_party.deposit_armor_number(i) > 0
          @data.push($data_armors[i])
        end
      end
    end
    if reset
      self.index = 0
    else
      self.index = @data[last_index] != nil ? last_index :
        [last_index - 1, 0].max
    end
 
    @item_max = @data.size
    if @item_max > 0
      self.contents = Bitmap.new(width - 32, row_max * 32)
      for i in 0...@item_max
        draw_item(i, type)
      end
    end
  end
 
  def draw_item(index, type)
    item = @data[index]
    case item
    when RPG::Item
      number = type == 0 ? $game_party.item_number(item.id) :
        $game_party.deposit_item_number(item.id)
    when RPG::Weapon
      number = type == 0 ? $game_party.weapon_number(item.id) :
        $game_party.deposit_weapon_number(item.id)
    when RPG::Armor
      number = type == 0 ? $game_party.armor_number(item.id) :
        $game_party.deposit_armor_number(item.id)
    end
    x = 4 + index % 2 * (288 + 32)
    y = index / 2 * 32
    rect = Rect.new(x, y, self.width / @column_max - 32, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    bitmap = RPG::Cache.icon(item.icon_name)
    self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
    self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
    self.contents.draw_text(x + 240, y, 16, 32, ":", 1)
    self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
  end
 
  def update_help
    @help_window.set_text(self.item == nil ? "" : self.item.description)
  end
end
 
class Window_DepositoryNumber < Window_Base
 
  def initialize
    @digits_max = 2
    @number = 0
 
    dummy_bitmap = Bitmap.new(32, 32)
    @cursor_width = dummy_bitmap.text_size("0").width + 8
    dummy_bitmap.dispose
    @default_size = @cursor_width * @digits_max + 32
    super(0, 0, @default_size, 128)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.z = 1000
    self.back_opacity = 160
    self.active = false
    self.visible = false
    @index = 0
    @item = nil
    refresh
    update_cursor_rect
  end
 
  def item=(item)
    @item = item
  end
 
  def number
    return @number
  end
   def number=(number)
    @number = [[number, 0].max, @max].min
    refresh
  end
 
  def update_cursor_rect
    self.cursor_rect.set(@index * @cursor_width, 32, @cursor_width, 32)
  end
 
  def reset(type)
    @number = 0
    @index = @digits_max - 1
    if type == 0
      case @item
      when RPG::Item
        @max = $game_party.item_number(@item.id)
        dep = $game_party.deposit_item_number(@item.id)
      when RPG::Weapon
        @max = $game_party.weapon_number(@item.id)
        dep = $game_party.deposit_weapon_number(@item.id)
      when RPG::Armor
        @max = $game_party.armor_number(@item.id)
        dep = $game_party.deposit_armor_number(@item.id)
      end
 
      self.contents.fill_rect(0, 64, width - 32, 32, Color.new(0, 0, 0, 0))
      self.contents.font.color = system_color
      self.contents.draw_text(0, 64, width - 32, 32, "Bank#{dep}")
    else
      case @item
      when RPG::Item
        @max = [$game_party.deposit_item_number(@item.id),
          10 ** @digits_max - $game_party.item_number(@item.id) - 1].min
        having = $game_party.item_number(@item.id)
      when RPG::Weapon
        @max = [$game_party.deposit_weapon_number(@item.id),
          10 ** @digits_max - $game_party.weapon_number(@item.id) - 1].min
        having = $game_party.weapon_number(@item.id)
      when RPG::Armor
        @max = [$game_party.deposit_armor_number(@item.id),
          10 ** @digits_max - $game_party.armor_number(@item.id) - 1].min
        having = $game_party.armor_number(@item.id)
      end
      # 所持数を描画
      self.contents.fill_rect(0, 64, width - 32, 32, Color.new(0, 0, 0, 0))
      self.contents.font.color = system_color
      self.contents.draw_text(0, 64, width - 32, 32, "Rucksack#{having}")
    end
    refresh
  end
 
  def refresh
    self.contents.fill_rect(0, 32, width - 32, 32, Color.new(0, 0, 0, 0))
    self.contents.font.color = normal_color
    s = sprintf("%0*d", @digits_max, @number)
    for i in 0...@digits_max
      self.contents.draw_text(i * @cursor_width + 4, 32, 32, 32, s[i,1])
    end
  end
 
  def set_text(string = " ")
    self.resize(self.contents.text_size(string).width + 40)
    self.contents.fill_rect(0, 0, width - 32, 32, Color.new(0, 0, 0, 0))
    self.contents.font.color = normal_color
    self.contents.draw_text(0, 0, width - 32, 32, string, 1)
    refresh
    centering
  end
 
  def resize(nw)
    self.width = nw
    buf = self.contents.dup
    self.contents.dispose
    self.contents = Bitmap.new(nw - 32, 96)
    self.contents.blt(0, 0, buf, buf.rect)
    buf.dispose
  end
 
  def centering
    self.x = 320 - self.width / 2
    self.y = 240 - self.height / 2
  end
 
  def update
    super
    return unless self.active
 
    if Input.repeat?(Input::UP) || Input.repeat?(Input::DOWN)
      $game_system.se_play($data_system.cursor_se)
 
      place = 10 ** (@digits_max - 1 - @index)
      n = self.number / place % 10
      self.number -= n * place
 
      n = (n + 1) % 10 if Input.repeat?(Input::UP)
      n = (n + 9) % 10 if Input.repeat?(Input::DOWN)
 
      self.number += n * place
      refresh
    end
     if Input.repeat?(Input::RIGHT)
      if @digits_max >= 2
        $game_system.se_play($data_system.cursor_se)
        @index = (@index + 1) % @digits_max
      end
    end
 
    if Input.repeat?(Input::LEFT)
      if @digits_max >= 2
        $game_system.se_play($data_system.cursor_se)
        @index = (@index + @digits_max - 1) % @digits_max
      end
    end
    update_cursor_rect
  end
end
 
class Scene_Depository
 
  def initialize(type)
    @type = type
    case type
    when 1 
       @command_money = 0
      @command_item = 100
    when 2 
       @command_money = 100
      @command_item = 0
    else 
         @command_money = 0
      @command_item = 2
    end
  end
 
  def main
 
    @spriteset = Spriteset_Map.new
 
    if $imported["Hilfe"]
      @dummy_window = Window_Base.new(0, 192, 640, 288)
      @help_window = Window_HelpExtension.new
    else
      @dummy_window = Window_Base.new(0, 128, 640, 352)
      @help_window = Window_Help.new
    end
    @dummy_window.back_opacity = 160
    @help_window.back_opacity = 160
    @command_window = Window_DepositoryCommand.new(@type)
    @gold_window = Window_DepositoryGold.new
    @item_window = Window_DepositoryItem.new
    @number_window = Window_DepositoryNumber.new
 
    @command_window.help_window = @help_window
    @item_window.help_window = @help_window
 
    Graphics.transition
 
    loop {
      Graphics.update
      Input.update
      update
      break if $scene != self
    }
 
    Graphics.freeze
 
    @spriteset.dispose
    @dummy_window.dispose
    @help_window.dispose
    @command_window.dispose
    @gold_window.dispose
    @item_window.dispose
    @number_window.dispose
  end
 
  def update
 
    @dummy_window.update
    @help_window.update
    @command_window.update
    @gold_window.update
    @item_window.update
    @number_window.update
 
    if @command_window.active
      update_command
      return
    end
 
    if @gold_window.active
      update_gold
      return
    end
 
    if @item_window.active
      update_item
      return
    end
      if @number_window.active
      update_number
      return
    end
  end
 
  def update_command
 
    if Input.trigger?(Input::B)
         $game_system.se_play($data_system.cancel_se)
         $scene = Scene_Map.new
      return
    end
 
    if Input.trigger?(Input::C)
 
      $game_system.se_play($data_system.decision_se)
         case @command_window.index
      when @command_money
               @gold_window.active = true
        @gold_window.visible = true
        @gold_window.reset(0)
        @help_window.set_text(KGC::DEPOSIT_GOLD)
      when @command_money + 1
          @gold_window.active = true
        @gold_window.visible = true
        @gold_window.reset(1)
        @help_window.set_text(KGC::WDEPOSIT_GOLD)
      when @command_item
          @item_window.refresh(0, true)
        @item_window.active = true
        @item_window.visible = true
      when @command_item + 1
         @item_window.refresh(1, true)
        @item_window.active = true
        @item_window.visible = true
      end
      @command_window.active = false
 
      @dummy_window.visible = false
      return
    end
  end
 
  def update_gold
 
    if Input.trigger?(Input::B)
          $game_system.se_play($data_system.cancel_se)
       @command_window.active = true
      @gold_window.active = false
      @gold_window.visible = false
      @dummy_window.visible = true
      return
    end
 
    if Input.trigger?(Input::C)
 
      price = @gold_window.price
 
      if price == 0
 
        $game_system.se_play($data_system.decision_se)
 
        @command_window.active = true
        @gold_window.active = false
        @gold_window.visible = false
        @dummy_window.visible = true
        return
      end
           $game_system.se_play($data_system.shop_se)
           case @command_window.index
      when @command_money 
             $game_party.lose_gold(price)
        $game_party.gain_deposit_gold(price)
      when @command_money + 1 
         $game_party.gain_gold(price)
        $game_party.lose_deposit_gold(price)
      end
          @gold_window.reset(@command_window.index)
      return
    end
  end
 
  def update_item
       if Input.trigger?(Input::B)
         $game_system.se_play($data_system.cancel_se)
           @command_window.active = true
      @item_window.active = false
      @item_window.visible = false
      @dummy_window.visible = true
      return
    end
     if Input.trigger?(Input::C)
            @item = @item_window.item
           if @item == nil
                $game_system.se_play($data_system.buzzer_se)
        return
      end
          @number_window.item = @item
          $game_system.se_play($data_system.decision_se)
          case @command_window.index
      when @command_item 
            @number_window.set_text(KGC::DEPOSIT_ITEM)
      when @command_item + 1 
        @number_window.set_text(KGC::WDEPOSIT_ITEM)
      end
           @number_window.reset(@command_window.index - @command_item)
            @item_window.active = false
      @number_window.active = true
      @number_window.visible = true
      return
    end
  end
   def update_number
      if Input.trigger?(Input::B)
          $game_system.se_play($data_system.cancel_se)
          @item_window.active = true
      @number_window.active = false
      @number_window.visible = false
      return
    end
     if Input.trigger?(Input::C)
            $game_system.se_play($data_system.decision_se)
      number = @number_window.number
           case @command_window.index
      when @command_item 
         case @item
        when RPG::Item
          $game_party.lose_item(@item.id, number)
          $game_party.gain_deposit_item(@item.id, number)
        when RPG::Weapon
          $game_party.lose_weapon(@item.id, number)
          $game_party.gain_deposit_weapon(@item.id, number)
        when RPG::Armor
          $game_party.lose_armor(@item.id, number)
          $game_party.gain_deposit_armor(@item.id, number)
        end
      when @command_item + 1 
         case @item
        when RPG::Item
          $game_party.gain_item(@item.id, number)
          $game_party.lose_deposit_item(@item.id, number)
        when RPG::Weapon
          $game_party.gain_weapon(@item.id, number)
          $game_party.lose_deposit_weapon(@item.id, number)
        when RPG::Armor
          $game_party.gain_armor(@item.id, number)
          $game_party.lose_deposit_armor(@item.id, number)
        end
      end
           @item_window.refresh(@command_window.index - @command_item)
           @item_window.active = true
      @number_window.active = false
      @number_window.visible = false
      return
    end
  end
end 
#Fertig xD 2h. 35min. 27sek.
zum Lesen den Text mit der Maus markieren
  • Everedge

    Bild
  • Battle-Bonzn

    Bild
  • Aurora Hearts

    Bild
  • Nichts!!!^^

    Ich sagte doch, hier ist nichts!^^ :-P

2

Donnerstag, 10. Januar 2008, 16:50

Bitte entschuldigt den Doppelpost, aber ich wollte mal wissen, ob ich richtig der Annahme gehe, dass niemand weiß wie das geht oder
niemand lust hat das zu machen?

Greez Eledor
  • Everedge

    Bild
  • Battle-Bonzn

    Bild
  • Aurora Hearts

    Bild
  • Nichts!!!^^

    Ich sagte doch, hier ist nichts!^^ :-P

3

Freitag, 11. Januar 2008, 18:30

Ich findes es ehh nicht so ne gute Idee wenn mann sein Konto überziehen kann. So oder so verliert man kein Geld beim Kämpfen, also nicht so wichtig sein Geld auf zu bewahren. Danach hätte es den selben Effekt wenn du jemandem direkt 10000gm gibst( das was er überziehen kann). Außerdem würde es ja sonst wenig Spaß machen wenn mann alle Waffen hat oder zuviel Tränke.
Das ist meine Meinung. Dazu ist es nicht einfach das in den "Change Gold"-Befehl einzubauen.

4

Freitag, 11. Januar 2008, 23:21

Ich glaube, da hast du was falsch verstanden^^, also ich will ja auch nicht, dass man überziehen kann, sondern nur auf das geld zugreifen, dass man auf der bank hat. Wäre ja wirklich blöd, wenn man überziehen könnte, denn dann würde es ja keinen spaß mehr machen.

greez Eledor
  • Everedge

    Bild
  • Battle-Bonzn

    Bild
  • Aurora Hearts

    Bild
  • Nichts!!!^^

    Ich sagte doch, hier ist nichts!^^ :-P

5

Samstag, 12. Januar 2008, 22:03

Aso, ok. Hmm das wird schwierig. Es gibt keine Variable "Abgelegtes Gold"(oder wie auch immer) welche sich auslesen und verändern lässt. Dazu müsst ich erst das Script verändern. Und erlich, das ist nicht leicht wenn es garkeine Kommentare gibt. Naja kannst du Izzly nicht mal fragen? Sonst würde ich es gern machen. Naja such erst mal weiter, vll find ich ja was.
Edit Habs gefunden.

6

Samstag, 12. Januar 2008, 22:29

Das Skript im Original von Tomy/KGC. Izzy hat es nur übersetzt auf deutsch vom japanischen.
Ist $game_party.deposit_gold nicht die Variable zum "Kontostand" ?

7

Sonntag, 13. Januar 2008, 10:13

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
#==============================================================================
# ** Scene_Shop
#------------------------------------------------------------------------------
#  This class performs shop screen processing.
#==============================================================================
 
class Scene_Shop
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    # Make help window
    @help_window = Window_Help.new
    # Make command window
    @command_window = Window_ShopCommand.new
    # Make gold window
    @gold_window = Window_Gold.new
    @gold_window.x = 480
    @gold_window.y = 64
    # Make dummy window
    @dummy_window = Window_Base.new(0, 128, 640, 352)
    # Make buy window
    @buy_window = Window_ShopBuy.new($game_temp.shop_goods)
    @buy_window.active = false
    @buy_window.visible = false
    @buy_window.help_window = @help_window
    # Make sell window
    @sell_window = Window_ShopSell.new
    @sell_window.active = false
    @sell_window.visible = false
    @sell_window.help_window = @help_window
    # Make quantity input window
    @number_window = Window_ShopNumber.new
    @number_window.active = false
    @number_window.visible = false
    # Make status window
    @status_window = Window_ShopStatus.new
    @status_window.visible = false
    # Execute transition
    Graphics.transition
    # Main loop
    loop do
      # Update game screen
      Graphics.update
      # Update input information
      Input.update
      # Frame update
      update
      # Abort loop if screen is changed
      if $scene != self
        break
      end
    end
    # Prepare for transition
    Graphics.freeze
    # Dispose of windows
    @help_window.dispose
    @command_window.dispose
    @gold_window.dispose
    @dummy_window.dispose
    @buy_window.dispose
    @sell_window.dispose
    @number_window.dispose
    @status_window.dispose
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Update windows
    @help_window.update
    @command_window.update
    @gold_window.update
    @dummy_window.update
    @buy_window.update
    @sell_window.update
    @number_window.update
    @status_window.update
    # If command window is active: call update_command
    if @command_window.active
      update_command
      return
    end
    # If buy window is active: call update_buy
    if @buy_window.active
      update_buy
      return
    end
    # If sell window is active: call update_sell
    if @sell_window.active
      update_sell
      return
    end
    # If quantity input window is active: call update_number
    if @number_window.active
      update_number
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (when command window is active)
  #--------------------------------------------------------------------------
  def update_command
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Switch to map screen
      $scene = Scene_Map.new
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # Branch by command window cursor position
      case @command_window.index
      when 0  # buy
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Change windows to buy mode
        @command_window.active = false
        @dummy_window.visible = false
        @buy_window.active = true
        @buy_window.visible = true
        @buy_window.refresh
        @status_window.visible = true
      when 1  # sell
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Change windows to sell mode
        @command_window.active = false
        @dummy_window.visible = false
        @sell_window.active = true
        @sell_window.visible = true
        @sell_window.refresh
      when 2  # quit
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to map screen
        $scene = Scene_Map.new
      end
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (when buy window is active)
  #--------------------------------------------------------------------------
  def update_buy
    # Set status window item
    @status_window.item = @buy_window.item
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Change windows to initial mode
      @command_window.active = true
      @dummy_window.visible = true
      @buy_window.active = false
      @buy_window.visible = false
      @status_window.visible = false
      @status_window.item = nil
      # Erase help text
      @help_window.set_text("")
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # Get item
      @item = @buy_window.item
      # If item is invalid, or price is higher than money possessed
      if @item == nil or @item.price > $game_party.gold and @item.price > $game_party.deposit_gold -$game_party.gold
        # Play buzzer SE
        $game_system.se_play($data_system.buzzer_se)
        return
      # Get items in possession count
      case @item
      when RPG::Item
        number = $game_party.item_number(@item.id)
      when RPG::Weapon
        number = $game_party.weapon_number(@item.id)
      when RPG::Armor
        number = $game_party.armor_number(@item.id)
      end
      # If 99 items are already in possession
      if number == 99
        # Play buzzer SE
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      # Play decision SE
      $game_system.se_play($data_system.decision_se)
      # Calculate maximum amount possible to buy
      max = @item.price == 0 ? 99 : $game_party.gold / @item.price
      max = [max, 99 - number].min
      if $game_party.gold < 0
        $game_party.gain_deposit_gold($game_party.gold)
        $game_party.gold = 0
      end
      # Change windows to quantity input mode
      @buy_window.active = false
      @buy_window.visible = false
      @number_window.set(@item, max, @item.price)
      @number_window.active = true
      @number_window.visible = true
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (when sell window is active)
  #--------------------------------------------------------------------------
  def update_sell
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Change windows to initial mode
      @command_window.active = true
      @dummy_window.visible = true
      @sell_window.active = false
      @sell_window.visible = false
      @status_window.item = nil
      # Erase help text
      @help_window.set_text("")
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # Get item
      @item = @sell_window.item
      # Set status window item
      @status_window.item = @item
      # If item is invalid, or item price is 0 (unable to sell)
      if @item == nil or @item.price == 0
        # Play buzzer SE
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      # Play decision SE
      $game_system.se_play($data_system.decision_se)
      # Get items in possession count
      case @item
      when RPG::Item
        number = $game_party.item_number(@item.id)
      when RPG::Weapon
        number = $game_party.weapon_number(@item.id)
      when RPG::Armor
        number = $game_party.armor_number(@item.id)
      end
      # Maximum quanitity to sell = number of items in possession
      max = number
      # Change windows to quantity input mode
      @sell_window.active = false
      @sell_window.visible = false
      @number_window.set(@item, max, @item.price / 2)
      @number_window.active = true
      @number_window.visible = true
      @status_window.visible = true
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (when quantity input window is active)
  #--------------------------------------------------------------------------
  def update_number
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Set quantity input window to inactive / invisible
      @number_window.active = false
      @number_window.visible = false
      # Branch by command window cursor position
      case @command_window.index
      when 0  # buy
        # Change windows to buy mode
        @buy_window.active = true
        @buy_window.visible = true
      when 1  # sell
        # Change windows to sell mode
        @sell_window.active = true
        @sell_window.visible = true
        @status_window.visible = false
      end
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # Play shop SE
      $game_system.se_play($data_system.shop_se)
      # Set quantity input window to inactive / invisible
      @number_window.active = false
      @number_window.visible = false
      # Branch by command window cursor position
      case @command_window.index
      when 0  # buy
        # Buy process
        $game_party.lose_gold(@number_window.number * @item.price)
        case @item
        when RPG::Item
          $game_party.gain_item(@item.id, @number_window.number)
        when RPG::Weapon
          $game_party.gain_weapon(@item.id, @number_window.number)
        when RPG::Armor
          $game_party.gain_armor(@item.id, @number_window.number)
        end
        # Refresh each window
        @gold_window.refresh
        @buy_window.refresh
        @status_window.refresh
        # Change windows to buy mode
        @buy_window.active = true
        @buy_window.visible = true
      when 1  # sell
        # Sell process
        $game_party.gain_gold(@number_window.number * (@item.price / 2))
        case @item
        when RPG::Item
          $game_party.lose_item(@item.id, @number_window.number)
        when RPG::Weapon
          $game_party.lose_weapon(@item.id, @number_window.number)
        when RPG::Armor
          $game_party.lose_armor(@item.id, @number_window.number)
        end
        # Refresh each window
        @gold_window.refresh
        @sell_window.refresh
        @status_window.refresh
        # Change windows to sell mode
        @sell_window.active = true
        @sell_window.visible = true
        @status_window.visible = false
      end
      return
    end
  end
end

Ersetzte dein SceneShop damit.
Habs nicht ausprobiert dürfte aber klappen.

8

Sonntag, 13. Januar 2008, 13:37

Danke dir Tikrass, aber wenn ich dann das spiel starten will, steht da, dass in zeile 170 ein fehler ist :-|

Greez Eledor
  • Everedge

    Bild
  • Battle-Bonzn

    Bild
  • Aurora Hearts

    Bild
  • Nichts!!!^^

    Ich sagte doch, hier ist nichts!^^ :-P

9

Sonntag, 13. Januar 2008, 13:47

Was denn für einer??? Für die Zukunft. Immer posten was da steht.

10

Sonntag, 13. Januar 2008, 14:02

Okay, werde ich mir für die Zukunft merken^^

Also da Steht:
Script 'Scene_Shop' line 170: SyntaxError occurred.

Greez Eledor
  • Everedge

    Bild
  • Battle-Bonzn

    Bild
  • Aurora Hearts

    Bild
  • Nichts!!!^^

    Ich sagte doch, hier ist nichts!^^ :-P

11

Sonntag, 13. Januar 2008, 16:28

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
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
#==============================================================================
# ** Scene_Shop
#------------------------------------------------------------------------------
#  This class performs shop screen processing.
#==============================================================================
 
class Scene_Shop
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    # Make help window
    @help_window = Window_Help.new
    # Make command window
    @command_window = Window_ShopCommand.new
    # Make gold window
    @gold_window = Window_Gold.new
    @gold_window.x = 480
    @gold_window.y = 64
    # Make dummy window
    @dummy_window = Window_Base.new(0, 128, 640, 352)
    # Make buy window
    @buy_window = Window_ShopBuy.new($game_temp.shop_goods)
    @buy_window.active = false
    @buy_window.visible = false
    @buy_window.help_window = @help_window
    # Make sell window
    @sell_window = Window_ShopSell.new
    @sell_window.active = false
    @sell_window.visible = false
    @sell_window.help_window = @help_window
    # Make quantity input window
    @number_window = Window_ShopNumber.new
    @number_window.active = false
    @number_window.visible = false
    # Make status window
    @status_window = Window_ShopStatus.new
    @status_window.visible = false
    # Execute transition
    Graphics.transition
    # Main loop
    loop do
      # Update game screen
      Graphics.update
      # Update input information
      Input.update
      # Frame update
      update
      # Abort loop if screen is changed
      if $scene != self
        break
      end
    end
    # Prepare for transition
    Graphics.freeze
    # Dispose of windows
    @help_window.dispose
    @command_window.dispose
    @gold_window.dispose
    @dummy_window.dispose
    @buy_window.dispose
    @sell_window.dispose
    @number_window.dispose
    @status_window.dispose
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Update windows
    @help_window.update
    @command_window.update
    @gold_window.update
    @dummy_window.update
    @buy_window.update
    @sell_window.update
    @number_window.update
    @status_window.update
    # If command window is active: call update_command
    if @command_window.active
      update_command
      return
    end
    # If buy window is active: call update_buy
    if @buy_window.active
      update_buy
      return
    end
    # If sell window is active: call update_sell
    if @sell_window.active
      update_sell
      return
    end
    # If quantity input window is active: call update_number
    if @number_window.active
      update_number
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (when command window is active)
  #--------------------------------------------------------------------------
  def update_command
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Switch to map screen
      $scene = Scene_Map.new
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # Branch by command window cursor position
      case @command_window.index
      when 0  # buy
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Change windows to buy mode
        @command_window.active = false
        @dummy_window.visible = false
        @buy_window.active = true
        @buy_window.visible = true
        @buy_window.refresh
        @status_window.visible = true
      when 1  # sell
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Change windows to sell mode
        @command_window.active = false
        @dummy_window.visible = false
        @sell_window.active = true
        @sell_window.visible = true
        @sell_window.refresh
      when 2  # quit
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to map screen
        $scene = Scene_Map.new
      end
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (when buy window is active)
  #--------------------------------------------------------------------------
  def update_buy
    # Set status window item
    @status_window.item = @buy_window.item
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Change windows to initial mode
      @command_window.active = true
      @dummy_window.visible = true
      @buy_window.active = false
      @buy_window.visible = false
      @status_window.visible = false
      @status_window.item = nil
      # Erase help text
      @help_window.set_text("")
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # Get item
      @item = @buy_window.item
      # If item is invalid, or price is higher than money possessed
      if @item == nil or @item.price > $game_party.gold and @item.price > $game_party.deposit_gold -$game_party.gold
        # Play buzzer SE
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      # Get items in possession count
      case @item
      when RPG::Item
        number = $game_party.item_number(@item.id)
      when RPG::Weapon
        number = $game_party.weapon_number(@item.id)
      when RPG::Armor
        number = $game_party.armor_number(@item.id)
      end
      # If 99 items are already in possession
      if number == 99
        # Play buzzer SE
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      # Play decision SE
      $game_system.se_play($data_system.decision_se)
      # Calculate maximum amount possible to buy
      max = @item.price == 0 ? 99 : $game_party.gold / @item.price
      max = [max, 99 - number].min
      if $game_party.gold < 0
        $game_party.gain_deposit_gold($game_party.gold)
        $game_party.gold = 0
      end
      # Change windows to quantity input mode
      @buy_window.active = false
      @buy_window.visible = false
      @number_window.set(@item, max, @item.price)
      @number_window.active = true
      @number_window.visible = true
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (when sell window is active)
  #--------------------------------------------------------------------------
  def update_sell
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Change windows to initial mode
      @command_window.active = true
      @dummy_window.visible = true
      @sell_window.active = false
      @sell_window.visible = false
      @status_window.item = nil
      # Erase help text
      @help_window.set_text("")
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # Get item
      @item = @sell_window.item
      # Set status window item
      @status_window.item = @item
      # If item is invalid, or item price is 0 (unable to sell)
      if @item == nil or @item.price == 0
        # Play buzzer SE
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      # Play decision SE
      $game_system.se_play($data_system.decision_se)
      # Get items in possession count
      case @item
      when RPG::Item
        number = $game_party.item_number(@item.id)
      when RPG::Weapon
        number = $game_party.weapon_number(@item.id)
      when RPG::Armor
        number = $game_party.armor_number(@item.id)
      end
      # Maximum quanitity to sell = number of items in possession
      max = number
      # Change windows to quantity input mode
      @sell_window.active = false
      @sell_window.visible = false
      @number_window.set(@item, max, @item.price / 2)
      @number_window.active = true
      @number_window.visible = true
      @status_window.visible = true
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (when quantity input window is active)
  #--------------------------------------------------------------------------
  def update_number
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Set quantity input window to inactive / invisible
      @number_window.active = false
      @number_window.visible = false
      # Branch by command window cursor position
      case @command_window.index
      when 0  # buy
        # Change windows to buy mode
        @buy_window.active = true
        @buy_window.visible = true
      when 1  # sell
        # Change windows to sell mode
        @sell_window.active = true
        @sell_window.visible = true
        @status_window.visible = false
      end
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # Play shop SE
      $game_system.se_play($data_system.shop_se)
      # Set quantity input window to inactive / invisible
      @number_window.active = false
      @number_window.visible = false
      # Branch by command window cursor position
      case @command_window.index
      when 0  # buy
        # Buy process
        $game_party.lose_gold(@number_window.number * @item.price)
        case @item
        when RPG::Item
          $game_party.gain_item(@item.id, @number_window.number)
        when RPG::Weapon
          $game_party.gain_weapon(@item.id, @number_window.number)
        when RPG::Armor
          $game_party.gain_armor(@item.id, @number_window.number)
        end
        # Refresh each window
        @gold_window.refresh
        @buy_window.refresh
        @status_window.refresh
        # Change windows to buy mode
        @buy_window.active = true
        @buy_window.visible = true
      when 1  # sell
        # Sell process
        $game_party.gain_gold(@number_window.number * (@item.price / 2))
        case @item
        when RPG::Item
          $game_party.lose_item(@item.id, @number_window.number)
        when RPG::Weapon
          $game_party.lose_weapon(@item.id, @number_window.number)
        when RPG::Armor
          $game_party.lose_armor(@item.id, @number_window.number)
        end
        # Refresh each window
        @gold_window.refresh
        @sell_window.refresh
        @status_window.refresh
        # Change windows to sell mode
        @sell_window.active = true
        @sell_window.visible = true
        @status_window.visible = false
      end
      return
    end
  end
end
zum Lesen den Text mit der Maus markieren

12

Sonntag, 13. Januar 2008, 17:50

Danke, aber aus irgendeinem Grund kommt da wieder der gleiche fehler...

Greez Eledor
  • Everedge

    Bild
  • Battle-Bonzn

    Bild
  • Aurora Hearts

    Bild
  • Nichts!!!^^

    Ich sagte doch, hier ist nichts!^^ :-P

13

Sonntag, 13. Januar 2008, 18:12

Ok, so dürfte es gehn.
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
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
#==============================================================================
# ** Scene_Shop
#------------------------------------------------------------------------------
#  This class performs shop screen processing.
#==============================================================================
 
class Scene_Shop
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    # Make help window
    @help_window = Window_Help.new
    # Make command window
    @command_window = Window_ShopCommand.new
    # Make gold window
    @gold_window = Window_Gold.new
    @gold_window.x = 480
    @gold_window.y = 64
    # Make dummy window
    @dummy_window = Window_Base.new(0, 128, 640, 352)
    # Make buy window
    @buy_window = Window_ShopBuy.new($game_temp.shop_goods)
    @buy_window.active = false
    @buy_window.visible = false
    @buy_window.help_window = @help_window
    # Make sell window
    @sell_window = Window_ShopSell.new
    @sell_window.active = false
    @sell_window.visible = false
    @sell_window.help_window = @help_window
    # Make quantity input window
    @number_window = Window_ShopNumber.new
    @number_window.active = false
    @number_window.visible = false
    # Make status window
    @status_window = Window_ShopStatus.new
    @status_window.visible = false
    # Execute transition
    Graphics.transition
    # Main loop
    loop do
      # Update game screen
      Graphics.update
      # Update input information
      Input.update
      # Frame update
      update
      # Abort loop if screen is changed
      if $scene != self
        break
      end
    end
    # Prepare for transition
    Graphics.freeze
    # Dispose of windows
    @help_window.dispose
    @command_window.dispose
    @gold_window.dispose
    @dummy_window.dispose
    @buy_window.dispose
    @sell_window.dispose
    @number_window.dispose
    @status_window.dispose
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Update windows
    @help_window.update
    @command_window.update
    @gold_window.update
    @dummy_window.update
    @buy_window.update
    @sell_window.update
    @number_window.update
    @status_window.update
    # If command window is active: call update_command
    if @command_window.active
      update_command
      return
    end
    # If buy window is active: call update_buy
    if @buy_window.active
      update_buy
      return
    end
    # If sell window is active: call update_sell
    if @sell_window.active
      update_sell
      return
    end
    # If quantity input window is active: call update_number
    if @number_window.active
      update_number
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (when command window is active)
  #--------------------------------------------------------------------------
  def update_command
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Switch to map screen
      $scene = Scene_Map.new
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # Branch by command window cursor position
      case @command_window.index
      when 0  # buy
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Change windows to buy mode
        @command_window.active = false
        @dummy_window.visible = false
        @buy_window.active = true
        @buy_window.visible = true
        @buy_window.refresh
        @status_window.visible = true
      when 1  # sell
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Change windows to sell mode
        @command_window.active = false
        @dummy_window.visible = false
        @sell_window.active = true
        @sell_window.visible = true
        @sell_window.refresh
      when 2  # quit
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to map screen
        $scene = Scene_Map.new
      end
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (when buy window is active)
  #--------------------------------------------------------------------------
  def update_buy
    # Set status window item
    @status_window.item = @buy_window.item
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Change windows to initial mode
      @command_window.active = true
      @dummy_window.visible = true
      @buy_window.active = false
      @buy_window.visible = false
      @status_window.visible = false
      @status_window.item = nil
      # Erase help text
      @help_window.set_text("")
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # Get item
      @item = @buy_window.item
      # If item is invalid, or price is higher than money possessed
      tempvar = $game_party.deposit_gold - $game_party.gold
      if @item.price > tempvar and @item == nil or @item.price > $game_party.gold 
        # Play buzzer SE
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      # Get items in possession count
      case @item
      when RPG::Item
        number = $game_party.item_number(@item.id)
      when RPG::Weapon
        number = $game_party.weapon_number(@item.id)
      when RPG::Armor
        number = $game_party.armor_number(@item.id)
      end
      # If 99 items are already in possession
      if number == 99
        # Play buzzer SE
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      # Play decision SE
      $game_system.se_play($data_system.decision_se)
      # Calculate maximum amount possible to buy
      max = @item.price == 0 ? 99 : $game_party.gold / @item.price
      max = [max, 99 - number].min
      if $game_party.gold < 0
        $game_party.gain_deposit_gold($game_party.gold)
        $game_party.gold = 0
      end
      # Change windows to quantity input mode
      @buy_window.active = false
      @buy_window.visible = false
      @number_window.set(@item, max, @item.price)
      @number_window.active = true
      @number_window.visible = true
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (when sell window is active)
  #--------------------------------------------------------------------------
  def update_sell
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Change windows to initial mode
      @command_window.active = true
      @dummy_window.visible = true
      @sell_window.active = false
      @sell_window.visible = false
      @status_window.item = nil
      # Erase help text
      @help_window.set_text("")
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # Get item
      @item = @sell_window.item
      # Set status window item
      @status_window.item = @item
      # If item is invalid, or item price is 0 (unable to sell)
      if @item == nil or @item.price == 0
        # Play buzzer SE
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      # Play decision SE
      $game_system.se_play($data_system.decision_se)
      # Get items in possession count
      case @item
      when RPG::Item
        number = $game_party.item_number(@item.id)
      when RPG::Weapon
        number = $game_party.weapon_number(@item.id)
      when RPG::Armor
        number = $game_party.armor_number(@item.id)
      end
      # Maximum quanitity to sell = number of items in possession
      max = number
      # Change windows to quantity input mode
      @sell_window.active = false
      @sell_window.visible = false
      @number_window.set(@item, max, @item.price / 2)
      @number_window.active = true
      @number_window.visible = true
      @status_window.visible = true
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (when quantity input window is active)
  #--------------------------------------------------------------------------
  def update_number
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Set quantity input window to inactive / invisible
      @number_window.active = false
      @number_window.visible = false
      # Branch by command window cursor position
      case @command_window.index
      when 0  # buy
        # Change windows to buy mode
        @buy_window.active = true
        @buy_window.visible = true
      when 1  # sell
        # Change windows to sell mode
        @sell_window.active = true
        @sell_window.visible = true
        @status_window.visible = false
      end
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # Play shop SE
      $game_system.se_play($data_system.shop_se)
      # Set quantity input window to inactive / invisible
      @number_window.active = false
      @number_window.visible = false
      # Branch by command window cursor position
      case @command_window.index
      when 0  # buy
        # Buy process
        $game_party.lose_gold(@number_window.number * @item.price)
        case @item
        when RPG::Item
          $game_party.gain_item(@item.id, @number_window.number)
        when RPG::Weapon
          $game_party.gain_weapon(@item.id, @number_window.number)
        when RPG::Armor
          $game_party.gain_armor(@item.id, @number_window.number)
        end
        # Refresh each window
        @gold_window.refresh
        @buy_window.refresh
        @status_window.refresh
        # Change windows to buy mode
        @buy_window.active = true
        @buy_window.visible = true
      when 1  # sell
        # Sell process
        $game_party.gain_gold(@number_window.number * (@item.price / 2))
        case @item
        when RPG::Item
          $game_party.lose_item(@item.id, @number_window.number)
        when RPG::Weapon
          $game_party.lose_weapon(@item.id, @number_window.number)
        when RPG::Armor
          $game_party.lose_armor(@item.id, @number_window.number)
        end
        # Refresh each window
        @gold_window.refresh
        @sell_window.refresh
        @status_window.refresh
        # Change windows to sell mode
        @sell_window.active = true
        @sell_window.visible = true
        @status_window.visible = false
      end
      return
    end
  end
end
zum Lesen den Text mit der Maus markieren

14

Sonntag, 13. Januar 2008, 18:21

@Tikrass: Da kommt beim Öffnen der Scene_Shop das hier:
Bild
Ich hab abder das Zeile 170-Problem so gelöst:

Ruby Quellcode

1
if @item == nil or @item.price >= $game_party.gold and @item.price >= ($game_party.deposit_gold - $game_party.gold)

Ersetz mal die Zeile 170 mit dieser. Aber ob der Rest auf funktioniert ist ohne Gewähr.

15

Sonntag, 13. Januar 2008, 18:32

Also jetzt kann ich zwar wieder das spiel starten und auch einkaufen und alles, aber wenn ich geld auf der bank habe weiß ich immernoch nicht, wie ich kaufen kann und dass dann das geld von der bank abgezogen wird^^

greez Eledor
  • Everedge

    Bild
  • Battle-Bonzn

    Bild
  • Aurora Hearts

    Bild
  • Nichts!!!^^

    Ich sagte doch, hier ist nichts!^^ :-P

16

Sonntag, 13. Januar 2008, 18:35

Das verstehe ich nicht. Gibs da keine Zeilenangabe?

17

Sonntag, 13. Januar 2008, 18:52

Also ich bin den einkauf nommal übergangen und so sieht es nun aus:

Wenn ich etwas kaufen will steht alles ganz normal da. Wenn ich mir eine sache nicht leisten kann, dann ist sie so grau. Wenn ich sie dann kaufe, was übrigends geht, dann muss ich nichts von meinem baren zahlen. wenn ich dann aber auf die bank gehe um zu gucken, wieviel ich auf dem konto habe, dann habe ich immernoch so viel wie ich eingezahlt habe. also ich bekomme die ware sozusagen kostenlos und das ist ja auch blöd.

greez eledor
  • Everedge

    Bild
  • Battle-Bonzn

    Bild
  • Aurora Hearts

    Bild
  • Nichts!!!^^

    Ich sagte doch, hier ist nichts!^^ :-P

18

Sonntag, 13. Januar 2008, 19:24

Aso der zieht einfach das Geld von der Bank ab, wenn du nicht mehr genug dabei hast.

19

Sonntag, 13. Januar 2008, 19:36

Wenn er es auch wirklich abziehen würde, wäre es auch nicht so schlimm,
aber auf der bank habe ich dann immernoch gleich viel geld.
  • Everedge

    Bild
  • Battle-Bonzn

    Bild
  • Aurora Hearts

    Bild
  • Nichts!!!^^

    Ich sagte doch, hier ist nichts!^^ :-P

20

Sonntag, 13. Januar 2008, 20:02

Der müsste das Geld von der Bank abziehen, sobald du nichtmehr genug im Inventar hast.

Social Bookmarks