Startseite »
Forum »
RPG-Studio.org - Skripte, Ressourcen & Tutorials »
Tutorial-Bereich »
RGSS / RGSS 2 / RGSS 3 / jsPlugins »
[RGSS] Eigener HUD
Was msus ich ändern um über den Hp/Sp den Namen des Charakters und darunter das Level des Charakters anzuzeigen???
also dann in dieser Form:
Name
Level
HP
SP
also dann in dieser Form:
Name
Level
HP
SP
-
Helpers Hand
-
BATTLEBONZN
Nein, Ich bin kein durchgeknallter Fanboy(nun ja fast nicht)
-
Zeugs
-
LOL
Zitat Ich will jetzt keine falschen Verdächtigungen wecken aber des Game hat ne gewisse ähnlich keit mit dem spiel Portal.
(RPG-Nullchecker über das Spiel Evil Science(Portal Fangame))
Du musst die HUD größe Anpassen (Initialize-Methode)
Und dann noch bei der refresh-methode das einfügen was du willst.
Manche Methoden sind schon vorgebaut in der Window_Base, so auch den Heldennamen anzuzeigen.
So kannst du für den Namen das verwenden:
Einfach einfügen und es sollte gehen, in der Window_Base ab Zeile 102 kannst du dir ansehen was es noch für Standardmethoden gibt.
Natürlich solltest du noch die Y-Koordinaten der einzelnen Punkte noch anpassen.
Und dann noch bei der refresh-methode das einfügen was du willst.
Manche Methoden sind schon vorgebaut in der Window_Base, so auch den Heldennamen anzuzeigen.
So kannst du für den Namen das verwenden:
|
|
Ruby Quellcode |
1 |
draw_actor_name($game_actors[ID_in_der_DB], x, y) |
Einfach einfügen und es sollte gehen, in der Window_Base ab Zeile 102 kannst du dir ansehen was es noch für Standardmethoden gibt.
Natürlich solltest du noch die Y-Koordinaten der einzelnen Punkte noch anpassen.
Das große Scientia Wiki zur Spielentwicklung 
Was ist das RGSS ? RGSS-Dokumentation auf Sc
Kyoshiros Makerkurs
Musik von Shabraxxx für euch
Guide zu den Audioformaten
Skripte von mir (Auswahl):
Atmungssystem
| Streichholzsystem
| Animiert durch Bücher blättern
Random : Marktsystem für Kardor
| Staterelated Battlergraphic
| Hinweis auf mögliche Aktionen
SelfSwitchExpirationtimer Skript - Gameplayerweiterung für Pilzesammler und Farmspiele
Meine Skripte werden gerade hier gesammelt.

Was ist das RGSS ? RGSS-Dokumentation auf Sc
Kyoshiros Makerkurs

Musik von Shabraxxx für euch
Guide zu den Audioformaten

Skripte von mir (Auswahl):
Atmungssystem
| Streichholzsystem
| Animiert durch Bücher blättern
Random : Marktsystem für Kardor
| Staterelated Battlergraphic
| Hinweis auf mögliche Aktionen
SelfSwitchExpirationtimer Skript - Gameplayerweiterung für Pilzesammler und Farmspiele
Meine Skripte werden gerade hier gesammelt.
Ok, danke, hat alles funktioniert, Dann beschäftige ich mich mal mit dem x, und y wer, bis der passt, also danke nochmals
mfg Big N
mfg Big N
-
Helpers Hand
-
BATTLEBONZN
Nein, Ich bin kein durchgeknallter Fanboy(nun ja fast nicht)
-
Zeugs
-
LOL
Zitat Ich will jetzt keine falschen Verdächtigungen wecken aber des Game hat ne gewisse ähnlich keit mit dem spiel Portal.
(RPG-Nullchecker über das Spiel Evil Science(Portal Fangame))
Sowas habe ich gesucht (weis etwas alt der Thread).
Nun habe ich aber ein Problem.
Ich möchte a) Das anstatt von MP und HP der Wert einer variabel da steht (da shabe ich schon hinbekommen, das er das anzeigt.) Doch er updatet das nicht.
und außerdem b) das ich das für alle 4 Party Mitgleider habe, also ganz links das von party mitglied 1, daneben das Fenster von Party Mitglied 2, rechts davon Mitglied 3 und ganz rechts Mitglied4.
Hoffe das ihr mir helfen könnt, zur Hilfe habe ich einmal meinen code angehängt
MfG Shylon
Nun habe ich aber ein Problem.
Ich möchte a) Das anstatt von MP und HP der Wert einer variabel da steht (da shabe ich schon hinbekommen, das er das anzeigt.) Doch er updatet das nicht.
und außerdem b) das ich das für alle 4 Party Mitgleider habe, also ganz links das von party mitglied 1, daneben das Fenster von Party Mitglied 2, rechts davon Mitglied 3 und ganz rechts Mitglied4.
Hoffe das ihr mir helfen könnt, zur Hilfe habe ich einmal meinen code angehängt
|
|
Quellcode |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
class HP_HUD < Window_Base
def initialize(actor=0)
super(0, 0, 180, 85)
self.contents = Bitmap.new(width - 32, height - 32)
self.back_opacity = 155
@actor = $game_party.actors[actor]
@var = $game_variables[1]
refresh
end
def refresh
@old_var = @var
self.contents.clear
self.contents.font.color = Color.new(200, 224, 255, 255)
self.contents.draw_text(-1, -7, 180, 32, "#{@actor.name}")
self.contents.draw_text(-1, 25, 180, 32, "Punkte : #{@var}")
end
def update
if @old_var != @var
refresh
end
super
end
end |
MfG Shylon
Wenn du 4 verschiedene Fenster willst, einfach 4 mal erstellen in Scene_Map und dann die x Variable verändern also
Und fertig hast du 4 Helden Fenster.
Übrigens würde ich im update auch @var immer den aktuellen Wert geben
Wenn nicht sogar gleich den Wert der $game_variable nutzen.
|
|
Ruby Quellcode |
1 2 3 4 5 |
@mein_fensterchen_1 = HP_HUD.new(1) @mein_fensterchen_1.x = 0 @mein_fensterchen_2 = HP_HUD.new(4) @mein_fensterchen_2.x = 180 #... |
Übrigens würde ich im update auch @var immer den aktuellen Wert geben

|
|
Ruby Quellcode |
1 2 3 4 5 6 7 |
def update @var = $game_variables[1] if @old_var != @var refresh end super end |
Das große Scientia Wiki zur Spielentwicklung 
Was ist das RGSS ? RGSS-Dokumentation auf Sc
Kyoshiros Makerkurs
Musik von Shabraxxx für euch
Guide zu den Audioformaten
Skripte von mir (Auswahl):
Atmungssystem
| Streichholzsystem
| Animiert durch Bücher blättern
Random : Marktsystem für Kardor
| Staterelated Battlergraphic
| Hinweis auf mögliche Aktionen
SelfSwitchExpirationtimer Skript - Gameplayerweiterung für Pilzesammler und Farmspiele
Meine Skripte werden gerade hier gesammelt.

Was ist das RGSS ? RGSS-Dokumentation auf Sc
Kyoshiros Makerkurs

Musik von Shabraxxx für euch
Guide zu den Audioformaten

Skripte von mir (Auswahl):
Atmungssystem
| Streichholzsystem
| Animiert durch Bücher blättern
Random : Marktsystem für Kardor
| Staterelated Battlergraphic
| Hinweis auf mögliche Aktionen
SelfSwitchExpirationtimer Skript - Gameplayerweiterung für Pilzesammler und Farmspiele
Meine Skripte werden gerade hier gesammelt.
So habe das jetzt gemacht udn es funktioniert^^
Habe nun nur noch ein kleines Problem: Jedes der Fenster soll eine andere Variabel anzeigen...
(Fenster 1 den Wert von Var. 1, Fenster 2 den Wert von Var usw.)
Währ nett wenn ihr mir hier noch ma helfen könntet.^^
MfG. Shylon
edit.:
Der mom. Code
Habe nun nur noch ein kleines Problem: Jedes der Fenster soll eine andere Variabel anzeigen...
(Fenster 1 den Wert von Var. 1, Fenster 2 den Wert von Var usw.)
Währ nett wenn ihr mir hier noch ma helfen könntet.^^
MfG. Shylon
edit.:
Der mom. Code
|
|
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 |
class HP_HUD < Window_Base
def initialize(actor=0)
super(0, 0, 160, 85)
self.contents = Bitmap.new(width - 32, height - 32)
self.back_opacity = 155
@actor = $game_party.actors[actor]
@var = $game_variables[1]
refresh
end
def refresh
@old_var = @var
self.contents.clear
self.contents.font.color = Color.new(200, 224, 255, 255)
self.contents.draw_text(-1, -7, 180, 32, "#{@actor.name}")
self.contents.draw_text(-1, 25, 180, 32, "Punkte : #{@var}")
end
def update
@var = $game_variables[1]
if @old_var != @var
refresh
end
super
end
end |
Des Rätsels Lösung ist das du nicht nur die Nummer des Actors übergibst, sondern auch die der Variable.
Also kommt ins Initialize als weiterer Parameter 'var_nummer'
das siet dann so aus:
und im update ebenfalls
Wobei ich den Code vereinfachen würde, da du sonst ja viel zu viele Variablen nutzt, würd ich die unnötige @var entfernen und direkt anstatt @var immer $game_variables[@var_nr] nehmen.
Nun rufst du das Fenster auf mit
Also kommt ins Initialize als weiterer Parameter 'var_nummer'
das siet dann so aus:
|
|
Ruby Quellcode |
1 2 3 4 5 6 7 8 9 |
def initialize(actor=0, var_nummer = 1) super(0, 0, 160, 85) self.contents = Bitmap.new(width - 32, height - 32) self.back_opacity = 155 @var_nr = var_nummer @actor = $game_party.actors[actor] @var = $game_variables[@var_nr] refresh end |
|
|
Ruby Quellcode |
1 2 3 4 5 6 7 |
def update @var = $game_variables[@var_nr] if @old_var != @var refresh end super end |
Wobei ich den Code vereinfachen würde, da du sonst ja viel zu viele Variablen nutzt, würd ich die unnötige @var entfernen und direkt anstatt @var immer $game_variables[@var_nr] nehmen.
Nun rufst du das Fenster auf mit
|
|
Ruby Quellcode |
1 2 3 |
@mein_fensterchen = HP_HUD.new(helden_nummer,variablen_nummer) #Beispiel: @mein_fensterchen = HP_HUD.new(2,24) # Also wird im fenster der Name von Held 2 und die Variable 24 angezeigt. |
Das große Scientia Wiki zur Spielentwicklung 
Was ist das RGSS ? RGSS-Dokumentation auf Sc
Kyoshiros Makerkurs
Musik von Shabraxxx für euch
Guide zu den Audioformaten
Skripte von mir (Auswahl):
Atmungssystem
| Streichholzsystem
| Animiert durch Bücher blättern
Random : Marktsystem für Kardor
| Staterelated Battlergraphic
| Hinweis auf mögliche Aktionen
SelfSwitchExpirationtimer Skript - Gameplayerweiterung für Pilzesammler und Farmspiele
Meine Skripte werden gerade hier gesammelt.

Was ist das RGSS ? RGSS-Dokumentation auf Sc
Kyoshiros Makerkurs

Musik von Shabraxxx für euch
Guide zu den Audioformaten

Skripte von mir (Auswahl):
Atmungssystem
| Streichholzsystem
| Animiert durch Bücher blättern
Random : Marktsystem für Kardor
| Staterelated Battlergraphic
| Hinweis auf mögliche Aktionen
SelfSwitchExpirationtimer Skript - Gameplayerweiterung für Pilzesammler und Farmspiele
Meine Skripte werden gerade hier gesammelt.
Ich kriege das mit dem Hud nicht hin...
Das HUD Fenster wird nicht angezeigt...
Ich benutze das SDK(keine Ahnung was das ist xD) nicht...
[php]class HP_HUD < Window_Base
def initialize(actor=0)
super(0, 0, 320, 64)
self.contents = Bitmap.new(width - 32, height - 32)
self.back_opacity = 125
@actor = $game_party.actors[0]
refresh
end
def refresh
@old_hp = @actor.hp
@old_sp = @actor.sp
self.contents.clear
self.contents.font.color = Color.new(200, 224, 255, 255)
self.contents.draw_text(-1, -7, 290, 42, "#{@actor.name} HP: #{@actor.hp} | #{@actor.maxhp} SP: #{@actor.sp} | #{@actor.maxsp}")
end
def update
if @actor.hp != @old_hp or @actor.sp != @old_sp
refresh
end
super
end
end[/php]
def initialize(actor=0)
super(0, 0, 320, 64)
self.contents = Bitmap.new(width - 32, height - 32)
self.back_opacity = 125
@actor = $game_party.actors[0]
refresh
end
def refresh
@old_hp = @actor.hp
@old_sp = @actor.sp
self.contents.clear
self.contents.font.color = Color.new(200, 224, 255, 255)
self.contents.draw_text(-1, -7, 290, 42, "#{@actor.name} HP: #{@actor.hp} | #{@actor.maxhp} SP: #{@actor.sp} | #{@actor.maxsp}")
end
def update
if @actor.hp != @old_hp or @actor.sp != @old_sp
refresh
end
super
end
end[/php]
zum Lesen den Text mit der Maus markieren
[php]#==============================================================================
# ** Scene_Map
#------------------------------------------------------------------------------
# This class performs map screen processing.
#==============================================================================
class Scene_Map
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
# Make sprite set
@spriteset = Spriteset_Map.new
# Make message window
@message_window = Window_Message.new
$hp_hud = HP_HUD.new
# Transition run
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 sprite set
@spriteset.dispose
# Dispose of message window
@message_window.dispose
# If go to Menu
if $hp_hud != nil and $hp_hud.disposed? == false
$hp_hud.dispose
end
# If switching to title screen
if $scene.is_a?(Scene_Title)
# Fade out screen
Graphics.transition
Graphics.freeze
end
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# Loop
loop do
# Update map, interpreter, and player order
# (this update order is important for when conditions are fulfilled
# to run any event, and the player isn't provided the opportunity to
# move in an instant)
$game_map.update
$game_system.map_interpreter.update
$game_player.update
# Update system (timer), screen
$game_system.update
if $hp_hud != nil and $hp_hud.disposed? == false
$hp_hud.update
end
$game_screen.update
# Abort loop if player isn't place moving
unless $game_temp.player_transferring
break
end
# Run place move
transfer_player
# Abort loop if transition processing
if $game_temp.transition_processing
break
end
end
# Update sprite set
@spriteset.update
# Update message window
@message_window.update
# If game over
if $game_temp.gameover
# Switch to game over screen
$scene = Scene_Gameover.new
return
end
# If returning to title screen
if $game_temp.to_title
# Change to title screen
$scene = Scene_Title.new
return
end
# If transition processing
if $game_temp.transition_processing
# Clear transition processing flag
$game_temp.transition_processing = false
# Execute transition
if $game_temp.transition_name == ""
Graphics.transition(20)
else
Graphics.transition(40, "Graphics/Transitions/" +
$game_temp.transition_name)
end
end
# If showing message window
if $game_temp.message_window_showing
return
end
# If encounter list isn't empty, and encounter count is 0
if $game_player.encounter_count == 0 and $game_map.encounter_list != []
# If event is running or encounter is not forbidden
unless $game_system.map_interpreter.running? or
$game_system.encounter_disabled
# Confirm troop
n = rand($game_map.encounter_list.size)
troop_id = $game_map.encounter_list[n]
# If troop is valid
if $data_troops[troop_id] != nil
# Set battle calling flag
$game_temp.battle_calling = true
$game_temp.battle_troop_id = troop_id
$game_temp.battle_can_escape = true
$game_temp.battle_can_lose = false
$game_temp.battle_proc = nil
end
end
end
# If B button was pressed
if Input.trigger?(Input::B)
# If event is running, or menu is not forbidden
unless $game_system.map_interpreter.running? or
$game_system.menu_disabled
# Set menu calling flag or beep flag
$game_temp.menu_calling = true
$game_temp.menu_beep = true
end
end
# If debug mode is ON and F9 key was pressed
if $DEBUG and Input.press?(Input::F9)
# Set debug calling flag
$game_temp.debug_calling = true
end
# If player is not moving
unless $game_player.moving?
# Run calling of each screen
if $game_temp.battle_calling
call_battle
elsif $game_temp.shop_calling
call_shop
elsif $game_temp.name_calling
call_name
elsif $game_temp.menu_calling
call_menu
elsif $game_temp.save_calling
call_save
elsif $game_temp.debug_calling
call_debug
end
end
end
#--------------------------------------------------------------------------
# * Battle Call
#--------------------------------------------------------------------------
def call_battle
# Clear battle calling flag
$game_temp.battle_calling = false
# Clear menu calling flag
$game_temp.menu_calling = false
$game_temp.menu_beep = false
# Make encounter count
$game_player.make_encounter_count
# Memorize map BGM and stop BGM
$game_temp.map_bgm = $game_system.playing_bgm
$game_system.bgm_stop
# Play battle start SE
$game_system.se_play($data_system.battle_start_se)
# Play battle BGM
$game_system.bgm_play($game_system.battle_bgm)
# Straighten player position
$game_player.straighten
# Switch to battle screen
$scene = Scene_Battle.new
end
#--------------------------------------------------------------------------
# * Shop Call
#--------------------------------------------------------------------------
def call_shop
# Clear shop call flag
$game_temp.shop_calling = false
# Straighten player position
$game_player.straighten
# Switch to shop screen
$scene = Scene_Shop.new
end
#--------------------------------------------------------------------------
# * Name Input Call
#--------------------------------------------------------------------------
def call_name
# Clear name input call flag
$game_temp.name_calling = false
# Straighten player position
$game_player.straighten
# Switch to name input screen
$scene = Scene_Name.new
end
#--------------------------------------------------------------------------
# * Menu Call
#--------------------------------------------------------------------------
def call_menu
# Clear menu call flag
$game_temp.menu_calling = false
# If menu beep flag is set
if $game_temp.menu_beep
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Clear menu beep flag
$game_temp.menu_beep = false
end
# Straighten player position
$game_player.straighten
# Switch to menu screen
$scene = Scene_Menu.new
end
#--------------------------------------------------------------------------
# * Save Call
#--------------------------------------------------------------------------
def call_save
# Straighten player position
$game_player.straighten
# Switch to save screen
$scene = Scene_Save.new
end
#--------------------------------------------------------------------------
# * Debug Call
#--------------------------------------------------------------------------
def call_debug
# Clear debug call flag
$game_temp.debug_calling = false
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Straighten player position
$game_player.straighten
# Switch to debug screen
$scene = Scene_Debug.new
end
#--------------------------------------------------------------------------
# * Player Place Move
#--------------------------------------------------------------------------
def transfer_player
# Clear player place move call flag
$game_temp.player_transferring = false
# If move destination is different than current map
if $game_map.map_id != $game_temp.player_new_map_id
# Set up a new map
$game_map.setup($game_temp.player_new_map_id)
end
# Set up player position
$game_player.moveto($game_temp.player_new_x, $game_temp.player_new_y)
# Set player direction
case $game_temp.player_new_direction
when 2 # down
$game_player.turn_down
when 4 # left
$game_player.turn_left
when 6 # right
$game_player.turn_right
when 8 # up
$game_player.turn_up
end
# Straighten player position
$game_player.straighten
# Update map (run parallel process event)
$game_map.update
# Remake sprite set
@spriteset.dispose
@spriteset = Spriteset_Map.new
# If processing transition
if $game_temp.transition_processing
# Clear transition processing flag
$game_temp.transition_processing = false
# Execute transition
Graphics.transition(20)
end
# Run automatic change for BGM and BGS set on the map
$game_map.autoplay
# Frame reset
Graphics.frame_reset
# Update input information
Input.update
end
end
[/php]
# ** Scene_Map
#------------------------------------------------------------------------------
# This class performs map screen processing.
#==============================================================================
class Scene_Map
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
# Make sprite set
@spriteset = Spriteset_Map.new
# Make message window
@message_window = Window_Message.new
$hp_hud = HP_HUD.new
# Transition run
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 sprite set
@spriteset.dispose
# Dispose of message window
@message_window.dispose
# If go to Menu
if $hp_hud != nil and $hp_hud.disposed? == false
$hp_hud.dispose
end
# If switching to title screen
if $scene.is_a?(Scene_Title)
# Fade out screen
Graphics.transition
Graphics.freeze
end
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# Loop
loop do
# Update map, interpreter, and player order
# (this update order is important for when conditions are fulfilled
# to run any event, and the player isn't provided the opportunity to
# move in an instant)
$game_map.update
$game_system.map_interpreter.update
$game_player.update
# Update system (timer), screen
$game_system.update
if $hp_hud != nil and $hp_hud.disposed? == false
$hp_hud.update
end
$game_screen.update
# Abort loop if player isn't place moving
unless $game_temp.player_transferring
break
end
# Run place move
transfer_player
# Abort loop if transition processing
if $game_temp.transition_processing
break
end
end
# Update sprite set
@spriteset.update
# Update message window
@message_window.update
# If game over
if $game_temp.gameover
# Switch to game over screen
$scene = Scene_Gameover.new
return
end
# If returning to title screen
if $game_temp.to_title
# Change to title screen
$scene = Scene_Title.new
return
end
# If transition processing
if $game_temp.transition_processing
# Clear transition processing flag
$game_temp.transition_processing = false
# Execute transition
if $game_temp.transition_name == ""
Graphics.transition(20)
else
Graphics.transition(40, "Graphics/Transitions/" +
$game_temp.transition_name)
end
end
# If showing message window
if $game_temp.message_window_showing
return
end
# If encounter list isn't empty, and encounter count is 0
if $game_player.encounter_count == 0 and $game_map.encounter_list != []
# If event is running or encounter is not forbidden
unless $game_system.map_interpreter.running? or
$game_system.encounter_disabled
# Confirm troop
n = rand($game_map.encounter_list.size)
troop_id = $game_map.encounter_list[n]
# If troop is valid
if $data_troops[troop_id] != nil
# Set battle calling flag
$game_temp.battle_calling = true
$game_temp.battle_troop_id = troop_id
$game_temp.battle_can_escape = true
$game_temp.battle_can_lose = false
$game_temp.battle_proc = nil
end
end
end
# If B button was pressed
if Input.trigger?(Input::B)
# If event is running, or menu is not forbidden
unless $game_system.map_interpreter.running? or
$game_system.menu_disabled
# Set menu calling flag or beep flag
$game_temp.menu_calling = true
$game_temp.menu_beep = true
end
end
# If debug mode is ON and F9 key was pressed
if $DEBUG and Input.press?(Input::F9)
# Set debug calling flag
$game_temp.debug_calling = true
end
# If player is not moving
unless $game_player.moving?
# Run calling of each screen
if $game_temp.battle_calling
call_battle
elsif $game_temp.shop_calling
call_shop
elsif $game_temp.name_calling
call_name
elsif $game_temp.menu_calling
call_menu
elsif $game_temp.save_calling
call_save
elsif $game_temp.debug_calling
call_debug
end
end
end
#--------------------------------------------------------------------------
# * Battle Call
#--------------------------------------------------------------------------
def call_battle
# Clear battle calling flag
$game_temp.battle_calling = false
# Clear menu calling flag
$game_temp.menu_calling = false
$game_temp.menu_beep = false
# Make encounter count
$game_player.make_encounter_count
# Memorize map BGM and stop BGM
$game_temp.map_bgm = $game_system.playing_bgm
$game_system.bgm_stop
# Play battle start SE
$game_system.se_play($data_system.battle_start_se)
# Play battle BGM
$game_system.bgm_play($game_system.battle_bgm)
# Straighten player position
$game_player.straighten
# Switch to battle screen
$scene = Scene_Battle.new
end
#--------------------------------------------------------------------------
# * Shop Call
#--------------------------------------------------------------------------
def call_shop
# Clear shop call flag
$game_temp.shop_calling = false
# Straighten player position
$game_player.straighten
# Switch to shop screen
$scene = Scene_Shop.new
end
#--------------------------------------------------------------------------
# * Name Input Call
#--------------------------------------------------------------------------
def call_name
# Clear name input call flag
$game_temp.name_calling = false
# Straighten player position
$game_player.straighten
# Switch to name input screen
$scene = Scene_Name.new
end
#--------------------------------------------------------------------------
# * Menu Call
#--------------------------------------------------------------------------
def call_menu
# Clear menu call flag
$game_temp.menu_calling = false
# If menu beep flag is set
if $game_temp.menu_beep
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Clear menu beep flag
$game_temp.menu_beep = false
end
# Straighten player position
$game_player.straighten
# Switch to menu screen
$scene = Scene_Menu.new
end
#--------------------------------------------------------------------------
# * Save Call
#--------------------------------------------------------------------------
def call_save
# Straighten player position
$game_player.straighten
# Switch to save screen
$scene = Scene_Save.new
end
#--------------------------------------------------------------------------
# * Debug Call
#--------------------------------------------------------------------------
def call_debug
# Clear debug call flag
$game_temp.debug_calling = false
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Straighten player position
$game_player.straighten
# Switch to debug screen
$scene = Scene_Debug.new
end
#--------------------------------------------------------------------------
# * Player Place Move
#--------------------------------------------------------------------------
def transfer_player
# Clear player place move call flag
$game_temp.player_transferring = false
# If move destination is different than current map
if $game_map.map_id != $game_temp.player_new_map_id
# Set up a new map
$game_map.setup($game_temp.player_new_map_id)
end
# Set up player position
$game_player.moveto($game_temp.player_new_x, $game_temp.player_new_y)
# Set player direction
case $game_temp.player_new_direction
when 2 # down
$game_player.turn_down
when 4 # left
$game_player.turn_left
when 6 # right
$game_player.turn_right
when 8 # up
$game_player.turn_up
end
# Straighten player position
$game_player.straighten
# Update map (run parallel process event)
$game_map.update
# Remake sprite set
@spriteset.dispose
@spriteset = Spriteset_Map.new
# If processing transition
if $game_temp.transition_processing
# Clear transition processing flag
$game_temp.transition_processing = false
# Execute transition
Graphics.transition(20)
end
# Run automatic change for BGM and BGS set on the map
$game_map.autoplay
# Frame reset
Graphics.frame_reset
# Update input information
Input.update
end
end
[/php]
zum Lesen den Text mit der Maus markieren
Das HUD Fenster wird nicht angezeigt...
Ich benutze das SDK(keine Ahnung was das ist xD) nicht...
Hm, also bei mir funktioniert der Code den du gepostet hast.
Aber eigentlich stimmt der Code, das Fenster wird angezeigt. Sicher das du genau diesen Code benutzt?
Aber eigentlich stimmt der Code, das Fenster wird angezeigt. Sicher das du genau diesen Code benutzt?
Das große Scientia Wiki zur Spielentwicklung 
Was ist das RGSS ? RGSS-Dokumentation auf Sc
Kyoshiros Makerkurs
Musik von Shabraxxx für euch
Guide zu den Audioformaten
Skripte von mir (Auswahl):
Atmungssystem
| Streichholzsystem
| Animiert durch Bücher blättern
Random : Marktsystem für Kardor
| Staterelated Battlergraphic
| Hinweis auf mögliche Aktionen
SelfSwitchExpirationtimer Skript - Gameplayerweiterung für Pilzesammler und Farmspiele
Meine Skripte werden gerade hier gesammelt.

