PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : [SPECIAL] Meine RPG Maker XP Scripts



SMWma
05.04.2010, 15:46
Weihnachtsspecial! Was passier hier:
Ich arbeite imo an einen Script. Und jeden Tag werde ich es updaten. Manchmal werde ich aber nur was am Code verändern.

Mein Script:

Fehler: f*ck umlaute ^,^
Was macht es:
Es verändert das Menü fst komplett. Es ist möglich, 5 Partymember zu besitzen.
Das Menü:
http://img217.imageshack.us/img217/3438/bildschirmfotoownmenu.png
Das Fenster mit den Auswahlpunkten hat 4 Kommandos:
Items, Charaktere, Speichern und Beenden.
Items, Speichern und Beenden erklären sich ja von selbst ^,^
http://img535.imageshack.us/img535/4638/bildschirmfotoownmenu1.png
Daraufhin werden die zwei Fenster links aktiv. Dort kann man den Charakter mit ↑ und ↓ auswählen. Mit ← und → kann man das markieren, was nach einen Druck nach Enter geschehen soll.

Code: ACHTUNG!!! UNBEDINGT DIE ERSTEN ZEILEN DURCHLESEN!
ungetestet auf Win2000, WinXP, WinVista, Win7... Also noch gar nicht auf Windows ^,^



# DIESES SCRIPT IST BISHER NOCH IN EINER SEHR FRÜHEN PHASE!!! DER CODE IST
# SCHEISZE ABER DAS SCRIPT ERFÜLLT SEINEN ZWECK!

# An dieser Stelle möchte ich erst mal einen großen Dank an -KD- richten. Seine
# Hilfsbereitschaft hat mir sehr geholfen. Und auch danke an Cepanks.
# Und... ja... Das script ist noch unfertig. Es wird bis zum 24.12 fertig sein.

# Stand: 02.12.2010 20:37:37 v. 0.02
# Gescriptet von: Adrian2000 aka SMWvi

# CONFIG!!!

$item = "Items" # Das letzte Wort bestimmt den Wert von dem Menü-
$character = "Charaktere" # eintrag. Dabei ist zu beachten, dass es eine bestim-
$save = "Speichern" # mte Länge nicht überschreiben darf. Ansonsten können
$exit = "Beenden" # hässliche Nebeneffekte auftreten. Also aufpassen ^,^
# Achja: Die "..." müssen da bleiben!
# Dann bleit bloß noch zu sagen: Ich mag Züge.
$equip = "Ausrüstung"
$skill = "Techniken"
$status = "Eigenschaften"

$totitle = "Zum Titelbild"
$shutdown = "Beenden"
$cancelexit = "Abbruch"

# Um die Transparenz auszustellen, Wert auf 255
$windowtransparence = 123 # stellen. Ich persönlich halte 123 als sehr sinnvoll.
$scrollingwindows = false # Sollen die Fenster ein- und ausscrollen?

####################
# ---------------- #
# - CONFIG END!!!- #
# ---------------- #
####################

class Game_Party
def add_actor(actor_id)
actor = $game_actors[actor_id]
if @actors.size < 5 and not @actors.include?(actor)
@actors.push(actor)
$game_player.refresh
end
end
end


class Scene_Menu
def initialize(menu_index = 0)
@menu_index = menu_index
end
def main
@map_spriteset = Spriteset_Map.new
$smi = -1
s1 = $item
s2 = $character
s3 = $save
s4 = $exit
@command_window = Window_Command.new(160, [s1, s2, s3, s4])
@command_window.index = @menu_index
@command_window.x = 480 #
@command_window.opacity = 255
if $game_party.actors.size == 0
@command_window.disable_item(1)
end
if $game_system.save_disabled
@command_window.disable_item(4)
end
@cmenu_window = Window_Cmenu.new
@cmenu_window.opacity = $windowtransparence
@cmenu_window.x = -12
@cmenu_window.y = -12
@info_window = Window_Info.new
if $scrollingwindows == true
@info_window.x = 640
else
@info_window.x = 496
end
@info_window.y = 336
@info_window.opacity = 255
@status_window = Window_MenuStatus.new
@status_window.x = -4
@status_window.y = 60
@status_window.opacity = $windowtransparence
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@command_window.dispose
@cmenu_window.dispose
@info_window.dispose
@status_window.dispose
@map_spriteset.dispose
end

