RUBINE MIT I !!!!! (NICHT RUBIENE)
Hallo Leute, Ich suche ein Script, mitdem man in einem Spiel 2 verschiedene Währungen einfügen kann.
1. Währung z.B. Gold und 2. Währung z.B. Rubine.
Ist das möglich? Kann man dann noch ein ein Menü unter der Goldanzeige die Rubinanzeige machen?
Also was ich genau suche:
2 Verschiedene Währungen die beide im menü angezeigt werden,
2 verschiedene Shops (einmal den normalen) und ein verändeter, wo man mit der anderen Währung zahlen muss (z-B_ mit Scriptbefehl).
1. Währung z.B. Gold und 2. Währung z.B. Rubine.
Ist das möglich? Kann man dann noch ein ein Menü unter der Goldanzeige die Rubinanzeige machen?
Also was ich genau suche:
2 Verschiedene Währungen die beide im menü angezeigt werden,
2 verschiedene Shops (einmal den normalen) und ein verändeter, wo man mit der anderen Währung zahlen muss (z-B_ mit Scriptbefehl).
Hier:
Die Variable für deine Rubiene:
Und deine Währung kannst du in Zeile 80 umändern.
Genauer beschrieben hast deinen Wunsch ja nicht, also wenns noch mängel gibt, einfach melden.
Die Variable für deine Rubiene:
|
|
Ruby Quellcode |
1 |
$rubiene = irgendwas |
Und deine Währung kannst du in Zeile 80 umändern.
|
|
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 |
$rubiene = 0 if $rubiene == nil class Scene_Menu def main s1 = $data_system.words.item s2 = $data_system.words.skill s3 = $data_system.words.equip s4 = "Status" s5 = "Save" s6 = "End Game" @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6]) @command_window.index = @menu_index if $game_party.actors.size == 0 @command_window.disable_item(0) @command_window.disable_item(1) @command_window.disable_item(2) @command_window.disable_item(3) end if $game_system.save_disabled @command_window.disable_item(4) end @playtime_window = Window_PlayTime.new @playtime_window.x = 0 @playtime_window.y = 224 @steps_window = Window_Steps.new @steps_window.x = 0 @steps_window.y = 320 @gold_window = Window_Gold.new @gold_window.x = 0 @gold_window.y = 386 @status_window = Window_MenuStatus.new @status_window.x = 160 @status_window.y = 0 Graphics.transition loop do Graphics.update Input.update update if $scene != self break end end Graphics.freeze @command_window.dispose @playtime_window.dispose @steps_window.dispose @gold_window.dispose @status_window.dispose end end class Window_Steps < Window_Base def initialize super(0, 0, 160, 64) self.contents = Bitmap.new(width - 32, height - 32) refresh end def refresh self.contents.clear cx = contents.text_size("Steps").width self.contents.font.color = system_color self.contents.draw_text(4, 0, 120-cx-2+50, 32, "Steps", 2) self.contents.font.color = normal_color self.contents.draw_text(0-10, 0, 22, 32, $game_party.steps.to_s, 2) end end class Window_Gold < Window_Base def initialize super(0, 0, 160, 94) self.contents = Bitmap.new(width - 32, height - 32) refresh end def refresh self.contents.clear cx = contents.text_size($data_system.words.gold).width self.contents.font.color = normal_color self.contents.draw_text(4, 0, 120-cx-2, 32, $game_party.gold.to_s, 2) self.contents.font.color = system_color self.contents.draw_text(124-cx, 0, cx, 32, $data_system.words.gold, 2) self.contents.font.color = system_color self.contents.draw_text(4, 30, 120-cx-2+17, 32, "R", 2) self.contents.font.color = normal_color self.contents.draw_text(107-cx, 30, cx, 32, $rubiene.to_s, 2) end end |
zum Lesen den Text mit der Maus markieren
Genauer beschrieben hast deinen Wunsch ja nicht, also wenns noch mängel gibt, einfach melden.
Mehr als a Allgäuer ka a Mensch it wera.
Wie soll ich wissen was ich denke, bevor ich nicht höre was ich sage?
NES-Emulator - a simple NES-Emulator
ERDL - a embedded Ruby Interpreter with the abilltiy to render images with DirectX ERDL shall be 100% compatible to RPGXP-Ruby Scripts
ERDL - a embedded Ruby Interpreter with the abilltiy to render images with DirectX ERDL shall be 100% compatible to RPGXP-Ruby Scripts
zum Lesen den Text mit der Maus markieren
Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »Reborn« (10. Juli 2009, 15:42)
Dann gäng das aber auch nicht mit den Lösungen von Hindi oder RPG Nullchecker.
Hierfür müsste ein richtiges Skript her... machs am besten als Skriptanfrage.
Ansonsten gäbs ja noch die Alternative, dass der Rubinverkäufer kein "Shop" is sondern einfach ein Typ der sagt "Hey willste das oder das kaufen?" Und dann kann man mit SHOW CHOICES den Spieler eins von 4 Spezialitems kaufen lassen ^^
Hierfür müsste ein richtiges Skript her... machs am besten als Skriptanfrage.
Ansonsten gäbs ja noch die Alternative, dass der Rubinverkäufer kein "Shop" is sondern einfach ein Typ der sagt "Hey willste das oder das kaufen?" Und dann kann man mit SHOW CHOICES den Spieler eins von 4 Spezialitems kaufen lassen ^^
Wie willst du es haben? Soll 1 Rubien 1000 Gold Wert sein, oder soll man entweder mit einem Rubien zahlen können?
EDIT:
Hab dir jetzt einfach mal ein Script geschrieben... Wird dir zwar noch nicht viel passen, aber mir lw und so...^^ Sag einfach was du anderst haben willst und ich werds umschreiben:
Also bei diesem Bsp. kannst du dir jetzt aussuchen mit was du zahlen willst, die Zahel wird dann von Gold auf Rubiene umgerechnet, das Ergebniss wird dann aufgerundet.
Kuzre Erklärung (alles im Call-Script):
10 Rubiene dazuzählen:
10 Rubiene abziehen:
Das hier steht in meinem Script:
Wert der Rubiene auf 20 Setzten:
In Zeile 2
in
ändern.
$wert wird immer durch den Preis des Items geteil, d.h. jetzt währe 1 Rubien 20 Gold wert.
Namen der Währung in "B" ändern:
In Zeile 3
in
ändern.
EDIT:
Hab dir jetzt einfach mal ein Script geschrieben... Wird dir zwar noch nicht viel passen, aber mir lw und so...^^ Sag einfach was du anderst haben willst und ich werds umschreiben:
Also bei diesem Bsp. kannst du dir jetzt aussuchen mit was du zahlen willst, die Zahel wird dann von Gold auf Rubiene umgerechnet, das Ergebniss wird dann aufgerundet.
|
|
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 |
$rubiene = 0 if $rubiene == nil $wert = 1000 if $wert == nil $waehrung = "R" if $waehrung == nil class Scene_Menu def main s1 = $data_system.words.item s2 = $data_system.words.skill s3 = $data_system.words.equip s4 = "Status" s5 = "Save" s6 = "End Game" @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6]) @command_window.index = @menu_index if $game_party.actors.size == 0 @command_window.disable_item(0) @command_window.disable_item(1) @command_window.disable_item(2) @command_window.disable_item(3) end if $game_system.save_disabled @command_window.disable_item(4) end @playtime_window = Window_PlayTime.new @playtime_window.x = 0 @playtime_window.y = 224 @steps_window = Window_Steps.new @steps_window.x = 0 @steps_window.y = 320 @gold_window = Window_Gold.new @gold_window.x = 0 @gold_window.y = 386 @status_window = Window_MenuStatus.new @status_window.x = 160 @status_window.y = 0 Graphics.transition loop do Graphics.update Input.update update if $scene != self break end end Graphics.freeze @command_window.dispose @playtime_window.dispose @steps_window.dispose @gold_window.dispose @status_window.dispose end end class Window_Steps < Window_Base def initialize super(0, 0, 160, 64) self.contents = Bitmap.new(width - 32, height - 32) refresh end def refresh self.contents.clear cx = contents.text_size("Steps").width self.contents.font.color = system_color self.contents.draw_text(4, 0, 120-cx-2+50, 32, "Steps", 2) self.contents.font.color = normal_color self.contents.draw_text(0-10, 0, 22, 32, $game_party.steps.to_s, 2) end end class Window_Gold < Window_Base def initialize super(0, 0, 160, 94) self.contents = Bitmap.new(width - 32, height - 32) refresh end def refresh self.contents.clear cx = contents.text_size($data_system.words.gold).width cxx = contents.text_size($rubiene.to_s) self.contents.font.color = normal_color self.contents.draw_text(4, -8, 120-cx-2, 32, $game_party.gold.to_s, 2) self.contents.font.color = system_color self.contents.draw_text(124-cx, -8, cx, 32, $data_system.words.gold, 2) self.contents.font.color = system_color self.contents.draw_text(4, 19, 120-cx-2+17, 32, $waehrung.to_s, 2) self.contents.font.color = normal_color self.contents.draw_text(107-cxx.width, 19, cxx.width, 32, $rubiene.to_s, 2) end end class Scene_Shop attr_reader :ruby def initialize @disable_ = Array.new end def update_buy @status_window.item = @buy_window.item if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) @command_window.active = true @dummy_window.visible = true @buy_window.active = false @buy_window.visible = false @status_window.visible = false @status_window.item = nil @help_window.set_text("") return end if Input.trigger?(Input::C) @item = @buy_window.item if $scene.ruby == 0 if @item == nil or @item.price / $wert > $rubiene $game_system.se_play($data_system.buzzer_se) end elsif $scene.ruby == 1 if @item == nil or @item.price > $game_party.gold $game_system.se_play($data_system.buzzer_se) return end end @help_window.set_text("Mit was wollen sie zahlen?") show_window_rubiene loop{ rubiene_update if Input.trigger?(Input::C) && @disable_[@ruby_window.index] != 0 @ruby = @ruby_window.index if @ruby == 0 @price = @item.price / $wert else @price = @item.price end @ruby_window.dispose break end } 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 number == 99 $game_system.se_play($data_system.buzzer_se) return end $game_system.se_play($data_system.decision_se) max = @item.price == 0 ? 99 : $rubiene * $wert / @item.price if $scene.ruby == 0 max = @item.price == 0 ? 99 : $game_party.gold / @item.price if $scene.ruby == 1 max = [max, 99 - number].min @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 def update_number if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) @number_window.active = false @number_window.visible = false case @command_window.index when 0 @buy_window.active = true @buy_window.visible = true when 1 @sell_window.active = true @sell_window.visible = true @status_window.visible = false end return end if Input.trigger?(Input::C) $game_system.se_play($data_system.shop_se) @number_window.active = false @number_window.visible = false case @command_window.index when 0 $game_party.lose_gold(@number_window.number * @item.price) if $scene.ruby == 1 if $scene.ruby == 0 if @number_window.number * @item.price / $wert < 1 price = 1 else price = @number_window.number * @item.price / $wert end $rubiene -= price end 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 @gold_window.refresh @buy_window.refresh @status_window.refresh @buy_window.active = true @buy_window.visible = true when 1 $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 @gold_window.refresh @sell_window.refresh @status_window.refresh @sell_window.active = true @sell_window.visible = true @status_window.visible = false end return end end def rubiene_update Graphics.update Input.update @ruby_window.update end def show_window_rubiene s1, s2 = "Rubienen", "Gold" @ruby_window = Window_Command.new(192, [s1, s2]) @ruby_window.x = 320 - @ruby_window.width / 2 @ruby_window.y = 240 - @ruby_window.height / 2 @disable_[0] = 0 @disable_[1] = 0 if @item.price / $wert > $rubiene @disable_[1] = 1 @ruby_window.disable_item(0) elsif @item.price > $game_party.gold @disable_[0] = 1 @ruby_window.disable_item(1) end end end class Window_ShopNumber < Window_Base def refresh self.contents.clear draw_item_name(@item, 4, 96) self.contents.font.color = normal_color self.contents.draw_text(272, 96, 32, 32, "×") self.contents.draw_text(308, 96, 24, 32, @number.to_s, 2) self.cursor_rect.set(304, 96, 32, 32) domination = $waehrung if $scene.ruby == 0 domination = $data_system.words.gold if $scene.ruby == 1 cx = contents.text_size(domination).width total_price = @price * @number self.contents.font.color = normal_color if $scene.ruby == 0 if total_price / $wert < 1 total_price = 1 else total_price = total_price / $wert end end @total_price = total_price self.contents.draw_text(4, 160, 328-cx-2, 32, total_price.to_s, 2) self.contents.font.color = system_color self.contents.draw_text(332-cx, 160, cx, 32, domination, 2) end end class Window_ShopBuy < Window_Selectable def draw_item(index) item = @data[index] 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 $scene.ruby == 0 if item.price / $wert < $rubiene and number < 99 self.contents.font.color = normal_color else self.contents.font.color = disabled_color end elsif $scene.ruby == 1 if item.price <= $game_party.gold and number < 99 self.contents.font.color = normal_color else self.contents.font.color = disabled_color end end x = 4 y = index * 32 rect = Rect.new(x, y, self.width - 32, 32) self.contents.fill_rect(rect, Color.new(0, 0, 0, 0)) bitmap = RPG::Cache.icon(item.icon_name) opacity = self.contents.font.color == normal_color ? 255 : 128 self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity) self.contents.draw_text(x + 28, y, 212, 32, item.name, 0) self.contents.draw_text(x + 240, y, 88, 32, item.price.to_s, 2) end end |
zum Lesen den Text mit der Maus markieren
Kuzre Erklärung (alles im Call-Script):
10 Rubiene dazuzählen:
|
|
Ruby Quellcode |
1 |
$rubiene += 10 |
10 Rubiene abziehen:
|
|
Ruby Quellcode |
1 |
$rubiene -= 10 |
Das hier steht in meinem Script:
Wert der Rubiene auf 20 Setzten:
In Zeile 2
|
|
Ruby Quellcode |
1 |
$wert = 1000 if $wert == nil |
in
|
|
Ruby Quellcode |
1 |
$wert = 20 if $wert == nil |
ändern.
$wert wird immer durch den Preis des Items geteil, d.h. jetzt währe 1 Rubien 20 Gold wert.
Namen der Währung in "B" ändern:
In Zeile 3
|
|
Ruby Quellcode |
1 |
$waehrung = "R" if $waehrung == nil |
in
|
|
Ruby Quellcode |
1 |
$waehrung = "B" if $waehrung == nil |
ändern.
Mehr als a Allgäuer ka a Mensch it wera.
Wie soll ich wissen was ich denke, bevor ich nicht höre was ich sage?
NES-Emulator - a simple NES-Emulator
ERDL - a embedded Ruby Interpreter with the abilltiy to render images with DirectX ERDL shall be 100% compatible to RPGXP-Ruby Scripts
ERDL - a embedded Ruby Interpreter with the abilltiy to render images with DirectX ERDL shall be 100% compatible to RPGXP-Ruby Scripts
zum Lesen den Text mit der Maus markieren
Dieser Beitrag wurde bereits 4 mal editiert, zuletzt von »Reborn« (11. Juli 2009, 09:31)
1. Beseitige ich schnell^^
2. Das soll doch so sein oder nicht?^^ Verstehe das nicht richtig...
2. Das soll doch so sein oder nicht?^^ Verstehe das nicht richtig...
Mehr als a Allgäuer ka a Mensch it wera.
Wie soll ich wissen was ich denke, bevor ich nicht höre was ich sage?
NES-Emulator - a simple NES-Emulator
ERDL - a embedded Ruby Interpreter with the abilltiy to render images with DirectX ERDL shall be 100% compatible to RPGXP-Ruby Scripts
ERDL - a embedded Ruby Interpreter with the abilltiy to render images with DirectX ERDL shall be 100% compatible to RPGXP-Ruby Scripts
zum Lesen den Text mit der Maus markieren
Dieser Beitrag wurde bereits 2 mal editiert, zuletzt von »Reborn« (11. Juli 2009, 10:36)
Der 1. Bug von dir wurde besetitg:
@Title
xD, kannst ja alle Rubine herraussuchen und korregieren... Naja, Hauptschüler halt...^^
|
|
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 |
$rubiene = 0 if $rubiene == nil $wert = 1000 if $wert == nil $waehrung = "R" class Scene_Menu def main s1 = $data_system.words.item s2 = $data_system.words.skill s3 = $data_system.words.equip s4 = "Status" s5 = "Save" s6 = "End Game" @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6]) @command_window.index = @menu_index if $game_party.actors.size == 0 @command_window.disable_item(0) @command_window.disable_item(1) @command_window.disable_item(2) @command_window.disable_item(3) end if $game_system.save_disabled @command_window.disable_item(4) end @playtime_window = Window_PlayTime.new @playtime_window.x = 0 @playtime_window.y = 224 @steps_window = Window_Steps.new @steps_window.x = 0 @steps_window.y = 320 @gold_window = Window_Gold.new @gold_window.x = 0 @gold_window.y = 386 @status_window = Window_MenuStatus.new @status_window.x = 160 @status_window.y = 0 Graphics.transition loop do Graphics.update Input.update update if $scene != self break end end Graphics.freeze @command_window.dispose @playtime_window.dispose @steps_window.dispose @gold_window.dispose @status_window.dispose end end class Window_Steps < Window_Base def initialize super(0, 0, 160, 64) self.contents = Bitmap.new(width - 32, height - 32) refresh end def refresh self.contents.clear cx = contents.text_size("Steps").width self.contents.font.color = system_color self.contents.draw_text(4, 0, 120-cx-2+50, 32, "Steps", 2) self.contents.font.color = normal_color self.contents.draw_text(0-10, 0, 22, 32, $game_party.steps.to_s, 2) end end class Window_Gold < Window_Base def initialize super(0, 0, 160, 94) self.contents = Bitmap.new(width - 32, height - 32) refresh end def refresh self.contents.clear cx = contents.text_size($data_system.words.gold).width cxx = contents.text_size($rubiene.to_s) self.contents.font.color = normal_color self.contents.draw_text(4, -8, 120-cx-2, 32, $game_party.gold.to_s, 2) self.contents.font.color = system_color self.contents.draw_text(124-cx, -8, cx, 32, $data_system.words.gold, 2) self.contents.font.color = system_color self.contents.draw_text(4, 19, 120-cx-2+17, 32, $waehrung, 2) self.contents.font.color = normal_color self.contents.draw_text(107-cxx.width, 19, cxx.width, 32, $rubiene.to_s, 2) end end class Scene_Shop attr_reader :ruby def initialize @disable_ = Array.new end def update_buy @status_window.item = @buy_window.item if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) @command_window.active = true @dummy_window.visible = true @buy_window.active = false @buy_window.visible = false @status_window.visible = false @status_window.item = nil @help_window.set_text("") return end if Input.trigger?(Input::C) @item = @buy_window.item if $scene.ruby == 0 if @item == nil or @item.price / $wert > $rubiene $game_system.se_play($data_system.buzzer_se) end elsif $scene.ruby == 1 if @item == nil or @item.price > $game_party.gold $game_system.se_play($data_system.buzzer_se) return end end 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 number == 99 $game_system.se_play($data_system.buzzer_se) return end @help_window.set_text("Mit was wollen sie zahlen?") show_window_rubine loop{ Graphics.update Input.update @ruby_window.update if Input.trigger?(Input::B) @ruby_window.dispose return end if Input.trigger?(Input::C) && @disable_[@ruby_window.index - 1] == 0 p"test" @ruby = @ruby_window.index if @ruby == 0 @price = @item.price / $wert else @price = @item.price end @ruby_window.dispose break end } $game_system.se_play($data_system.decision_se) max = @item.price == 0 ? 99 : $rubiene * $wert / @item.price if $scene.ruby == 0 max = @item.price == 0 ? 99 : $game_party.gold / @item.price if $scene.ruby == 1 max = [max, 99 - number].min @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 def update_number if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) @number_window.active = false @number_window.visible = false case @command_window.index when 0 @buy_window.active = true @buy_window.visible = true when 1 @sell_window.active = true @sell_window.visible = true @status_window.visible = false end return end if Input.trigger?(Input::C) $game_system.se_play($data_system.shop_se) @number_window.active = false @number_window.visible = false case @command_window.index when 0 $game_party.lose_gold(@number_window.number * @item.price) if $scene.ruby == 1 if $scene.ruby == 0 if @number_window.number * @item.price / $wert < 1 price = 1 else price = @number_window.number * @item.price / $wert end $rubiene -= price end 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 @gold_window.refresh @buy_window.refresh @status_window.refresh @buy_window.active = true @buy_window.visible = true when 1 $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 @gold_window.refresh @sell_window.refresh @status_window.refresh @sell_window.active = true @sell_window.visible = true @status_window.visible = false end return end end def show_window_rubine s1, s2 = "Rubienen", "Gold" @ruby_window = Window_Command.new(192, [s1, s2]) @ruby_window.x = 320 - @ruby_window.width / 2 @ruby_window.y = 240 - @ruby_window.height / 2 @ruby_window.z = 1000 @disable_[0], @disable_[1] = 0, 0 if @item.price > $game_party.gold || $game_party.gold == 0 @disable_[0] = 1 @ruby_window.disable_item(1) end if @item.price / $wert > $rubiene || $rubiene == 0 @disable_[1] = 1 @ruby_window.disable_item(0) end @disable_[0] end end class Window_ShopNumber < Window_Base def refresh self.contents.clear draw_item_name(@item, 4, 96) self.contents.font.color = normal_color self.contents.draw_text(272, 96, 32, 32, "×") self.contents.draw_text(308, 96, 24, 32, @number.to_s, 2) self.cursor_rect.set(304, 96, 32, 32) domination = $waehrung if $scene.ruby == 0 domination = $data_system.words.gold if $scene.ruby == 1 cx = contents.text_size(domination).width total_price = @price * @number self.contents.font.color = normal_color if $scene.ruby == 0 if total_price / $wert < 1 total_price = 1 else total_price = total_price / $wert end end @total_price = total_price self.contents.draw_text(4, 160, 328-cx-2, 32, total_price.to_s, 2) self.contents.font.color = system_color self.contents.draw_text(332-cx, 160, cx, 32, domination, 2) end end class Window_ShopBuy < Window_Selectable def draw_item(index) item = @data[index] 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 $scene.ruby == 0 if item.price / $wert < $rubiene and number < 99 self.contents.font.color = normal_color else self.contents.font.color = disabled_color end elsif $scene.ruby == 1 if item.price <= $game_party.gold and number < 99 self.contents.font.color = normal_color else self.contents.font.color = disabled_color end end x = 4 y = index * 32 rect = Rect.new(x, y, self.width - 32, 32) self.contents.fill_rect(rect, Color.new(0, 0, 0, 0)) bitmap = RPG::Cache.icon(item.icon_name) opacity = self.contents.font.color == normal_color ? 255 : 128 self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity) self.contents.draw_text(x + 28, y, 212, 32, item.name, 0) self.contents.draw_text(x + 240, y, 88, 32, item.price.to_s, 2) end end |
zum Lesen den Text mit der Maus markieren
@Title
xD, kannst ja alle Rubine herraussuchen und korregieren... Naja, Hauptschüler halt...^^
Mehr als a Allgäuer ka a Mensch it wera.
Wie soll ich wissen was ich denke, bevor ich nicht höre was ich sage?
NES-Emulator - a simple NES-Emulator
ERDL - a embedded Ruby Interpreter with the abilltiy to render images with DirectX ERDL shall be 100% compatible to RPGXP-Ruby Scripts
ERDL - a embedded Ruby Interpreter with the abilltiy to render images with DirectX ERDL shall be 100% compatible to RPGXP-Ruby Scripts
zum Lesen den Text mit der Maus markieren
Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »Reborn« (11. Juli 2009, 11:04)
Naja, das was Hüpfende Kokosnuss gesagt hat mit "Show Choises" habe ich NICHT vor... Ich mach kurz mal ein Screen.
So ungefähr stell ich mir das vor... bei den Shops bezahlt man mit dem einen mit Münzen und den anderen mit rubinen
Naja, das was Hüpfende Kokosnuss gesagt hat mit "Show Choises" habe ich NICHT vor... Ich mach kurz mal ein Screen.
So ungefähr stell ich mir das vor... bei den Shops bezahlt man mit dem einen mit Münzen und den anderen mit rubinen
So ungefähr stell ich mir das vor... bei den Shops bezahlt man mit dem einen mit Münzen und den anderen mit rubinen
Naja, das was Hüpfende Kokosnuss gesagt hat mit "Show Choises" habe ich NICHT vor... Ich mach kurz mal ein Screen.
So ungefähr stell ich mir das vor... bei den Shops bezahlt man mit dem einen mit Münzen und den anderen mit rubinen
@Terralord-93
Ah ok, dass ist ja sogar noch leichter^^ Ich setzt mich mal nochmal dran...
Aber wieso sagst du das nicht gleich?^^
Jetzt muss ich wieder alles umschreiben.... -.-
Ah ok, dass ist ja sogar noch leichter^^ Ich setzt mich mal nochmal dran...
Aber wieso sagst du das nicht gleich?^^
Jetzt muss ich wieder alles umschreiben.... -.-
Mehr als a Allgäuer ka a Mensch it wera.
Wie soll ich wissen was ich denke, bevor ich nicht höre was ich sage?
NES-Emulator - a simple NES-Emulator
ERDL - a embedded Ruby Interpreter with the abilltiy to render images with DirectX ERDL shall be 100% compatible to RPGXP-Ruby Scripts
ERDL - a embedded Ruby Interpreter with the abilltiy to render images with DirectX ERDL shall be 100% compatible to RPGXP-Ruby Scripts
zum Lesen den Text mit der Maus markieren
Sag mal, wenn ich das richtig verstanden habe, willst du einfach nur Ein-und Verkaufsmenü haben, wo du vorher eine von zwei möglichen Währungen festlegen willst?
Wenn das so ist, ahbe ich für dich ein sehr sauberes Script erstellt. Die zweite Währung funktioniert mit Hilfe einer normalen Variable, die ID kannst du selbst festlegen. Um die Rubin-Variable ab- oder aufsteigen zu lassen, einfach "Control Variables..." auf Registerkarte 1 in den Event Commands.
Hier das Script, einfach direkt über Main auf einer neuen Seite im Script-Editor einfügen.
Du kannst so ziemlich alles verändern, wie z.B. die Menüpunkte und andere wichtige Dinge. Im Kopf meines Scipts findest du die "module Options", passe hier alles deinen Wünschen an. Folgende Variabeln kannst du bearbeiten:
Willst du den Shop jetzt aufrufen, nutze wir gewohnt auf Registerkarte 3 in den Event Command "Shop Processing...". Möchtest du jetzt, dass der Spieler nur in Rubinen bezahlen soll, dann füge vor dem Aufrufen des Shops noch folgendes ein:
0...steht hierbei für den Standard-Shop und
1...für den Rubin-Shop
Immer wenn der Shop geschlossen wird, wird die Shop-Type automatisch wieder auf 0 gesetzt.
Alles verstanden? Ich hoffe du wirst mein Script nutzen und wenn du noch weitere Fragen und Wünsche hast oder Bugs entdeckst, einfach posten.
~ Gruß Kenai
Wenn das so ist, ahbe ich für dich ein sehr sauberes Script erstellt. Die zweite Währung funktioniert mit Hilfe einer normalen Variable, die ID kannst du selbst festlegen. Um die Rubin-Variable ab- oder aufsteigen zu lassen, einfach "Control Variables..." auf Registerkarte 1 in den Event Commands.
Hier das Script, einfach direkt über Main auf einer neuen Seite im Script-Editor einfügen.
|
|
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 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 |
#============================================================================== # ** Scene_Shop # - Edited by Kenai # - Version: 1.0 # - Date: 12.07.2009 (DD.MM.JJJJ) #------------------------------------------------------------------------------ # This class performs shop screen processing. #============================================================================== module Options # Währung AltCurrency = "R" # ID der Variable ($game_variables) VariableID = 1 # Menüpunkt für "Einkaufen" BuyText = "Buy" # Menüpunkt für "Verkaufen" SellText = "Sell" # Menüpunkt für "Verlassen" ExitText = "Exit" # Text für Objekte die bereits im Besitz sind PossessionText = "number in possession" end class Interpreter def set_shoptype(type = 0) $game_temp.currency_type = [[type, 0].max, 1].min end def command_355 script = @list[@index].parameters[0] + "\n" loop { if @list[@index + 1].code == 655 script += @list[@index + 1].parameters[0] + "\n" else break end @index += 1 } result = eval(script) return true end end 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 $game_temp.currency_type = 0 # 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 if $game_temp.currency_type != 0 @gold = $game_variables[Options::VariableID] else @gold = $game_party.gold end # 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 > @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 : @gold / @item.price max = [max, 99 - number].min # 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 class Game_Party #-------------------------------------------------------------------------- # * Gain Gold (or lose) # n : amount of gold #-------------------------------------------------------------------------- def gain_gold(n) if $game_temp.currency_type != 0 $game_variables[Options::VariableID] = [[$game_variables[Options::VariableID] + n, 0].max, 9999999].min else @gold = [[@gold + n, 0].max, 9999999].min end end end class Game_Temp #-------------------------------------------------------------------------- # * Public Instance Variables #-------------------------------------------------------------------------- attr_accessor :currency_type #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- alias shop_currency_initialize initialize def initialize shop_currency_initialize @currency_type = 0 end end class Window_ShopNumber < Window_Base #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize super(0, 128, 368, 352) self.contents = Bitmap.new(width - 32, height - 32) @item = nil @max = 1 @price = 0 @number = 1 end #-------------------------------------------------------------------------- # * Set Items, Max Quantity, and Price #-------------------------------------------------------------------------- def set(item, max, price) @item = item @max = max @price = price @number = 1 refresh end #-------------------------------------------------------------------------- # * Set Inputted Quantity #-------------------------------------------------------------------------- def number return @number end #-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- def refresh self.contents.clear draw_item_name(@item, 4, 96) self.contents.font.color = normal_color self.contents.draw_text(272, 96, 32, 32, "×") self.contents.draw_text(308, 96, 24, 32, @number.to_s, 2) self.cursor_rect.set(304, 96, 32, 32) # Draw total price and currency units if $game_temp.currency_type != 0 domination = Options::AltCurrency else domination = $data_system.words.gold end cx = contents.text_size(domination).width total_price = @price * @number self.contents.font.color = normal_color self.contents.draw_text(4, 160, 328-cx-2, 32, total_price.to_s, 2) self.contents.font.color = system_color self.contents.draw_text(332-cx, 160, cx, 32, domination, 2) end #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update super if self.active # Cursor right (+1) if Input.repeat?(Input::RIGHT) and @number < @max $game_system.se_play($data_system.cursor_se) @number += 1 refresh end # Cursor left (-1) if Input.repeat?(Input::LEFT) and @number > 1 $game_system.se_play($data_system.cursor_se) @number -= 1 refresh end # Cursdr up (+10) if Input.repeat?(Input::UP) and @number < @max $game_system.se_play($data_system.cursor_se) @number = [@number + 10, @max].min refresh end # Cursor down (-10) if Input.repeat?(Input::DOWN) and @number > 1 $game_system.se_play($data_system.cursor_se) @number = [@number - 10, 1].max refresh end end end end class Window_Gold < Window_Base #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize super(0, 0, 160, 64) self.contents = Bitmap.new(width - 32, height - 32) refresh end #-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- def refresh self.contents.clear if $game_temp.currency_type != 0 gold = $game_variables[Options::VariableID] text = Options::AltCurrency else gold = $game_party.gold.to_s text = $data_system.words.gold end cx = contents.text_size($data_system.words.gold).width self.contents.font.color = normal_color self.contents.draw_text(4, 0, 120-cx-2, 32, gold.to_s, 2) self.contents.font.color = system_color self.contents.draw_text(124-cx, 0, cx, 32, text, 2) end end class Window_ShopCommand < Window_Selectable #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize super(0, 64, 480, 64) self.contents = Bitmap.new(width - 32, height - 32) @item_max = 3 @column_max = 3 @commands = [Options::BuyText, Options::SellText, Options::ExitText] refresh self.index = 0 end #-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- def refresh self.contents.clear for i in 0...@item_max draw_item(i) end end #-------------------------------------------------------------------------- # * Draw Item # index : item number #-------------------------------------------------------------------------- def draw_item(index) x = 4 + index * 160 self.contents.draw_text(x, 0, 128, 32, @commands[index]) end end class Window_ShopStatus < Window_Base #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize super(368, 128, 272, 352) self.contents = Bitmap.new(width - 32, height - 32) @item = nil refresh end #-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- def refresh self.contents.clear if @item == nil return end 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 self.contents.font.color = system_color self.contents.draw_text(4, 0, 200, 32, Options::PossessionText) self.contents.font.color = normal_color self.contents.draw_text(204, 0, 32, 32, number.to_s, 2) if @item.is_a?(RPG::Item) return end # Equipment adding information for i in 0...$game_party.actors.size # Get actor actor = $game_party.actors[i] # If equippable, then set to normal text color. If not, set to # invalid text color. if actor.equippable?(@item) self.contents.font.color = normal_color else self.contents.font.color = disabled_color end # Draw actor's name self.contents.draw_text(4, 64 + 64 * i, 120, 32, actor.name) # Get current equipment if @item.is_a?(RPG::Weapon) item1 = $data_weapons[actor.weapon_id] elsif @item.kind == 0 item1 = $data_armors[actor.armor1_id] elsif @item.kind == 1 item1 = $data_armors[actor.armor2_id] elsif @item.kind == 2 item1 = $data_armors[actor.armor3_id] else item1 = $data_armors[actor.armor4_id] end # If equippable if actor.equippable?(@item) # If weapon if @item.is_a?(RPG::Weapon) atk1 = item1 != nil ? item1.atk : 0 atk2 = @item != nil ? @item.atk : 0 change = atk2 - atk1 end # If armor if @item.is_a?(RPG::Armor) pdef1 = item1 != nil ? item1.pdef : 0 mdef1 = item1 != nil ? item1.mdef : 0 pdef2 = @item != nil ? @item.pdef : 0 mdef2 = @item != nil ? @item.mdef : 0 change = pdef2 - pdef1 + mdef2 - mdef1 end # Draw parameter change values self.contents.draw_text(124, 64 + 64 * i, 112, 32, sprintf("%+d", change), 2) end # Draw item if item1 != nil x = 4 y = 64 + 64 * i + 32 bitmap = RPG::Cache.icon(item1.icon_name) opacity = self.contents.font.color == normal_color ? 255 : 128 self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity) self.contents.draw_text(x + 28, y, 212, 32, item1.name) end end end #-------------------------------------------------------------------------- # * Set Item # item : new item #-------------------------------------------------------------------------- def item=(item) if @item != item @item = item refresh end end end |
zum Lesen den Text mit der Maus markieren
Du kannst so ziemlich alles verändern, wie z.B. die Menüpunkte und andere wichtige Dinge. Im Kopf meines Scipts findest du die "module Options", passe hier alles deinen Wünschen an. Folgende Variabeln kannst du bearbeiten:
|
|
Ruby Quellcode |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
module Options # Währung AltCurrency = "R" # ID der Variable ($game_variables) VariableID = 1 # Menüpunkt für "Einkaufen" BuyText = "Buy" # Menüpunkt für "Verkaufen" SellText = "Sell" # Menüpunkt für "Verlassen" ExitText = "Exit" # Text für Objekte die bereits im Besitz sind PossessionText = "number in possession" end |
Willst du den Shop jetzt aufrufen, nutze wir gewohnt auf Registerkarte 3 in den Event Command "Shop Processing...". Möchtest du jetzt, dass der Spieler nur in Rubinen bezahlen soll, dann füge vor dem Aufrufen des Shops noch folgendes ein:
|
|
Ruby Quellcode |
1 |
set_shoptype(1) |
0...steht hierbei für den Standard-Shop und
1...für den Rubin-Shop
Immer wenn der Shop geschlossen wird, wird die Shop-Type automatisch wieder auf 0 gesetzt.
Alles verstanden? Ich hoffe du wirst mein Script nutzen und wenn du noch weitere Fragen und Wünsche hast oder Bugs entdeckst, einfach posten.
~ Gruß Kenai
-
NeuigkeitenSämtliche Projekte sind erst mal pausiert. Weitere Informationen findet ihr hier. (Stand: 21.12.2012). -
Cursal Engine (Jump and Run Engine)Mit Hilfe der Cursal Engine (RCE) ist es möglich auf ziemlich einfache Weise „Jump and Run“-Projekte im RPG Maker XP zu entwerfen. Das Anlegen basiert auf Installations- und Updatepaketen sowie reinen Archiven für fortgeschrittene Benutzer. Die Version 2 (CE2) befindet sich bereits in Entwicklung. Interessiert? Dann lade dir die neuste Version herunter ;3! -
AvatarDiese kleinen, netten und knuffigen Vögelchen nennen sich Hamachou und dürften einigen aus Skies of Arcadia bekannt sein. Ich habe diese Bilder weder selbst gezeichnet noch modelliert. Dennoch finde ich sie so knuffig, dass man sie einfach lieb haben muss und ich hoffe euch geht's genau so^^". Diese Grafiken sind wirklich rar und ich bin stolz sie im Web gefunden zu haben.
Dieser Beitrag wurde bereits 3 mal editiert, zuletzt von »Kenai« (12. Juli 2009, 10:36)
369 ist ein Fehler.
Mehr als a Allgäuer ka a Mensch it wera.
Wie soll ich wissen was ich denke, bevor ich nicht höre was ich sage?
NES-Emulator - a simple NES-Emulator
ERDL - a embedded Ruby Interpreter with the abilltiy to render images with DirectX ERDL shall be 100% compatible to RPGXP-Ruby Scripts
ERDL - a embedded Ruby Interpreter with the abilltiy to render images with DirectX ERDL shall be 100% compatible to RPGXP-Ruby Scripts
zum Lesen den Text mit der Maus markieren
Hast einen alten Beitrag von mir erwischt, da dort mal ein "+"-Zeichen fehlt, denn aus irgendeinem Grund hat mir die Foren-Software mein schönen Plus entfernt. Da es im RMXP ja noch da war
... höchst seltsam.
Jedenfalls düfte es jetzt funktionieren. (Beitrag ob ist jetzt wieder fehlerfrei.)
~ Gruß Kenai
... höchst seltsam.Jedenfalls düfte es jetzt funktionieren. (Beitrag ob ist jetzt wieder fehlerfrei.)
~ Gruß Kenai
-
NeuigkeitenSämtliche Projekte sind erst mal pausiert. Weitere Informationen findet ihr hier. (Stand: 21.12.2012). -
Cursal Engine (Jump and Run Engine)Mit Hilfe der Cursal Engine (RCE) ist es möglich auf ziemlich einfache Weise „Jump and Run“-Projekte im RPG Maker XP zu entwerfen. Das Anlegen basiert auf Installations- und Updatepaketen sowie reinen Archiven für fortgeschrittene Benutzer. Die Version 2 (CE2) befindet sich bereits in Entwicklung. Interessiert? Dann lade dir die neuste Version herunter ;3! -
AvatarDiese kleinen, netten und knuffigen Vögelchen nennen sich Hamachou und dürften einigen aus Skies of Arcadia bekannt sein. Ich habe diese Bilder weder selbst gezeichnet noch modelliert. Dennoch finde ich sie so knuffig, dass man sie einfach lieb haben muss und ich hoffe euch geht's genau so^^". Diese Grafiken sind wirklich rar und ich bin stolz sie im Web gefunden zu haben.
Hi Kenai, danke schonmal, funktioniert alles schon ziemlich gut 
Doch da gibts einen kleinen Fehler...
Ich habe mir jetzt zum Test 100 Rubine geholt, das Item, das ich holen wollte brauchte 33 Rubine.
Die Schrift des Items ist grau unterlegt, das bedeutet, das ich nicht genug Rubine hab.
trotzallem kann ich das Item kaufen.
Ich habe mir 100 Gold geholt, dann war im normalen Shop, sowie auch im Rubinshop die Schrift normal...
Jedoch soll die Schrift bei dem Rubinshop nur Grau unterlegt sein, wenn ich nicht genug Rubine hab und auch, wenn ich 10000 Gold habe.
Ich hoffe ich habs genau erklärt.
-Edit- wie kann ich die Rubinanzahl im Menü anzeigen lassen?
-EDIT2- Kann man im Shop auch die Schrift "R" mit einer Grafik ersetzen?

