Startseite »
Forum »
RPG-Studio.org - Skripte, Ressourcen & Tutorials »
Tutorial-Bereich »
RGSS / RGSS 2 / RGSS 3 / jsPlugins »

[unspezifisch] Kompatibilität
Lieber Besucher, herzlich willkommen bei: RPG Studio - Make your World real. Falls dies Ihr erster Besuch auf dieser Seite ist, lesen Sie sich bitte die Hilfe durch. Dort wird Ihnen die Bedienung dieser Seite näher erläutert. Darüber hinaus sollten Sie sich registrieren, um alle Funktionen dieser Seite nutzen zu können. Benutzen Sie das Registrierungsformular, um sich zu registrieren oder informieren Sie sich ausführlich über den Registrierungsvorgang. Falls Sie sich bereits zu einem früheren Zeitpunkt registriert haben, können Sie sich hier anmelden.
Benutzerinformationen überspringen
Motto: Wer anderen eine Bratwurst brät, der hat ein Bratwurstbratgerät.
Kompatibilität
Ich beziehe mich hier auf RGSS (RMXP), aber die meisten Sachen müssten Problemlos auf den RMVX übertragen werden können.
-
Allgemein
Wenn man zwei Skripte hat, die aber nur einzeln und nicht zusammen funktionieren, muss man beide auf mehrere mögliche Problemursachen testen und diese gegebenenfalls beheben. -
Aufbau von einfachen Ruby-Teilen
Bevor es losgeht muss ich ein paar Begriffe erklären bzw zeigen, wie der Code davon aussieht.
Comment / Kommentar
Ein Kommentar ist ein Abschnitt im Code, der vom Compiler (also dem "Übersetzer" des Codes, von Text in nutzbaren Bytecode) ignoriert wird. Zu finden sind Kommentare meistens am Beginn eines Skripts, zur Erklärung, wie man es benutzt und manchmal auch mittendrin :)
Im Skript-Editor werden sie grün markiert, daher sind sie leicht zu finden. Es gibt zwei Arten, wie Comments aussehen können:
Ruby Quellcode
1 2 3 4 5
if is_actor? # Is Actor? atk = $data_weapons[self.weapon_id].atk # Weapon else # else, is Enemy atk = $data_enemies[self.id].atk # Database Enemy ATK end
Die Kommentare beginnen mit der Raute #. Nach der Raute gilt der Rest der Zeile als Kommentar, alles was davor steht ist aber normaler Code.
Ruby Quellcode
1 2 3 4 5 6
=begin bla bla mehr bla =end code
Von "=begin" bis "=end" wird alles als Kommentar gewertet. Das ist eher weniger im Skript zu entdecken, höchstens am Anfang in den Zeilen der Erklärung.
Klasse
Eine Klasse beginnt mit dem Stichwort "class", gefolgt von einem (meistens groß geschriebenen) Wort. Danach kommt der Klassencode und dann das Wort "end".
Ruby Quellcode
1 2 3
class Scene_Title #blabla end
Module
Module sind aufgebaut wie Klassen, mit dem feinen Unterschied, dass sie mit dem Schlüsselwort "module" anstatt "class" beginnen.
Methoden
Methoden sind in fast allen Fällen innerhalb von Klassen oder Modulen geschrieben. Sie beginnen mit dem Wort "def", danach dem Namen, gefolgt vom Code und danach wieder das "end".
Ruby Quellcode
1 2 3 4 5
class Scene_Title def main # bla end end
Die Methodennamen können zwei Besonderheiten enthalten (eine von beiden oder beide zusasmmen):
Ruby Quellcode
1
def main(irgendwas, irgendwas_anderes)
Ruby Quellcode
1 2 3 4
class Scene_Title def self.main # ist dasselbe wie def Scene_Title.main
-
Methodenüberschreibung
Am einfachsten zu erkennen (aber nicht zu beheben) ist die Methodenüberschreibung. Was das bedeutet dürfte für die, die es nicht verstehen auch uninteressant sein, ist aber egal :)
Anhand eines Beispiels werde ich das erklären. Wir haben 2 Skripts (unsinnige Skripts, aber ist nur ein Beispiel :) :
- ein Skript, das andauernd im Titelbild ein Fenster mit einer Nachricht öffnen soll
- ein Skript, dass sowohl den Titel als auch das Menü zum laggen bringt und außerdem verhindern soll, dass der Spieler im Titel das Spiel über "Shutdown" beendet :)
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
class Scene_Title def main if $BTEST battle_test return end $data_actors = load_data("Data/Actors.rxdata") $data_classes = load_data("Data/Classes.rxdata") $data_skills = load_data("Data/Skills.rxdata") $data_items = load_data("Data/Items.rxdata") $data_weapons = load_data("Data/Weapons.rxdata") $data_armors = load_data("Data/Armors.rxdata") $data_enemies = load_data("Data/Enemies.rxdata") $data_troops = load_data("Data/Troops.rxdata") $data_states = load_data("Data/States.rxdata") $data_animations = load_data("Data/Animations.rxdata") $data_tilesets = load_data("Data/Tilesets.rxdata") $data_common_events = load_data("Data/CommonEvents.rxdata") $data_system = load_data("Data/System.rxdata") $game_system = Game_System.new @random_print = rand(256).chr @sprite = Sprite.new @sprite.bitmap = RPG::Cache.title($data_system.title_name) s1 = "New Game" s2 = "Continue" s3 = "Shutdown" @command_window = Window_Command.new(192, [s1, s2, s3]) @command_window.back_opacity = 160 @command_window.x = 320 - @command_window.width / 2 @command_window.y = 288 @continue_enabled = false for i in 0..3 if FileTest.exist?("Save#{i+1}.rxdata") @continue_enabled = true end end if @continue_enabled @command_window.index = 1 else @command_window.disable_item(1) end $game_system.bgm_play($data_system.title_bgm) Audio.me_stop Audio.bgs_stop Graphics.transition loop do Graphics.update Input.update update if $scene != self break end end Graphics.freeze @command_window.dispose @sprite.bitmap.dispose @sprite.dispose end def update @command_window.update p @random_print if Input.trigger?(Input::C) case @command_window.index when 0 command_new_game when 1 command_continue when 2 command_shutdown end end end end
zum Lesen den Text mit der Maus markieren
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
class Scene_Title #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update Bitmap.new(500, 500) # Update command window @command_window.update # If C button was pressed if Input.trigger?(Input::C) # Branch by command window cursor position case @command_window.index when 0 # New game command_new_game when 1 # Continue command_continue when 2 # Shutdown end end end end class Scene_Menu #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update Bitmap.new(500, 500) # Update windows @command_window.update @playtime_window.update @steps_window.update @gold_window.update @status_window.update # If command window is active: call update_command if @command_window.active update_command return end # If status window is active: call update_status if @status_window.active update_status return end end end
zum Lesen den Text mit der Maus markieren
Wer will, kann nun schon Schritt 3 durchführen, kann aber ne Menge Arbeit sein, dient dafür der Übersicht.
Schritt 1:
Alle Klassen und Module, die sich nicht überschneiden, also nicht in beiden Skripten vorkommen, werden gelöscht (natürlich nicht im richtigen Skript, sondern in einer Kopie oder so).
Danach wird dasselbe mit den Methoden der Klassen und Module gemacht.
Also:
class Scene_Title
Ist im ersten Skript da. Ist im zweiten Skript da. Bleibt also.
class Scene_Menu
Ist im zweiten Skript da, im ersten aber nicht. Wird also gelöscht (wie weit gelöscht wird, kann man meistens an der Einrückung der Zeilen sehen).
Scene_Title -> def main
Ist im ersten Skript da, aber im zweiten nicht. Wird gelöscht.
Scene_Title -> def update
Ist in beiden da, bleibt also.
Danach sehen die beiden Kopien der Skripte so aus:
Ruby Quellcode
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
class Scene_Title def update @command_window.update p @random_print if Input.trigger?(Input::C) case @command_window.index when 0 command_new_game when 1 command_continue when 2 command_shutdown end end end end
zum Lesen den Text mit der Maus markieren
Ruby Quellcode
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
class Scene_Title #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update Bitmap.new(500, 500) # Update command window @command_window.update # If C button was pressed if Input.trigger?(Input::C) # Branch by command window cursor position case @command_window.index when 0 # New game command_new_game when 1 # Continue command_continue when 2 # Shutdown end end end end
zum Lesen den Text mit der Maus markieren
Schritt 2:
Jetzt muss man, wenn vorhanden, die Original-Methode suchen (und kopieren).
Also geht man in das Skript Scene_Title und welch ein Wunder: dort gibt es def update. Also kopiert man sie irgendwohin.
Ruby Quellcode
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
class Scene_Title #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update # Update command window @command_window.update # If C button was pressed if Input.trigger?(Input::C) # Branch by command window cursor position case @command_window.index when 0 # New game command_new_game when 1 # Continue command_continue when 2 # Shutdown command_shutdown end end end end
zum Lesen den Text mit der Maus markieren
Schritt 3:
Dieser Schritt kann auch übersprungen werden, aber wer nicht so viel Erfahrung mit RGSS hat, sollte ihn lieber befolgen.
Alle Kommentare müssen aus den Skriptkopien gelöscht werden.
Wer sich jetzr die 3 Codestücke anguckt wird große Ähnlichkeiten feststellen. Das ist das Ziel und je ähnlicher die Codes sich bei den Skripten sind, umso einfacher geht der Rest.
Schritt 4:
Änderungen der Methoden erkennen. Die kopierten Methoden aus den Skripten (nicht dem Original) sollten zumindestens teilweise dieselben Zeilen enthalten, wie das Original. Der erste Code enthält alle Zeilen, bei dem Zweiten fehlt eine (wer sie noch nicht gefunden hat sollte jetzt suchen =o).
Nun muss analysiert werden, was sich bei dem Code geändert hat:
Beim ersten Skript wurde nach der Zeile "@command_window.update" die Zeile "p @random_print" eingefügt.
Beim zweiten Skript wurde direkt am Anfang die Zeile "Bitmap.new(500, 500)" eingefügt und in der neunten Zeile "command_shutdown" gelöscht.
Nun tut man genau das, mit der Kopie des Originals, sodass die Änderungen beider Skripte in einer Methode zusammengefasst werden:
Ruby Quellcode
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
class Scene_Title def update Bitmap.new(500, 500) @command_window.update p @random_print if Input.trigger?(Input::C) case @command_window.index when 0 command_new_game when 1 command_continue when 2 end end end end
Schritt 5:
Der neue Code muss nun unter den beiden Skripten (aber immer noch über Main) eingefügt werden. Das wars. Juhu :D -
alias - Gleiche Namen
Ein seltener Fehler. Man sucht erstmal nach folgender Syntax:
Ruby Quellcode
1
alias x y
Ruby Quellcode
1
alias_method :x, :y
Das wird man häufig finden, das Problem besteht allerdings nur, wenn in den zwei Skripten, die man vereinen will, x gleich ist und beides in derselben Klasse steht.
Beispiel:
Ruby Quellcode
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
# SKRIPT 1: class Scene_Title alias old_main main def main #blabla end end # SKRIPT 2: class Scene_Title alias_method :old_main, :main def main #blabla old_main end end
Um das zu beheben ist nicht viel Arbeit notwendig. Man ändert in einem der beiden Skripte das erste Wort (oben das "x") ab.
zB macht man "old_main" zu "old_main_bratwurst". Danach geht man in die Methode (oben das "y", im Beispiel "main"), die meistes sowieso direkt darunter steht. Da ändert man dann ebenfalls überall wo x steht, zum neuen Namen.
Beispiel:
Ruby Quellcode
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
# SKRIPT 1: class Scene_Title alias old_main main def main #blabla end end # SKRIPT 2: class Scene_Title alias_method :old_main_bratwurst, :main def main #blabla old_main_bratwurst end end
-
alias-Überschreibung
Die Überschreibung schon wieder ;(
Dieser Fehler entsteht, wenn ein Skript eine Methode überschreibt und eins diese aliast.
Häufig wird er behoben, wenn man einfach die Skriptpositionen tauscht (das eine über dem anderen im Skripteditor).
Ist dem nicht so, ist hier die Lösung:
Man geht zuerst wie bei der Methodenüberschreibung vor, kopiert die Skripte und löscht alle Klassen, die nicht bei beiden vorkommen.
Dann prüft man wieder auf Methoden, allerdings beim (im Skripteditor) unteren Skript ganz normal, im oberen jedoch anders.
Da sucht man wieder nach "alias x y" oder "alias_method :x, :y". Wenn y denselben Namen hat wie eine der Methoden im anderen Skript, liegt eine alias-Überschreibung vor.
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
class Scene_Title alias_method :old_update, :update def update Bitmap.new(500, 500) old_update p rand(256).chr end end # --------------------------------------- class Scene_Title def update @command_window.update 20 + 1 * 1994 if Input.trigger?(Input::B) case @command_window.index when 0 command_new_game when 2 command_shutdown end end end end
zum Lesen den Text mit der Maus markieren
Scene_Title->update existiert unten.
Oben gibt es in der Scene_Title-Klasse die Zeile "alias_method :old_update, :update".
Das zu beheben ist relativ einfach. Man nimmt einfach den kompletten Code von der unteren Methode und fügt ihn bei der oberen anstatt dem x ("old_update") ein:
Ruby Quellcode
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
class Scene_Title alias_method :old_update, :update def update Bitmap.new(500, 500) @command_window.update 20 + 1 * 1994 if Input.trigger?(Input::B) case @command_window.index when 0 command_new_game when 2 command_shutdown end end p rand(256).chr end end
Ebenfalls, wie bei der Methodenüberschreibung, muss der Code nun unter den Skripten, über Main eingefügt werden.
So, das wars, andere Probleme fallen mir grad nicht ein =)
Benutzerinformationen überspringen
Motto: So lasset uns kein Trübsal sinnieren und gar königlich dinieren!