def update
# Scroll Windows!
if $scrollingwindows == true
if @info_window.x > 496
@info_window.x -= 12
end
end
@map_spriteset.update
@command_window.update
@info_window.update
@status_window.update
@cmenu_window.update
if @command_window.active
update_command
return
end
if @status_window.active
update_status
return
end
end

def update_command
@cmenu_window.refresh
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 command other than save or end game, and party members = 0
if $game_party.actors.size == 0 and @command_window.index < 4
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# Branch by command window cursor position
case @command_window.index
when 0 # item
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to item screen
$scene = Scene_Item.new
when 1 # secondmenu
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Make status window active
@command_window.active = false
@status_window.active = true
@status_window.index = 0
@status_window.opacity = 255
@command_window.opacity = $windowtransparence
$rcwi = @command_window.index
@command_window.index = -1
$smi = 0
@cmenu_window.opacity = 255
when 2 # save
# If saving is forbidden
if $game_system.save_disabled
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to save screen
$scene = Scene_Save.new
when 3 # end game
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to end game screen
$scene = Scene_End.new
end
return
end
end
#--------------------------------------------------------------------------
# * Frame Update (when two windows are active)
#--------------------------------------------------------------------------
def update_status
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Make command window active
@command_window.active = true
@status_window.active = false
@status_window.index = -1
@status_window.opacity = $windowtransparence
@command_window.opacity = 255
@command_window.index = $rcwi
$rcwi = -1
@cmenu_window.dispose
@cmenu_window = Window_Cmenu.new
@cmenu_window.x = -12
@cmenu_window.y = -12
@cmenu_window.opacity = $windowtransparence
$smi = -1

return
end

# Check for "Pfeiltasten" (whats the f*cking english word?)

if Input.trigger?(Input::LEFT)
$smi = $smi - 1
end
if Input.trigger?(Input::RIGHT)
$smi = $smi + 1
end

# Check for current Index

if $smi == -1
$smi = 2
end

if $smi == 3
$smi = 0
end

# Draw Menu Item

@cmenu_window.refresh

# If C button was pressed
if Input.trigger?(Input::C)
# Branch by command window cursor position
case $smi
when 0 # skill
# If this actor's action limit is 2 or more
if $game_party.actors[@status_window.index].restriction >= 2
# Play buzzer SE
$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 1 # equipment
$game_system.se_play($data_system.decision_se)
$scene = Scene_Equip.new(@status_window.index)
when 2 # status
$game_system.se_play($data_system.decision_se)
$scene = Scene_Status.new(@status_window.index)
end
return
end
end
end

################################################################################
################################################################################
################################################################################
################################################################################
################################################################################

class Window_Info < Window_Base
#--------------------------------------------------------------------------
def initialize
super(0, 0, 160, 160)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
end
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.color = system_color
self.contents.draw_text(4, 0, 120, 32, "Schritte")
self.contents.font.color = normal_color
self.contents.draw_text(4, 0, 120, 32, $game_party.steps.to_s, 2)

cx = contents.text_size($data_system.words.gold).width
self.contents.font.color = normal_color
self.contents.draw_text(4, 32, 120-cx-2, 32, $game_party.gold.to_s, 2)
self.contents.font.color = system_color
self.contents.draw_text(124-cx, 32, cx, 32, $data_system.words.gold, 2)

self.contents.font.color = system_color
self.contents.draw_text(4, 64, 120, 32, "Spielzeit")
@total_sec = Graphics.frame_count / Graphics.frame_rate
hour = @total_sec / 60 / 60
min = @total_sec / 60 % 60
sec = @total_sec % 60
text = sprintf("%02d:%02d:%02d", hour, min, sec)
self.contents.font.color = normal_color
self.contents.draw_text(4, 96, 120, 32, text, 2)
end

def update
super
if Graphics.frame_count / Graphics.frame_rate != @total_sec
refresh
end
end
end
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
class Window_Cmenu < Window_Base
def initialize
super(0, 0, 480, 64)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
end