Was ist das RGSS ? RGSS-Dokumentation auf Sc
Kyoshiros Makerkurs

Musik von Shabraxxx für euch
Guide zu den Audioformaten

Skripte von mir (Auswahl):
Atmungssystem
| Streichholzsystem
| Animiert durch Bücher blättern
Random : Marktsystem für Kardor
| Staterelated Battlergraphic
| Hinweis auf mögliche Aktionen
SelfSwitchExpirationtimer Skript - Gameplayerweiterung für Pilzesammler und Farmspiele
Meine Skripte werden gerade hier gesammelt.
jep... Zu bemerken ist allerdings, dass ich mit
Den HUD zumindest anzeigen kann. Der Switch ist laut Debugmenü auch an. Und auch wenn ich ins Menü gehe, bleibt das Hud da, wenn ich
benutze. Neben dieses Script wurden noch volgende verwendet:
Scene_Questlog
No F12
Save&Load
Ringmenu
Diagfoales Laufen mit Charaveränderung:
AMS
NewDeubg
ModuleUcoders
Verdeckenscript:
Iconoverheaddisplay
|
|
Ruby Quellcode |
1 |
$hp_hud = HP_HUD.new |
Den HUD zumindest anzeigen kann. Der Switch ist laut Debugmenü auch an. Und auch wenn ich ins Menü gehe, bleibt das Hud da, wenn ich
|
|
Ruby Quellcode |
1 |
$hp_hud = HP_HUD.new |
benutze. Neben dieses Script wurden noch volgende verwendet:
Scene_Questlog
|
|
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 |
#============================================================================== # ** Questlog V3 # von Caesar (07.08.2008) #------------------------------------------------------------------------------ # http://www.rpg-studio.de/http://www.rpg-studio.de/itzamna/node/53 # http://rapidshare.com/files/133831391/Questlog-3.0.pdf # http://forum.rpg-xp.net/thread.php?threadid=3986 #============================================================================== #///////////////////////HTML-Rendering-Engine///////////////////////////////// #~~~~~~~~~~~~~~~~by Caesar~~~~~~~~~~~~~~~~~~~ #\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ class Bitmap def draw_shadow_text(x, y, width, height, str, align=0) color = font.color.dup font.color = Color.new(192, 192, 192, 156) draw_text(x+2, y+2, width, height, str, align) font.color = color draw_text(x, y, width, height, str, align) end #---------------- def draw_html(x, y, width, height, str) # remember string and font variables str = str.dup color = font.color.dup bold = font.bold italic = font.italic size = font.size name = font.name.dup #:::::::::: shadow = false underlined = false opacity = 255 str.gsub!(/<if=([0-9]+)>(.+?)<else>(.+?)<\/if>/) {$game_switches[$1.to_i] ? $2 : $3} str.gsub!(/<var=([0-9]+)>/) {$game_variables[$1.to_i].to_s} str.gsub!(/<eval={(.+?)}>/) {eval $1} str.gsub!(/<style=([A-Za-z0-9_-]+)>(.+?)<\/style>/) { STYLES.has_key?($1) ? STYLES[$1].sub("|", $2) : "" } if defined?(STYLES) str.gsub!(/<br>/) {"\n"} str.gsub!(/\\\\/) {"\00"} str.gsub!(/<b>/) {"\01"} str.gsub!(/<\/b>/) {"\02"} str.gsub!(/<i>/) {"\03"} str.gsub!(/<\/i>/) {"\04"} str.gsub!(/<color=(#?[0-9a-z_]+)>/) {"\05[#{$1}]"} str.gsub!(/<\/color>/) {"\06"} str.gsub!(/<shadow>/) {"\16"} str.gsub!(/<\/shadow>/) {"\17"} str.gsub!(/<small>/) {"\20"} str.gsub!(/<\/small>/) {"\21"} str.gsub!(/<big>/) {"\23"} str.gsub!(/<\/big>/) {"\21"} str.gsub!(/<size=([0-9]+)>/) {"\24[#{$1}]"} str.gsub!(/<\/size>/) {"\21"} str.gsub!(/<font=([A-Za-z0-9\s]+)>/) {"\25[#{$1}]"} str.gsub!(/<\/font>/) {"\26"} str.gsub!(/<u>/) {"\27"} str.gsub!(/<\/u>/) {"\30"} str.gsub!(/<icon=([_A-Za-z0-9-]+)>/) {"\11[#{$1}]"} str.gsub!(/<image=([_A-Za-z0-9-]+)>/) {"\31[#{$1}]"} str.gsub!(/<down=([0-9]+)>/) {"\22[#{$1}]"} str.gsub!(/<space=([0-9]+)>/) {"\100[#{$1}]"} str.gsub!(/<line>/) {"\07"} ix = 0 iy = 0 while ((c = str.slice!(/./m)) != nil) if c == "\00" # \\ c = "\\" end if c == "\01" # <b> font.bold = true end if c == "\02" #</b> font.bold = bold end if c == "\03" # <i> font.italic = true end if c == "\04" # </i> font.italic = false end if c == "\05" # <color=xxx> str.sub!(/\[(#?[0-9a-z_]+)\]/, "") if $1[0] == 35 col = Color.decode($1) elsif $1.to_i != 0 col = Window_Base.text_color($1.to_i) else col = Color.get($1) end font.color = col end if c == "\06" # </color> font.color = color end if c == "\16" # <shadow> shadow = true end if c == "\17" # </shadow> shadow = false end if c == "\20" # <small> font.size -= 5 if font.size > 10 end if c == "\21" # </small> </big> </size> font.size = size end if c == "\23" # <big> font.size += 5 if font.size < 92 end if c == "\24" # <size=xx> str.sub!(/\[([0-9]+)\]/, "") newsize = $1.to_i font.size = newsize if newsize > 5 and newsize < 97 end if c == "\25" # <font=xxx> str.sub!(/\[([A-Za-z0-9\s]+)\]/, "") font.name = $1 if Font.exist?($1) end if c == "\26" # </font> font.name = name end if c == "\27" # <u> underlined = true end if c == "\30" # </u> underlined = false end if c == "\11" #<icon=xxx> str.sub!(/\[([_A-Za-z0-9-]+)\]/, "") icon = RPG::Cache.icon($1) blt(ix + 8, iy + LINE_HEIGHT/2 - 12, icon, Rect.new(0, 0, 24, 24)) ix += 24 end if c == "\31" # <image=xxx> str.sub!(/\[([_A-Za-z0-9-]+)\]/, "") image = RPG::Cache.picture($1) iy += LINE_HEIGHT blt((width-image.rect.width)/2, iy, image, image.rect) iy += image.rect.height ix = 0 end if c == "\22" # <down=xxx> str.sub!(/\[([0-9]+)\]/, "") iy += $1.to_i ix = 0 end if c == "\100" # <space=xxx> str.sub!(/\[([0-9]+)\]/, "") ix += $1.to_i c = "" end if c == "\07" # <line> iy += LINE_HEIGHT + 3 fill_rect(16, iy, width-32, 2, font.color) fill_rect(16, iy, width-32, 2, Color.new(192, 192, 192, 156)) if shadow iy += 5 ix = 0 end if c == "\n" iy += LINE_HEIGHT ix = 0 end #::::::::: if shadow draw_shadow_text(x+ix+4, y+iy, 40, font.size, c) else draw_text(x+ix+4, y+iy, 40, font.size, c) end w = text_size(c).width if underlined fill_rect(x+ix+4, y+iy+text_size("T").height+3, w, 2, font.color) end ix += w end #:::::::::: #reset font variables font.color = color font.bold = bold font.italic = italic font.size = size font.name = name #return height of the bitmap return iy + LINE_HEIGHT end end #============== class Color def Color.get(s) eval "Color.#{s}" rescue Color.white end #------------ def Color.decode(hex) return Color.decode(hex[1..hex.length]) if hex[0] == 35 hex.downcase! red = hex[0..1].hex green = hex[2..3].hex blue = hex[4..5].hex alpha = hex.length == 8 ? hex[6..7].hex : 255 return Color.new(red, green, blue, alpha) end #------------ def Color.normal_color return Color.new(255, 255, 255, 255) end #----------- def Color.disabled_color return Color.new(255, 255, 255, 128) end #----------- def Color.system_color return Color.new(192, 224, 255, 255) end #----------- def Color.crisis_color return Color.new(255, 255, 64, 255) end #----------- def Color.knockout_color return Color.new(255, 64, 0) end #------------ def Color.white(alpha=255) return Color.new(255, 255, 255, alpha) end #----------- def Color.black(alpha=255) return Color.new(0, 0, 0, alpha) end #---------- def Color.red(alpha=255) return Color.new(255, 0, 0, alpha) end #---------- def Color.green(alpha=255) return Color.new(0, 255, 0, alpha) end #--------- def Color.blue(alpha=255) return Color.new(0, 0, 255, alpha) end #---------- def Color.yellow(alpha=255) return Color.new(255, 255, 0, alpha) end #---------- def Color.cyan(alpha=255) return Color.new(0, 255, 255, alpha) end #---------- def Color.magenta(alpha=255) return Color.new(255, 255, 0, alpha) end #---------- def Color.light_gray(alpha=255) return Color.new(192, 192, 192, alpha) end #----------- def Color.gray(alpha=255) return Color.new(128, 128, 128, alpha) end #----------- def Color.dark_gray(alpha=255) return Color.new(64, 64, 64, alpha) end #----------- def Color.pink(alpha=255) return Color.new(255, 175, 175, alpha) end #----------- def Color.orange(alpha=255) return Color.new(255, 200, 0, alpha) end end #===================== class Window_Base < Window # redefine text colors for static context def self.text_color(n) case n when 0 return Color.new(255, 255, 255, 255) when 1 return Color.new(128, 128, 255, 255) when 2 return Color.new(255, 128, 128, 255) when 3 return Color.new(128, 255, 128, 255) when 4 return Color.new(128, 255, 255, 255) when 5 return Color.new(255, 128, 255, 255) when 6 return Color.new(255, 255, 128, 255) when 7 return Color.new(192, 192, 192, 255) else return Color.white end end end #//////////////////////////////////Questlog 3.0///////////////////////////////// #~~~~~~~~~~~~~~~~~~by Caesar~~~~~~~~~~~~~~~~~ #\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ #===================Parameter================== # Wenn true, werden neue Quests oben eingefügt, ansonsten unten INSERT_AT_TOP = true # Zeilenhöhe in der Questbeschreibung LINE_HEIGHT = 24 # Windowskin der Questlog-Fenster (nil = default) WINDOWSKIN = nil # "Überschrift" des Questlogs HEADER_TEXT = "Questlog" # Geschwindigkeit beim Scrollen (Pixel / Frame) SCROLL_SPEED = 7 # Styles für die Beschreibungen der Quests STYLES = { "h1" => "<size=45><font=Cambria><b>|</b></font></size><down=40>", "h2" => "<big><b><font=Cambria>|</font></b></big><down=32>", "disabled" => "<color=disabled_color>|</color>", "highlight" => "<color=#eeee32>|</color>", "system" => "<color=system_color>|</color>" } # Dieser Process wird ausgeführt, sobald das Questlog geschlossen wird; # (Default: Spieler kommt wieder auf die Map) ON_CLOSE = Proc.new {$scene = Scene_Map.new} #============================================ class Scene_Questlog def main @window_header = Window_Help.new @window_header.x = 65 @window_header.y = 28 @window_header.z = 500 @window_header.width = 510 @window_header.windowskin = RPG::Cache.windowskin(WINDOWSKIN) unless WINDOWSKIN.nil? @window_header.contents = Bitmap.new(478, 32) @window_header.contents.font.size = 30 @window_header.contents.draw_text(0, 0, 510, 32, HEADER_TEXT, 1) @window_titles = Window_Questlog_Titles.new @window_titles.windowskin = RPG::Cache.windowskin(WINDOWSKIN) unless WINDOWSKIN.nil? @window_description = Window_Questlog_Description.new( $game_system.questlog.quests.map{|q| q.description}) @window_description.windowskin = RPG::Cache.windowskin(WINDOWSKIN) unless WINDOWSKIN.nil? @index = @window_titles.index spriteset = Spriteset_Map.new Graphics.transition loop do Graphics.update Input.update update if $scene != self break end end Graphics.freeze @window_header.dispose @window_titles.dispose @window_description.dispose spriteset.dispose end #---------------- def update @window_titles.update if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) ON_CLOSE.call return end if Input.press?(Input::R) @window_description.scroll_down elsif Input.press?(Input::L) @window_description.scroll_up end if @index != @window_titles.index @window_description.index = @index = @window_titles.index end end end #============= class Quest attr_reader :title attr_reader :description def initialize(title, description) @title = title @description = description end end #============ class Questlog attr_reader :quests def initialize @quests = [] end #----------- def add(quest, description="") return add(Quest.new(quest, description)) unless quest.is_a?(Quest) i = index(quest.title) return @quests[i] = quest if i != nil if INSERT_AT_TOP # insert quest at top of the list @quests.unshift(quest) else # insert quest at bottom of the list @quests.push(quest) end end #----------- def remove(title) @quests.delete_if{ |quest| quest.title == title} end #----------- def count return @quests.length end #------------ def index(title) for i in 0..@quests.length-1 return i if @quests[i].title == title end return nil end #------------ def Questlog.add(title, description="") $game_system.questlog.add(title, description) end #------------ def Questlog.remove(title) $game_system.questlog.remove(title) end end #============= class Window_Questlog_Description < Window_Base attr_reader :index #------------------ def initialize(descriptions) super(275, 92, 300, 360) @descriptions = descriptions @cache = Array.new(descriptions.size) self.contents = Bitmap.new(width-32, height-32) self.index = 0 self.z = 500 end #----------- def index=(index) return if index == @index or @descriptions.empty? @index = index self.oy = 0 # bitmaps are only rendered once and than cached to reach more efficiency if @cache[index].nil? buffer = Bitmap.new(width-32, 2000) docheight = buffer.draw_html(0, 0, 270, 2000, @descriptions[index]) @cache[index] = self.contents = Bitmap.new(width-32, docheight) self.contents.blt(0, 0, buffer, Rect.new(0, 0, self.width-32, docheight)) else self.contents = @cache[index] end end #----------- def scroll_down self.oy += SCROLL_SPEED if self.height + self.oy - 32 < self.contents.height end #------------ def scroll_up self.oy -= SCROLL_SPEED self.oy = 0 if self.oy < 0 end end #============= class Window_Questlog_Titles < Window_Base attr_reader :index def initialize super(65, 92, 210, 360) self.z = 500 @item_max = $game_system.questlog.count self.contents = Bitmap.new(width-32, @item_max > 0 ? @item_max*32 : 32) @index = 0 refresh end #------------- def index=(index) @index = index update_cursor_rect end #------------- def top_row=(row) if row < 0 row = 0 end if row > @item_max - 1 row = @item_max - 1 end self.oy = row * 32 end #------------- def page_row_max return (self.height - 32) / 32 end #------------- def page_item_max return page_row_max * @column_max end #------------- def update_cursor_rect if @index < 0 self.cursor_rect.empty return end row = @index top_row = self.oy / 32 if row < top_row self.top_row = row end if row > top_row + (self.page_row_max - 1) self.top_row = row - (self.page_row_max - 1) end self.cursor_rect.set(0, @index * 32 - self.oy, self.width - 32, 32) end #------------- def refresh self.contents.clear for i in 0...$game_system.questlog.count quest = $game_system.questlog.quests[i] y = i*32 self.contents.draw_html(4, y, 150, 32, quest.title) end end #------------ def update super if self.active and @item_max > 0 and @index >= 0 if Input.repeat?(Input::DOWN) and (Input.trigger?(Input::DOWN) or @index < @item_max - 1) $game_system.se_play($data_system.cursor_se) @index = (@index + 1) % @item_max end if Input.repeat?(Input::UP) and (Input.trigger?(Input::UP) or @index > 0) $game_system.se_play($data_system.cursor_se) @index = (@index - 1 + @item_max) % @item_max end end update_cursor_rect end end #=========== class Scene_Map def call_questlog $game_temp.questlog_calling = false $game_player.straighten $scene = Scene_Questlog.new end end #=========== class Game_System attr_accessor :questlog alias questlog_init initialize def initialize questlog_init @questlog = Questlog.new end end #=========== class Game_Temp attr_accessor :questlog_calling alias questlog_init initialize def initialize questlog_init @questlog_calling = false end end #======================== class Scene_Load < Scene_File # if a game that does not yet contain the questlog is loaded # a new (empty) questlog instance is created alias questlog_read_save_data read_save_data def read_save_data(file) questlog_read_save_data(file) $game_system.questlog = Questlog.new if $game_system.questlog.nil? end end |
No F12
|
|
Ruby Quellcode |
1 2 3 4 5 6 7 8 9 10 11 |
def no_f1(bool) Win32API.new(*%w(NoF12 NoF1 L V)).call(bool ? 1 : 0) end def no_f12(bool) Win32API.new('NoF12', 'NoF12', 'L', nil).call(bool ? 1 : 0) end def no_alt_enter(bool) Win32API.new('NoF12', 'NoAltEnter', 'L', nil).call(bool ? 1 : 0) end |
Save&Load
|
|
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 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 |
#=============================================================================== # Neues Speicher- und Laden-System 1.4 # Autor/Credits: Cow # (+ Screenshotscript von Andreas21) # 11.03.2009 #=============================================================================== module Saves DelMessage = "Datei wirklich löschen?" Playtime = "Spielzeit" Time = "Datum, Zeit:" SaveMessage = "Namen eingeben!" LoadMessage = "Spielstand auswählen!" ReplMessage = "Datei überschreiten?" DecsMessage = "Enter: Ja Esc: Nein" LimtMessage = "Löschen und Fortfahren!" NoFile = "Keine Speicherstände vorhanden!" AllowScreen = true # false/true: Screenshot-Funktion aktivieren/deaktivieren ScreenOpc = 200 # 0-255: Transparenz des Screenshots FrameSkin = '001-Blue01' # Windowskin, dessen Rahmen den Screenshot umrahmt KLimit = 30 # Anzahl maximaler Buchstaben für eine Datei HideEnd = true # Wenn dieser Wert auf true gesetzt wird, wird die # Dateiendung .rxdata nicht mehr angezeigt. WalkSpeed = 10# Geschwindigkeit der Charaktere im SaveFile-Window: # WalkSpeed ist die Anzahl an Frames, die zwischen den # Schritten gewartet werden soll. ArrowSpeed = 25 # Geschwindigkeit des Cursor-Blinkens Limit = 10 # Limit für Speicherdateien, Zahl durch nil ersetzen, wenn # es kein Limit geben soll. #=============================================================================== CopyFile = Win32API.new('kernel32', 'CopyFile' , 'ppi', 'i') def self.copy(from, to) CopyFile.call(from, to, 0) end end class Window_Command def enable_item(index) draw_item(index, normal_color) end end 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 @sprite = Sprite.new @sprite.bitmap = RPG::Cache.title($data_system.title_name) s1 = "" s2 = "" s3 = "" @command_window = Window_Command.new(192, [s1, s2, s3]) @command_window.back_opacity = 160 @command_window.x = 999 - @command_window.width / 2 @command_window.y = 999 @continue_enabled = true $game_system.bgm_play($data_system.title_bgm) Audio.me_stop Audio.bgs_stop Graphics.transition loop do Graphics.update Input.update update break if $scene != self end Graphics.freeze @command_window.dispose @sprite.bitmap.dispose @sprite.dispose end end class Window_Input < Window_Base Set ={" " => 0x20, "a" => 0x41, "b" => 0x42, "c" => 0x43, "d" => 0x44, "e" => 0x45, "f" => 0x46, "g" => 0x47, "h" => 0x48, "i" => 0x49, "j" => 0x4A, "k" => 0x4B, "l" => 0x4C, "m" => 0x4D, "n" => 0x4E, "o" => 0x4F, "p" => 0x50, "q" => 0x51, "r" => 0x52, "s" => 0x53, "t" => 0x54, "u" => 0x55, "v" => 0x56, "w" => 0x57, "x" => 0x58, "y" => 0x59, "z" => 0x5A, "0" => 0x60, "1" => 0x61, "2" => 0x62, "3" => 0x63, "4" => 0x64, "5" => 0x65, "6" => 0x66, "7" => 0x67, "8" => 0x68, "9" => 0x69, "," => 0x6E, "." => 0xBE, "ü" => 0xBA, "," => 0xBC, "-" => 0xBD, "ö" => 0xC0, "ß" => 0xDB, "ä" => 0xDE} attr_accessor :string def initialize(x, y, width = 96, height = 64) super(x, y, width, height) @width = width @count = 0 self.contents = Bitmap.new(width - 32, height - 32) self.opacity = 255 @string = "" end def refresh @count += 1 self.contents.clear if self.active && (@count / Saves::ArrowSpeed) % 2 == 0 cursor_x = 304 + self.contents.text_size(@string).width / 2 self.contents.fill_rect(cursor_x, 3, 2, 26, Color.new(255,255,255)) end self.contents.draw_text(-16, 0, @width, 32, @string, 1) end def update super if self.active if Key.press?(0x10) Set.each_pair do |letter, key| if Key.trigger?(key) if @string.size >= Saves::KLimit $game_system.se_play($data_system.cancel_se) return end @string += letter.upcase end end elsif Key.trigger?(0x08) @string = @string[0,@string.size-1] else Set.each_pair do |letter, key| if Key.trigger?(key) if @string.size >= Saves::KLimit $game_system.se_play($data_system.cancel_se) return end @string += letter end end end @string = @string == nil ? "" : @string refresh end end end module Key GetKeyState = Win32API.new("user32","GetAsyncKeyState",['i'],'i') GetKeyboardState = Win32API.new("user32","GetKeyState",['i'],'i') GetSetKeyState = Win32API.new("user32","SetKeyboardState",['i'],'i') module_function def press?(key) if GetKeyState.call(key) != 0 return true end return false end def trigger?(key) if GetKeyState.call(key)&0x01==1 return true end return false end def times?(key,times=0) if GetKeyboardState.call(key)&0x01==times return true end return false end end class Window_Directory < Window_Command attr_accessor :change attr_reader :commands def initialize(x, y, width, height, path) @path = path files = Dir.glob(path + '*') commands = Array.new files.each do |file| if file.include?('.rxdata') commands.push(file) end end if commands.empty? commands.push('') end super(width, commands) self.x = x self.y = y self.height = height end def refill(path) files = Dir.glob(path + '*') commands = Array.new files.each do |file| if file.include?('.rxdata') commands.push(file) end end if commands.empty? commands.push('') end @item_max = commands.size self.contents = Bitmap.new(self.width - 32, (@commands.size + 1) * 32) @commands = commands refresh end def draw_item(index, color) self.contents.font.color = color rect = Rect.new(32, 32 * index, self.contents.width - 8, 32) if @commands[index].include?('.rxdata') @bitmap = RPG::Cache.icon('save.png') else @bitmap = Bitmap.new(24, 24) end self.contents.blt(4 + x, 4 + 32 * index, @bitmap, Rect.new(0, 0, 24, 24)) self.contents.fill_rect(rect, Color.new(0, 0, 0, 0)) @commands[index].sub!(@path, '') type = Saves::HideEnd real = @commands[index] name = type ? real.sub('.rxdata', '') : real self.contents.draw_text(rect, name) end def update super @change = false if self.active and @item_max > 0 and @index >= 0 if Key.trigger?(0x28) if (@column_max == 1 and Input.trigger?(Input::DOWN)) or @index < @item_max - @column_max $game_system.se_play($data_system.cursor_se) @index = (@index + @column_max) % @item_max end @change = true end if Key.trigger?(0x26) if (@column_max == 1 and Input.trigger?(Input::UP)) or @index >= @column_max $game_system.se_play($data_system.cursor_se) @index = (@index - @column_max + @item_max) % @item_max end @change = true end end if self.active and @help_window != nil update_help end update_cursor_rect end def command return @commands[self.index] end end class Window_SaveFile < Window_Base attr_reader :filename def initialize(y = 128, height = 352) super(320, y, 320, height) self.contents = Bitmap.new(width - 32, height - 32) @step_count = 0 @last_step = 0 end def fill(filename) @step_count = 0 @last_step = 0 @time_stamp = Time.at(0) return if filename.empty? file = File.open('Saves/' + filename, "r") @time_stamp = file.mtime @characters = Marshal.load(file) @frame_count = Marshal.load(file) @game_system = Marshal.load(file) @game_switches = Marshal.load(file) @game_variables = Marshal.load(file) @total_sec = @frame_count / Graphics.frame_rate file.close self.contents.clear self.contents.font.color = normal_color for i in 0...@characters.size bitmap = RPG::Cache.character(@characters[i][0], @characters[i][1]) cw = bitmap.rect.width / 4 ch = bitmap.rect.height / 4 src_rect = Rect.new(0, 0, cw, ch) x = 32 + i * 64 - cw / 2 self.contents.blt(x, 220 + 68 - ch, bitmap, src_rect) end hour = @total_sec / 60 / 60 min = @total_sec / 60 % 60 sec = @total_sec % 60 time_string = sprintf("d:d:d", hour, min, sec) self.contents.draw_text(0, 96, 288, 32, Saves::Playtime) self.contents.draw_text(0, 96, 288, 32, time_string, 2) time_string = @time_stamp.strftime("%d.%m.%Y, %H:%M") self.contents.draw_text(0, 64, 288, 32, Saves::Time) self.contents.draw_text(0, 64, 288, 32, time_string, 2) self.contents.font.color = Color.new(255, 255, 155) type = Saves::HideEnd real = filename name = type ? real.sub('.rxdata', '') : real self.contents.draw_text(0, 0, 288, 32, name, 1) end def update super speed = Saves::WalkSpeed @step_count += 1 @step_count %= 4 * speed step = @step_count / speed if step != @last_step return if @characters == nil self.contents.fill_rect(0, 200, 320, 200, Color.new(0, 0, 0, 0)) for i in 0...@characters.size bitmap = RPG::Cache.character(@characters[i][0], @characters[i][1]) cw = bitmap.rect.width / 4 ch = bitmap.rect.height / 4 src_rect = Rect.new(step * cw, 0, cw, ch) x = 32 + i * 64 - cw / 2 self.contents.blt(x, 220 + 68 - ch, bitmap, src_rect) end @last_step = step end end end class Scene_Save def main unless Dir.glob('*').include?('Saves') Dir.mkdir('Saves') end @main_window = Window_Base.new(0, 0, 640, 64) @main_window.contents = Bitmap.new(408, 32) @main_window.contents.draw_text(0, 0, 608, 32, Saves::SaveMessage, 1) @input_window = Window_Input.new(0, 64, 640) @input_window.active = true @browser = Window_Directory.new(0, 128, 320, 352, 'Saves/') @browser.active = true @info = Window_SaveFile.new @info.fill(@browser.command) Graphics.transition loop do Graphics.update update break if $scene != self end Graphics.freeze @main_window.dispose @input_window.dispose @browser.dispose @info.dispose end def update input @browser.update @info.update @info.fill(@browser.command) if @browser.change delete if Key.trigger?(0x2E) if Key.trigger?(0x1B) $game_system.se_play($data_system.cancel_se) if $game_temp.save_calling $game_temp.save_calling = false $scene = Scene_Map.new return end $scene = Scene_Menu.new(4) end end def input @input_window.update if Key.trigger?(0x0D) && ! @input_window.string.empty? @filename = 'Saves/' + @input_window.string + '.rxdata' @replace = true replace if FileTest.exist?(@filename) if Saves::Limit != nil if @browser.commands.size >= Saves::Limit limit $game_system.se_play($data_system.buzzer_se) return end end if @replace file = File.open(@filename, 'wb') save!(file) file.close @input_window.string = '' @browser.refill('Saves/') $game_system.se_play($data_system.save_se) Graphics.transition if $game_temp.save_calling $game_temp.save_calling = false $scene = Scene_Map.new return end $scene = Scene_Menu.new(4) end end end def save!(file) Saves.copy('Saves/~', 'Saves/~' + @input_window.string) File.delete('Saves/~') characters = [] for i in 0...$game_party.actors.size actor = $game_party.actors[i] characters.push([actor.character_name, actor.character_hue]) end Marshal.dump(characters, file) Marshal.dump(Graphics.frame_count, file) $game_system.save_count += 1 $game_system.magic_number = $data_system.magic_number Marshal.dump($game_system, file) Marshal.dump($game_switches, file) Marshal.dump($game_variables, file) Marshal.dump($game_self_switches, file) Marshal.dump($game_screen, file) Marshal.dump($game_actors, file) Marshal.dump($game_party, file) Marshal.dump($game_troop, file) Marshal.dump($game_map, file) Marshal.dump($game_player, file) end def replace window = Window_Base.new(220, 176, 200, 96) window.contents = Bitmap.new(168, 64) window.z = 500 @main_window.opacity = 155 @input_window.opacity = 155 @browser.opacity = 155 @info.opacity = 155 rect = [Rect.new(0, 0, 168, 32), Rect.new(0, 32, 168, 32)] window.contents.draw_text(rect[0], Saves::ReplMessage, 1) window.contents.draw_text(rect[1], Saves::DecsMessage, 1) loop do Graphics.update if Key.trigger?(0x1B) $game_system.se_play($data_system.cancel_se) @replace = false elsif Key.trigger?(0x0D) @replace = true else next end window.dispose @main_window.opacity = 255 @input_window.opacity = 255 @browser.opacity = 255 @info.opacity = 255 break end end def delete unless FileTest.exist?('Saves/' + @browser.command) $game_system.se_play($data_system.cancel_se) return end window = Window_Base.new(220, 176, 200, 96) window.contents = Bitmap.new(168, 64) window.z = 500 @main_window.opacity = 155 @input_window.opacity = 155 @browser.opacity = 155 @info.opacity = 155 rect = [Rect.new(0, 0, 168, 32), Rect.new(0, 32, 168, 32)] window.contents.draw_text(rect[0], Saves::DelMessage, 1) window.contents.draw_text(rect[1], Saves::DecsMessage, 1) loop do Graphics.update if Key.trigger?(0x0D) File.delete('Saves/' + @browser.command) @browser.refill('Saves/') @info.fill(@browser.command) elsif Key.trigger?(0x1B) $game_system.se_play($data_system.cancel_se) else next end window.dispose @main_window.opacity = 255 @input_window.opacity = 255 @browser.opacity = 255 @info.opacity = 255 break end end def limit @main_window.contents.clear @main_window.contents.font.color = Color.new(255, 150, 150) @main_window.contents.draw_text(0, 0, 608, 32, Saves::LimtMessage, 1) 75.times { Graphics.update } @main_window.contents.clear @main_window.contents.font.color = normal_color @main_window.contents.draw_text(0, 0, 608, 32, Saves::SaveMessage, 1) end end class Scene_Load def main @main_window = Window_Base.new(0, 0, 640, 64) @main_window.contents = Bitmap.new(608, 32) @browser = Window_Directory.new(0, 64, 320, 416, 'Saves/') @info = Window_SaveFile.new(64, 416) @no_file = false no_file unless Dir.glob('*').include?('Saves') no_file if Dir.glob('Saves/*').empty? return if @no_file @main_window.contents.draw_text(0,0,608,32,Saves::LoadMessage,1) @info.fill(@browser.command) Graphics.transition loop do Graphics.update update break if $scene != self end Graphics.freeze @main_window.dispose @browser.dispose @info.dispose end def update @browser.update @info.update @info.fill(@browser.command) if @browser.change if Key.trigger?(0x1B) $game_system.se_play($data_system.cancel_se) $scene = Scene_Map.new return end if Key.trigger?(0x0D) load elsif Key.trigger?(0x25) || Key.trigger?(0x26) return unless Saves::AllowScreen unless FileTest.exist?('Saves/~' + @browser.command.sub('.rxdata', '')) $game_system.se_play($data_system.buzzer_se) return end show_screen end end def no_file @no_file = true @main_window.contents.clear @main_window.contents.draw_text(0,0,608,32,Saves::NoFile,1) Graphics.transition loop do Graphics.update @browser.update if Key.trigger?(0x0D) || Key.trigger?(0x1B) $game_system.se_play($data_system.cancel_se) $scene = Scene_Map.new break end end Graphics.freeze @main_window.dispose @browser.dispose @info.dispose end def show_screen $game_system.se_play($data_system.decision_se) window = Window_Base.new(0, 0, 640, 0) window.back_opacity = 0 window.opacity = 0 window.height = 480 window.z = 1001 window.windowskin = RPG::Cache.windowskin(Saves::FrameSkin) sprite = Sprite.new sprite.z = 1000 sprite.opacity = 0 sprite.bitmap = RPG::Cache.saves(@browser.command) until sprite.opacity >= Saves::ScreenOpc Graphics.update sprite.opacity += 30 window.opacity += 30 end until Key.trigger?(0x0D) Graphics.update end $game_system.se_play($data_system.cancel_se) until sprite.opacity <= 0 Graphics.update sprite.opacity -= 30 window.opacity -= 30 end sprite.dispose window.dispose end def load $game_system.se_play($data_system.load_se) file = File.open('Saves/' + @browser.command, "rb") characters = Marshal.load(file) Graphics.frame_count = Marshal.load(file) $game_system = Marshal.load(file) $game_switches = Marshal.load(file) $game_variables = Marshal.load(file) $game_self_switches = Marshal.load(file) $game_screen = Marshal.load(file) $game_actors = Marshal.load(file) $game_party = Marshal.load(file) $game_troop = Marshal.load(file) $game_map = Marshal.load(file) $game_player = Marshal.load(file) if $game_system.magic_number != $data_system.magic_number $game_map.setup($game_map.map_id) $game_player.center($game_player.x, $game_player.y) end $game_party.refresh file.close $game_system.bgm_play($game_system.playing_bgm) $game_system.bgs_play($game_system.playing_bgs) $game_map.update $scene = Scene_Map.new end end module Screen @screen = Win32API.new('screenshot', 'Screenshot', 'llllpll', '') @readini = Win32API.new('kernel32', 'GetPrivateProfileStringA', 'pppplp', 'l') @findwindow = Win32API.new('user32', 'FindWindowA', 'pp', 'l') module_function def shot(x, y, width, height, file, typ) @screen.call(x, y, width, height, file, handel, typ) end def handel game_name = "\0" * 256 @readini.call('Game', 'Title', '', game_name, 255, ".\\Game.ini") game_name.delete!("\0") return @findwindow.call('RGSS Player', game_name) end end module RPG module Cache def self.saves(filename) self.load_bitmap("Saves/~", filename.sub('.rxdata', '')) end end end class Scene_Map def main @spriteset = Spriteset_Map.new @message_window = Window_Message.new Graphics.transition loop do Graphics.update Input.update update if $scene != self break end end unless Dir.glob('*').include?('Saves') Dir.mkdir('Saves') end Screen.shot(0, 0, 640, 480, 'Saves/~', 2) Graphics.freeze @spriteset.dispose @message_window.dispose if $scene.is_a?(Scene_Title) Graphics.transition Graphics.freeze end end end |
Ringmenu
|
|
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 |
#------------------------------------------------------------------------------ # Ring_Menu #------------------------------------------------------------------------------ # By: XRXS, Dubealex, and Hypershadow180 #------------------------------------------------------------------------------ class Scene_Menu #------------------------------------------------------------------------------ # Initialize #------------------------------------------------------------------------------ def initialize(menu_index = 0) @menu_index = menu_index $location_text=[] $gold_text=[] $window_size=[] $ring_menu_text=[] $chara_select=[] @window_opacity=[] @chara_select=[] @window_position=[] $location_text[0]="Tahoma" # Font Type $location_text[1]=24 # Font Size $location_text[2]=0 # Location Title Color $location_text[4]=0 # Map Name Color $location_text[3]="Karte:" # Text $gold_text[0]="Tahoma" # Font Type $gold_text[1]=24 # Font Size $gold_text[2]=0 # Gold Title Color $gold_text[3]=0 # Gold Color $gold_text[4]="Gold" # Text @window_opacity[0]=255 # Border Opacity @window_opacity[1]=130 # Background Opacity $window_location_skin="001-Blue01" # Location Windowskin $window_gold_skin="001-Blue01" # Gold Windowskin @window_position[0]=0 # X Axis Position @window_position[1]=0 # Location Y Axis Position @window_position[2]=384 # Gold Y Axis Position $window_size[0]=160 # Length $window_size[1]=96 # Height $ring_menu_text[0]="Tahoma" # Font Type $ring_menu_text[7]=0 # Font Color $ring_menu_text[8]=24 # Font Size $ring_menu_text[1]="Item" $ring_menu_text[2]="Magie" $ring_menu_text[3]="Rüstung" $ring_menu_text[4]="Status" $ring_menu_text[5]="Speichern" $ring_menu_text[6]="Beenden" @chara_select[0]=408 # X Axis Position @chara_select[1]=0 # Y Axis Position $chara_select[0]="Tahoma" # Font Type $chara_select[1]=0 # Font Color $chara_select[5]=24 # Font Size $chara_select[2]=255 # Border Opacity $chara_select[3]=130 # Background Opacity $chara_select[4]="001-Blue01" # Windowskin end #------------------------------------------------------------------------------ # Main #------------------------------------------------------------------------------ def main @window_location = Window_Location.new @window_location.x = @window_position[0] @window_location.y = @window_position[1] @window_location.opacity = @window_opacity[0] @window_location.back_opacity = @window_opacity[1] @window_gold = Window_MenuGold.new @window_gold.x = @window_position[0] @window_gold.y = @window_position[2] @window_gold.opacity = @window_opacity[0] @window_gold.back_opacity = @window_opacity[1] @spriteset = Spriteset_Map.new px = $game_player.screen_x - 15 py = $game_player.screen_y - 24 @command_window = Window_RingMenu.new(px,py) @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 @command_window.z = 100 if $game_system.save_disabled @command_window.disable_item(4) end @status_window = Window_RingMenuStatus.new @status_window.x = @chara_select[0] @status_window.y = @chara_select[1] @status_window.z = 200 @status_window.opacity=$chara_select[2] @status_window.back_opacity=$chara_select[3] @status_window.visible = false Graphics.transition loop do Graphics.update Input.update update if $scene != self break end end Graphics.freeze @spriteset.dispose @window_location.dispose @window_gold.dispose @command_window.dispose @status_window.dispose end #------------------------------------------------------------------------------ # Update #------------------------------------------------------------------------------ def update @window_location.update @window_gold.update @command_window.update @status_window.update if @command_window.active update_command return end if @status_window.active update_status return end end #------------------------------------------------------------------------------ # Update Comman #------------------------------------------------------------------------------ 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) if $game_party.actors.size == 0 and @command_window.index < 4 $game_system.se_play($data_system.buzzer_se) return end case @command_window.index when 0 $game_system.se_play($data_system.decision_se) $scene = Scene_Item.new when 1 $game_system.se_play($data_system.decision_se) @command_window.active = false @status_window.active = true @status_window.visible = true @status_window.index = 0 when 2 $game_system.se_play($data_system.decision_se) @command_window.active = false @status_window.active = true @status_window.visible = true @status_window.index = 0 when 3 $game_system.se_play($data_system.decision_se) @command_window.active = false @status_window.active = true @status_window.visible = true @status_window.index = 0 when 4 if $game_system.save_disabled $game_system.se_play($data_system.buzzer_se) return end $game_system.se_play($data_system.decision_se) $scene = Scene_Save.new when 5 $game_system.se_play($data_system.decision_se) $scene = Scene_End.new end return end return if @command_window.animation? if Input.press?(Input::UP) or Input.press?(Input::LEFT) $game_system.se_play($data_system.cursor_se) @command_window.setup_move_move(Window_RingMenu::MODE_MOVEL) return end if Input.press?(Input::DOWN) or Input.press?(Input::RIGHT) $game_system.se_play($data_system.cursor_se) @command_window.setup_move_move(Window_RingMenu::MODE_MOVER) return end end #------------------------------------------------------------------------------ # Update Status #------------------------------------------------------------------------------ def update_status if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) @command_window.active = true @status_window.active = false @status_window.visible = false @status_window.index = -1 return end if Input.trigger?(Input::C) case @command_window.index when 1 if $game_party.actors[@status_window.index].restriction >= 2 $game_system.se_play($data_system.buzzer_se) return end $game_system.se_play($data_system.decision_se) $scene = Scene_Skill.new(@status_window.index) when 2 $game_system.se_play($data_system.decision_se) $scene = Scene_Equip.new(@status_window.index) when 3 $game_system.se_play($data_system.decision_se) $scene = Scene_Status.new(@status_window.index) end return end end end #------------------------------------------------------------------------------ # Window_RingMenu #------------------------------------------------------------------------------ class Window_RingMenu < Window_Base STARTUP_FRAMES = 20 MOVING_FRAMES = 5 RING_R = 72 ICON_ITEM = RPG::Cache.icon("034-Item03") ICON_SKILL = RPG::Cache.icon("044-Skill01") ICON_EQUIP = RPG::Cache.icon("001-Weapon01") ICON_STATUS = RPG::Cache.icon("050-Skill07") ICON_SAVE = RPG::Cache.icon("038-Item07") ICON_EXIT = RPG::Cache.icon("046-Skill03") ICON_DISABLE= RPG::Cache.icon("") SE_STARTUP = "056-Right02" MODE_START = 1 MODE_WAIT = 2 MODE_MOVER = 3 MODE_MOVEL = 4 attr_accessor :index #------------------------------------------------------------------------------ # Initialize #------------------------------------------------------------------------------ def initialize( center_x, center_y ) super(0, 0, 640, 480) self.contents = Bitmap.new(width-32, height-32) self.contents.font.name = $ring_menu_text[0] self.contents.font.color = text_color($ring_menu_text[7]) self.contents.font.size = $ring_menu_text[8] self.opacity = 0 self.back_opacity = 0 s1 = $ring_menu_text[1] s2 = $ring_menu_text[2] s3 = $ring_menu_text[3] s4 = $ring_menu_text[4] s5 = $ring_menu_text[5] s6 = $ring_menu_text[6] @commands = [ s1, s2, s3, s4, s5, s6 ] @item_max = 6 @index = 0 @items = [ ICON_ITEM, ICON_SKILL, ICON_EQUIP, ICON_STATUS, ICON_SAVE, ICON_EXIT ] @disabled = [ false, false, false, false, false, false ] @cx = center_x - 16 @cy = center_y - 16 setup_move_start refresh end #------------------------------------------------------------------------------ # Update #------------------------------------------------------------------------------ def update super refresh end #------------------------------------------------------------------------------ # Refresh #------------------------------------------------------------------------------ def refresh self.contents.clear case @mode when MODE_START refresh_start when MODE_WAIT refresh_wait when MODE_MOVER refresh_move(1) when MODE_MOVEL refresh_move(0) end rect = Rect.new(@cx - 272, @cy + 24, self.contents.width-32, 32) self.contents.draw_text(rect, @commands[@index],1) end #------------------------------------------------------------------------------ # Refresh Start #------------------------------------------------------------------------------ def refresh_start d1 = 2.0 * Math::PI / @item_max d2 = 1.0 * Math::PI / STARTUP_FRAMES r = RING_R - 1.0 * RING_R * @steps / STARTUP_FRAMES for i in 0...@item_max j = i - @index d = d1 * j + d2 * @steps x = @cx + ( r * Math.sin( d ) ).to_i y = @cy - ( r * Math.cos( d ) ).to_i draw_item(x, y, i) end @steps -= 1 if @steps < 1 @mode = MODE_WAIT end end #------------------------------------------------------------------------------ # Refresh Wait #------------------------------------------------------------------------------ def refresh_wait d = 2.0 * Math::PI / @item_max for i in 0...@item_max j = i - @index x = @cx + ( RING_R * Math.sin( d * j ) ).to_i y = @cy - ( RING_R * Math.cos( d * j ) ).to_i draw_item(x, y, i) end end #------------------------------------------------------------------------------ # Refresh Move #------------------------------------------------------------------------------ def refresh_move( mode ) d1 = 2.0 * Math::PI / @item_max d2 = d1 / MOVING_FRAMES d2 *= -1 if mode != 0 for i in 0...@item_max j = i - @index d = d1 * j + d2 * @steps x = @cx + ( RING_R * Math.sin( d ) ).to_i y = @cy - ( RING_R * Math.cos( d ) ).to_i draw_item(x, y, i) end @steps -= 1 if @steps < 1 @mode = MODE_WAIT end end #------------------------------------------------------------------------------ # Draw Item #------------------------------------------------------------------------------ def draw_item(x, y, i) rect = Rect.new(0, 0, @items[i].width, @items[i].height) if @index == i self.contents.blt( x, y, @items[i], rect ) if @disabled[@index] self.contents.blt( x, y, ICON_DISABLE, rect ) end else self.contents.blt( x, y, @items[i], rect, 128 ) if @disabled[@index] self.contents.blt( x, y, ICON_DISABLE, rect, 128 ) end end end #------------------------------------------------------------------------------ # Disable Item #------------------------------------------------------------------------------ def disable_item(index) @disabled[index] = true end #------------------------------------------------------------------------------ # Setup Move Start #------------------------------------------------------------------------------ def setup_move_start @mode = MODE_START @steps = STARTUP_FRAMES if SE_STARTUP != nil and SE_STARTUP != "" Audio.se_play("Audio/SE/" + SE_STARTUP, 80, 100) end end #------------------------------------------------------------------------------ # Setup Move Move #------------------------------------------------------------------------------ def setup_move_move(mode) if mode == MODE_MOVER @index -= 1 @index = @items.size - 1 if @index < 0 elsif mode == MODE_MOVEL @index += 1 @index = 0 if @index >= @items.size else return end @mode = mode @steps = MOVING_FRAMES end #------------------------------------------------------------------------------ # Animation #------------------------------------------------------------------------------ def animation? return @mode != MODE_WAIT end end #------------------------------------------------------------------------------ # Window_RingMenuStatus #------------------------------------------------------------------------------ class Window_RingMenuStatus < Window_Selectable #------------------------------------------------------------------------------ # Initialize #------------------------------------------------------------------------------ def initialize super(204, 64, 232, 352) self.contents = Bitmap.new(width - 32, height - 32) self.contents.font.size = $chara_select[5] refresh self.active = false self.index = -1 end #------------------------------------------------------------------------------ # Refresh #------------------------------------------------------------------------------ def refresh self.contents.clear self.windowskin = RPG::Cache.windowskin($chara_select[4]) self.contents.font.name = $chara_select[0] self.contents.font.color = text_color($chara_select[1]) @item_max = $game_party.actors.size for i in 0...$game_party.actors.size x = 80 y = 80 * i actor = $game_party.actors[i] draw_actor_graphic(actor, x - 60, y + 65) draw_actor_name(actor, x, y + 2) draw_actor_hp(actor, x - 40, y + 26) draw_actor_sp(actor, x - 40, y + 50) end end #------------------------------------------------------------------------------ # Update Cursor Rect #------------------------------------------------------------------------------ def update_cursor_rect if @index < 0 self.cursor_rect.empty else self.cursor_rect.set(0, @index * 80, self.width - 32, 80) end end end #------------------------------------------------------------------------------ # Game_Map #------------------------------------------------------------------------------ class Game_Map #------------------------------------------------------------------------------ # Name #------------------------------------------------------------------------------ def name $map_infos[@map_id] end end #------------------------------------------------------------------------------ # Scene_Title #------------------------------------------------------------------------------ class Scene_Title $map_infos = load_data("Data/MapInfos.rxdata") for key in $map_infos.keys $map_infos[key] = $map_infos[key].name end end #------------------------------------------------------------------------------ # Window_Location #------------------------------------------------------------------------------ class Window_Location < Window_Base #------------------------------------------------------------------------------ # Initialize #------------------------------------------------------------------------------ def initialize super(0, 0, $window_size[0], $window_size[1]) self.contents = Bitmap.new(width - 32, height - 32) self.contents.font.name = $location_text[0] self.contents.font.size = $location_text[1] refresh end #------------------------------------------------------------------------------ # Refresh #------------------------------------------------------------------------------ def refresh self.contents.clear self.windowskin = RPG::Cache.windowskin($window_location_skin) self.contents.font.color = text_color($location_text[2]) self.contents.draw_text(4, 0, 120, 32, $location_text[3]) self.contents.font.color = text_color($location_text[4]) self.contents.draw_text(4, 32, 120, 32, $game_map.name, 2) end end #------------------------------------------------------------------------------ # Window_MenuGold #------------------------------------------------------------------------------ class Window_MenuGold < Window_Base #------------------------------------------------------------------------------ # Initialize #------------------------------------------------------------------------------ def initialize super(0, 0, $window_size[0], $window_size[1]) self.contents = Bitmap.new(width - 32, height - 32) self.contents.font.name = $gold_text[0] self.contents.font.size = $gold_text[1] refresh end #------------------------------------------------------------------------------ # Refresh #------------------------------------------------------------------------------ def refresh self.contents.clear self.windowskin = RPG::Cache.windowskin($window_gold_skin) self.contents.font.color = text_color($gold_text[2]) self.contents.draw_text(4, 0, 120, 32, $gold_text[4]) self.contents.font.color = text_color($gold_text[3]) self.contents.draw_text(4, 32, 120, 32, $game_party.gold.to_s, 2) end end |
Diagfoales Laufen mit Charaveränderung:
|
|
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 |
#----- Credits an Xiderowg -----# class Game_System attr_accessor :move_speed alias xas_system_initialize initialize def initialize xas_system_initialize @move_speed = 4 end end #=============================================================================== # Game_Player #=============================================================================== class Game_Player < Game_Character def hero_dash_graphic?(actor) if (Input.press?(Input::RIGHT) or Input.press?(Input::LEFT) or Input.press?(Input::UP) or Input.press?(Input::DOWN)) RPG::Cache.character(actor.character_name.to_s + "_dash", actor.character_hue) rescue return false end end def hero_dash_quarter_graphic?(actor) if (Input.press?(Input::RIGHT) or Input.press?(Input::LEFT) or Input.press?(Input::UP) or Input.press?(Input::DOWN)) RPG::Cache.character(actor.character_name.to_s + "_dash_quarter", actor.character_hue) rescue return false end end def hero_quarter_graphic?(actor) RPG::Cache.character(actor.character_name.to_s + "_quarter", actor.character_hue) rescue return false end def update @actor = $game_party.actors[0] if @actor != nil actor = $game_party.actors[0] if actor.hp <= 0 if XAS_BA::AUTOGAMEOVER == true $scene = Scene_Gameover.new rescue nil if self.collapse_done else $game_switches[XAS_BA::GAMEOVER_SWITCH_ID] = true $game_map.refresh end end end last_moving = moving? unless moving? or $game_system.map_interpreter.running? or @move_route_forcing or $game_temp.message_window_showing #or # $game_temp.dodge_time_real > 0 case Input.dir8 when 1 move_left move_down when 2 move_down when 3 move_down move_right when 4 move_left when 6 move_right when 7 move_up move_left when 8 move_up when 9 move_right move_up end case Input.dir8 when 1 quarter = true when 2 quarter = false when 3 quarter = true when 4 quarter = false when 6 quarter = false when 7 quarter = true when 8 quarter = false when 9 quarter = true end actor = $game_party.actors[0] @move_speed = $game_system.move_speed if (quarter != nil and quarter == true) and hero_quarter_graphic?(actor) #and self.action == nil @character_name = actor.character_name + "_quarter" else @character_name = actor.character_name end end last_real_x = @real_x last_real_y = @real_y super if @real_y > last_real_y and @real_y - $game_map.display_y > CENTER_Y $game_map.scroll_down(@real_y - last_real_y) end if @real_x < last_real_x and @real_x - $game_map.display_x < CENTER_X $game_map.scroll_left(last_real_x - @real_x) end if @real_x > last_real_x and @real_x - $game_map.display_x > CENTER_X $game_map.scroll_right(@real_x - last_real_x) end if @real_y < last_real_y and @real_y - $game_map.display_y < CENTER_Y $game_map.scroll_up(last_real_y - @real_y) end unless moving? if last_moving result = check_event_trigger_here([1,2]) if result == false unless $DEBUG and Input.press?(Input::CTRL) if @encounter_count > 0 @encounter_count -= 1 end end end end if Input.trigger?(Input::C) check_event_trigger_here([0]) check_event_trigger_there([0,1,2]) end end end end |
AMS
|
|
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 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 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 |
#=================================================== # ■ AMS - Advanced Message Script - R4 [Update #2] #=================================================== # For more infos and update, visit: # www.dubealex.com (Creation Asylum) # # Edited, Fixed and Enhanced by: Dubealex # Original Script Core by: XRXS Scripter (Jap Dudes) # HTML Hexadecimal color feature from: Phylomorphis # # Special Thanks: # Rabu: For enabling the Show Face feature in an encrypted project # # To found all my new features, search the following: #NEW # To configure the button to skip the dialog, search: #SKIP_TEXT_CODE # # May 18, 2005 #=================================================== LETTER_BY_LETTER_MODE = true #Set the letter by letter mode ON/OFF #=================================================== # ▼ CLASS AMS Begins #=================================================== class AMS attr_accessor :name_box_x_offset attr_accessor :name_box_y_offset attr_accessor :font_type attr_accessor :name_font_type attr_accessor :font_size attr_accessor :name_font_size attr_accessor :message_box_opacity attr_accessor :name_box_skin attr_accessor :name_box_text_color attr_accessor :message_box_text_color attr_accessor :message_box_skin attr_accessor :name_box_width attr_accessor :name_box_height attr_accessor :message_width attr_accessor :message_height attr_accessor :message_x attr_accessor :message_y_bottom attr_accessor :message_y_middle attr_accessor :message_y_top attr_accessor :event_message_x_ofset attr_accessor :event_message_y_ofset def initialize @name_box_x_offset = 0 #Choose the X axis offset of the name bos. default= 0 @name_box_y_offset = -10#Choose the Y axis offset of the name bos. default= -10 @name_box_width = 8 #Choose the width of the Name Box. default= 8 @name_box_height = 26 #Choose the height of the Name Box. default= 26 @font_type = "Tahoma" #Choose the Font Name (Case Sensitive) for message box @name_font_type = "Tahoma" #Choose the Font Name (Case Sensitive) for Name Box @font_size = 22 #Choose the default Font Size for message box text @name_font_size = 22 #Choose the deafault Font Size for Name Box text @name_box_text_color=0 #Choose the Text Color of the Name Box @message_box_text_color=0 #Choose the Text Color of the Message Box @message_box_opacity = 160 #Choose the opacity of the message window. Default=160 @message_box_skin = "001-Blue01" #Choose the WindowSkin for the Message Box @name_box_skin = "001-Blue01" #Choose the WindowSkin for the Name Box @message_width = 480 #Choose the width size of the message box. Default=480 @message_height = 160 #Choose the height size of the message box. Default=160 @message_x = 80 #Choose the X position of the message box. Default=80 @message_y_bottom = 304#Choose the Y bottom position of the message box. Default=304 @message_y_middle = 160#Choose the Y middle position of the message box. Default=160 @message_y_top = 16 #Choose the Y top position of the message box. Default=16 @event_message_x_ofset = 0 #Choose the X position offset of the event message. Default=0 @event_message_y_ofset = 48 #Choose the Y position offset of the event message. Default=48 end end #=================================================== # ▲ CLASS AMS Ends #=================================================== #=================================================== # ▼ Class Window_Message Begins #=================================================== class Window_Message < Window_Selectable alias xrxs9_initialize initialize def initialize @alex_skip = false xrxs9_initialize if $soundname_on_speak == nil then $soundname_on_speak = "" end $gaiji_file = "./Graphics/Gaiji/sample.png" if FileTest.exist?($gaiji_file) @gaiji_cache = Bitmap.new($gaiji_file) else @gaigi_cache = nil end @opacity_text_buf = Bitmap.new(32, 32) end #-------------------------------------------------------------------------- alias xrxs9_terminate_message terminate_message def terminate_message if @name_window_frame != nil @name_window_frame.dispose @name_window_frame = nil end if @name_window_text != nil @name_window_text.dispose @name_window_text = nil end xrxs9_terminate_message end #-------------------------------------------------------------------------- def refresh self.contents.clear self.contents.font.color = text_color($ams.message_box_text_color) self.contents.font.name = $ams.font_type self.contents.font.size = $ams.font_size self.windowskin = RPG::Cache.windowskin($ams.message_box_skin) @x = @y = @max_x = @max_y = @indent = @lines = 0 @face_indent = 0 @opacity = 255 @cursor_width = 0 @write_speed = 0 @write_wait = 0 @mid_stop = false @face_file = nil @popchar = -2 if $game_temp.choice_start == 0 @x = 8 end if $game_temp.message_text != nil @now_text = $game_temp.message_text if (/\A\\[Ff]\[(.+?)\]/.match(@now_text))!=nil then @face_file = $1 + ".png" @x = @face_indent = 128 if FileTest.exist?("Graphics/Pictures/" + $1 + ".png") self.contents.blt(16, 16, RPG::Cache.picture(@face_file), Rect.new(0, 0, 96, 96)) end @now_text.gsub!(/\\[Ff]\[(.*?)\]/) { "" } end begin last_text = @now_text.clone @now_text.gsub!(/\\[Vv]\[([IiWwAaSs]?)([0-9]+)\]/) { convart_value($1, $2.to_i) } end until @now_text == last_text @now_text.gsub!(/\\[Nn]\[([0-9]+)\]/) do $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : "" end #NEW #Dubealex's Stop Skip Text ON-OFF @now_text.gsub!(/\\[%]/) { "\100" } #End new command #NEW #Dubealex's Show Monster Name Feature @now_text.gsub!(/\\[Mm]\[([0-9]+)\]/) do $data_enemies[$1.to_i] != nil ? $data_enemies[$1.to_i].name : "" end #End new command #NEW #Dubealex's Show Item Price Feature @now_text.gsub!(/\\[Pp]rice\[([0-9]+)\]/) do $data_items[$1.to_i] != nil ? $data_items[$1.to_i].price : "" end #End new command #NEW #Dubealex's Show Hero Class Name Feature @now_text.gsub!(/\\[Cc]lass\[([0-9]+)\]/) do $data_classes[$data_actors[$1.to_i].class_id] != nil ? $data_classes[$data_actors[$1.to_i].class_id].name : "" end #End new command #NEW #Dubealex's Show Current Map Name Feature @now_text.gsub!(/\\[Mm]ap/) do $game_map.name!= nil ? $game_map.name: "" end #End new command #NEW #Dubealex's Choose Name Box Text Color @now_text.gsub!(/\\[Zz]\[([0-9]+)\]/) do $ams.name_box_text_color=$1.to_i @now_text.sub!(/\\[Zz]\[([0-9]+)\]/) { "" } end #End new command name_window_set = false if (/\\[Nn]ame\[(.+?)\]/.match(@now_text)) != nil name_window_set = true name_text = $1 @now_text.sub!(/\\[Nn]ame\[(.*?)\]/) { "" } end if (/\\[Pp]\[([-1,0-9]+)\]/.match(@now_text))!=nil then @popchar = $1.to_i if @popchar == -1 @x = @indent = 48 @y = 4 end @now_text.gsub!(/\\[Pp]\[([-1,0-9]+)\]/) { "" } end @max_choice_x = 0 if @popchar >= 0 @text_save = @now_text.clone @max_x = 0 @max_y = 4 for i in 0..3 line = @now_text.split(/\n/)[3-i] @max_y -= 1 if line == nil and @max_y <= 4-i next if line == nil line.gsub!(/\\\w\[(\w+)\]/) { "" } cx = contents.text_size(line).width @max_x = cx if cx > @max_x if i >= $game_temp.choice_start @max_choice_x = cx if cx > @max_choice_x end end self.width = @max_x + 32 + @face_indent self.height = (@max_y - 1) * 32 + 64 @max_choice_x -= 68 @max_choice_x -= @face_indent*216/128 else @max_x = self.width - 32 - @face_indent for i in 0..3 line = @now_text.split(/\n/)[i] next if line == nil line.gsub!(/\\\w\[(\w+)\]/) { "" } cx = contents.text_size(line).width if i >= $game_temp.choice_start @max_choice_x = cx if cx > @max_choice_x end end @max_choice_x += 8 end @cursor_width = 0 @now_text.gsub!(/\\\\/) { "\000" } @now_text.gsub!(/\\[Cc]\[([0123456789ABCDEF#]+)\]/) { "\001[#{$1}]" } @now_text.gsub!(/\\[Gg]/) { "\002" } @now_text.gsub!(/\\[Ss]\[([0-9]+)\]/) { "\003[#{$1}]" } @now_text.gsub!(/\\[Aa]\[(.*?)\]/) { "\004[#{$1}]" } #NEW #Dubealex's Permanent Color Change @now_text.gsub!(/\\[Cc]olor\[([0-9]+)\]/) do $ams.message_box_text_color= $1.to_i @now_text.sub!(/\\[Cc]\[([0-9]+)\]/) { "" } end #End of new command #NEW #Dubealex's Font Change Feature @now_text.gsub(/\\[Tt]\[(.*?)\]/) do buftxt = $1.to_s $ams.font_type = buftxt @now_text.sub!(/\\[Tt]\[(.*?)\]/) { "" } end #End of new command @now_text.gsub!(/\\[.]/) { "\005" } @now_text.gsub!(/\\[|]/) { "\006" } @now_text.gsub!(/\\[>]/) { "\016" } @now_text.gsub!(/\\[<]/) { "\017" } @now_text.gsub!(/\\[!]/) { "\020" } @now_text.gsub!(/\\[~]/) { "\021" } @now_text.gsub!(/\\[Ee]\[([0-9]+)\]/) { "\022[#{$1}]" } @now_text.gsub!(/\\[Ii]/) { "\023" } @now_text.gsub!(/\\[Oo]\[([0-9]+)\]/) { "\024[#{$1}]" } @now_text.gsub!(/\\[Hh]\[([0-9]+)\]/) { "\025[#{$1}]" } @now_text.gsub!(/\\[Bb]\[([0-9]+)\]/) { "\026[#{$1}]" } @now_text.gsub!(/\\[Rr]\[(.*?)\]/) { "\027[#{$1}]" } reset_window if name_window_set color=$ams.name_box_text_color off_x = $ams.name_box_x_offset off_y = $ams.name_box_y_offset space = 2 x = self.x + off_x - space / 2 y = self.y + off_y - space / 2 w = self.contents.text_size(name_text).width + $ams.name_box_width + space h = $ams.name_box_height + space @name_window_frame = Window_Frame.new(x, y, w, h) @name_window_frame.z = self.z + 1 x = self.x + off_x + 4 y = self.y + off_y @name_window_text = Air_Text.new(x, y, name_text, color) @name_window_text.z = self.z + 2 end end reset_window if $game_temp.choice_max > 0 @item_max = $game_temp.choice_max self.active = true self.index = 0 end if $game_temp.num_input_variable_id > 0 digits_max = $game_temp.num_input_digits_max number = $game_variables[$game_temp.num_input_variable_id] @input_number_window = Window_InputNumber.new(digits_max) @input_number_window.number = number @input_number_window.x = self.x + 8 @input_number_window.y = self.y + $game_temp.num_input_start * 32 end end #-------------------------------------------------------------------------- def update super if @fade_in self.contents_opacity += 24 if @input_number_window != nil @input_number_window.contents_opacity += 24 end if self.contents_opacity == 255 @fade_in = false end return end @now_text = nil if @now_text == "" if @now_text != nil and @mid_stop == false if @write_wait > 0 @write_wait -= 1 return end text_not_skip = LETTER_BY_LETTER_MODE while true @max_x = @x if @max_x < @x @max_y = @y if @max_y < @y if (c = @now_text.slice!(/./m)) != nil if c == "\000" c = "\\" end if c == "\001" @now_text.sub!(/\[([0123456789ABCDEF#]+)\]/, "") temp_color = $1 color = temp_color.to_i leading_x = temp_color.to_s.slice!(/./m) if leading_x == "#" self.contents.font.color = hex_color(temp_color) next end if color >= 0 and color <= 7 self.contents.font.color = text_color(color) end next end if c == "\002" if @gold_window == nil and @popchar <= 0 @gold_window = Window_Gold.new @gold_window.x = 560 - @gold_window.width if $game_temp.in_battle @gold_window.y = 192 else @gold_window.y = self.y >= 128 ? 32 : 384 end @gold_window.opacity = self.opacity @gold_window.back_opacity = self.back_opacity end c = "" end if c == "\003" @now_text.sub!(/\[([0-9]+)\]/, "") speed = $1.to_i if speed >= 0 and speed <= 19 @write_speed = speed end c = "" end if c == "\004" @now_text.sub!(/\[(.*?)\]/, "") buftxt = $1.dup.to_s if buftxt.match(/\//) == nil and buftxt != "" then $soundname_on_speak = "Audio/SE/" + buftxt else $soundname_on_speak = buftxt.dup end c = "" elsif c == "\004" c = "" end if c == "\005" @write_wait += 5 c = "" end if c == "\006" @write_wait += 20 c = "" end if c == "\016" text_not_skip = false c = "" end if c == "\017" text_not_skip = true c = "" end if c == "\020" @mid_stop = true c = "" end if c == "\021" terminate_message return end if c == "\023" @indent = @x c = "" end if c == "\024" @now_text.sub!(/\[([0-9]+)\]/, "") @opacity = $1.to_i color = self.contents.font.color self.contents.font.name = $ams.font_type self.contents.font.size = $ams.font_size self.contents.font.color = Color.new(color.red, color.green, color.blue, color.alpha * @opacity / 255) c = "" end if c == "\025" @now_text.sub!(/\[([0-9]+)\]/, "") self.contents.font.size = [[$1.to_i, 6].max, 32].min c = "" end if c == "\026" @now_text.sub!(/\[([0-9]+)\]/, "") @x += $1.to_i c = "" end if c == "\027" @now_text.sub!(/\[(.*?)\]/, "") @x += ruby_draw_text(self.contents, @x, @y * line_height + (line_height - self.contents.font.size), $1, @opacity) if $soundname_on_speak != "" Audio.se_play($soundname_on_speak) end c = "" end if c == "\030" @now_text.sub!(/\[(.*?)\]/, "") self.contents.blt(@x , @y * line_height + 8, RPG::Cache.icon($1), Rect.new(0, 0, 24, 24)) if $soundname_on_speak != "" Audio.se_play($soundname_on_speak) end @x += 24 c = "" end if c == "\n" @lines += 1 @y += 1 @x = 0 + @indent + @face_indent if @lines >= $game_temp.choice_start @x = 8 + @indent + @face_indent @cursor_width = @max_choice_x end c = "" end if c == "\022" @now_text.sub!(/\[([0-9]+)\]/, "") @x += gaiji_draw(4 + @x, @y * line_height + (line_height - self.contents.font.size), $1.to_i) c = "" end #NEW #Dubealex's Text Skip On/OFF Command if c == "\100" if @alex_skip==false @alex_skip=true else @alex_skip=false end c = "" end #end of new command if c != "" self.contents.draw_text(0+@x, 32 * @y, 40, 32, c) @x += self.contents.text_size(c).width if $soundname_on_speak != "" then Audio.se_play($soundname_on_speak) end end #SKIP_TEXT_CODE # B = Escape, 0 (On The NumPad), X # C = Enter, Space Bar and C # A = Shift, Z if Input.press?(Input::C) # <-- Change the value on that line if @alex_skip==false text_not_skip = false end end else text_not_skip = true break end if text_not_skip break end end @write_wait += @write_speed return end if @input_number_window != nil @input_number_window.update if Input.trigger?(Input::C) $game_system.se_play($data_system.decision_se) $game_variables[$game_temp.num_input_variable_id] = @input_number_window.number $game_map.need_refresh = true @input_number_window.dispose @input_number_window = nil terminate_message end return end if @contents_showing if $game_temp.choice_max == 0 self.pause = true end if Input.trigger?(Input::B) if $game_temp.choice_max > 0 and $game_temp.choice_cancel_type > 0 $game_system.se_play($data_system.cancel_se) $game_temp.choice_proc.call($game_temp.choice_cancel_type - 1) terminate_message end end if Input.trigger?(Input::C) if $game_temp.choice_max > 0 $game_system.se_play($data_system.decision_se) $game_temp.choice_proc.call(self.index) end if @mid_stop @mid_stop = false return else terminate_message end end return end if @fade_out == false and $game_temp.message_text != nil @contents_showing = true $game_temp.message_window_showing = true refresh Graphics.frame_reset self.visible = true self.contents_opacity = 0 if @input_number_window != nil @input_number_window.contents_opacity = 0 end @fade_in = true return end if self.visible @fade_out = true self.opacity -= 48 if self.opacity == 0 self.visible = false @fade_out = false $game_temp.message_window_showing = false end return end end #-------------------------------------------------------------------------- def get_character(parameter) case parameter when 0 return $game_player else events = $game_map.events return events == nil ? nil : events[parameter] end end #-------------------------------------------------------------------------- def reset_window #MESSAGE_SIZE #MESSAGE_POSITION if @popchar >= 0 events = $game_map.events if events != nil character = get_character(@popchar) x = [[character.screen_x - $ams.event_message_x_ofset - self.width / 2, 4].max, 636 - self.width].min y = [[character.screen_y - $ams.event_message_y_ofset - self.height, 4].max, 476 - self.height].min self.x = x self.y = y end elsif @popchar == -1 self.x = -4 self.y = -4 self.width = 648 self.height = 488 else if $game_temp.in_battle self.y = 16 else case $game_system.message_position when 0 self.y = $ams.message_y_top when 1 self.y = $ams.message_y_middle when 2 self.y = $ams.message_y_bottom end self.x = $ams.message_x if @face_file == nil self.width = $ams.message_width self.x = $ams.message_x else if self.width <= 600 self.width = 600 self.x -=60 end end self.height = $ams.message_height end end self.contents = Bitmap.new(self.width - 32, self.height - 32) self.contents.font.color = text_color($ams.message_box_text_color) self.contents.font.name = $ams.font_type self.contents.font.size = $ams.font_size if @face_file != nil self.contents.blt(16, 16, RPG::Cache.picture(@face_file), Rect.new(0, 0, 96, 96)) end if @popchar == -1 self.opacity = 255 self.back_opacity = 0 elsif $game_system.message_frame == 0 self.opacity = 255 self.back_opacity = $ams.message_box_opacity else self.opacity = 0 self.back_opacity = $ams.message_box_opacity end end #-------------------------------------------------------------------------- def gaiji_draw(x, y, num) if @gaiji_cache == nil return 0 else if @gaiji_cache.width < num * 24 return 0 end if self.contents.font.size >= 20 and self.contents.font.size <= 24 size = 24 else size = self.contents.font.size * 100 * 24 / 2200 end self.contents.stretch_blt(Rect.new(x, y, size, size), @gaiji_cache, Rect.new(num * 24, 0, 24, 24)) if $soundname_on_speak != "" then Audio.se_play($soundname_on_speak) end return size end end #-------------------------------------------------------------------------- def line_height return 32 if self.contents.font.size >= 20 and self.contents.font.size <= 24 return 32 else return self.contents.font.size * 15 / 10 end end #-------------------------------------------------------------------------- def ruby_draw_text(target, x, y, str,opacity) sizeback = target.font.size target.font.size * 3 / 2 > 32 ? rubysize = 32 - target.font.size : rubysize = target.font.size / 2 rubysize = [rubysize, 6].max opacity = [[opacity, 0].max, 255].min split_s = str.split(/,/) split_s[0] == nil ? split_s[0] = "" : nil split_s[1] == nil ? split_s[1] = "" : nil height = sizeback + rubysize width = target.text_size(split_s[0]).width target.font.size = rubysize ruby_width = target.text_size(split_s[1]).width target.font.size = sizeback buf_width = [target.text_size(split_s[0]).width, ruby_width].max width - ruby_width != 0 ? sub_x = (width - ruby_width) / 2 : sub_x = 0 if opacity == 255 target.font.size = rubysize target.draw_text(x + sub_x, y - target.font.size, target.text_size(split_s[1]).width, target.font.size, split_s[1]) target.font.size = sizeback target.draw_text(x, y, width, target.font.size, split_s[0]) return width else if @opacity_text_buf.width < buf_width or @opacity_text_buf.height < height @opacity_text_buf.dispose @opacity_text_buf = Bitmap.new(buf_width, height) else @opacity_text_buf.clear end @opacity_text_buf.font.size = rubysize @opacity_text_buf.draw_text(0 , 0, buf_width, rubysize, split_s[1], 1) @opacity_text_buf.font.size = sizeback @opacity_text_buf.draw_text(0 , rubysize, buf_width, sizeback, split_s[0], 1) if sub_x >= 0 target.blt(x, y - rubysize, @opacity_text_buf, Rect.new(0, 0, buf_width, height), opacity) else target.blt(x + sub_x, y - rubysize, @opacity_text_buf, Rect.new(0, 0, buf_width, height), opacity) end return width end end #-------------------------------------------------------------------------- def convart_value(option, index) option == nil ? option = "" : nil option.downcase! case option when "i" unless $data_items[index].name == nil r = sprintf("\030[%s]%s", $data_items[index].icon_name, $data_items[index].name) end when "w" unless $data_weapons[index].name == nil r = sprintf("\030[%s]%s", $data_weapons[index].icon_name, $data_weapons[index].name) end when "a" unless $data_armors[index].name == nil r = sprintf("\030[%s]%s", $data_armors[index].icon_name, $data_armors[index].name) end when "s" unless $data_skills[index].name == nil r = sprintf("\030[%s]%s", $data_skills[index].icon_name, $data_skills[index].name) end else r = $game_variables[index] end r == nil ? r = "" : nil return r end #-------------------------------------------------------------------------- def dispose terminate_message if @gaiji_cache != nil unless @gaiji_cache.disposed? @gaiji_cache.dispose end end unless @opacity_text_buf.disposed? @opacity_text_buf.dispose end $game_temp.message_window_showing = false if @input_number_window != nil @input_number_window.dispose end super end #-------------------------------------------------------------------------- def update_cursor_rect if @index >= 0 n = $game_temp.choice_start + @index self.cursor_rect.set(8 + @indent + @face_indent, n * 32, @cursor_width, 32) else self.cursor_rect.empty end end end #========================================= # ▲ CLASS Window_Message Ends #========================================= #========================================= # ▼ Class Window_Frame Begins #========================================= class Window_Frame < Window_Base def initialize(x, y, width, height) super(x, y, width, height) self.windowskin = RPG::Cache.windowskin($ams.name_box_skin) self.contents = nil end #-------------------------------------------------------------------------- def dispose super end end #========================================= # ▲ CLASS Window_Frame Ends #========================================= #========================================= # ▼ CLASS Game_Map Additional Code Begins #========================================= class Game_Map #Dubealex's Addition (from XRXS) to show Map Name on screen def name $map_infos[@map_id] end end #========================================= # ▲ CLASS Game_Map Additional Code Ends #========================================= #========================================= # ▼ CLASS Scene_Title Additional Code Begins #========================================= class Scene_Title #Dubealex's Addition (from XRXS) to show Map Name on screen $map_infos = load_data("Data/MapInfos.rxdata") for key in $map_infos.keys $map_infos[key] = $map_infos[key].name end #Dubealex's addition to save data from the AMS in the save files $ams = AMS.new end #========================================= # ▲ CLASS Scene_Title Additional Code Ends #========================================= #========================================= # ▼ CLASS Window_Base Additional Code Begins #========================================= class Window_Base < Window #Dubealex Addition (from Phylomorphis) to use HTML Hex Code Colors def hex_color(string) red = 0 green = 0 blue = 0 if string.size != 6 print("Hex strings must be six characters long.") print("White text will be used.") return Color.new(255, 255, 255, 255) end for i in 1..6 s = string.slice!(/./m) if s == "#" print("Hex color string may not contain the \"#\" character.") print("White text will be used.") return Color.new(255, 255, 255, 255) end value = hex_convert(s) if value == -1 print("Error converting hex value.") print("White text will be used.") return Color.new(255, 255, 255, 255) end case i when 1 red += value * 16 when 2 red += value when 3 green += value * 16 when 4 green += value when 5 blue += value * 16 when 6 blue += value end end return Color.new(red, green, blue, 255) end #-------------------------------------------------------------------------- def hex_convert(character) case character when "0" return 0 when "1" return 1 when "2" return 2 when "3" return 3 when "4" return 4 when "5" return 5 when "6" return 6 when "7" return 7 when "8" return 8 when "9" return 9 when "A" return 10 when "B" return 11 when "C" return 12 when "D" return 13 when "E" return 14 when "F" return 15 end return -1 end end #========================================= # ▲ CLASS Window_Base Additional Code Ends #========================================= #========================================= # ▼ Class Air_Text Begins #========================================= class Air_Text < Window_Base def initialize(x, y, designate_text, color=0) super(x-16, y-16, 32 + designate_text.size * 12, 56) self.opacity = 0 self.back_opacity = 0 self.contents = Bitmap.new(self.width - 32, self.height - 32) w = self.contents.width h = self.contents.height self.contents.font.name = $ams.name_font_type self.contents.font.size = $ams.name_font_size self.contents.font.color = text_color(color) self.contents.draw_text(0, 0, w, h, designate_text) end #-------------------------------------------------------------------------- def dispose self.contents.clear super end end #========================================== # ▲ CLASS Air_Text Ends #========================================== #=================================================== # ▼ CLASS Scene_Save Additional Code Begins #=================================================== class Scene_Save < Scene_File alias ams_original_write_save_data write_save_data def write_save_data(file) ams_original_write_save_data(file) Marshal.dump($ams, file) end end #=================================================== # ▲ CLASS Scene_Save Additional Code Ends #=================================================== #=================================================== # ▼ CLASS Scene_Load Additional Code Begins #=================================================== class Scene_Load < Scene_File alias ams_original_read_save_data read_save_data def read_save_data(file) ams_original_read_save_data(file) $ams = Marshal.load(file) end end #=================================================== # ▲ CLASS Scene_Load Additional Code Ends #=================================================== |
NewDeubg
|
|
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 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 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 |
#============================================================================== # ** Custom Debugger V1.0 # von RPG Advocat (23.07.2008) #------------------------------------------------------------------------------ # http://www.rpg-studio.de/http://www.rpg-studio.de/itzamna/node/1 # http://www.phylomortis.com/resource/script/scr010.html # http://www.phylomortis.com #============================================================================== class Scene_Debug # ------------------------------ def main @left_window = Window_DebugLeft.new @right_window = Window_DebugRight.new c1 = "Heilen" c2 = "God Mode" c3 = "Geld" c4 = "Kämpfe(unnötig)" c5 = "Items" c6 = "Waffen/Ausrüstung" c7 = "Rüstung" c8 = "Teleport" c9 = "Geschwindichkeit" c10 = "Speichern" x1 = "An" x2 = "Aus" w1 = "Sehr langsam" w2 = "Bissl langsam" w3 = "leicht langsam" w4 = "Normal" w5 = "Schnell" w6 = "Lichtgeschwindichkeit" d1 = "Betamapchoose" main_commands = [c1, c2, c3, c4, c5, c6, c7, c8, c9, c10] speed_commands = [w1, w2, w3, w4, w5, w6] toggle_commands = [x1, x2] warp_commands = [d1] @other_window = Window_Command.new(240, main_commands) @speed_window = Window_Command.new(120, speed_commands) @enc_window = Window_Command.new(80, toggle_commands) @god_window = Window_Command.new(80, toggle_commands) @warp_window = Window_Command.new(240, warp_commands) @target_window = Window_Target.new @money_window = Window_Gold.new @number_window = Window_InputNumber.new(7) @var_window = Window_InputNumber.new(8) @help_window = Window_Base.new(192, 352, 448, 128) @help_window.contents = Bitmap.new(406, 96) @help_window.contents.font.name = "Arial" @help_window.contents.font.size = 24 @left_window.top_row = $game_temp.debug_top_row @left_window.index = $game_temp.debug_index @right_window.mode = @left_window.mode @right_window.top_id = @left_window.top_id @other_window.visible = false @other_window.active = false @target_window.visible = false @target_window.active = false @enc_window.visible = false @enc_window.active = false @god_window.visible = false @god_window.active = false @speed_window.visible = false @speed_window.active = false @warp_window.visible = false @warp_window.active = false @money_window.visible = false @money_window.active = false @number_window.visible = false @number_window.active = false @var_window.visible = false @var_window.active = false @itemset_window = Window_Dataset.new(1) @itemset_window.visible = false @itemset_window.active = false @weaponset_window = Window_Dataset.new(2) @weaponset_window.visible = false @weaponset_window.active = false @armorset_window = Window_Dataset.new(3) @armorset_window.visible = false @armorset_window.active = false @other_window.opacity = 255 @other_window.y = 48 @other_window.z = 200 @target_window.x = 304 @target_window.y = 0 @target_window.z = 300 @target_window.opacity = 255 @enc_window.x = 225 @enc_window.y = 180 @enc_window.z = 210 @enc_window.opacity = 255 @god_window.x = 225 @god_window.y = 180 @god_window.z = 210 @god_window.opacity = 255 @speed_window.x = 270 @speed_window.y = 100 @speed_window.z = 220 @speed_window.opacity = 255 @warp_window.x = 270 @warp_window.y = 100 @warp_window.z = 220 @warp_window.opacity = 255 @itemset_window.x = 0 @itemset_window.y = 0 @itemset_window.z = 1000 @itemset_window.opacity = 255 @weaponset_window.x = 0 @weaponset_window.y = 0 @weaponset_window.z = 1000 @weaponset_window.opacity = 255 @armorset_window.x = 0 @armorset_window.y = 0 @armorset_window.z = 1000 @armorset_window.opacity = 255 @money_window.x = 270 @money_window.y = 100 @money_window.z = 700 @money_window.opacity = 255 @number_window.x = 270 @number_window.y = 164 @number_window.z = 710 @number_window.opacity = 255 @var_window.x = 270 @var_window.y = 164 @var_window.z = 710 @var_window.opacity = 255 @variable_edit = 0 Graphics.transition loop do Graphics.update Input.update update if $scene != self break end end $game_map.refresh Graphics.freeze @left_window.dispose @right_window.dispose @help_window.dispose @other_window.dispose @god_window.dispose @speed_window.dispose @enc_window.dispose @target_window.dispose @warp_window.dispose @itemset_window.dispose @weaponset_window.dispose @armorset_window.dispose @money_window.dispose @var_window.dispose end # ------------------------------ def update @right_window.mode = @left_window.mode @right_window.top_id = @left_window.top_id @left_window.update @right_window.update @other_window.update @enc_window.update @itemset_window.update @weaponset_window.update @armorset_window.update @target_window.update @god_window.update @speed_window.update @warp_window.update @money_window.update @number_window.update @var_window.update $game_temp.debug_top_row = @left_window.top_row $game_temp.debug_index = @left_window.index if @left_window.active update_left return end if @right_window.active update_right return end if @other_window.active update_command return end if @target_window.active update_target return end if @enc_window.active update_enc return end if @itemset_window.active update_itemset return end if @weaponset_window.active update_weaponset return end if @armorset_window.active update_armorset return end if @god_window.active update_god return end if @speed_window.active update_speed return end if @warp_window.active update_warp return end if @number_window.active update_money return end if @var_window.active update_var return end end # ------------------------------ def update_left 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) if @left_window.mode == 0 text1 = "C (Enter) : ON / OFF" @help_window.contents.draw_text(4, 0, 406, 32, text1) else text1 = "Links : -1 Rechts : +1" text2 = "Q : -10" text3 = "W : +10" text4 = "C: RM2K(3) Editer" text5 = "A: Vorzeichen" @help_window.contents.draw_text(4, 0, 200, 32, text1) @help_window.contents.draw_text(4, 32, 200, 32, text2) @help_window.contents.draw_text(4, 64, 200, 32, text3) @help_window.contents.draw_text(240, 0, 180, 32, text4) @help_window.contents.draw_text(240, 32, 180, 32, text5) end @left_window.active = false @right_window.active = true @right_window.index = 0 return end if Input.trigger?(Input::X) $game_system.se_play($data_system.decision_se) @other_window.visible = true @left_window.active = false @other_window.active = true end end # ------------------------------ def update_command if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) @other_window.active = false @left_window.active = true @other_window.visible = false return end if Input.trigger?(Input::C) $game_system.se_play($data_system.decision_se) case @other_window.index when 0 @other_window.active = false @target_window.active = true @target_window.visible = true @target_window.index = 0 when 1 @god_window.index = 1 if $game_temp.god_mode @god_window.index = 0 end @god_window.active = true @god_window.visible = true @other_window.active = false when 2 @number_window.number = 0 @money_window.visible = true @number_window.active = true @number_window.visible = true @other_window.active = false when 3 @enc_window.index = 0 if $game_system.encounter_disabled @enc_window.index = 1 end @enc_window.active = true @enc_window.visible = true @other_window.active = false when 4 @itemset_window.index = 0 @itemset_window.active = true @itemset_window.visible = true @other_window.active = false when 5 @weaponset_window.index = 0 @weaponset_window.active = true @weaponset_window.visible = true @other_window.active = false when 6 @armorset_window.index = 0 @armorset_window.active = true @armorset_window.visible = true @other_window.active = false when 7 @warp_window.active = true @warp_window.visible = true @other_window.active = false when 8 @speed_window.index = $game_player.move_speed - 1 @speed_window.active = true @speed_window.visible = true @other_window.active = false when 9 $scene = Scene_Save.new return end end end # ------------------------------ def update_money if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) @number_window.active = false @other_window.active = true @money_window.visible = false @number_window.visible = false return end if Input.trigger?(Input::C) $game_system.se_play($data_system.decision_se) $game_party.lose_gold(9999999) $game_party.gain_gold(@number_window.number) @money_window.refresh end if Input.repeat?(Input::X) $game_system.se_play($data_system.cursor_se) $game_party.gain_gold(9999999) @money_window.refresh end if Input.repeat?(Input::Y) $game_system.se_play($data_system.cursor_se) $game_party.lose_gold(9999999) @money_window.refresh end end # ------------------------------ def update_itemset if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) @itemset_window.active = false @other_window.active = true @itemset_window.visible = false return end if Input.repeat?(Input::RIGHT) $game_system.se_play($data_system.cursor_se) $game_party.gain_item(@itemset_window.index + 1, 1) @itemset_window.refresh end if Input.repeat?(Input::LEFT) $game_system.se_play($data_system.cursor_se) $game_party.lose_item(@itemset_window.index + 1, 1) @itemset_window.refresh end if Input.repeat?(Input::X) $game_system.se_play($data_system.cursor_se) $game_party.lose_item(@itemset_window.index + 1, 10) @itemset_window.refresh end if Input.repeat?(Input::Y) $game_system.se_play($data_system.cursor_se) $game_party.gain_item(@itemset_window.index + 1, 10) @itemset_window.refresh end end # ------------------------------ def update_weaponset if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) @weaponset_window.active = false @other_window.active = true @weaponset_window.visible = false return end if Input.repeat?(Input::RIGHT) $game_system.se_play($data_system.cursor_se) $game_party.gain_weapon(@weaponset_window.index + 1, 1) @weaponset_window.refresh end if Input.repeat?(Input::LEFT) $game_system.se_play($data_system.cursor_se) $game_party.lose_weapon(@weaponset_window.index + 1, 1) @weaponset_window.refresh end if Input.repeat?(Input::X) $game_system.se_play($data_system.cursor_se) $game_party.lose_weapon(@weaponset_window.index + 1, 10) @weaponset_window.refresh end if Input.repeat?(Input::Y) $game_system.se_play($data_system.cursor_se) $game_party.gain_weapon(@weaponset_window.index + 1, 10) @weaponset_window.refresh end end # ------------------------------ def update_armorset if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) @armorset_window.active = false @other_window.active = true @armorset_window.visible = false return end if Input.repeat?(Input::RIGHT) $game_system.se_play($data_system.cursor_se) $game_party.gain_armor(@armorset_window.index + 1, 1) @armorset_window.refresh end if Input.repeat?(Input::LEFT) $game_system.se_play($data_system.cursor_se) $game_party.lose_armor(@armorset_window.index + 1, 1) @armorset_window.refresh end if Input.repeat?(Input::X) $game_system.se_play($data_system.cursor_se) $game_party.lose_armor(@armorset_window.index + 1, 10) @armorset_window.refresh end if Input.repeat?(Input::Y) $game_system.se_play($data_system.cursor_se) $game_party.gain_armor(@armorset_window.index + 1, 10) @armorset_window.refresh end end # ------------------------------- def update_enc if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) @enc_window.active = false @other_window.active = true @enc_window.visible = false return end if Input.trigger?(Input::C) case @enc_window.index when 0 $game_system.se_play($data_system.decision_se) $game_system.encounter_disabled = false @enc_window.active = false @other_window.active = true @enc_window.visible = false when 1 $game_system.se_play($data_system.decision_se) $game_system.encounter_disabled = true @enc_window.active = false @other_window.active = true @enc_window.visible = false end end end # ------------------------------- def update_god if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) @god_window.active = false @other_window.active = true @god_window.visible = false return end if Input.trigger?(Input::C) case @god_window.index when 0 $game_system.se_play($data_system.decision_se) $game_temp.god_mode = true @god_window.active = false @other_window.active = true @god_window.visible = false when 1 $game_system.se_play($data_system.decision_se) $game_temp.god_mode = false @god_window.active = false @other_window.active = true @god_window.visible = false end end end # ------------------------------- def update_speed if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) @speed_window.active = false @other_window.active = true @speed_window.visible = false return end if Input.trigger?(Input::C) $game_system.se_play($data_system.decision_se) $game_player.move_speed = @speed_window.index + 1 @speed_window.active = false @other_window.active = true @speed_window.visible = false end end # ------------------------------- def update_warp if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) @warp_window.active = false @other_window.active = true @warp_window.visible = false return end if Input.trigger?(Input::C) $game_system.se_play($data_system.decision_se) $game_temp.player_transferring = true case @warp_window.index when 0 $game_temp.player_new_map_id = 1 $game_temp.player_new_x = 1 $game_temp.player_new_y = 1 @warp_window.active = false @other_window.active = true @warp_window.visible = false end end end # ------------------------------ def update_target if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) @target_window.active = false @other_window.active = true @target_window.visible = false return end if Input.trigger?(Input::C) $game_system.se_play($data_system.save_se) for i in 1..$data_states.size $game_party.actors[@target_window.index].remove_state(i) end $game_party.actors[@target_window.index].hp += 9999 $game_party.actors[@target_window.index].sp += 9999 @target_window.refresh end if Input.trigger?(Input::X) $game_system.se_play($data_system.save_se) $game_party.actors[@target_window.index].hp += 9999 @target_window.refresh end if Input.trigger?(Input::Y) $game_system.se_play($data_system.save_se) $game_party.actors[@target_window.index].sp += 9999 @target_window.refresh end if Input.trigger?(Input::A) $game_system.se_play($data_system.save_se) for i in 1..$data_states.size $game_party.actors[@target_window.index].remove_state(i) end @target_window.refresh end end # ------------------------------ def update_var if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) @var_window.active = false @var_window.visible = false @right_window.active = true return end if Input.trigger?(Input::C) $game_system.se_play($data_system.decision_se) $game_variables[@variable_edit] = @var_window.number @right_window.refresh @var_window.active = false @var_window.visible = false @right_window.active = true end end # ------------------------------ def update_right if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) @left_window.active = true @right_window.active = false @right_window.index = -1 @help_window.contents.clear return end current_id = @right_window.top_id + @right_window.index if @right_window.mode == 0 if Input.trigger?(Input::C) $game_system.se_play($data_system.decision_se) $game_switches[current_id] = (not $game_switches[current_id]) @right_window.refresh return end end if @right_window.mode == 1 if Input.repeat?(Input::RIGHT) $game_system.se_play($data_system.cursor_se) $game_variables[current_id] += 1 if $game_variables[current_id] > 99999999 $game_variables[current_id] = 99999999 end @right_window.refresh return end if Input.repeat?(Input::LEFT) $game_system.se_play($data_system.cursor_se) $game_variables[current_id] -= 1 if $game_variables[current_id] < -99999999 $game_variables[current_id] = -99999999 end @right_window.refresh return end if Input.repeat?(Input::C) $game_system.se_play($data_system.decision_se) current_id = @right_window.top_id + @right_window.index @variable_edit = current_id @var_window.number = $game_variables[current_id].abs @var_window.visible = true @var_window.active = true @right_window.active = false end if Input.repeat?(Input::X) $game_system.se_play($data_system.decision_se) current_id = @right_window.top_id + @right_window.index $game_variables[current_id] *= -1 @right_window.refresh end if Input.repeat?(Input::R) $game_system.se_play($data_system.cursor_se) $game_variables[current_id] += 10 if $game_variables[current_id] > 99999999 $game_variables[current_id] = 99999999 end @right_window.refresh return end if Input.repeat?(Input::L) $game_system.se_play($data_system.cursor_se) $game_variables[current_id] -= 10 if $game_variables[current_id] < -99999999 $game_variables[current_id] = -99999999 end @right_window.refresh return end end end end class Window_Dataset < Window_Selectable #--------------------------------- def initialize(type) super(0, 0, 300, 480) self.contents = Bitmap.new(width - 32, height - 32) self.back_opacity = 160 self.contents.font.name = "Arial" self.contents.font.size = 24 @type = type if @type == 1 @item_max = $data_items.size - 1 end if @type == 2 @item_max = $data_weapons.size - 1 end if @type == 3 @item_max = $data_armors.size - 1 end refresh end #--------------------------------- def refresh if self.contents != nil self.contents.dispose self.contents = nil end y = 0 self.contents = Bitmap.new(width - 32, 32 * @item_max) self.contents.clear self.contents.font.name = "Arial" self.contents.font.size = 24 self.opacity = 255 self.back_opacity = 255 if @type == 1 for i in 1..$data_items.size - 1 draw_item_name($data_items[i], 4, i*32 - 32) number = $game_party.item_number(i).to_s self.contents.draw_text(4, i*32 - 32, 262, 32, number, 2) end end if @type == 2 for i in 1..$data_weapons.size - 1 draw_item_name($data_weapons[i], 4, i*32 - 32) number = $game_party.weapon_number(i).to_s self.contents.draw_text(4, i*32 - 32, 262, 32, number, 2) end end if @type == 3 for i in 1..$data_armors.size - 1 draw_item_name($data_armors[i], 4, i*32 - 32) number = $game_party.armor_number(i).to_s self.contents.draw_text(4, i*32 - 32, 262, 32, number, 2) end end end #--------------------------------- def update super end end class Game_Actor < Game_Battler # ------------------------------------- def base_maxhp if $game_temp.god_mode return 9999 end return $data_actors[@actor_id].parameters[0, @level] end # ------------------------------------- def base_maxsp if $game_temp.god_mode return 9999 end return $data_actors[@actor_id].parameters[1, @level] end # ------------------------------------- def base_str if $game_temp.god_mode return 999 end n = $data_actors[@actor_id].parameters[2, @level] weapon = $data_weapons[@weapon_id] armor1 = $data_armors[@armor1_id] armor2 = $data_armors[@armor2_id] armor3 = $data_armors[@armor3_id] armor4 = $data_armors[@armor4_id] n += weapon != nil ? weapon.str_plus : 0 n += armor1 != nil ? armor1.str_plus : 0 n += armor2 != nil ? armor2.str_plus : 0 n += armor3 != nil ? armor3.str_plus : 0 n += armor4 != nil ? armor4.str_plus : 0 return [[n, 1].max, 999].min end # ------------------------------------- def base_dex if $game_temp.god_mode return 999 end n = $data_actors[@actor_id].parameters[3, @level] weapon = $data_weapons[@weapon_id] armor1 = $data_armors[@armor1_id] armor2 = $data_armors[@armor2_id] armor3 = $data_armors[@armor3_id] armor4 = $data_armors[@armor4_id] n += weapon != nil ? weapon.dex_plus : 0 n += armor1 != nil ? armor1.dex_plus : 0 n += armor2 != nil ? armor2.dex_plus : 0 n += armor3 != nil ? armor3.dex_plus : 0 n += armor4 != nil ? armor4.dex_plus : 0 return [[n, 1].max, 999].min end # ------------------------------------- def base_agi if $game_temp.god_mode return 999 end n = $data_actors[@actor_id].parameters[4, @level] weapon = $data_weapons[@weapon_id] armor1 = $data_armors[@armor1_id] armor2 = $data_armors[@armor2_id] armor3 = $data_armors[@armor3_id] armor4 = $data_armors[@armor4_id] n += weapon != nil ? weapon.agi_plus : 0 n += armor1 != nil ? armor1.agi_plus : 0 n += armor2 != nil ? armor2.agi_plus : 0 n += armor3 != nil ? armor3.agi_plus : 0 n += armor4 != nil ? armor4.agi_plus : 0 return [[n, 1].max, 999].min end # ------------------------------------- def base_int if $game_temp.god_mode return 999 end n = $data_actors[@actor_id].parameters[5, @level] weapon = $data_weapons[@weapon_id] armor1 = $data_armors[@armor1_id] armor2 = $data_armors[@armor2_id] armor3 = $data_armors[@armor3_id] armor4 = $data_armors[@armor4_id] n += weapon != nil ? weapon.int_plus : 0 n += armor1 != nil ? armor1.int_plus : 0 n += armor2 != nil ? armor2.int_plus : 0 n += armor3 != nil ? armor3.int_plus : 0 n += armor4 != nil ? armor4.int_plus : 0 return [[n, 1].max, 999].min end # ------------------------------------- def base_atk if $game_temp.god_mode return 9999999 end weapon = $data_weapons[@weapon_id] return weapon != nil ? weapon.atk : 0 end # ------------------------------------- def base_pdef if $game_temp.god_mode return 999999 end weapon = $data_weapons[@weapon_id] armor1 = $data_armors[@armor1_id] armor2 = $data_armors[@armor2_id] armor3 = $data_armors[@armor3_id] armor4 = $data_armors[@armor4_id] pdef1 = weapon != nil ? weapon.pdef : 0 pdef2 = armor1 != nil ? armor1.pdef : 0 pdef3 = armor2 != nil ? armor2.pdef : 0 pdef4 = armor3 != nil ? armor3.pdef : 0 pdef5 = armor4 != nil ? armor4.pdef : 0 return pdef1 + pdef2 + pdef3 + pdef4 + pdef5 end # ------------------------------------- def base_mdef if $game_temp.god_mode return 999999 end weapon = $data_weapons[@weapon_id] armor1 = $data_armors[@armor1_id] armor2 = $data_armors[@armor2_id] armor3 = $data_armors[@armor3_id] armor4 = $data_armors[@armor4_id] mdef1 = weapon != nil ? weapon.mdef : 0 mdef2 = armor1 != nil ? armor1.mdef : 0 mdef3 = armor2 != nil ? armor2.mdef : 0 mdef4 = armor3 != nil ? armor3.mdef : 0 mdef5 = armor4 != nil ? armor4.mdef : 0 return mdef1 + mdef2 + mdef3 + mdef4 + mdef5 end end class Game_Character attr_accessor :move_speed end class Game_Temp attr_accessor :god_mode @god_mode = false end |
ModuleUcoders
|
|
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 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 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 |
#=============================================================================== # ** Module UCoders - Contains Methods used by Unknown Coders' scripts # # Visit Us: # www.unknowncoders.com # #------------------------------------------------------------------------------- # Authors Mr.Mo "Muhammet Sivri" | Trebor777 # Version 1.2 # Date 11/24/07 (m/d/y) #=============================================================================== module UCoders #-------------------------------------------------------------------------- # * Constants #-------------------------------------------------------------------------- Object = {} Scripts = {} #-------------------------------------------------------------------------- # * Include Script #-------------------------------------------------------------------------- def UCoders.include(name,args) Scripts[name] = args end #-------------------------------------------------------------------------- # * Include Script #-------------------------------------------------------------------------- def UCoders.has?(name) return !Scripts[name].nil? end #-------------------------------------------------------------------------- # * Returns a list of parameters from an event's comments #-------------------------------------------------------------------------- def UCoders.event_comment_input(*args) parameters = []; list = *args[0].list; lines = *args[1]; trigger = *args[2] return nil if list.nil? || !list.is_a?(Array) list.each { |o| next if o.code != 108 || !(o.parameters[0].to_s).include?(trigger) start = list.index(o) finish = start + lines for id in start...finish next if !list[id]; parameters.push(list[id].parameters[0]) end return parameters } return nil end #-------------------------------------------------------------------------- # * Returns the event comment with the needed key #-------------------------------------------------------------------------- def UCoders.event_comment(*args) parameters = []; list = *args[0].list; trigger = *args[1] return nil if list.nil? || !list.is_a?(Array) list.each { |o| next if o.code != 108 || !(o.parameters[0].to_s).include?(trigger) parameters.push(o.parameters) } return parameters unless parameters.empty? return nil end #-------------------------------------------------------------------------- # * Log Error - Records and Saves all errors. #-------------------------------------------------------------------------- def UCoders.log_error # Record Error k = 0 time = Time.now.strftime("%a %d %b %Y, %X") log = File.open("ErrorLog.rxdata","a+") log.write("[ #{time} ]\n") # Write Message and Type log.write("'#{$!.message}' Type #{$!.class}\n") for i in 0..$!.backtrace.size e = $!.backtrace[i] /Section(.*):(.*):in (.*)/.match(e) space = " "*(i*2) log.write(space+" <>Script '#{$RGSS_SCRIPTS[$1.to_i][1]}' | Line #{$2} | Method #{$3}\n") # Don't list more then 4 backtraces to make it simpler, can be changed! break if i >= 4 next if k == 1 # Get the first trace script = "#{$RGSS_SCRIPTS[$1.to_i][1]}" line = $2 method = $3 k = 1 end log.write("\n") log.close # Make some sense if $DEBUG print "#{$!.message} \nScript '#{script}' \nLine '#{line}' \nMethod '#{method}' \nType '#{$!.class}'" else print "Unexpected Error! The ErrorLog is in folder:\n #{File.expand_path('.')}" end end #-------------------------------------------------------------------------- # * Checks the object range #-------------------------------------------------------------------------- def UCoders.in_screen?(object) scene_x = $game_map.display_x - 256 scene_y = $game_map.display_y - 256 scene_width = $game_map.display_x + 2816 scene_height = $game_map.display_y + 2176 return (object.real_x.between?(scene_x, scene_width) and object.real_y.between?(scene_y,scene_height)) end #-------------------------------------------------------------------------- # * Get Events In (range of element) #-------------------------------------------------------------------------- def UCoders.get_events_in(range,element) objects = [] $game_map.events.each_value { |e| objects.push(e) if UCoders.in_range?(element, e, range) } return objects end #-------------------------------------------------------------------------- # * Get Range(Element, Object) #-------------------------------------------------------------------------- def UCoders.get_range(element, object) x = (element.x - object.x)**2 y = (element.y - object.y)**2 r = x + y return Math.sqrt(r).to_i end #-------------------------------------------------------------------------- # * In Range?(Element, Object, Range) #-------------------------------------------------------------------------- def UCoders.in_range?(element, object, range) x = (element.x - object.x)**2 y = (element.y - object.y)**2 return x + y <= (range * range) end #-------------------------------------------------------------------------- # * In Direction?(Element, Object) #-------------------------------------------------------------------------- def UCoders.in_direction?(event,object) return true if event.direction == 2 && object.y >= event.y && object.x == event.x return true if event.direction == 4 && object.x <= event.x && object.y == event.y return true if event.direction == 6 && object.x >= event.x && object.y == event.y return true if event.direction == 8 && object.y <= event.y && object.x == event.x return false end end #============================================================================== # ** Multi-Dimensional Array # Creates a MultiD array. When value not specified, returns nil. #============================================================================== class MultiArray #-------------------------------------------------------------------------- # * Initialize # d : number of dimensions(x,y,z) #-------------------------------------------------------------------------- def initialize(*dimensions) @dimensions=Array.new(dimensions.size) @factors=Array.new(dimensions.size) product=1 i=dimensions.size-1 while i >= 0 @dimensions[i]=dimensions[i] @factors[i]=product product*=@dimensions[i] i-=1 end @data=Array.new(product) end #-------------------------------------------------------------------------- # * X Size #-------------------------------------------------------------------------- def xsize return @dimensions[0] end #-------------------------------------------------------------------------- # * Y Size #-------------------------------------------------------------------------- def ysize return 1 if @dimensions.size<2 return @dimensions[1] end #-------------------------------------------------------------------------- # * Z Size #-------------------------------------------------------------------------- def zsize return 1 if @dimensions.size<3 return @dimensions[2] end #-------------------------------------------------------------------------- # * NSize #-------------------------------------------------------------------------- def nsize(n) raise IndexError if @dimensions.size<n return @dimensions[n-1] end #-------------------------------------------------------------------------- # * Get ID #-------------------------------------------------------------------------- def get_id(indices) raise IndexError if indices.size != @dimensions.size offset=0 for i in 0 ... @dimensions.size raise IndexError if indices[i] < 0 or indices[i]>=@dimensions[i] offset += @factors[i]*indices[i] end return offset end #-------------------------------------------------------------------------- # * Get [] #-------------------------------------------------------------------------- def [](*indices) @data[self.get_id(indices)] end #-------------------------------------------------------------------------- # * Set []= #-------------------------------------------------------------------------- def []=(*indicesAndValue) value = indicesAndValue.pop @data[self.get_id(indicesAndValue)]=value end end #============================================================================== # ** 2-Dimensional Array # Creates a 2D array. When value not specified, returns 0. #============================================================================== class Array2D #-------------------------------------------------------------------------- # * Initialize #-------------------------------------------------------------------------- def initialize # Create Data Array @data = {} end #-------------------------------------------------------------------------- # * Get #-------------------------------------------------------------------------- def [](i,j) @data[i] = {} if @data[i].nil? @data[i][j] = 0 if @data[i][j].nil? return @data[i][j] end #-------------------------------------------------------------------------- # * Set #-------------------------------------------------------------------------- def []=(i,j,v) @data[i] = {} if @data[i].nil? @data[i][j] = v return v end end #============================================================================== # ** RPG::Event::Page::Condition #============================================================================== class RPG::Event::Page::Condition #-------------------------------------------------------------------------- # * Conditions Met? #-------------------------------------------------------------------------- def conditions_met?(map_id, event_id) # Switch 1 condition confirmation if @switch1_valid && $game_switches[@switch1_id] == false return false end # Switch 2 condition confirmation if @switch2_valid && $game_switches[@switch2_id] == false return false end # Variable condition confirmation if @variable_valid && $game_variables[@variable_id] < @variable_value return false end # Self switch condition confirmation if @self_switch_valid key = [map_id, event_id, @self_switch_ch] if $game_self_switches[key] == false return false end end # Returns True return true end end #============================================================================== # ** Game_Event #============================================================================== class Game_Event < Game_Character attr_reader :real_x, :real_y, :event #-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- def refresh new_page = refresh_new_page # Get New Page return if refresh_page_change?(new_page) # Return if No Page Change clear_starting # Clear starting flag return if refresh_page_reset? # Return if Nil Page Reset refresh_set_page # Set page variables refresh_check_process # Check parallel processing check_event_trigger_auto # Auto event start determinant end #-------------------------------------------------------------------------- # * Refresh : New Page #-------------------------------------------------------------------------- def refresh_new_page return @erased ? nil : refresh_trigger_conditions end #-------------------------------------------------------------------------- # * Refresh Trigger Conditions #-------------------------------------------------------------------------- def refresh_trigger_conditions # Check in order of large event pages for page in @event.pages.reverse # Skips If Page Conditions Not Met next unless page.condition.conditions_met?(@map_id, @id) # Set local variable: new_page new_page = page # Remove loop break end # Return new page return new_page end #-------------------------------------------------------------------------- # * Refresh : Page Change #-------------------------------------------------------------------------- def refresh_page_change?(new_page) # If event page is the same as last time if new_page == @page # End method return true end # Set @page as current event page @page = new_page return false end #-------------------------------------------------------------------------- # * Refresh : Page Reset #-------------------------------------------------------------------------- def refresh_page_reset? # If no page fulfills conditions if @page == nil # Reset values refresh_reset # End method return true end return false end #-------------------------------------------------------------------------- # * Refresh Reset #-------------------------------------------------------------------------- def refresh_reset # Set each instance variable @tile_id = 0 @character_name = "" @character_hue = 0 @move_type = 0 @through = true @trigger = nil @list = nil @interpreter = nil end #-------------------------------------------------------------------------- # * Refresh Set Page #-------------------------------------------------------------------------- def refresh_set_page # Set each instance variable @tile_id = @page.graphic.tile_id @character_name = @page.graphic.character_name @character_hue = @page.graphic.character_hue if @original_direction != @page.graphic.direction @direction = @page.graphic.direction @original_direction = @direction @prelock_direction = 0 end if @original_pattern != @page.graphic.pattern @pattern = @page.graphic.pattern @original_pattern = @pattern end @opacity = @page.graphic.opacity @blend_type = @page.graphic.blend_type @move_type = @page.move_type @move_speed = @page.move_speed @move_frequency = @page.move_frequency @move_route = @page.move_route @move_route_index = 0 @move_route_forcing = false @walk_anime = @page.walk_anime @step_anime = @page.step_anime @direction_fix = @page.direction_fix @through = @page.through @always_on_top = @page.always_on_top @trigger = @page.trigger @list = @page.list @interpreter = nil end #-------------------------------------------------------------------------- # * Refresh Check Process #-------------------------------------------------------------------------- def refresh_check_process # If trigger is [parallel process] if @trigger == 4 # Create parallel process interpreter @interpreter = Interpreter.new end end end class Interpreter #-------------------------------------------------------------------------- # * Script #-------------------------------------------------------------------------- def command_355 # Set first line to script script = @list[@index].parameters[0] + "\n" # Loop loop do # If next event command is second line of script || after if @list[@index+1].code == 655 # Add second line || after to script script += @list[@index+1].parameters[0] + "\n" # If event command is not second line || after else # Abort loop break end # Advance index @index += 1 end # Evaluation result = eval(script) # Continue return true end #-------------------------------------------------------------------------- # * In Range?(Element, Object, Range) #-------------------------------------------------------------------------- def in_range?(element, object, range) x = (element.x - object.x)**2 y = (element.y - object.y)**2 return x + y <= (range * range) end end #============================================================================== # ** Scene_Load #------------------------------------------------------------------------------ # This class performs load screen processing. #============================================================================== class Scene_Load < Scene_File #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize # Remake temporary object $game_temp = Game_Temp.new # Timestamp selects new file $game_temp.last_file_index = 0 latest_time = Time.at(0) for i in 0..3 filename = make_filename(i) if FileTest.exist?(filename) file = File.open(filename, "r") if file.mtime > latest_time latest_time = file.mtime $game_temp.last_file_index = i end file.close end end super("Welcher Fluch soll geladen werden?") end #-------------------------------------------------------------------------- # * Decision Processing #-------------------------------------------------------------------------- def on_decision(filename) # If file doesn't exist unless FileTest.exist?(filename) # Play buzzer SE $game_system.se_play($data_system.buzzer_se) return end # Play load SE $game_system.se_play($data_system.load_se) # Read save data file = File.open(filename, "rb") read_save_data(file) file.close # Restore BGM and BGS $game_system.bgm_play($game_system.playing_bgm) $game_system.bgs_play($game_system.playing_bgs) # Update map (run parallel process event) $game_map.update # Switch to map screen $scene = Scene_Map.new end #-------------------------------------------------------------------------- # * Cancel Processing #-------------------------------------------------------------------------- def on_cancel # Play cancel SE $game_system.se_play($data_system.cancel_se) # Switch to title screen $scene = Scene_Map.new end #-------------------------------------------------------------------------- # * Read Save Data # file : file object for reading (opened) #-------------------------------------------------------------------------- def read_save_data(file) read_characters(file) read_frame(file) read_data(file) read_edit read_refresh end #-------------------------------------------------------------------------- # * Read Character Data #-------------------------------------------------------------------------- def read_characters(file) # Read character data for drawing save file characters = Marshal.load(file) end #-------------------------------------------------------------------------- # * Read Frame Count #-------------------------------------------------------------------------- def read_frame(file) # Read frame count for measuring play time Graphics.frame_count = Marshal.load(file) end #-------------------------------------------------------------------------- # * Read Data #-------------------------------------------------------------------------- def read_data(file) # Read each type of game object $game_system = Marshal.load(file) $game_switches = Marshal.load(file) $game_variables = Marshal.load(file) $game_self_switches = Marshal.load(file) $game_screen = Marshal.load(file) $game_actors = Marshal.load(file) $game_party = Marshal.load(file) $game_troop = Marshal.load(file) $game_map = Marshal.load(file) $game_player = Marshal.load(file) end #-------------------------------------------------------------------------- # * Read Edit #-------------------------------------------------------------------------- def read_edit # If magic number is different from when saving # (if editing was added with editor) if $game_system.magic_number != $data_system.magic_number # Load map $game_map.setup($game_map.map_id) $game_player.center($game_player.x, $game_player.y) end end #-------------------------------------------------------------------------- # * Refresh Game Party #-------------------------------------------------------------------------- def read_refresh # Refresh party members $game_party.refresh end end #============================================================================== # ** Game_Character (part 1) #------------------------------------------------------------------------------ # This class deals with characters. It's used as a superclass for the # Game_Player && Game_Event classes. #============================================================================== class Game_Character #-------------------------------------------------------------------------- # * Follow_Path #-------------------------------------------------------------------------- def follow_path(x,y,&block) node = Node.new(x, y) path = A_Star_Pathfinder.new(node, self) path.reach_method = block end #-------------------------------------------------------------------------- # * Turn Towards B #-------------------------------------------------------------------------- def turn_to(b) # Get difference in player coordinates sx = @x - b.x sy = @y - b.y # If coordinates are equal if sx == 0 && sy == 0 return end # If horizontal distance is longer if sx.abs > sy.abs # Turn to the right || left towards player sx > 0 ? turn_left : turn_right # If vertical distance is longer else # Turn up || down towards player sy > 0 ? turn_up : turn_down end end #-------------------------------------------------------------------------- # * Move toward B #-------------------------------------------------------------------------- def move_towards(b,ran=true) return if in_range2?(b,1) || !@a_star_path.nil? # Get difference in player coordinates sx = @x - b.x sy = @y - b.y @target = b # If coordinates are equal return if sx == 0 && sy == 0 # Get absolute value of difference abs_sx = sx.abs abs_sy = sy.abs # If horizontal && vertical distances are equal if abs_sx == abs_sy # Increase one of them randomly by 1 rand(2) == 0 ? abs_sx += 1 : abs_sy += 1 end # If horizontal distance is longer if abs_sx > abs_sy # Move towards player, prioritize left && right directions if sx > 0 return move_left if passable?(@x, @y, 4) else return move_right if passable?(@x, @y, 6) end if not moving? && sy != 0 if sy > 0 return move_up if passable?(@x, @y, 8) else return move_down if passable?(@x, @y, 2) end end # If vertical distance is longer else # Move towards player, prioritize up && down directions if sy > 0 return move_up if passable?(@x, @y, 8) else return move_down if passable?(@x, @y, 2) end if not moving? && sx != 0 if sx > 0 return move_left if passable?(@x, @y, 4) else return move_right if passable?(@x, @y, 6) end end end =begin # Can't find the path, Try pathfidning if self.respond_to?(:a_star_path) && @a_star_path.nil? # Get X,Y x,y=b.x,b.y # Follow Path nx = x + (passable?(x-1,y,0) ? -1 : passable?(x+1,y,0) ? 1 : 0) ny = y + (passable?(x,y-1,0) ? -1 : passable?(x,y+1,0) ? 1 : 0) self.follow_path(nx,ny) # Return if Path success return if !@a_star_path.nil? && @a_star_path.found end =end if ran move_random turn_to(b) end end #-------------------------------------------------------------------------- # * Move toward Pos XY #-------------------------------------------------------------------------- def move_towards_pos(x,y,ran=true) # Get difference in player coordinates sx = @x - x sy = @y - y # If coordinates are equal return if sx == 0 && sy == 0 # Get absolute value of difference abs_sx = sx.abs abs_sy = sy.abs # If horizontal && vertical distances are equal if abs_sx == abs_sy # Increase one of them randomly by 1 rand(2) == 0 ? abs_sx += 1 : abs_sy += 1 end # If horizontal distance is longer if abs_sx > abs_sy # Move towards player, prioritize left && right directions if sx > 0 return move_left if passable?(@x, @y, 4) else return move_right if passable?(@x, @y, 6) end if not moving? && sy != 0 if sy > 0 return move_up if passable?(@x, @y, 8) else return move_down if passable?(@x, @y, 2) end end # If vertical distance is longer else # Move towards player, prioritize up && down directions if sy > 0 return move_up if passable?(@x, @y, 8) else return move_down if passable?(@x, @y, 2) end if not moving? && sx != 0 if sx > 0 return move_left if passable?(@x, @y, 4) else return move_right if passable?(@x, @y, 6) end end end if ran move_random end end #-------------------------------------------------------------------------- # * Determine if Passable # x : x-coordinate # y : y-coordinate # d : direction (0,2,4,6,8) # * 0 = Determines if all directions are impassable (for jumping) #-------------------------------------------------------------------------- def passable?(x, y, d) # Get new coordinates new_x = x + (d == 6 ? 1 : d == 4 ? -1 : 0) new_y = y + (d == 2 ? 1 : d == 8 ? -1 : 0) return false if !check_map_pass(new_x,x,new_y,y,d) return false if !check_event_pass(new_x,new_y,d) return false if !check_player_pass(new_x,new_y,d) # passable return true end #-------------------------------------------------------------------------- # * Check Map Pass #-------------------------------------------------------------------------- def check_map_pass(new_x,x,new_y,y,d) # If coordinates are outside of map unless $game_map.valid?(new_x, new_y) # impassable return false end # If through is ON if @through # passable return true end # If unable to leave first move tile in designated direction unless $game_map.passable?(x, y, d, self) # impassable return false end # If unable to enter move tile in designated direction unless $game_map.passable?(new_x, new_y, 10 - d) # impassable return false end return true end #-------------------------------------------------------------------------- # * Check Event Pass #-------------------------------------------------------------------------- def check_event_pass(new_x,new_y,d) # Loop all events for event in $game_map.events.values # If event coordinates are consistent with move destination if event.x == new_x and event.y == new_y # If through is OFF unless event.through # If self is event if self_condition_player # impassable return false end # With self as the player and partner graphic as character if event.character_name != "" # impassable return false end end end end return true end #-------------------------------------------------------------------------- # * Self Condition Player #-------------------------------------------------------------------------- def self_condition_player bool = (self != $game_player) return bool end #-------------------------------------------------------------------------- # * Check Player Pass #-------------------------------------------------------------------------- def check_player_pass(new_x,new_y,d) # If player coordinates are consistent with move destination if $game_player.x == new_x and $game_player.y == new_y # If through is OFF unless $game_player.through # If your own graphic is the character if @character_name != "" # impassable return false end end end return true end end #============================================================================== # ** Game_Map #============================================================================== class Game_Map def map; return @map; end #-------------------------------------------------------------------------- # * Determine if Passable # x : x-coordinate # y : y-coordinate # d : direction (0,2,4,6,8,10) # * 0,10 = determine if all directions are impassable # self_event : Self (If event is determined passable) #-------------------------------------------------------------------------- def passable?(x, y, d, self_event = nil) # If coordinates given are outside of the map unless valid?(x, y) # impassable return false end # Change direction (0,2,4,6,8,10) to obstacle bit (0,1,2,4,8,0) bit = (1 << (d / 2 - 1)) & 0x0f # Pass Events pe = pass_events(bit,x,y,self_event) return pe unless pe.nil? # Loop searches in order from top of layer for i in [2, 1, 0] # Get tile ID tile_id = data[x, y, i] # Tile ID acquistion failure if tile_id == nil # impassable return false # If obstacle bit is set elsif @passages[tile_id] & bit != 0 # impassable return false # If obstacle bit is set in all directions elsif @passages[tile_id] & 0x0f == 0x0f # impassable return false # If priorities other than that are 0 elsif @priorities[tile_id] == 0 # passable return true end end # passable return true end #-------------------------------------------------------------------------- # * Events #-------------------------------------------------------------------------- def pass_events(bit,x,y,self_event) # Loop in all events for event in events.values # If tiles other than self are consistent with coordinates if event.tile_id >= 0 and event != self_event and event.x == x and event.y == y and not event.through # If obstacle bit is set if @passages[event.tile_id] & bit != 0 # impassable return false # If obstacle bit is set in all directions elsif @passages[event.tile_id] & 0x0f == 0x0f # impassable return false # If priorities other than that are 0 elsif @priorities[event.tile_id] == 0 # passable return true end end end return nil end end |
Verdeckenscript:
|
|
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 |
#============================================================================== # ** VerdeckenScript V0.02 # von f0tz!baerchen (30.07.2008) #------------------------------------------------------------------------------ # http://www.rpg-studio.de/http://www.rpg-studio.de/itzamna/node/29 # http://nachtmasken.rmxp.de/ #============================================================================== class Shadow_Character < Sprite_Character end class Sprite_Character alias trans_chars_sprite_character_initialize initialize alias trans_chars_sprite_character_update update def initialize(viewport, character = nil) trans_chars_sprite_character_initialize(viewport, character) return if self.type.to_s == 'Shadow_Character' @shadow_sprite = Shadow_Character.new(viewport, character) @shadow_sprite.z = 9999 @shadow_sprite.opacity = [@shadow_sprite.opacity, 75].min end def update trans_chars_sprite_character_update return if @shadow_sprite == nil @shadow_sprite.update @shadow_sprite.z = 9999 @shadow_sprite.opacity = [@shadow_sprite.opacity, 50].min end end |
Iconoverheaddisplay
|
|
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 |
#=============================================================================== # ** Icon Display 1.0 - www.unknowncoders.com #------------------------------------------------------------------------------- # Author Mr.Mo "Muhammet Sivri" # Version 1.0 # Date 12/04/07 (m/d/y) #=============================================================================== # Introduction #=============================================================================== # Displays an icon over events or the player. You can choose for how long. # You can also display without triggering the event by using comments on events. # # To display over an event, call this script: # # $game_map.events[EVENT_ID].display_icon("icon_name") # # EVENT_ID = the ID of the event, can be found on the left top corner of the # event editor. Make sure to remove any 0 that are up front. # For exmple: 001 = 1 or 010 = 10 # # To display over an event without triggers using comments: # # IconD icon_name frames # # You do not need frames if you want to display non-stop. Examples: # # IconD 049-Skill06 # IconD 049-Skill06 30 # # The first one displays forever, the second displays for 3 seconds. # # To display over a player, call this script: # # $game_player.display_icon("icon_name") # # NOTE: You can also add how long it should be shown, default is until map change. # To add the lenght of display do this: # # .display_icon("icon_name",FRAMES) # # FRAMES = number of frames(10=1) that the icon will be displayed. # # Exmaples: # # $game_map.events[EVENT_ID].display_icon("icon_name",100) > 10 seconds # $game_player.display_icon("icon_name",40) > 4 seconds #=============================================================================== UCoders.include('Icon Display', ['Mr.Mo','1.0']) class Game_Character attr_accessor :icon, :icon_frames, :displaying_icon, :current_icon #-------------------------------------------------------------------------- alias mrmo_icond_game_character_initialize initialize #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize @icon = @displaying_icon = @current_icon = "" @icon_frames = 0 mrmo_icond_game_character_initialize end #-------------------------------------------------------------------------- # * Display Icon #-------------------------------------------------------------------------- def display_icon(icon,frames=0) @icon = icon @icon_frames = frames end #-------------------------------------------------------------------------- # * Setup Icon #-------------------------------------------------------------------------- def setup_icond(event,list) parameters = UCoders.event_comment_input(event,1,"IconD"); return false if parameters.nil? # Get Icon @icon = parameters[0].split[1].to_s @icon_frames = (parameters[0].split[2].to_i) end end #============================================================================== # ** Sprite_Character #------------------------------------------------------------------------------ # This sprite is used to display the character.It observes the Game_Character # class and automatically changes sprite conditions. #============================================================================== class Sprite_Character < RPG::Sprite alias mrmo_icond_sprite_character_int initialize alias mrmo_icond_sprite_character_update update #-------------------------------------------------------------------------- # * Initialize #-------------------------------------------------------------------------- def initialize(viewport, character = nil) mrmo_icond_sprite_character_int(viewport, character) show_icon unless (@character.icon=@character.current_icon).empty? #@character.displaying_icon = "" end #-------------------------------------------------------------------------- # * Dispose #-------------------------------------------------------------------------- def dispose super @icon_sprite.dispose if !@icon_sprite.nil? && !@icon_sprite.disposed? end #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update mrmo_icond_sprite_character_update # Check if an icon needs to be displayed if @character.icon == "r" @icon_sprite.dispose unless @icon_sprite.nil? @icon_sprite = nil @character.icon = @character.current_icon = @character.displaying_icon = "" end if !@character.icon.empty? show_icon @character.icon = "" end if !@icon_sprite.nil? @icon_sprite.x = self.x-(@icon_sprite.bitmap.width/2) @icon_sprite.y = (self.y-@icon_sprite.bitmap.height)-self.bitmap.height/4 + 4 @character.icon_frames -= 1 if @character.icon_frames > 1 if @character.icon_frames == 1 @icon_sprite.dispose @icon_sprite = nil @character.current_icon = @character.displaying_icon = "" end end end #-------------------------------------------------------------------------- # * Show Icon #-------------------------------------------------------------------------- def show_icon @character.current_icon = @character.displaying_icon = @icon = @character.icon # Create Sprite @icon_sprite = Sprite.new if @icon_sprite.nil? @icon_sprite.bitmap = RPG::Cache.icon("#{@icon}") end end #============================================================================ # * Game Event #============================================================================ class Game_Event < Game_Character #-------------------------------------------------------------------------- alias mrmo_icon_game_event_refresh refresh #-------------------------------------------------------------------------- # * Refreshes Page #-------------------------------------------------------------------------- def refresh mrmo_icon_game_event_refresh setup_icond(self,@list) end end |
zum Lesen den Text mit der Maus markieren
Wo ist denn die Signatur?
xD
xD
Uff... Bei der Menge und Größenordnung wäre es vllt sinnvoller gewesen die Scripts.rxdata hochzuladen.
Das Problem ist dein Save Script, es überschreibt die Klasse Scene Map. Führe also deine Änderungen in diesem Scene Map durch oder besser noch erstelle den HUD im initialize.
Habs jetzt nicht getestet.
Sollte das Tutorial sowieso mal überarbeiten. Ist schon lange her wie ich das geschrieben hab und finde die Bauart doch nicht wirklich optimal xD
Das Problem ist dein Save Script, es überschreibt die Klasse Scene Map. Führe also deine Änderungen in diesem Scene Map durch oder besser noch erstelle den HUD im initialize.
|
|
Ruby Quellcode |
1 2 3 4 5 6 7 |
class Scene_Map alias :scene_map_hud_initialize :initialize def initialize scene_map_hud_initialize $hp_hud = HP_HUD.new end end |
Habs jetzt nicht getestet.
Sollte das Tutorial sowieso mal überarbeiten. Ist schon lange her wie ich das geschrieben hab und finde die Bauart doch nicht wirklich optimal xD
Skripte:
Animations "Entruckler"
Console
Drunken Mode
Eventskript Debugger
Flat-Events
Impassable Script
Item Shortcut
MSS: Monsta's Shoot System (Neu)
Radius Skript
Random Event Teleport
RMXP Leistungstest
Single Rotate
Split Screen (Beta)
Tutorials:
'alias' Bug beheben
Eigenes RTP
Standard KS komplett Übersetzen
RGSS: Eigener HUD
Programme:
Maker Exchange [ MEX ]
RMXP Skript Explorer
RPGXP Code Converter
Spiele:
[Minispiel] Stampfi V1.5 (Gold)
[Minispiel] Mastermind XP
[Humor] Verfressene Klone
______________________________
[Zukunft] Evil Science
zum Lesen den Text mit der Maus markieren
Danke für die Antwort. Aber leider bin ich ein RGSS-Anfänger. Wo sollte ich dies nun einfügen?
Es wäre nett, wenn du sagen würdest, in welchen Script unter welcher Zeile.
MFG Adrian2000
€dit: Durch probieren fand ich nun herraus, dass ich das am Anfang vom HUD-Fenster Script machen muss.
Nun erscheint auch im Spiel ein Fenster. Allerdings auch, wenn Switch 3 aus ist und wenn ich ins Menü gehe, bleibt es immernoch da
Es wäre nett, wenn du sagen würdest, in welchen Script unter welcher Zeile.
MFG Adrian2000
€dit: Durch probieren fand ich nun herraus, dass ich das am Anfang vom HUD-Fenster Script machen muss.
Nun erscheint auch im Spiel ein Fenster. Allerdings auch, wenn Switch 3 aus ist und wenn ich ins Menü gehe, bleibt es immernoch da
Wo ist denn die Signatur?
xD
xD Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »adrian2000« (7. August 2009, 13:53)
Eigentlich sollte Monstas Code als neues Script über Main eingefügt werden, denke ich 