Doch da gibts einen kleinen Fehler...
Ich habe mir jetzt zum Test 100 Rubine geholt, das Item, das ich holen wollte brauchte 33 Rubine.
Die Schrift des Items ist grau unterlegt, das bedeutet, das ich nicht genug Rubine hab.
trotzallem kann ich das Item kaufen.
Ich habe mir 100 Gold geholt, dann war im normalen Shop, sowie auch im Rubinshop die Schrift normal...
Jedoch soll die Schrift bei dem Rubinshop nur Grau unterlegt sein, wenn ich nicht genug Rubine hab und auch, wenn ich 10000 Gold habe.
Ich hoffe ich habs genau erklärt.
-Edit- wie kann ich die Rubinanzahl im Menü anzeigen lassen?
-EDIT2- Kann man im Shop auch die Schrift "R" mit einer Grafik ersetzen?
Dieser Beitrag wurde bereits 2 mal editiert, zuletzt von »Terralord-93« (12. Juli 2009, 13:54)
Ähnliche Themen
-
Skript-Anfragen »-
Währungs-Skript gesucht
(7. Januar 2009, 13:03)
-
Einsteigerhilfe »-
Tag und Nacht und noch ne Frage
(31. Oktober 2007, 20:39)
-
RGSS 1 Probleme & Talk »-
Währungen
(16. Juli 2006, 16:35)
-
RGSS Archiv »-
ein besonderer shop^^
(28. März 2005, 20:15)

Mein Zeugs