def refresh
self.contents.clear
case $smi
when -1
self.contents.font.color = normal_color
self.contents.draw_text(4, 0, 160, 32, $skill)
self.contents.draw_text(164, 0, 320, 32, $equip)
self.contents.draw_text(324, 0, 480, 32, $status)
when 0
self.contents.font.color = system_color
self.contents.draw_text(4, 0, 160, 32, $skill)
self.contents.font.color = normal_color
self.contents.draw_text(164, 0, 320, 32, $equip)
self.contents.draw_text(324, 0, 480, 32, $status)
when 1
self.contents.font.color = normal_color
self.contents.draw_text(4, 0, 160, 32, $skill)
self.contents.font.color = system_color
self.contents.draw_text(164, 0, 320, 32, $equip)
self.contents.font.color = normal_color
self.contents.draw_text(324, 0, 480, 32, $status)
when 2
self.contents.font.color = normal_color
self.contents.draw_text(4, 0, 160, 32, $skill)
self.contents.draw_text(164, 0, 320, 32, $equip)
self.contents.font.color = system_color
self.contents.draw_text(324, 0, 480, 32, $status)
end
end
end

#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------

class Window_MenuStatus < Window_Selectable
def initialize
super(0, 0, 480, 430)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
self.active = false
self.index = -1
end
def refresh
self.contents.clear
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
x = 64
y = i * 80
actor = $game_party.actors[i]
draw_actor_graphic(actor, x - 40, y + 80)
draw_actor_name(actor, x, y)
draw_actor_class(actor, x + 144, y)
draw_actor_level(actor, x, y + 32)
draw_actor_state(actor, x + 90, y + 32)
draw_actor_exp(actor, x, y +50)
draw_actor_hp(actor, x + 236, y + 32)
draw_actor_sp(actor, x + 236, y + 50)
end
end
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

################################################################################
################################################################################
################################################################################
################################################################################
################################################################################

class Scene_End
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
@map_spriteset = Spriteset_Map.new
s1 = $totitle
s2 = $shutdown
s3 = $cancelexit
@command_window = Window_Command.new(192, [s1, s2, s3])
@command_window.x = 320 - @command_window.width / 2
@command_window.y = 240 - @command_window.height / 2
Graphics.transition
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 window
@command_window.dispose
# If switching to title screen
if $scene.is_a?(Scene_Title)
# Fade out screen
Graphics.transition
Graphics.freeze
end
@map_spriteset.dispose
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
@map_spriteset.update
# Update command window
@command_window.update
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Switch to menu screen
$scene = Scene_Menu.new(3)
return
end
# If C button was pressed
if Input.trigger?(Input::C)
# Branch by command window cursor position
case @command_window.index
when 0 # to title
command_to_title
when 1 # shutdown
command_shutdown
when 2 # quit
command_cancel
end
return
end
end
#--------------------------------------------------------------------------
# * Process When Choosing [Cancel] Command
#--------------------------------------------------------------------------
def command_cancel
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to menu screen
$scene = Scene_Menu.new(3)
end
end

class Scene_Save < Scene_File
def on_decision(filename)
$game_system.se_play($data_system.save_se)
file = File.open(filename, "wb")
write_save_data(file)
file.close
if $game_temp.save_calling
$game_temp.save_calling = false
$scene = Scene_Map.new
return
end
$scene = Scene_Menu.new(2)
end
def on_cancel
$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(2)
end
end

class Scene_Equip
def update_right
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Menu.new(1)
return
end
end
end

class Scene_Status
def update
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Menu.new(1)
return
end
if Input.trigger?(Input::R)
$game_system.se_play($data_system.cursor_se)
@actor_index += 1
@actor_index %= $game_party.actors.size
$scene = Scene_Status.new(@actor_index)
return
end
if Input.trigger?(Input::L)
$game_system.se_play($data_system.cursor_se)
@actor_index += $game_party.actors.size - 1
@actor_index %= $game_party.actors.size
$scene = Scene_Status.new(@actor_index)
return
end
end
end

################################################################################
################################################################################
################################################################################