Als neues Script über Main einfügen
Sollte funktionieren, wobei ich, weil ich jetzt nicht alle Scripte von dir kopieren wollte, auch das ungetestet präsentiere.
|
|
Ruby Quellcode |
1 2 3 4 5 6 7 8 |
class Scene_Map alias neues_main_mit_hud_drin main def main $hp_hud = HP_HUD.new if $game_switches[3] # Switch3 neues_main_mit_hud_drin $hp_hud.dispose if $hp_hud != nil end end |
zum Lesen den Text mit der Maus markieren
Das große Scientia Wiki zur Spielentwicklung 
Was ist das RGSS ? RGSS-Dokumentation auf Sc
Kyoshiros Makerkurs
Musik von Shabraxxx für euch
Guide zu den Audioformaten
Skripte von mir (Auswahl):
Atmungssystem
| Streichholzsystem
| Animiert durch Bücher blättern
Random : Marktsystem für Kardor
| Staterelated Battlergraphic
| Hinweis auf mögliche Aktionen
SelfSwitchExpirationtimer Skript - Gameplayerweiterung für Pilzesammler und Farmspiele
Meine Skripte werden gerade hier gesammelt.

Was ist das RGSS ? RGSS-Dokumentation auf Sc
Kyoshiros Makerkurs