Ich habe hier einen gewöhnlichen Kompatibilitätsfehler:

Und das hier ist das Script, falls nötig:
![]() |
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 |
#=============================================================================== # Stamina System # By Jet10985 (Jet) # Help by: Mithran #=============================================================================== # This snippet will add a stamina system to your game. Stamina, meaning that # when the player dashes, they will lose stamina. When the stamina runs out # the player will not be able to dash until it is re-charged. # This script has: 20 customization options. #=============================================================================== =begin How to use: To increase the max stamina level, you can use this event "Script..." command: increase_max_stamina(amount) amount = the amount you want to increase max stamina by To stop stamina loss, therefore giving infinite stamina while on, use this: stamina_loss(option) option = either true or false. True gives them infinite stamina, false makes the stamina go down once again. =end module Jet_Stamina # Use an icon or a letter to show with the item gauge? USE_LETTER = false # Icon id if you chose false in the above config. ICON_STAMINA_ID = 374 # This the the letters that will be displayed with the stamina bar to # represent that the bar is for stamina. STAMINA_INITIAL = "S" # These are the level up of stamina. By default, it has 4 specified. # these represent levels 1 through 4 of the stamina. The level where it # comes from is derived from a below configuration. STAMINA_LEVELS = [50, 65, 80, 95, 110, 125, 140, 155, 170, 185, 200] # This actor's level will determine the stamina level set above. ACTOR_STAMINA_ID = 0 # This is how much the stamina level will raise for any unspecified levels # in the above configuration. BASE_STAMINA_RAISE = 25 # This is how much stamina will be drained per square moved will dashing. STAMINA_DOWN_PER_SQUARE = 3 # This is how much stamina will be re-gained every second when not moving. STAMINA_REGEN_PER_SECOND = 5 # This is a variable that will hold the current amount of stamina. STAMINA_TO_VARIABLE_ID = 53 # Show the stamina on the map? STAMINA_ON_MAP = true # This is where the window shall be shown if the window is shown on the map. MAP_WINDOW_COORDS = [10, 306] # This is the switch that if on, the map's window will be visible. MAP_ONOFF_SWITCH = 189 # This is how transperant the map's stamina window is. # 0 is just the bar, no window, 255 is a completely solid window. MAP_WINDOW_OPACITY = 0 # Show stamina in the menu? STAMINA_IN_MENU = false # Do you want them to regenerate stamina while in the menu? UPDATE_STAMINA_IN_MENU = false # This is where the window shall be shown if the window is shown on the menu. MENU_WINDOW_COORDS = [0, 250] # Show numbers with the stamina bar, or just the bar? STAMINA_BAR_WITH_NUMBERS = true # These are the stamina bar's colors. By default it is goldenrod/dark goldenrod. STAMINA_GAUGE_COLOR1 = Color.new(50, 250, 50) STAMINA_GAUGE_COLOR2 = Color.new(50, 125, 50) # If you are using a jump system, this will drain some stamina each time # that the player jumps JUMP_SYSTEM_COMPATABILITY = false # This is how much stamina will be lost for each jump. STAMINA_JUMP_LOSS = 6 end #=============================================================================== # DON'T EDIT FURTHER UNLESS YOU KNOW WHAT TO DO. #=============================================================================== class Game_Stamina include Jet_Stamina attr_accessor :stamina attr_accessor :max_stamina attr_accessor :stamina_gain attr_accessor :max_stamina_plus attr_accessor :disable_stamina_loss attr_accessor :got_initial_stamina def initialize @stamina = 0 @stamina_gain = 0 @max_stamina = 0 @max_stamina_plus = 0 @disable_stamina_loss = true @got_initial_stamina = false end def update_stamina get_max_stamina $game_stamina.stamina_gain += 1 unless $game_player.moving? && $game_player.dash? if $game_stamina.stamina_gain == 60 $game_stamina.stamina += STAMINA_REGEN_PER_SECOND $game_stamina.stamina_gain = 0 if $game_stamina.stamina > $game_stamina.max_stamina $game_stamina.stamina = $game_stamina.max_stamina end end $game_variables[STAMINA_TO_VARIABLE_ID] = $game_stamina.stamina end def get_initial_stamina if $game_party.members[ACTOR_STAMINA_ID].level < STAMINA_LEVELS.size $game_stamina.stamina = STAMINA_LEVELS[$game_party.members[ACTOR_STAMINA_ID].level - 1] else $game_stamina.stamina = STAMINA_LEVELS.max + (($game_party.members[ACTOR_STAMINA_ID].level - (STAMINA_LEVELS.size - 1)) * BASE_STAMINA_RAISE) end end def get_max_stamina if $game_party.members[ACTOR_STAMINA_ID].level > STAMINA_LEVELS.size $game_stamina.max_stamina = STAMINA_LEVELS.max + (($game_party.members[ACTOR_STAMINA_ID].level - (STAMINA_LEVELS.size - 1)) * BASE_STAMINA_RAISE) + $game_stamina.max_stamina_plus else $game_stamina.max_stamina = STAMINA_LEVELS[$game_party.members[ACTOR_STAMINA_ID].level - 1] + $game_stamina.max_stamina_plus end return $game_stamina.max_stamina end end $game_stamina = Game_Stamina.new class Game_Interpreter def stamina_loss(option) if option == true || option == false $game_stamina.disable_stamina_loss = option else p "The option you chose was neither true or false. Please error check and try again" end end def increase_max_stamina(amount) $game_stamina.max_stamina_plus += amount end end class Game_Character include Jet_Stamina if JUMP_SYSTEM_COMPATABILITY alias jet5902_jump jump unless $@ def jump(*args) $game_stamina.stamina -= STAMINA_JUMP_LOSS jet5902_jump(*args) end end alias jet9211_increase_steps increase_steps unless $@ def increase_steps(*args) $game_stamina.stamina -= STAMINA_DOWN_PER_SQUARE if $game_player.dash? && $game_stamina.disable_stamina_loss && self.is_a?(Game_Player) jet9211_increase_steps(*args) end end class Window_Stamina < Window_Base def initialize(x, y) super(x, y, 160, WLH + 32) self.opacity = MAP_WINDOW_OPACITY if $scene.is_a?(Scene_Map) refresh end def refresh self.contents.clear draw_actor_stamina(0, 0) end def update refresh end end class Window_Base include Jet_Stamina def stamina_color return crisis_color if $game_stamina.stamina < $game_stamina.get_max_stamina / 4 return normal_color end def draw_actor_stamina(x, y, width = 120) draw_actor_stamina_gauge(x, y, width) self.contents.font.color = system_color if USE_LETTER self.contents.draw_text(x, y, 30, WLH, STAMINA_INITIAL) else draw_icon(ICON_STAMINA_ID, x, y) end self.contents.font.color = stamina_color last_font_size = self.contents.font.size xr = x + width if STAMINA_BAR_WITH_NUMBERS if width < 120 self.contents.draw_text(xr - 44, y, 44, WLH, $game_stamina.stamina, 2) else self.contents.draw_text(xr - 99, y, 44, WLH, $game_stamina.stamina, 2) self.contents.font.color = normal_color self.contents.draw_text(xr - 55, y, 11, WLH, "/", 2) self.contents.draw_text(xr - 44, y, 44, WLH, $game_stamina.get_max_stamina, 2) end end end def draw_actor_stamina_gauge(x, y, width = 120) gw = width * $game_stamina.stamina / $game_stamina.max_stamina gc1 = STAMINA_GAUGE_COLOR1 gc2 = STAMINA_GAUGE_COLOR2 self.contents.fill_rect(x, y + WLH - 8, width, 6, gauge_back_color) self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 6, gc1, gc2) end end class Scene_Map include Jet_Stamina alias jet0221_start start unless $@ def start $game_stamina.update_stamina unless $game_stamina.got_initial_stamina $game_stamina.get_initial_stamina $game_stamina.got_initial_stamina = true end @stamina_window = Window_Stamina.new(MAP_WINDOW_COORDS[0], MAP_WINDOW_COORDS[1]) if STAMINA_ON_MAP @stamina_window.visible = false jet0221_start end alias jet5021_update update unless $@ def update $game_stamina.update_stamina if !$game_switches[MAP_ONOFF_SWITCH] && STAMINA_ON_MAP @stamina_window.visible = false elsif STAMINA_ON_MAP @stamina_window.visible = true end @stamina_window.update if STAMINA_ON_MAP if @stamina_window.visible && !$game_player.dash? @stamina_window.opacity -= 1 if @stamina_window.opacity == 10 @stamina_window.openness -= 1 end elsif @stamina_window.visible && $game_player.dash? @stamina_window.opacity += 1 unless @stamina_window.opacity == 255 @stamina_window.openness += 1 unless @stamina_window.openness == 255 end jet5021_update end alias jet2048_terminate terminate unless $@ def terminate @stamina_window.dispose if STAMINA_ON_MAP jet2048_terminate end end class Game_Player alias jet6902_dash? dash? unless $@ def dash? return false if $game_stamina.stamina < Jet_Stamina::STAMINA_DOWN_PER_SQUARE jet6902_dash? end end class Scene_Menu include Jet_Stamina alias jet5893_start start unless $@ def start jet5893_start @stamina_window = Window_Stamina.new(MENU_WINDOW_COORDS[0], MENU_WINDOW_COORDS[1]) if STAMINA_IN_MENU end alias jet6942_update update unless $@ def update jet6942_update $game_stamina.update_stamina if UPDATE_STAMINA_IN_MENU @stamina_window.update if STAMINA_IN_MENU end alias jet7692_terminate terminate unless $@ def terminate @stamina_window.dispose if STAMINA_IN_MENU jet7692_terminate end end class Scene_File alias jet3891_write_save_data write_save_data unless $@ def write_save_data(file) jet3891_write_save_data(file) Marshal.dump($game_stamina, file) end alias jet5931_read_save_data read_save_data unless $@ def read_save_data(file) jet5931_read_save_data(file) $game_stamina = Marshal.load(file) end end unless $engine_scripts.nil? JetEngine.active("Stamina System", "v1") end |
Allerdings konnte ich mein Problem nicht finden.
Die Klasse Game_Stamina gibt es nur ein einziges mal. Auch die Methoden gibt es nur einmal. Aliased wurden auch nur neue Methoden.
Gibt es noch eine Möglichkeit?
-
So lasset uns beginnen!
-
Ein Abenteuer, wie du es noch nie erlebt hast!
Tauche ein in die wunderbare Welt des Königs und erlebe auf deiner Reise die verrücktesten Dinge!
NICHT MEHR LANGE!Hier gibt es weitere Informationen!
-
Jetzt die Demo herunterladen!
-
Titelbild
-
-
XBOX 360
-
Avatar im Großformat
Ohne nähere Information kann man da wenig zu sagen. Ich kann jetzt nur ins blaue raten: Du startest das Spiel evtl. mit einer leeren Heldengruppe. Dieser Fall wird vom Script nicht abgefangen und könnte zum Absturz führen, da das Script davon ausgeht, dass immer ein Held in der Gruppe existiert, der das Stamina-Level bestimmt.

Ähnliche Themen
-
Maker-Talk »
-
RPG XP MAker unter Windows 7 ?? (31. Dezember 2009, 19:06)
-
Andere Maker »
-
Problem: ACTKool funktioniert nicht mehr (8. April 2010, 21:23)
-
Maker-Talk »
-
RMXP Lag unter Windows 7 (15. Mai 2010, 18:10)
-
RGSS 1 Probleme & Talk »
-
Steuerung ändern. nur noch nach rechts und lnks laufen! (8. März 2009, 14:06)
-
Ältere Suchanfragen »
-
GTA1 Tileset (17. März 2007, 20:30)