class Window_BattleStatus < Window_Base
def initialize
super(0, 320, 640, 160)
self.contents = Bitmap.new(width - 32, height - 32)
@level_up_flags = [false, false, false, false]
refresh
end
def dispose
super
end
def level_up(actor_index)
@level_up_flags[actor_index] = true
end
def refresh
self.contents.clear
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
actor = $game_party.actors[i]
actor_x = i * 120 + 3
draw_actor_name(actor, actor_x, 0)
draw_actor_hp(actor, actor_x, 32,80)
draw_actor_sp(actor, actor_x, 64, 80)
if @level_up_flags[i]
self.contents.font.color = normal_color
self.contents.draw_text(actor_x, 96, 120, 32, "LEVEL UP!")
else
draw_actor_state(actor, actor_x, 96)
end
end
end
def update
super
if $game_temp.battle_main_phase
self.contents_opacity -= 4 if self.contents_opacity > 191
else
self.contents_opacity += 4 if self.contents_opacity < 255
end
end
end
class Window_PartyCommand < Window_Selectable
def initialize
super(180, 0, 280, 64)
self.contents = Bitmap.new(width - 32, height - 32)
self.back_opacity = 180
@commands = ["Kämpfe", "Flüchte"]
@item_max = 2
@column_max = 2
draw_item(0, normal_color)
draw_item(1, $game_temp.battle_can_escape ? normal_color : disabled_color)
self.active = false
self.visible = false
self.index = 0
end
def draw_item(index, color)
self.contents.font.color = color
rect = Rect.new(0 + index * 120 + 4, 0, 128 - 10, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
self.contents.draw_text(rect, @commands[index], 1)
end
def update_cursor_rect
self.cursor_rect.set(0 + index * 120, 0, 128, 32)
end
end
class Game_Actor < Game_Battler
def screen_x
if self.index != nil
return self.index * 120 + 60
else
return 0
end
end
end
class Scene_Battle
def phase3_setup_command_window
@party_command_window.active = false
@party_command_window.visible = false
@actor_command_window.active = true
@actor_command_window.visible = true
@actor_command_window.x = @actor_index * 120
@actor_command_window.index = 0
end
end
class Spriteset_Battle
attr_reader :viewport1
attr_reader :viewport2
def initialize
@viewport1 = Viewport.new(0, 0, 640, 320)
@viewport2 = Viewport.new(0, 0, 640, 480)
@viewport3 = Viewport.new(0, 0, 640, 480)
@viewport4 = Viewport.new(0, 0, 640, 480)
@viewport2.z = 101
@viewport3.z = 200
@viewport4.z = 5000
@battleback_sprite = Sprite.new(@viewport1)
@enemy_sprites = []
for enemy in $game_troop.enemies.reverse
@enemy_sprites.push(Sprite_Battler.new(@viewport1, enemy))
end
@actor_sprites = []
@actor_sprites.push(Sprite_Battler.new(@viewport2))
@actor_sprites.push(Sprite_Battler.new(@viewport2))
@actor_sprites.push(Sprite_Battler.new(@viewport2))
@actor_sprites.push(Sprite_Battler.new(@viewport2))
@actor_sprites.push(Sprite_Battler.new(@viewport2))
@weather = RPG::Weather.new(@viewport1)
@picture_sprites = []
for i in 51..100
@picture_sprites.push(Sprite_Picture.new(@viewport3,
$game_screen.pictures[i]))
end
@timer_sprite = Sprite_Timer.new
update
end
def dispose
if @battleback_sprite.bitmap != nil
@battleback_sprite.bitmap.dispose
end
@battleback_sprite.dispose
for sprite in @enemy_sprites + @actor_sprites
sprite.dispose
end
@weather.dispose
for sprite in @picture_sprites
sprite.dispose
end
@timer_sprite.dispose
@viewport1.dispose
@viewport2.dispose
@viewport3.dispose
@viewport4.dispose
end
def effect?
for sprite in @enemy_sprites + @actor_sprites
return true if sprite.effect?
end
return false
end
def update
@actor_sprites[0].battler = $game_party.actors[0]
@actor_sprites[1].battler = $game_party.actors[1]
@actor_sprites[2].battler = $game_party.actors[2]
@actor_sprites[3].battler = $game_party.actors[3]
@actor_sprites[4].battler = $game_party.actors[4]
if @battleback_name != $game_temp.battleback_name
@battleback_name = $game_temp.battleback_name
if @battleback_sprite.bitmap != nil
@battleback_sprite.bitmap.dispose
end
@battleback_sprite.bitmap = RPG::Cache.battleback(@battleback_name)
@battleback_sprite.src_rect.set(0, 0, 640, 320)
end
for sprite in @enemy_sprites + @actor_sprites
sprite.update
end
@weather.type = $game_screen.weather_type
@weather.max = $game_screen.weather_max
@weather.update
for sprite in @picture_sprites
sprite.update
end
@timer_sprite.update
@viewport1.tone = $game_screen.tone
@viewport1.ox = $game_screen.shake
@viewport4.color = $game_screen.flash_color
@viewport1.update
@viewport2.update
@viewport4.update
end
end



---
Fehlende Features bzw. noch nicht eingebaut:
Code verkürzen (zu 50% fertig)
Globale Variablen löschen
Untermenüs fehlen komplett
Einscrollende Fenster

Ideen und Kritik werden berücksichtigt, solange es nicht heißt:

Dein Code ist unnötig kompliziert(das weiß ich ^,^)
Wow, sieht das geil aus(bitte konstruktive Kritik

Und ja, mir ist klar, dass ich wieder mit Tomaten beworfen werde, da es ja noch nicht fertig ist. Mir geht es hier bloß um die Vorstellung und um das Sammeln von Ideen.

Na dann, es ist ja noch 03.12.2010 ^,^ Also macht das Türchen uff xD

Ich werde diesen Thread hier immer wieder mal updaten und hier meine RPG Maker XP Scripts vorstellen.

Dieses Script hier ist noch nicht fertig, aber dennoch nützlich. Ich muss nur noch einstellen, dass die Battle Graphic des 5 Spielers angezeigt wird. Jep, des fünften Partymembers, denn dieses Script ändert das Menü nicht nur zu einem Glas-Menü(evt. wird Steps wieder eingebaut), sondern erhöht auch die maximale Anzahl an Partymenbern auf 5, wie man es von vielen Spielen kennt. Der 5 Spieler kann auch schon kämpfen. Und alles selber Gescriptet, deshalb bin ich so stolz auf mich ^.^ Lange Rede kurzer Sinn:

Glas-Menü mit 5 Spielern
http://img709.imageshack.us/img709/6154/bildschirmfotonz.png
http://img651.imageshack.us/img651/536/bildschirmfoto1wb.png

# Script by Adrian2000

#------------------------------------------------------------------------------#
# CONFIG ----------------------------------------------------------------------#
#------------------------------------------------------------------------------#

$wo = 180 # Fenster-Stärke (im Menu) (0-255)
$sw = true # Stepswindow Anzeigen?
$pm = true # True = Maximal 5 false = maximal 4

#------------------------------------------------------------------------------#
# End CONFIG ------------------------------------------------------------------#
#------------------------------------------------------------------------------#
class Window_Steps < Window_Base
def refresh
self.contents.clear
self.contents.font.color = system_color
self.contents.draw_text(4, 0, 120, 32, "Schritte")
self.contents.font.color = normal_color
self.contents.draw_text(4, 32, 120, 32, $game_party.steps.to_s, 2)
end
end
class Game_Party
def add_actor(actor_id)
actor = $game_actors[actor_id]
if $pm
if @actors.size < 5 and not @actors.include?(actor)
@actors.push(actor)
$game_player.refresh
end
else
if @actors.size < 4 and not @actors.include?(actor)
@actors.push(actor)
$game_player.refresh
end
end
end
end
class Window_Gold < Window_Base
def initialize
super(0, 0, 160, 64)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
end
def refresh
self.contents.clear
cx = contents.text_size($data_system.words.gold).width
self.contents.font.color = normal_color
self.contents.draw_text(4, 0, 120-cx-2, 32, $game_party.gold.to_s, 2)
self.contents.font.color = system_color
self.contents.draw_text(124-cx, 0, cx, 32, $data_system.words.gold, 2)
end
end
class Window_PlayTime < Window_Base
def initialize
super(0, 0, 160, 62)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
end
def refresh
self.contents.clear
self.contents.font.color = system_color
@total_sec = Graphics.frame_count / Graphics.frame_rate
hour = @total_sec / 60 / 60
min = @total_sec / 60 % 60
sec = @total_sec % 60
text = sprintf("%02d:%02d:%02d", hour, min, sec)
self.contents.font.color = normal_color
self.contents.draw_text(4, 0, 120, 32, text, 2)
end
def update
super
if Graphics.frame_count / Graphics.frame_rate != @total_sec
refresh
end
end
end
class Window_MenuStatus < Window_Selectable
def initialize
if $pm
super(0, 0, 480, 430)
else
super(0, 0, 480, 350)
end
self.contents = Bitmap.new(width - 32, height - 32)
refresh
self.active = false
self.index = -1
end
def refresh
self.contents.clear
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
x = 64
y = i * 80
actor = $game_party.actors[i]
draw_actor_graphic(actor, x - 40, y + 80)
draw_actor_name(actor, x, y)
draw_actor_class(actor, x + 144, y)
draw_actor_level(actor, x, y + 32)
draw_actor_state(actor, x + 90, y + 32)
draw_actor_exp(actor, x, y +50)
draw_actor_hp(actor, x + 236, y + 32)
draw_actor_sp(actor, x + 236, y + 50)
end
end
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
class Scene_Menu
def initialize(menu_index = 0)
@menu_index = menu_index
end
def main
@map_spriteset = Spriteset_Map.new
s1 = "Items"
s2 = "Techniken"
s3 = "Ausrüstung"
s4 = "Status"
s5 = "Sichern"
s6 = "Aufhören"
@command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6])
@command_window.index = @menu_index
@command_window.x = 480
@command_window.opacity = $wo
if $game_party.actors.size == 0
@command_window.disable_item(0)
@command_window.disable_item(1)
@command_window.disable_item(2)
@command_window.disable_item(3)
end
if $game_system.save_disabled
@command_window.disable_item(4)
end