Musik von Shabraxxx für euch
Guide zu den Audioformaten

Skripte von mir (Auswahl):
Atmungssystem
| Streichholzsystem
| Animiert durch Bücher blättern
Random : Marktsystem für Kardor
| Staterelated Battlergraphic
| Hinweis auf mögliche Aktionen
SelfSwitchExpirationtimer Skript - Gameplayerweiterung für Pilzesammler und Farmspiele
Meine Skripte werden gerade hier gesammelt.
Guten morgen allerseits,
ich rufe das alte Thema wieder vor^^, möchte deswegen kein neuen Thread aufmachen...
ich habe noch ein kleines problem, und zwar möchte ich ein Bild auf der Map anzeigen lassen. Sprich den HUD ersetzten durch eine Bild.
hier in diesem thema bin ich auf diesen code zugestossen und komme net weiter. dieser code erstellt nur den bild, aber wie heisst die syntax für das anzeigen ?
mit freundlichen grüssen
Celdhar
ich rufe das alte Thema wieder vor^^, möchte deswegen kein neuen Thread aufmachen...
ich habe noch ein kleines problem, und zwar möchte ich ein Bild auf der Map anzeigen lassen. Sprich den HUD ersetzten durch eine Bild.
|
|
Ruby Quellcode |
1 |
picture = RPG::Cache.picture("Bildtest") |
hier in diesem thema bin ich auf diesen code zugestossen und komme net weiter. dieser code erstellt nur den bild, aber wie heisst die syntax für das anzeigen ?
mit freundlichen grüssen
Celdhar
Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »Playm« (21. Juli 2010, 17:16)
Bitte erstell keine Doppelposts mehr, du kannst deinen Beitrag editieren, wenn du noch etwas anfügen möchtest.
Deine Umsetzung ist nebenbei ziemlich schlecht. Eine Anzeige von einer Grafik macht man mit einer Sprite Klasse, eine Window Klasse nutzt man nur, wenn man auch ein Window möchte.
Ich empfehle dir den Grundlagenkurs von =Kai= zum Thema scripten, hier auf Scientia (Link in meiner Signatur).
Deine Umsetzung ist nebenbei ziemlich schlecht. Eine Anzeige von einer Grafik macht man mit einer Sprite Klasse, eine Window Klasse nutzt man nur, wenn man auch ein Window möchte.
Ich empfehle dir den Grundlagenkurs von =Kai= zum Thema scripten, hier auf Scientia (Link in meiner Signatur).
Das große Scientia Wiki zur Spielentwicklung 
Was ist das RGSS ? RGSS-Dokumentation auf Sc
Kyoshiros Makerkurs
Musik von Shabraxxx für euch
Guide zu den Audioformaten
Skripte von mir (Auswahl):
Atmungssystem
| Streichholzsystem
| Animiert durch Bücher blättern
Random : Marktsystem für Kardor
| Staterelated Battlergraphic
| Hinweis auf mögliche Aktionen
SelfSwitchExpirationtimer Skript - Gameplayerweiterung für Pilzesammler und Farmspiele
Meine Skripte werden gerade hier gesammelt.

Was ist das RGSS ? RGSS-Dokumentation auf Sc
Kyoshiros Makerkurs

Musik von Shabraxxx für euch
Guide zu den Audioformaten

Skripte von mir (Auswahl):
Atmungssystem
| Streichholzsystem
| Animiert durch Bücher blättern
Random : Marktsystem für Kardor
| Staterelated Battlergraphic
| Hinweis auf mögliche Aktionen
SelfSwitchExpirationtimer Skript - Gameplayerweiterung für Pilzesammler und Farmspiele
Meine Skripte werden gerade hier gesammelt.
Also ich find das Tut auch klasse, funktioniert soweit auch alles, bis auf eine Sache, die mich etwas stört..
Und zwar, wenn ich das Fenster aufgerufen habe verschwindet es nach kurzer Zeit wieder (gefühlte 10 sekunden meistens, wobei es manchmal auch um einiges länger dauert.)
Ich weiß nicht wirklich was das Problem sein soll, ich benutze zur zeit keine zusätzlichen Scripts und habe in der Scene_Map alles eingefügt wie beschrieben..
Mein Code sieht derzeit so aus:
Das ganze soll eine Uhr darstellen..
Wie sich das ganze bei Mapchanges u.s.w. verhält habe ich noch nicht getestet, jedenfalls möchte ich, dass das Fenster bei mir auch während Textanzeigen, aber halt nicht im Menü oder bei Kämpfen.. Kann mir da evtl. jemand weiterhelfen?
Wollte dafür jetzt nicht extra ein neues Thema aufmachen, ich hoffe das ist ok so.
Und zwar, wenn ich das Fenster aufgerufen habe verschwindet es nach kurzer Zeit wieder (gefühlte 10 sekunden meistens, wobei es manchmal auch um einiges länger dauert.)
Ich weiß nicht wirklich was das Problem sein soll, ich benutze zur zeit keine zusätzlichen Scripts und habe in der Scene_Map alles eingefügt wie beschrieben..
Mein Code sieht derzeit so aus:
|
|
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 |
class Zeitfenster < Window_Base def initialize(actor=0) super(0, 0, 180, 85) self.contents = Bitmap.new(width - 32, height - 32) self.back_opacity = 155 @actor = $game_party.actors[actor] refresh end def refresh @var = $game_variables[4] self.contents.clear self.contents.font.color = Color.new(200, 224, 255, 255) self.contents.draw_text(25, 10, 50, 32, $game_variables[4].to_s) self.contents.draw_text(45, 10, 50, 32, ":") self.contents.draw_text(50, 10, 50, 32, $game_variables[5].to_s) end def update if @old_var != @var refresh end super end end |
zum Lesen den Text mit der Maus markieren
Das ganze soll eine Uhr darstellen..
Wie sich das ganze bei Mapchanges u.s.w. verhält habe ich noch nicht getestet, jedenfalls möchte ich, dass das Fenster bei mir auch während Textanzeigen, aber halt nicht im Menü oder bei Kämpfen.. Kann mir da evtl. jemand weiterhelfen?
Wollte dafür jetzt nicht extra ein neues Thema aufmachen, ich hoffe das ist ok so.
Du müsstest mal den Code zeigen, der dein Fenster erstellt. So wie ich es sehe, speicherst du nämlich keine Referenz auf dein Fenster, wodurch der GB es einfach nach einiger Zeit löscht.
Der Vergleich "if @old_var != @var" wird immer true sein, da @old_var immer nil ist, als ungesetzter Wert, da scheint ein Verständnisproblem vorzuliegen. Lies nochmal das Tutorial ;)
Der Vergleich "if @old_var != @var" wird immer true sein, da @old_var immer nil ist, als ungesetzter Wert, da scheint ein Verständnisproblem vorzuliegen. Lies nochmal das Tutorial ;)
Das große Scientia Wiki zur Spielentwicklung 
Was ist das RGSS ? RGSS-Dokumentation auf Sc
Kyoshiros Makerkurs
Musik von Shabraxxx für euch
Guide zu den Audioformaten
Skripte von mir (Auswahl):
Atmungssystem
| Streichholzsystem
| Animiert durch Bücher blättern
Random : Marktsystem für Kardor
| Staterelated Battlergraphic
| Hinweis auf mögliche Aktionen
SelfSwitchExpirationtimer Skript - Gameplayerweiterung für Pilzesammler und Farmspiele
Meine Skripte werden gerade hier gesammelt.