@playtime_window = Window_PlayTime.new
@playtime_window.x = 480
@playtime_window.y = 224
@playtime_window.opacity = $wo

@gold_window = Window_Gold.new
@gold_window.x = 480
@gold_window.y = 286
@gold_window.opacity = $wo
if $sw
@steps_window = Window_Steps.new
@steps_window.x = 480
@steps_window.y = 350
@steps_window.opacity = $wo
end
@status_window = Window_MenuStatus.new
@status_window.x = 0
@status_window.y = 0
@status_window.opacity = $wo
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@command_window.dispose
@playtime_window.dispose
@gold_window.dispose
if $sw
@steps_window.dispose
end
@status_window.dispose
@map_spriteset.dispose
end
def update
@map_spriteset.update
@command_window.update
@playtime_window.update
@gold_window.update
if $sw
@steps_window.update
end
@status_window.update
if @command_window.active
update_command
return
end
if @status_window.active
update_status
return
end
end
end

#
#
#

if $pm
class Window_BattleStatus < Window_Base
def initialize
super(0, 320, 640, 160)
self.contents = Bitmap.new(width - 32, height - 32)
@level_up_flags = [false, false, false, false]
refresh
end
def dispose
super
end
def level_up(actor_index)
@level_up_flags[actor_index] = true
end
def refresh
self.contents.clear
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
actor = $game_party.actors[i]
actor_x = i * 120 + 3
draw_actor_name(actor, actor_x, 0)
draw_actor_hp(actor, actor_x, 32,80)
draw_actor_sp(actor, actor_x, 64, 80)
if @level_up_flags[i]
self.contents.font.color = normal_color
self.contents.draw_text(actor_x, 96, 120, 32, "LEVEL UP!")
else
draw_actor_state(actor, actor_x, 96)
end
end
end
def update
super
if $game_temp.battle_main_phase
self.contents_opacity -= 4 if self.contents_opacity > 191
else
self.contents_opacity += 4 if self.contents_opacity < 255
end
end
end
class Window_PartyCommand < Window_Selectable
def initialize
super(180, 0, 280, 64)
self.contents = Bitmap.new(width - 32, height - 32)
self.back_opacity = 180
@commands = ["Kämpfe", "Flüchte"]
@item_max = 2
@column_max = 2
draw_item(0, normal_color)
draw_item(1, $game_temp.battle_can_escape ? normal_color : disabled_color)
self.active = false
self.visible = false
self.index = 0
end
def draw_item(index, color)
self.contents.font.color = color
rect = Rect.new(0 + index * 120 + 4, 0, 128 - 10, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
self.contents.draw_text(rect, @commands[index], 1)
end
def update_cursor_rect
self.cursor_rect.set(0 + index * 120, 0, 128, 32)
end
end
class Game_Actor < Game_Battler
def screen_x
if self.index != nil
return self.index * 120 + 60
else
return 0
end
end
end
class Scene_Battle
def phase3_setup_command_window
@party_command_window.active = false
@party_command_window.visible = false
@actor_command_window.active = true
@actor_command_window.visible = true
@actor_command_window.x = @actor_index * 120
@actor_command_window.index = 0
end
end
class Spriteset_Battle
attr_reader :viewport1
attr_reader :viewport2
def initialize
@viewport1 = Viewport.new(0, 0, 640, 320)
@viewport2 = Viewport.new(0, 0, 640, 480)
@viewport3 = Viewport.new(0, 0, 640, 480)
@viewport4 = Viewport.new(0, 0, 640, 480)
@viewport2.z = 101
@viewport3.z = 200
@viewport4.z = 5000
@battleback_sprite = Sprite.new(@viewport1)
@enemy_sprites = []
for enemy in $game_troop.enemies.reverse
@enemy_sprites.push(Sprite_Battler.new(@viewport1, enemy))
end
@actor_sprites = []
@actor_sprites.push(Sprite_Battler.new(@viewport2))
@actor_sprites.push(Sprite_Battler.new(@viewport2))
@actor_sprites.push(Sprite_Battler.new(@viewport2))
@actor_sprites.push(Sprite_Battler.new(@viewport2))
@actor_sprites.push(Sprite_Battler.new(@viewport2))
@weather = RPG::Weather.new(@viewport1)
@picture_sprites = []
for i in 51..100
@picture_sprites.push(Sprite_Picture.new(@viewport3,
$game_screen.pictures[i]))
end
@timer_sprite = Sprite_Timer.new
update
end
def dispose
if @battleback_sprite.bitmap != nil
@battleback_sprite.bitmap.dispose
end
@battleback_sprite.dispose
for sprite in @enemy_sprites + @actor_sprites
sprite.dispose
end
@weather.dispose
for sprite in @picture_sprites
sprite.dispose
end
@timer_sprite.dispose
@viewport1.dispose
@viewport2.dispose
@viewport3.dispose
@viewport4.dispose
end
def effect?
for sprite in @enemy_sprites + @actor_sprites
return true if sprite.effect?
end
return false
end
def update
@actor_sprites[0].battler = $game_party.actors[0]
@actor_sprites[1].battler = $game_party.actors[1]
@actor_sprites[2].battler = $game_party.actors[2]
@actor_sprites[3].battler = $game_party.actors[3]
@actor_sprites[4].battler = $game_party.actors[4]
if @battleback_name != $game_temp.battleback_name
@battleback_name = $game_temp.battleback_name
if @battleback_sprite.bitmap != nil
@battleback_sprite.bitmap.dispose
end
@battleback_sprite.bitmap = RPG::Cache.battleback(@battleback_name)
@battleback_sprite.src_rect.set(0, 0, 640, 320)
end
for sprite in @enemy_sprites + @actor_sprites
sprite.update
end
@weather.type = $game_screen.weather_type
@weather.max = $game_screen.weather_max
@weather.update
for sprite in @picture_sprites
sprite.update
end
@timer_sprite.update
@viewport1.tone = $game_screen.tone
@viewport1.ox = $game_screen.shake
@viewport4.color = $game_screen.flash_color
@viewport1.update
@viewport2.update
@viewport4.update
end
end
end


So, noch ein simples Menü findet ihr hier auch noch. Es besitzt nur 4 Auswahlmöglichkeiten: Items, Speichern, Zurück zum Spiel und Aufhören.
Auch dies ist ein Glasmenü, perfekt zu kleineren Spielchen wie Mario Party ect.
Der Einbau:
Ersetzt das alte Item-Menu durch dieses. Allerdings müsst ihr in Scene_save in der Zeile 33 die Zahl durch eine 1,
in Scene_end die Ziffer in der Zeile 59 durch eine 3
Das ist zwar komplex aber es lohnt sich.

class Scene_Menu
#--------------------------------------------------------------------------
# * Object Initialization
# menu_index : command cursor's initial position
#--------------------------------------------------------------------------
def initialize(menu_index = 0)
@menu_index = menu_index
end
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
@map_spriteset = Spriteset_Map.new
# Make command window
s1 = "Item"
s2 = "Speichern"
s3 = "Zurück zum Spiel"
s4 = "Ende"
@command_window = Window_Command.new(180, [s1, s2, s3, s4])
@command_window.index = @menu_index
@command_window.x = 320 - @command_window.width / 2
@command_window.y = 240 - @command_window.height / 2
@command_window.opacity = 160
# If number of party members is 0
if $game_party.actors.size == 0
# Disable items, skills, equipment, and status
@command_window.disable_item(0)
@command_window.disable_item(1)
@command_window.disable_item(2)
@command_window.disable_item(3)
end
# If save is forbidden
if $game_system.save_disabled
# Disable save
@command_window.disable_item(4)
end
Graphics.transition
# Main loop
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame update
update
# Abort loop if screen is changed
if $scene != self
break
end
end
# Prepare for transition
Graphics.freeze
# Dispose of windows
@command_window.dispose
# @status_window.dispose
@map_spriteset.dispose
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
@map_spriteset.update
# Update windows
@command_window.update
# @status_window.update
# If command window is active: call update_command
if @command_window.active
update_command
return
end
# If status window is active: call update_status
if @status_window.active
update_status
return
end
end
#--------------------------------------------------------------------------
# * Frame Update (when command window is active)
#--------------------------------------------------------------------------
def update_command
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Switch to map screen
$scene = Scene_Map.new
return
end
# If C button was pressed
if Input.trigger?(Input::C)
# If command other than save or end game, and party members = 0
if $game_party.actors.size == 0 and @command_window.index < 4
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# Branch by command window cursor position
case @command_window.index
when 0 # item
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to item screen
$scene = Scene_Item.new
when 1 # skill
# If saving is forbidden
if $game_system.save_disabled
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to save screen
$scene = Scene_Save.new
when 2 # equipment
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to end game screen
$scene = Scene_Map.new
when 3 # equipment
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to end game screen
$scene = Scene_End.new
return
end
end
#--------------------------------------------------------------------------
# * Frame Update (when status window is active)
#--------------------------------------------------------------------------
def update_status
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Make command window active
@command_window.active = true
@status_window.active = false
@status_window.index = -1
return
end
# If C button was pressed
if Input.trigger?(Input::C)
# Branch by command window cursor position
case @command_window.index
when 1 # skill
# If this actor's action limit is 2 or more
if $game_party.actors[@status_window.index].restriction >= 2
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to skill screen
$scene = Scene_Skill.new(@status_window.index)
when 2 # equipment
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to equipment screen
$scene = Scene_Equip.new(@status_window.index)
when 3 # status
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to status screen
$scene = Scene_Status.new(@status_window.index)
when 3 # status
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Make status window active
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 4 # save
# If saving is forbidden
if $game_system.save_disabled
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to save screen
$scene = Scene_Save.new
end
end
return
end
end
end
Und hier noch was einfaches: 8 Way Moveevent:

class Game_Player < Game_Character
def passable?(x, y, d)
new_x = x + (d == 6 ? 1 : d == 4 ? -1 : 0)
new_y = y + (d == 2 ? 1 : d == 8 ? -1 : 0)
unless $game_map.valid?(new_x, new_y)
return false
end
if $DEBUG and Input.press?(Input::CTRL)
return true
end
super
end
#-----------------------------------------------------------------
def update
last_moving = moving?
unless moving? or $game_system.map_interpreter.running? or
@move_route_forcing or $game_temp.message_window_showing
case Input.dir8
when 1
move_lower_left
when 2
move_down
when 3
move_lower_right
when 4
move_left
when 6
move_right
when 7
move_upper_left
when 8
move_up
when 9
move_upper_right
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

VegaCenter
05.04.2010, 19:58
Ich freu mich schon auf mehr :-)

SMWma
05.04.2010, 22:26
sodele, ich bin Fertig.
Ein Funktionierendes Menü mit einem Battle Skript, der es ermöglicht, zu 5 zu kämpfen. Jep, 5 Partymember.

Dies kann allerdings auch nicht benutzt werden, dazu muss man einfach mal false einstellen.

Rayo
06.04.2010, 13:39
"PHP-Code"

Öhm,...

Hast du nicht die Scripts mit RGSS gemacht?

Ansonsten: Cool! ;)

SMWma
18.04.2010, 14:32
ja, wieso? PHP ist halt besser als ein einfacherer Code-Tag ^.^ Und ja, das ist RGSS:D

SMWma
02.12.2010, 21:06
und Doppelpost ^,^ Das Script wurde upgedatet:

Was gibt es neues:
Config-Zeilen angelegt: Leichter anzupassen
Code stark verkürzt!

Morgen: Das, was ihr wollt ^,^