Was ist das RGSS ? RGSS-Dokumentation auf Sc
Kyoshiros Makerkurs

Musik von Shabraxxx für euch
Guide zu den Audioformaten

Skripte von mir (Auswahl):
Atmungssystem
| Streichholzsystem
| Animiert durch Bücher blättern
Random : Marktsystem für Kardor
| Staterelated Battlergraphic
| Hinweis auf mögliche Aktionen
SelfSwitchExpirationtimer Skript - Gameplayerweiterung für Pilzesammler und Farmspiele
Meine Skripte werden gerade hier gesammelt.
Naja, der Code bei mir ist eigentlich ganz einfach: Zeitfenster.new(0)
Der Actor als Parameter ist ja im prinzip so ohne nutzen, möcht ihn aber im Moment nicht löschen, falls dadurch irgendwelche Fehler entstehen.. Ich schaus mir nochmal an, ich hoff ich find den Fehler
aber danke für den Tipp schonmal.
Kleine Frage, diese Methode hier bringt mir dabei sicherlich den effekt, dass der Skript alle weiteren handlungen des Spiels verhindert, ähnlich einem Autorun-Event, oder?
den hab ich aus dem anderen Fenster-Tutorial, das ich mal gelesen habe.
Der Actor als Parameter ist ja im prinzip so ohne nutzen, möcht ihn aber im Moment nicht löschen, falls dadurch irgendwelche Fehler entstehen.. Ich schaus mir nochmal an, ich hoff ich find den Fehler
aber danke für den Tipp schonmal.Kleine Frage, diese Methode hier bringt mir dabei sicherlich den effekt, dass der Skript alle weiteren handlungen des Spiels verhindert, ähnlich einem Autorun-Event, oder?
den hab ich aus dem anderen Fenster-Tutorial, das ich mal gelesen habe.





