8Jetzt mal ehrlich, der ist angetackert als "Wichtig!", hat aber keinerlei interessante Inhalte. Warum? Weil er im Laufe der Zeit verkommen ist, da sich niemand mehr wirklich drum kümmert. Jetzt fungiert er als genau das, was er eigentlich nie sein wollte; eine Bettelquelle für Scripte.
Nicht, dass man mich falsch versteht. Ich finde beides gut. Aber dann müssen diese Themen auch ernsthaft durchgesetzt werden.
Fangen wir mal mit diesem Thema an: Standardscripte die man haben sollte!
Man könnte sich ja fragen, ob man dieses Thema überhaupt braucht. Schließlich gibts ja RMXP.org und Creation Asylum. Aber das ist genau die Tatsache, warum ich diesen Thread für wichtig erachte. Erstmal ist beides auf englisch, was natürlich kein Hindernis sein sollte, aber trotzdem lähmend sein kann, außerdem sind beide Seiten sehr langsam im Seitenaufbau, was ungemein frustrierend ist, wenn man sich dort länger aufhält.
Ich erzähle mal von meinen Erfahrungen:
Nach etwa einem Jahr wollte ich mich wieder an den RPGMakerXP setzen, mit einem Projekt weitermachen und schauen, ob es irgendwelche neuen interessanten Programmiererrungenschaften gibt.
Erst einmal ist es, wenn man mit den Entwicklungen der letzten Monate nicht vertraut ist unglaublich schwierig, bei der Fülle an unterschiedlichen Kampfsystemen, Menüs und Erweiterungen den Überblick zu behalten. Es ist dann auch noch absolut zeitaufwendig, verschiedene auf den ersten Blick gleichwertige Scripte zu testen und zu vergleichen.
Ich versuchte mir die vergangene Woche mal einen Überblick zu verschaffen und bin nun so klug als wie zuvor. Naja, vielleicht etwas klüger ^^
Es wäre wunderbar gewesen, hätte dieser Thread als Erfahrungsaustausch fungieren können zwischen Leuten, die diese Entwicklung mitgemacht haben und Leuten die neu dazugekommen sind.
Meine Verbesserungsvorschläge wären:
-Die Scripte nicht posten sondern einen Link. Fast alle Scripts hier sind veraltet, das ist unschön. Und wer hier liest, der erkennt das häufig auch gar nicht.
Wer sich ein Script selber ausgedacht hat, kann dies natürlich so schreiben ^^
Zusätzlich sollte jemand, der merkt, dass es eine neue Version oder bessere Alternative gibt, ein bisschen Verantwortungsbewusstsein entwickeln und das hier kundtun. Nur so können wir hoffen, dass wir aktuelle Informationen weitergeben können.
-Die Links zu den Scripten in den ersten Post stecken, damit man nicht den ganzen Thread durchblättern muss (gut, zwei Seiten geht noch, aber das kann auch auch schnell mal mehr werden) mit einer Kurzbeschreibung.
IMHO kann ruhig in diesem Thread auch diskutiert werden. Wie ich erwähnte, Erfahrungsaustausch ist wichtig. Wer eine bessere Alternative kennt, ruhig her damit.
-Vielleicht sollten die Scripte auch etwas in Kategorien gebracht werden? KS, Messages, Menüs etc., dann könnte man sie auch gut miteinander vergleichen.
Natürlich könnte man sich die Mühe machen und selber nach passenden Sachen suchen, aber es wäre doch sehr schön, wenn es auch eine deutsche Auflistung gäbe, von Leuten die Ahnung haben.
Wieviele Leute können den Ruby? Ich kanns nicht und ich habe auch wirklich keine Zeit mich damit groß auseinanderzusetzen. Ich will doch bloß ein RPG machen! ^^ Sicher geht es vielen Leuten so, und dann greift man auf nette Scripts zurück, weil der XP diese Möglichkeit bietet. Vielleicht wäre es gut "Standard"-Scripts durch "Sehr gute" Scripts zu ersetzen und auch mal nette Menüs und soetwas vorzustellen. Es gibt so viele Quellen und man allein kann so schlecht den Überblick behalten.
Oben erwähnte ich mal das Fragen nach Scripts. Fände ich auch nicht schlecht, einen Thread dafür, aber das könnte auch zu weit führen. Das soll ja hier kein Script-Forum werden. Naja.
So, ich hoffe, dass ich mal ein paar kleine Anregungen geben konnte, wie man diesen verwahrlosten Thread neues Leben einhauchen könnte.
Motivation ist etwas wichtiges und meiner Erfahrung nach kann das suchen nach hübschen Scripts motvierend, aber auf dauer auch sehr unmotvierend sein, wenn man von der Masse erschlagen wird, die es gibt. Und da wäre so ein Thread hier rettend.
...
JEP!!!Recht hast du!!!
Zitat
Vielleicht wäre es gut "Standard"-Scripts durch "Sehr gute" Scripts zu ersetzen und auch mal nette Menüs und soetwas vorzustellen. Es gibt so viele Quellen und man allein kann so schlecht den Überblick behalten.
...
Und deshalb hab ich hier ein paar interessante skripts rausgesucht:
Zitat
Ich habe das Ringmenüskript (http://scientia.rpgfantasy.de/wiki/index.php/Ringmenü) einmal angepasst, auf Wunsch eines Freundes hin.
Dieses ist dreidimensional, nicht mehr dieser öde Kreis.
Absofort könnt ihr statt Icons auch Grafiken aus dem Ordner Pictures einbinden.
Setzt dafür einfach grafik_typ = "p" und passt die Dateinamen an (Bei Icons im Ordner icons, bei Pictures im Ordner pictures, ohne Dateinamen).
Beim Aufruf von "Quicksave.save" wird das Spiel in eine Datei namens "quicksave.sav" gespeichert. Beim Aufruf von "Quicksave.load" wird der Spielstand aus dieser Datei, sofern vorhanden, geladen.
Damit das Schnellspeichern jederzeit auf der Map per Tastendruck, z.B. F5, funktioniert, muss im Script Scene_Map in der update-Methode was eingefügt werden:
...
if $DEBUG and Input.press?(Input::F9)
$game_temp.debug_calling = true
end
#~~~~~~~~~~~~~~~
if Input.trigger?(Input::F5)
Quicksave.save
end
if Input.trigger?(Input::F6)
Quicksave.load
end
#~~~~~~~~~~~~~~~
unless $game_player.moving?
if $game_temp.battle_calling
call_battle
elsif $game_temp.shop_calling
...
F5 -> Speichern
F6 -> Laden
Es können auch andere Tasten verwendet werden, dann muss man statt F5 und F6 eben was anderes schreiben, möglich ist F5-F9.
Das alles funktioniert ohne jegliche Dialoge. Zumindest mich nervt es, wenn ich für jedes Speichern erst mal das Menü aufrufen, den Menüpunkt Speichern anwählen und einen Spielstand bestimmen muss.
Bei Verwendung wie immer bitte Creditseintrag^^
Zitat
NPC-WindowsAuf diesen Beitrag antworten Zitatantwort auf diesen Beitrag erstellen Diesen Beitrag editieren/löschen Diesen Beitrag einem Moderator melden Zum Anfang der Seite springen
So, ich hab mal wieder Zeit gefunden, was zu scripten: kleine Fenster über den NPC's (geht natürlich auch über anderen Events). Dort kann man z.B. den Namen der Characters anzeigen lassen. Das Ganze sieht dann so aus:
Ich bin kein Mapper, sondern Scripter, also achtet mehr auf die Fenster als auf's Mapping Augenzwinkern
Um das Script zu benutzen, muss man folgenden Code als neues Script über Main einfügen:
#//////////////////////////////////////////NPC-Window///////////////////////////////////////////////
#~~~~~~~~~~~~~~~~~~~~by Caesar~~~~~~~~~~~~~~~~~~~~~~
#\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
#__________________________________________________
class Interpreter
def set_text(character, text)
#@parameter character: -1 --> player, 0 ---> this event, 1 ---> event with that id
character = get_character(character)
character.text = text if text != character.text
end
end
#==========================
class Game_Character
attr_accessor :text
alias init initialize
def initialize
init
@text = ""
@window_text = nil
@old_text = ""
end
#-----------
alias npc_text_update update
def update
npc_text_update
if @text != @old_text
@window_text.dispose if @window_text != nil
if @text == nil or @text == ""
@window_text = nil
@old_text = ""
else
@window_text = NPC_Window.new(@text)
@old_text = @text
end
end
if @window_text != nil
@window_text.update
@window_text.visible = ! @transparent
@window_text.x = screen_x - @window_text.width/2
@window_text.y = screen_y - 40 - 50
end
end
end
#====================
class NPC_Window < Window_Base
def initialize(text)
dummy_bitmap = Bitmap.new(32,32)
dummy_bitmap.font.name = $defaultfonttype
dummy_bitmap.font.size = 14
text_size = dummy_bitmap.text_size(text).width
super(0, 0, text_size+32, 30)
self.contents = nil
self.back_opacity = 140
@air_text = Air_Text.new(self.x, self.y, self.width, self.height, text)
end
#-----------
def refresh
@air_text.refresh
super
end
#-----------
def update
@air_text.update
@air_text.x = self.x-16
@air_text.y = self.y-16
super
end
#-----------
def dispose
@air_text.dispose
super
end
end
#===========
class Air_Text < Window_Base
def initialize(x, y, width, height, designate_text)
super(x-48, y-48, width+32, height+32)
self.contents = Bitmap.new(self.width - 32, self.height - 32)
self.opacity = 0
self.back_opacity = 0
w = self.contents.width
h = self.contents.height
self.contents.font.name = $defaultfonttype
self.contents.font.size = 14
self.contents.draw_text(0, 0, w, h, designate_text, 1)
end
#--------------------
def dispose
self.contents.clear
super
end
end
Wie benutzt man das Script: Ganz einfach. Mit der Eventfunktion "Script aufrufen" / "Call Script":
Zitat
set_text(CHARACTER, "TEXT")
...
Für CHARACTER muss man eine Zahl schreiben, die angibt, über welchem Character das Fenster sein soll:
-1 --> Spieler (ich weiß, das is kein NPC, geht aber trotzdem)
0 --> das Event, in dem man den Befehl aufruft
alles andere > 0 ---> das Event mit der entsprechenden ID
Für TEXT schreibt man einfach in doppelten Anführungsstrichen den Text, der im Fenster stehen soll. Um ein Fenster zu entfernen, setzt man den Text "", also gar keinen Text, dann wird auch kein Fenster angezeigt.
Die Fenster bewegen sich auch mit, wenn der jeweilige Character sich bewegt.
Ich glaub, mehr gibt's auch gar nicht zu erklären. Viel Spaß mit dem Script!
Und wie immer: Bei Verwendung des Scripts bitte ich um einen Creditseintrag.
...
So hier ist das Menüscript von Prexus
Einfach ein neues Script über Main einfügen und Bilder mit den Namen eurer Charas in den Pictures Ordner tun^^
# Advanced CMS Menu by Prexus
class Scene_Menu
def initialize(menu_index = 0)
@menu_index = menu_index
end
def main
s1 = $data_system.words.item
s2 = $data_system.words.skill
s3 = $data_system.words.equip
s4 = "Statut"
s5 = "Sauvegarder"
s6 = "Quitter"
@command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6])
@command_window.index = @menu_index
if $game_party.actors.size == 0
@command_window.disable_item(0)
@command_window.disable_item(1)
@command_window.disable_item(2)
@command_window.disable_item(3)
end
if $game_system.save_disabled
@command_window.disable_item(4)
end
@command_window.x = 32
@command_window.y = 32
@command_window.z = 3005
@command_window.back_opacity = 128
@playtime_window = Window_PlayTime.new
@playtime_window.x = 32
@playtime_window.y = 480-32-@playtime_window.height
@playtime_window.back_opacity = 128
@playtime_window.z = 3005
@gold_window = Window_Gold.new
@gold_window.x = 640-32-@gold_window.width
@gold_window.y = 480-32-@gold_window.height
@gold_window.back_opacity = 128
@gold_window.z = 3005
@chr_status = Window_CharacterStatus.new
@chr_status.visible = false
@status_window = Window_MenuStatus.new
@status_window.chr_status = @chr_status
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@command_window.dispose
@chr_status.dispose
@status_window.dispose
@gold_window.dispose
@playtime_window.dispose
end
def update
if @status_window.active and (@command_window.x != -128 or @playtime_window.x != 32-@playtime_window.width)
if @command_window.x != -128
@command_window.z = 3001
@command_window.x -= 5
end
if @playtime_window.x != 32-@playtime_window.width
@playtime_window.x -= 5
end
return
end
if @command_window.active and (@command_window.x != 32 or @playtime_window.x != 32)
if @command_window.x != 32
@command_window.z = 3005
@command_window.x += 5
end
if @playtime_window.x != 32
@playtime_window.x += 5
end
return
end
@command_window.update
@status_window.update
@gold_window.update
@playtime_window.update
@chr_status.update
if @command_window.active
update_command
@chr_status.visible = false
return
end
if @status_window.active
update_status
@chr_status.visible = true
return
end
end
def update_command
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Map.new
return
end
if Input.trigger?(Input::C)
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.index = 0
when 2
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@status_window.active = 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.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
end
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.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
class Window_CharacterStatus < Window_Base
def initialize
super(480-32, 0, 192, 128)
self.contents = Bitmap.new(width-32, height-32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
self.back_opacity = 0
self.z = 3006
end
def refresh(index)
self.contents.clear
if index >= 0
actor = $game_party.actors[index]
draw_actor_name(actor, 0, 0)
draw_actor_level(actor, 0, 24)
draw_actor_hp(actor, 0, 48)
draw_actor_sp(actor, 0, 72)
end
end
end
class Window_MenuStatus < Window_Base
attr_reader :index
attr_reader :chr_status
def initialize
@viewport = Viewport.new(0, 0, 640, 480)
@viewport.z = 3001
super(-16, -16, 640+32, 480+32)
self.contents = Bitmap.new(width-32, height-32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
self.active = false
self.z = 3000
@index = -1
@column_max = 1
@sprites = []
refresh
end
def index=(index)
@index = index
if self.active and @chr_status != nil
update_chr_status
end
update_cursor_rect
refresh
end
def refresh
self.contents.clear
for i in 0...@sprites.size
@sprites[i].dispose
end
@sprites = []
@item_max = $game_party.actors.size
for i in 0...@item_max
actor = $game_party.actors[@item_max-i-1]
@sprites[@item_max-i-1] = Sprite.new(@viewport)
@sprites[@item_max-i-1].bitmap = RPG::Cache.picture(actor.image_name)
@sprites[@item_max-i-1].x = 560-((i+1)*120)
@sprites[@item_max-i-1].y = 480-@sprites[@item_max-i-1].bitmap.height
@sprites[@item_max-i-1].opacity = 255
@sprites[@item_max-i-1].z = 3004-i
end
end
def update_cursor_rect
if @index < 0
for i in 0...@sprites.size
@sprites[i].opacity = 255
end
else
for i in 0...@sprites.size
if i == @index
@sprites[i].opacity = 255
@sprites[i].z += 4
else
@sprites[i].opacity = 200
@sprites[i].z = 3001+i
end
end
end
end
def dispose
super
for i in 0...@sprites.size
@sprites[i].dispose
end
end
def chr_status=(chr_status)
@chr_status = chr_status
if self.active and @chr_status != nil
update_chr_status
end
end
def update
super
if self.active and @item_max > 0 and @index >= 0
if Input.repeat?(Input::RIGHT)
if Input.trigger?(Input::RIGHT) or @index < @item_max - @column_max
$game_system.se_play($data_system.cursor_se)
@index = (@index + @column_max) % @item_max
end
end
if Input.repeat?(Input::LEFT)
if Input.trigger?(Input::LEFT) or @index >= @column_max
$game_system.se_play($data_system.cursor_se)
@index = (@index - @column_max + @item_max) % @item_max
end
end
end
if self.active and @chr_status != nil
update_chr_status
elsif @chr_status != nil
@chr_status.refresh(-1)
end
update_cursor_rect
end
def update_chr_status
@chr_status.refresh(@index)
end
end
class Window_Base
def shadow_color
return Color.new(0, 0, 0, 255)
end
def draw_actor_name(actor, x, y)
self.contents.font.color = shadow_color
self.contents.draw_text(x+1, y+1, 120, 32, actor.name)
self.contents.font.color = normal_color
self.contents.draw_text(x, y, 120, 32, actor.name)
end
def draw_actor_level(actor, x, y)
self.contents.font.color = shadow_color
self.contents.draw_text(x+1, y+1, 32, 32, "Lv")
self.contents.draw_text(x + 33, y + 1, 24, 32, actor.level.to_s, 2)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 32, 32, "Lv")
self.contents.font.color = normal_color
self.contents.draw_text(x + 32, y, 24, 32, actor.level.to_s, 2)
end
def draw_actor_hp(actor, x, y, width = 144)
self.contents.font.color = shadow_color
self.contents.draw_text(x+1, y+1, 32, 32, $data_system.words.hp)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 32, 32, $data_system.words.hp)
if width - 32 >= 108
hp_x = x + width - 108
flag = true
elsif width - 32 >= 48
hp_x = x + width - 48
flag = false
end
ich habe mal ein kleines billiges Skript gemacht, womit man die Steuerung des Helden vertauschen kann. Ich nenne das ganze das "Drunken Mode" Skript ;-)
Folgende Modi sind vorgegeben:
Modus 0:
Pfeil Unten -> Nach Oben gehen
Pfeil Links -> Nach Rechts gehen
Pfeil Rechts -> Nach Links gehen
Pfeil Oben -> Nach Unten gehen
Modus 1:
Pfeil Unten -> Nach Rechts gehen
Pfeil Links -> Nach Unten gehen
Pfeil Rechts -> Nach Oben gehen
Pfeil Oben -> Nach Links gehen
Modus 2:
Pfeil Unten -> Nach Links gehen
Pfeil Links -> Nach Oben gehen
Pfeil Rechts -> Nach Unten gehen
Pfeil Oben -> Nach Rechts gehen
Einbau:
1. Folgenden Code über "Main" einfügen:
#=======Drunken Mode Skript=======#
#============by Monsta============#
#====Version 1.0=== 31.1.2006 ====#
#=========www.Monsta.aw3.de=======#
class Game_Player < Game_Character
SWITCH_ID = 1
MODES = [["move_up","move_right","move_left","move_down"],
["move_right","move_down","move_up","move_left"],
["move_left","move_up","move_down","move_right"]]
def drunken_moving
case Input.dir4
when 2
if $game_switches[SWITCH_ID]
eval(MODES[@mode][0])
else
move_down
end
when 4
if $game_switches[SWITCH_ID]
eval(MODES[@mode][1])
else
move_left
end
when 6
if $game_switches[SWITCH_ID]
eval(MODES[@mode][2])
else
move_right
end
when 8
if $game_switches[SWITCH_ID]
eval(MODES[@mode][3])
else
move_up
end
end
end
def mode(mode)
@mode = mode
end
alias drunken_ini initialize
def initialize
@mode = 0
drunken_ini
end
end
2. Im Skript "Game_Player" die Zeilen 214 - 223:
case Input.dir4
when 2
move_down
when 4
move_left
when 6
move_right
when 8
move_up
end
durch diesen Code ersetzen:
drunken_moving
drunken_moving
3. Im Skript bei "SWITCH_ID" den Switch eintragen, der das Skript An und Aus Schalten soll.
Zusätzlich kann man in der Konstante "MODES" noch eigene Tastenrichtungen vorgeben.
Im Spiel kann man den Modus des Skriptes ändern, indem man dies in ein Event Skript folgendes Schreibt (Modus 0-2 sind vorgegeben):
$game_player.mode(0)
Vielleicht kanns ja jemand fürn Minigame oder so gebrauchen^^ Viel Spaß damit...
Mfg Monsta
Hallo Community,
vor ein paar Tagen habe ich angefangen,
mich mit RGSS zu beschäftigen...
Ich bekam immer mehr Ideen
und wollte diese natürlich umsetzten **
Sodass ich mich an einen Creditsscript gewagt hab
und hier ist es :
Ein neues Script unter Scene_Title erstellen und den Scene_Credits nennen:
#--------------------------------------------------------------------------
# * Credits Script by Firephoenix / Visit www.rpgxp-world.net / www.ysites.de/rmtoplist/
#--------------------------------------------------------------------------
# * Versions Log: - v0.1 Relase
#--------------------------------------------------------------------------
# * Thanx to !Tocs! for his help. I'm a beginner and so he explain me a lot...
#--------------------------------------------------------------------------
class Window1 < Window_Base
#------------------------------------------------------------------------
# * Object Initialization
#------------------------------------------------------------------------
def initialize
Audio.bgm_fade(1500)
Audio.bgs_fade(1500)
Audio.me_fade(1500)
super(0, 0, 640, 240)
self.contents = Bitmap.new(width - 32, height - 32)
# Hier kann man die Transparenz des oberen Fensters ändern
# 0 = Die "Box" ist nicht sichtbar | 255 = Keine Transparenz
self.opacity = 240
refresh
end
#-----------------------------------------------------------------------
# * Refresh
#------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.color = normal_color
# Hier kann der Text geändert werden
self.contents.draw_text(0, -108, 640, 240, "Erste Zeile", 0)
self.contents.draw_text(0, -85, 640, 240, "Zweite Zeile", 0)
self.contents.draw_text(0, -60, 640, 240, "Dritte Zeile", 0)
self.contents.draw_text(0, -35, 640, 240, "Vierte Zeile", 0)
self.contents.draw_text(0, -10, 640, 240, "Fünfte Zeile", 0)
self.contents.draw_text(0, 15, 640, 240, "Sexte Zeile", 0)
self.contents.draw_text(0, 40, 640, 240, "Achte Zeile", 0)
self.contents.draw_text(0, 67, 640, 240, "Neunte Zeile", 0)
end
end
class Window2 < Window_Base
#------------------------------------------------------------------------
# * Object Initialization
#------------------------------------------------------------------------
def initialize
super(0, 240, 640, 240)
self.contents = Bitmap.new(width - 32, height - 32)
# Hier kann man die Transparenz des unteren Fensters ändern
# 0 = Die "Box" ist nicht sichtbar | 255 = Keine Transparenz
self.opacity = 240
refresh
end
#------------------------------------------------------------------------
# * Refresh
#------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.color = normal_color
# Hier kann der Text geändert werden
self.contents.draw_text(0, -108, 640, 240, "Erste Zeile", 0)
self.contents.draw_text(0, -85, 640, 240, "Zweite Zeile", 0)
self.contents.draw_text(0, -60, 640, 240, "Dritte Zeile", 0)
self.contents.draw_text(0, -35, 640, 240, "Vierte Zeile", 0)
self.contents.draw_text(0, -10, 640, 240, "Fünfte Zeile", 0)
self.contents.draw_text(0, 15, 640, 240, "Sexte Zeile", 0)
self.contents.draw_text(0, 40, 640, 240, "Achte Zeile", 0)
self.contents.draw_text(0, 67, 640, 240, "Neunte Zeile", 0)
end
end
class Credits
#------------------------------------------------------------------------
# * Main Processing
#------------------------------------------------------------------------
#------------------------------------------------------------------------
# * Object Initialization
# menu_index : command cursor's initial position
#------------------------------------------------------------------------
def initialize(menu_index = 0)
@menu_index = menu_index
end
#------------------------------------------------------------------------
# * Main Processing
#------------------------------------------------------------------------
def main
@window1 = Window1.new
@window2 = Window2.new
# Execute transition
Graphics.transition
# Main loop
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame update
update
# Abort loop if screen is changed
if $scene != self
break
end
end
# Prepare for transition
Graphics.freeze
# Dispose of windows
@window1.dispose
@window2.dispose
end
#------------------------------------------------------------------------
# * Frame Update
#------------------------------------------------------------------------
def update
@window1.update
@window2.update
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Switch to map screen
$scene = Scene_Title.new
return
end
end
end
Scene_Title mit dem hier ersetzten:
#=============================================
# ** Scene_Title
#------------------------------------------------------------------------------
# This class performs title screen processing.
#=============================================
class Scene_Title
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
# If battle test
if $BTEST
battle_test
return
end
# Load database
$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")
# Make system object
$game_system = Game_System.new
# Make title graphic
@sprite = Sprite.new
@sprite.bitmap = RPG::Cache.title($data_system.title_name)
# Make command window
s1 = "Beginnen"
s2 = "Fortfahren"
s3 = "Beenden"
s4 = "Credits"
@command_window = Window_Command.new(250, [s1, s2, s4, s3])
@command_window.back_opacity = 40
@command_window.x = 320 - @command_window.width / 2
@command_window.y = 300
# Continue enabled determinant
# Check if at least one save file exists
# If enabled, make @continue_enabled true; if disabled, make it false
@continue_enabled = false
for i in 0..3
if FileTest.exist?("Save#{i+1}.rxdata")
@continue_enabled = true
end
end
# If continue is enabled, move cursor to "Continue"
# If disabled, display "Continue" text in gray
if @continue_enabled
@command_window.index = 1
else
@command_window.disable_item(1)
end
# Play title BGM
$game_system.bgm_play($data_system.title_bgm)
# Stop playing ME and BGS
Audio.me_stop
Audio.bgs_stop
# Execute transition
Graphics.transition
# Main loop
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame update
update
# Abort loop if screen is changed
if $scene != self
break
end
end
# Prepare for transition
Graphics.freeze
# Dispose of command window
@command_window.dispose
#@command_TEXT.dispose
# Dispose of title graphic
@sprite.bitmap.dispose
@sprite.dispose
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# Update command window
@command_window.update
# If C button was pressed
if Input.trigger?(Input::C)
# Branch by command window cursor position
case @command_window.index
when 0 # New game
command_new_game
when 1 # Continue
command_continue
when 3 # Shutdown
command_shutdown
when 2 # Credits
command_credits
end
end
end
#--------------------------------------------------------------------------
# * Command: New Game
#--------------------------------------------------------------------------
def command_new_game
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Stop BGM
Audio.bgm_stop
# Reset frame count for measuring play time
Graphics.frame_count = 0
# Make each type of game object
$game_temp = Game_Temp.new
$game_system = Game_System.new
$game_switches = Game_Switches.new
$game_variables = Game_Variables.new
$game_self_switches = Game_SelfSwitches.new
$game_screen = Game_Screen.new
$game_actors = Game_Actors.new
$game_party = Game_Party.new
$game_troop = Game_Troop.new
$game_map = Game_Map.new
$game_player = Game_Player.new
# Set up initial party
$game_party.setup_starting_members
# Set up initial map position
$game_map.setup($data_system.start_map_id)
# Move player to initial position
$game_player.moveto($data_system.start_x, $data_system.start_y)
# Refresh player
$game_player.refresh
# Run automatic change for BGM and BGS set with map
$game_map.autoplay
# Update map (run parallel process event)
$game_map.update
# Switch to map screen
$scene = Scene_Map.new
end
#--------------------------------------------------------------------------
# * Command: Continue
#--------------------------------------------------------------------------
def command_continue
# If continue is disabled
unless @continue_enabled
# 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 load screen
$scene = Scene_Load.new
end
#--------------------------------------------------------------------------
# * Command: Shutdown
#--------------------------------------------------------------------------
def command_shutdown
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Fade out BGM, BGS, and ME
Audio.bgm_fade(800)
Audio.bgs_fade(800)
Audio.me_fade(800)
# Shutdown
$scene = nil
end
#--------------------------------------------------------------------------
# * Command: Credits
#--------------------------------------------------------------------------
def command_credits
$scene = Credits.new
end
#--------------------------------------------------------------------------
# * Battle Test
#--------------------------------------------------------------------------
def battle_test
# Load database (for battle test)
$data_actors = load_data("Data/BT_Actors.rxdata")
$data_classes = load_data("Data/BT_Classes.rxdata")
$data_skills = load_data("Data/BT_Skills.rxdata")
$data_items = load_data("Data/BT_Items.rxdata")
$data_weapons = load_data("Data/BT_Weapons.rxdata")
$data_armors = load_data("Data/BT_Armors.rxdata")
$data_enemies = load_data("Data/BT_Enemies.rxdata")
$data_troops = load_data("Data/BT_Troops.rxdata")
$data_states = load_data("Data/BT_States.rxdata")
$data_animations = load_data("Data/BT_Animations.rxdata")
$data_tilesets = load_data("Data/BT_Tilesets.rxdata")
$data_common_events = load_data("Data/BT_CommonEvents.rxdata")
$data_system = load_data("Data/BT_System.rxdata")
# Reset frame count for measuring play time
Graphics.frame_count = 0
# Make each game object
$game_temp = Game_Temp.new
$game_system = Game_System.new
$game_switches = Game_Switches.new
$game_variables = Game_Variables.new
$game_self_switches = Game_SelfSwitches.new
$game_screen = Game_Screen.new
$game_actors = Game_Actors.new
$game_party = Game_Party.new
$game_troop = Game_Troop.new
$game_map = Game_Map.new
$game_player = Game_Player.new
# Set up party for battle test
$game_party.setup_battle_test_members
# Set troop ID, can escape flag, and battleback
$game_temp.battle_troop_id = $data_system.test_troop_id
$game_temp.battle_can_escape = true
$game_map.battleback_name = $data_system.battleback_name
# Play battle start SE
$game_system.se_play($data_system.battle_start_se)
# Play battle BGM
$game_system.bgm_play($game_system.battle_bgm)
# Switch to battle screen
$scene = Scene_Battle.new
end
end
Nun sollte alles funktionieren...
Wer Vorschläge/Kritik/ *g* Lob hat,
nur her damit ^^...
MFG Firephoenix
I know that there are a few scripts that let the player distribute their own stat points when they level up, but I wasn't too happen with the one I downloaded when it conflicted with some other scripts I had. So I decided to script my own level up system. As of the moment, you can change the hero's maxhp, maxsp, str, dex, agi, and int. I am working on how to get around the error that shows up when I try to include atk, pdef, and mdef. Anyways, those 3 last attributes have been commented out from this version of the script, so it should work fine. I have also added instructions on how to implement a pop up window when they enter the status menu asking the player if he/she wants to distribute any remaining AP of the selected hero if and only if the selected hero has remaining AP.
Anyways, here is the script. Just paste it above Main in the script editor.
I have added a lot of commented instructions at the top of the script. Please follow it carefully.
To call the script, use "$scene = Scene_AP_Distribute.new(@actor_index)"
@actor_index being the position of the heroes currently in the party.
So if Arshes was in the first position in party, he would be @actor_index = 0
Report any bugs here if you find them. Anyways, enjoy !!!
#=========================================================================
=====
# * Scene_AP_Distribute
#------------------------------------------------------------------------------
# * by Skyboar
# * made August 2007
#
# * Script allows the player to freely customizing the Hero's stat points
# * including max hp, max sp, technique, critical, agility, and spirit
#
#==============================================================================
# *Instructions on how to use*
#
# Just Insert this script above "Main" in script editor.
#
#------------------------------------------------------------------------------
# Insert the following code in "Window_BattleStatus"
#
# this code: actor.stat_points += $AP
#
# under this code: if @level_up_flags[i]
#------------------------------------------------------------------------------
#
#Insert the following code in "Game_Actor"
#
# this code: attr_accessor :stat_points
#
# under this code: class Game_Actor < Game_Battler
#
#------------------------------------------------------------------------------
#
#Insert the following code in "Game_Actor"
#
# this code: @stat_points = 0
#
# under this code: def setup(actor_id)
# actor = $data_actors[actor_id]
#
# #------------------------------------------------------------------------------
#
# * Instructions on how to implement a pop up window asking the player if he/she would
# * like to distribute any remaining AP that the selected hero has.
#
#------------------------------------------------------------------------------
#
#Insert the following code in "Scene_Status"
#
# this code:
##--------------[Used for Level Up AP System]-----------------------
#
# if @actor.stat_points > 0
# @alert = true
# else
# @alert = false
# end
# @alert_window = Window_AP_RemainAlert.new(@actor)
# @alert_window.x = 320 - (@alert_window.width / 2)
# @alert_window.y = 120
# @alert_window.z = 10000
# if @alert == true
# @alert_window.visible = true
# elsif @alert == false
# @alert_window.visible = false
# end
# @alertconfirm_window = Window_AP_RemainConfirm.new(@actor)
# @alertconfirm_window.x = 320 - (@alertconfirm_window.width / 2)
# @alertconfirm_window.y = 230
# @alertconfirm_window.z = 10001
# @alertconfirm_window.index = 0
# if @alert == true
# @alertconfirm_window.visible = true
# @alertconfirm_window.active = true
# elsif @alert == false
# @alertconfirm_window.visible = false
# @alertconfirm_window.active = false
# end
##--------------[Used for Level Up AP System]-----------------------
#
# under this code: def main
# @actor = $game_party.actors[@actor_index]
#
#------------------------------------------------------------------------------
#
#Insert the following code in "Scene_Status"
#
# this code:
##--------------[Used for Level Up AP System]-----------------
# @alert_window.dispose
# @alertconfirm_window.dispose
##--------------[Used for Level Up AP System]-----------------------
#
# under this code: Graphics.freeze
#
#
#------------------------------------------------------------------------------
#
#Insert the following code in "Scene_Status"
#
# this code:
##--------------[Used for Level Up AP System]-----------------
#@alertconfirm_window.update
# if @alertconfirm_window.active
# update_alertconfirm
# return
# end
##--------------[Used for Level Up AP System]-----------------------
#
# under this code: def update
#
# Insert the following code in "Scene_Status"
# under "def update's 'end' " but before the class's end (the very last 'end' in the scene) "
# code to be inserted into Scene_Status:
##--------------[Used for Level Up AP System]-----------------
#def update_alertconfirm
# if Input.trigger?(Input::B)
# $game_system.se_play($data_system.cancel_se)
# @alert_window.visible = false
# @alertconfirm_window.active = false
# @alertconfirm_window.visible = false
# @alert = false
# return
# end
# if Input.trigger?(Input::C)
# $game_system.se_play($data_system.decision_se)
# case @alertconfirm_window.index
# when 0
# $scene = Scene_AP_Distribute.new(@actor_index)
# when 1
# @alert_window.visible = false
# @alertconfirm_window.active = false
# @alertconfirm_window.visible = false
# @alert = false
# return
# end
#end
#--------------[Used for Level Up AP System]-----------------
#------------------------------------------------------------------------------
#
# *Now you are ready to define the variables for the leveling up stats scene
# *You are welcome to freely change the variables instead of using the default
# *that I set up the script up with.
#
# *Enjoy!!!
#
#==============================================================================
#-------------[global variables for leveling up system]--------------------------------
#-------------[Change the VALUES BELOW to your liking]---------------------------
#-------------[global variables for leveling up system]--------------------------------
$AP = 9 #determines how much Attribute Points each hero gets upon Level Up
#change the following values to how much is added to each hero's attribute upon AP distribution
$add_stat_maxhp = 10 #for example value 10 means that 10 will be added to the hero's max hp
$add_stat_maxsp = 3
$add_stat_atk = 1
$add_stat_pdef = 1
$add_stat_mdef = 1
$add_stat_tech = 1
$add_stat_crit = 1
$add_stat_agi = 1
$add_stat_spr = 1
#-------------[global variables for leveling up system]--------------------------------
#-------------[Change the VALUES BELOW to your liking]---------------------------
#-------------[global variables for leveling up system]--------------------------------
#==============================================================================
# * Window_AP_RemainAlert
#prompts the player asking to distribute remaining AP if and only if they have any remaining.
#------------------------------------------------------------------------------
#==============================================================================
class Window_AP_RemainAlert< Window_Base
#--------------------------------------------------------------------------
# - Object initialization
#--------------------------------------------------------------------------
def initialize(actor)
super(0, 0, 300, 120)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $defaultfonttype
self.contents.font.size = $defaultfontsize
@actor = actor
refresh
end
#--------------------------------------------------------------------------
# - Refreshment
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.color = normal_color
self.contents.draw_text(-15, -5, 300, 32, "!!! Alert !!!", 1)
self.contents.font.color = normal_color
self.contents.draw_text(-15, 25, 300, 32, @actor.name + " has " + @actor.stat_points.to_s + " AP remaining.", 1)
self.contents.draw_text(-15, 55, 300, 32, "Distribute the remaining " + @actor.stat_points.to_s + " AP ?", 1)
end
end
#==============================================================================
# * Window_AP_RemainConfirm
#prompts the player asking if he/she permanently wants to distribute remaining AP.
#------------------------------------------------------------------------------
#==============================================================================
class Window_AP_RemainConfirm < Window_Selectable
#--------------------------------------------------------------------------
# - Object initialization
#--------------------------------------------------------------------------
def initialize(actor)
super(0, 0, 200, 55)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $defaultfonttype
self.contents.font.size = $defaultfontsize
@item_max = 2
@row_max = 1
@column_max = 2
@actor = actor
@commands = ["Yes", "No"]
refresh
end
#--------------------------------------------------------------------------
# - Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
t = @commands.size
for i in 0...@commands.size
x = (i % 2) * 100
y = (i / 2) * 32
self.contents.font.color = normal_color
self.contents.draw_text(x - 15, y - 5 , 100, 32, @commands[i], 1)
end
end
#--------------------------------------------------------------------------
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
else
self.cursor_rect.set((@index * 100), -5, 70, 32)
end
end
#--------------------------------------------------------------------------
end
#==============================================================================
# * Window_AP_Warning #prompts the player asking if he/she permanently wants to use the ap they distributed
#------------------------------------------------------------------------------
#==============================================================================
class Window_AP_Warning< Window_Base
#--------------------------------------------------------------------------
# - Object initialization
#--------------------------------------------------------------------------
def initialize
super(0, 0, 300, 120)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $defaultfonttype
self.contents.font.size = $defaultfontsize
refresh
end
#--------------------------------------------------------------------------
# - Refreshment
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.color = normal_color
self.contents.draw_text(-15, -5, 300, 32, "!!! WARNING !!!", 1)
self.contents.font.color = normal_color
self.contents.draw_text(-15, 25, 300, 32, "AP distributed will be permanently removed", 1)
self.contents.draw_text(-15, 55, 300, 32, "from Hero's Remaining AP count.", 1)
end
end
#==============================================================================
# * Window_AP_WarningConfirm #prompts the player asking if he/she permanently wants to use the ap they distributed
#------------------------------------------------------------------------------
#==============================================================================
class Window_AP_WarningConfirm < Window_Selectable
#--------------------------------------------------------------------------
# - Object initialization
#--------------------------------------------------------------------------
def initialize
super(0, 0, 200, 55)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $defaultfonttype
self.contents.font.size = $defaultfontsize
@item_max = 2
@row_max = 1
@column_max = 2
@commands = ["Confirm", "Cancel"]
refresh
end
#--------------------------------------------------------------------------
# - Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
t = @commands.size
for i in 0...@commands.size
x = (i % 2) * 100
y = (i / 2) * 32
self.contents.font.color = normal_color
self.contents.draw_text(x - 15, y - 5 , 100, 32, @commands[i], 1)
end
end
#--------------------------------------------------------------------------
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
else
self.cursor_rect.set((@index * 100), -5, 70, 32)
end
end
#--------------------------------------------------------------------------
end
#==============================================================================
# * Window_AP_HeroFace
#------------------------------------------------------------------------------
#displays the hero's portrait or battler graphic as well as name, lv, class, and remaining AP.
#==============================================================================
class Window_AP_HeroFace < Window_Base
#--------------------------------------------------------------------------
# - Object initialization
#--------------------------------------------------------------------------
def initialize(actor)
super(50, 40, 160, 300)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $defaultfonttype
self.contents.font.size = $defaultfontsize
@actor = actor
self.z = 10
refresh
end
#======[use this for displaying hero's portrait]===============
def draw_actor_face_portrait(actor, x, y)
bitmap = RPG::Cache.picture(actor.id.to_s)
src_rect = Rect.new(0, 0, 96, 192)
self.contents.blt(28, 0, bitmap, src_rect)
end
#======[use this for displaying hero's battler portrait]===============
def draw_actor_battler(actor, x, y)
bitmap = RPG::Cache.battler(@actor.battler_name, @actor.battler_hue)
src_rect = Rect.new(0, 0, 96, 192)
self.contents.blt(0, 0, bitmap, Rect.new(0, 0, 200, 480))
end
#======================================
#--------------------------------------------------------------------------
# - Refreshment
#--------------------------------------------------------------------------
def refresh
self.contents.clear
x = 0
y = 0
draw_actor_battler(@actor,0,0) #used for displaying battler
#draw_actor_face_portrait(@actor, x + 28, y + 0) #used for displaying hero portrait
draw_actor_name(@actor, x + 28, y + 165)
draw_actor_level(@actor, x + 28, y + 190)
draw_actor_class(@actor, x + 28, y + 215)
self.contents.font.color = normal_color
self.contents.draw_text(x + 28, y + 240, 320, 32, "AP", 0)
self.contents.font.color = normal_color
self.contents.draw_text(x - 40, y + 240, 160, 32, @actor.stat_points.to_s, 2)
end
end
#==============================================================================
# * Window_AP_HeroStatus
#------------------------------------------------------------------------------
# displays the Hero's current status before the AP is distributed and the stat points are changed.
#==============================================================================
class Window_AP_HeroStatus < Window_Base
#--------------------------------------------------------------------------
# - Object initialization
# actor : Actor
#--------------------------------------------------------------------------
def initialize(actor)
super(10, 200, 300, 360)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $defaultfonttype
self.contents.font.size = $defaultfontsize
@actor = actor
refresh
end
#--------------------------------------------------------------------------
# - Refreshment
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.color = system_color
self.contents.draw_text(105, -5, 120, 32, "Current Stats", 0)
self.contents.font.color = normal_color
self.contents.draw_text(105, 30, 120, 32, "Max HP", 0)
self.contents.font.color = normal_color
self.contents.draw_text(105, 55, 120, 32, "Max SP", 0)
self.contents.font.color = normal_color
self.contents.draw_text(122, 30, 120, 32, @actor.maxhp.to_s, 2)
self.contents.draw_text(122, 55, 120, 32, @actor.maxsp.to_s, 2)
draw_actor_parameter(@actor, 105, 105, 0)#char's attack
draw_actor_parameter(@actor, 105, 130, 1)#char's phy def
draw_actor_parameter(@actor, 105, 155, 2)#char's mag def
draw_actor_parameter(@actor, 105, 205, 3)#char's Tech
draw_actor_parameter(@actor, 105, 230, 4)#char's Critical
draw_actor_parameter(@actor, 105, 255, 5)#char's Agility
draw_actor_parameter(@actor, 105, 280, 6)#char's Spirit
end
end
#==============================================================================
# * Window_AP_Add
#------------------------------------------------------------------------------
# displays and updates the values of the subtotal and total AP distribution and stat points
#==============================================================================
class Window_AP_Add < Window_Selectable
#--------------------------------------------------------------------------
# - Object initialization
# actor : Actor
#--------------------------------------------------------------------------
def initialize(actor)
super(10, 200, 340, 360)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $defaultfonttype
self.contents.font.size = $defaultfontsize
@item_max = 11
@row_max = 11
@column_max = 1
@actor = actor
refresh
end
#--------------------------------------------------------------------------
# - Refreshment
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.color = system_color
self.contents.draw_text(5, 0, 120, 32, "Added Stats", 0)
#-----[global variables subtotal display]----------------------------------------------------
self.contents.font.color = normal_color
self.contents.draw_text(-65, 35, 120, 32, $subtotal_stat_maxhp.to_s, 2)
self.contents.draw_text(-65, 60, 120, 32, $subtotal_stat_maxsp.to_s, 2)
self.contents.draw_text(-65, 110, 120, 32, $subtotal_stat_atk.to_s, 2)
self.contents.draw_text(-65, 135, 120, 32, $subtotal_stat_pdef.to_s, 2)
self.contents.draw_text(-65, 160, 120, 32, $subtotal_stat_mdef.to_s, 2)
self.contents.draw_text(-65, 210, 120, 32, $subtotal_stat_tech.to_s, 2)
self.contents.draw_text(-65, 235, 120, 32, $subtotal_stat_crit.to_s, 2)
self.contents.draw_text(-65, 260, 120, 32, $subtotal_stat_agi.to_s, 2)
self.contents.draw_text(-65, 285, 120, 32, $subtotal_stat_spr.to_s, 2)
#-----["=" sign display]----------------------------------------------------
self.contents.font.color = normal_color
self.contents.draw_text(22, 35, 120, 32, "=", 2)
self.contents.draw_text(22, 60, 120, 32, "=", 2)
self.contents.draw_text(22, 110, 120, 32, "=", 2)
self.contents.draw_text(22, 135, 120, 32, "=", 2)
self.contents.draw_text(22, 160, 120, 32, "=", 2)
self.contents.draw_text(22, 210, 120, 32, "=", 2)
self.contents.draw_text(22, 235, 120, 32, "=", 2)
self.contents.draw_text(22, 260, 120, 32, "=", 2)
self.contents.draw_text(22, 285, 120, 32, "=", 2)
#-----[global variables total display]----------------------------------------------------
self.contents.font.color = system_color
self.contents.draw_text(125, 0, 120, 32, "New Stats", 2)
self.contents.font.color = normal_color
self.contents.draw_text(125, 35, 120, 32, $total_stat_maxhp.to_s, 2)
self.contents.draw_text(125, 60, 120, 32, $total_stat_maxsp.to_s, 2)
self.contents.draw_text(125, 110, 120, 32, $total_stat_atk.to_s, 2)
self.contents.draw_text(125, 135, 120, 32, $total_stat_pdef.to_s, 2)
self.contents.draw_text(125, 160, 120, 32, $total_stat_mdef.to_s, 2)
self.contents.draw_text(125, 210, 120, 32, $total_stat_tech.to_s, 2)
self.contents.draw_text(125, 235, 120, 32, $total_stat_crit.to_s, 2)
self.contents.draw_text(125, 260, 120, 32, $total_stat_agi.to_s, 2)
self.contents.draw_text(125, 285, 120, 32, $total_stat_spr.to_s, 2)
end
#-----[update of cursor]----------------------------------------------------
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
else
self.cursor_rect.set(0, (@index * 25) + 35, 280, 28)
end
end
end
#==============================================================================
# * Window_AP_Confirm #gives options for confirming, distribute, and resetting AP.
#------------------------------------------------------------------------------
#==============================================================================
class Window_AP_Confirm < Window_Selectable
#--------------------------------------------------------------------------
# - Object initialization
#--------------------------------------------------------------------------
def initialize
super(0, 0, 300, 60)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $defaultfonttype
self.contents.font.size = $defaultfontsize
@item_max = 3
@row_max = 1
@column_max = 3
@commands = ["Confirm", "Distribute", "Reset"]
refresh
end
#--------------------------------------------------------------------------
# - Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
t = @commands.size
for i in 0...@commands.size
x = (i % 3) * 100
y = (i / 3) * 32
self.contents.font.color = normal_color
self.contents.draw_text(x - 15, y - 5 , 100, 32, @commands[i], 1)
end
end
#--------------------------------------------------------------------------
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
else
self.cursor_rect.set((@index * 100), -5, 70, 32)
end
end
end
#==============================================================================
class Scene_AP_Distribute #this is where all the magic happens
#--------------------------------------------------------------------------
# - Main processing
#--------------------------------------------------------------------------
def initialize(actor_index = 0, equip_index = 0)
@actor_index = actor_index
end
#--------------------------------------------------------------------------
def main
@actor = $game_party.actors[@actor_index]
#-------------[global variables for leveling up system]--------------------------------
#-------------[DO NOT TAMPER WITH THESE VALUES BELOW]-------------------
#-------------[global variables for leveling up system]--------------------------------
@old_stat_points = @actor.stat_points #used to keep track of AP amount before distribution
$total_stat_maxhp = @actor.maxhp
$total_stat_maxsp = @actor.maxsp
$total_stat_atk = @actor.atk
$total_stat_pdef = @actor.pdef
$total_stat_mdef = @actor.mdef
$total_stat_tech = @actor.str
$total_stat_crit = @actor.dex
$total_stat_agi = @actor.agi
$total_stat_spr = @actor.int
$subtotal_stat_maxhp = 0
$subtotal_stat_maxsp = 0
$subtotal_stat_atk = 0
$subtotal_stat_pdef = 0
$subtotal_stat_mdef = 0
$subtotal_stat_tech = 0
$subtotal_stat_crit = 0
$subtotal_stat_agi = 0
$subtotal_stat_spr = 0
#-------------[global variables for leveling up system]-------------------------------
#-------------[DO NOT TAMPER WITH THESE VALUES ABOVE]-------------------
#-------------[global variables for leveling up system]--------------------------------
@map_sprite = Spriteset_Map.new
@alert_window = Window_AP_Warning.new
@alert_window.x = 320 - (@alert_window.width / 2)
@alert_window.y = 120
@alert_window.z = 100000
@alert_window.opacity = 240
@alert_window.visible = false
@alertconfirm_window = Window_AP_WarningConfirm.new
@alertconfirm_window.x = 320 - (@alertconfirm_window.width / 2)
@alertconfirm_window.y = 230
@alertconfirm_window.z = 100000
@alertconfirm_window.opacity = 240
@alertconfirm_window.active = false
@alertconfirm_window.visible = false
@alertconfirm_window.index = 0
@confirm_window = Window_AP_Confirm.new
@confirm_window.x = 320 - (@confirm_window.width / 2)
@confirm_window.y = 380
@confirm_window.z = 10000
@confirm_window.opacity = 200
@confirm_window.active = true
@confirm_window.index = 1
@hero_window = Window_AP_HeroFace.new(@actor)
@hero_window.x = -10
@hero_window.y = 30
@hero_window.z = 10000
@hero_window.opacity = 200
@herostatus_window = Window_AP_HeroStatus.new(@actor)
@herostatus_window.x = 40
@herostatus_window.y = 40
@herostatus_window.z = 1000
@herostatus_window.opacity = 200
@ap_add_window = Window_AP_Add.new(@actor)
@ap_add_window.x = 320
@ap_add_window.y = 35
@ap_add_window.z = 1000
@ap_add_window.opacity = 200
@ap_add_window.active = false
@ap_add_window.index = -1
# Transition execution
Graphics.transition
# Main loop
loop do
# Renewing the game picture
Graphics.update
# Updating the information of input
Input.update
# Frame renewal
update
# When the picture changes, discontinuing the loop
if $scene != self
break
end
end
# Transition preparation
Graphics.freeze
# Releasing the window
@confirm_window.dispose
@hero_window.dispose
@herostatus_window.dispose
@ap_add_window.dispose
@alert_window.dispose
@alertconfirm_window.dispose
@map_sprite.dispose
# When it changes to the title picture and it is in
if $scene.is_a?(Scene_Title)
# Fading out picture
Graphics.transition
Graphics.freeze
end
end
#--------------------------------------------------------------------------
# - Frame renewal
#--------------------------------------------------------------------------
def update
@ap_add_window.update
@confirm_window.update
@alertconfirm_window.update
if @confirm_window.active
update_confirm
return
end
if @ap_add_window.active
update_ap_add
return
end
if @alertconfirm_window.active
update_alertconfirm
return
end
end
# --------------------------------
def update_confirm
if Input.trigger?(Input::B) #cancel
$game_system.se_play($data_system.cancel_se)
if @actor.stat_points != @old_stat_points #checks to see if player has used any of the remaining AP
@alert_window.visible = true
@alertconfirm_window.active = true
@alertconfirm_window.visible = true
@confirm_window.active = false
@confirm_window.index = -1
else
$scene = Scene_Status.new(@actor_index)
end
return
end
if Input.trigger?(Input::C) #confirm
case @confirm_window.index
when 0 #confirm distribution of ap
$game_system.se_play($data_system.decision_se)
if @actor.stat_points != @old_stat_points #checks to see if player has used any of the remaining AP
@alert_window.visible = true
@alertconfirm_window.active = true
@alertconfirm_window.visible = true
@confirm_window.active = false
@confirm_window.index = -1
else
$scene = Scene_Status.new(@actor_index)
end
when 1 #distribute ap
$game_system.se_play($data_system.decision_se)
@confirm_window.active = false
@confirm_window.index = -1
@ap_add_window.active = true
@ap_add_window.index = 0
when 2 #reset distributed ap
$game_system.se_play($data_system.decision_se)
$subtotal_stat_maxhp = 0
$subtotal_stat_maxsp = 0
$subtotal_stat_atk = 0
$subtotal_stat_pdef = 0
$subtotal_stat_mdef = 0
$subtotal_stat_tech = 0
$subtotal_stat_crit = 0
$subtotal_stat_agi = 0
$subtotal_stat_spr = 0
$total_stat_maxhp = @actor.maxhp
$total_stat_maxsp = @actor.maxsp
$total_stat_atk = @actor.atk
$total_stat_pdef = @actor.pdef
$total_stat_mdef = @actor.mdef
$total_stat_tech = @actor.str
$total_stat_crit = @actor.dex
$total_stat_agi = @actor.agi
$total_stat_spr = @actor.int
@actor.stat_points = @old_stat_points
@hero_window.refresh
@herostatus_window.refresh
@ap_add_window.refresh
end
return
end
end
# --------------------------------
def update_ap_add #updates the distribution of the AP to hero's attributes
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@ap_add_window.active = false
@ap_add_window.index = -1
@confirm_window.active = true
@confirm_window.index = 1
return
end
if Input.trigger?(Input::A) #resets AP
$game_system.se_play($data_system.decision_se)
$subtotal_stat_maxhp = 0
$subtotal_stat_maxsp = 0
$subtotal_stat_atk = 0
$subtotal_stat_pdef = 0
$subtotal_stat_mdef = 0
$subtotal_stat_tech = 0
$subtotal_stat_crit = 0
$subtotal_stat_agi = 0
$subtotal_stat_spr = 0
$total_stat_maxhp = @actor.maxhp
$total_stat_maxsp = @actor.maxsp
$total_stat_atk = @actor.atk
$total_stat_pdef = @actor.pdef
$total_stat_mdef = @actor.mdef
$total_stat_tech = @actor.str
$total_stat_crit = @actor.dex
$total_stat_agi = @actor.agi
$total_stat_spr = @actor.int
@actor.stat_points = @old_stat_points
@hero_window.refresh
@herostatus_window.refresh
@ap_add_window.refresh
return
end
if Input.repeat?(Input::LEFT) #subtract AP
$game_system.se_play($data_system.cursor_se)
case @ap_add_window.index
when 0 #subtract from maxhp
if$subtotal_stat_maxhp > 0
@actor.stat_points += 1
$subtotal_stat_maxhp = $subtotal_stat_maxhp - $add_stat_maxhp #update subtotal
$total_stat_maxhp = $total_stat_maxhp - $add_stat_maxhp #update total
else
$game_system.se_play($data_system.buzzer_se)
end
when 1 #subtract from maxsp
if$subtotal_stat_maxsp > 0
@actor.stat_points += 1
$subtotal_stat_maxsp = $subtotal_stat_maxsp - $add_stat_maxsp
$total_stat_maxsp = $total_stat_maxsp - $add_stat_maxsp #update total
else
$game_system.se_play($data_system.buzzer_se)
end
# when 3 #subtract from atk
# if$subtotal_stat_atk > 0
# @actor.stat_points += 1
# $subtotal_stat_atk = $subtotal_stat_atk - $add_stat_atk
# $total_stat_atk = $total_stat_atk - $add_stat_atk #update total
# else
# $game_system.se_play($data_system.buzzer_se)
# end
# when 4 #subtract from pdef
# if$subtotal_stat_pdef > 0
# @actor.stat_points += 1
# $subtotal_stat_pdef = $subtotal_stat_pdef - $add_stat_pdef
# $total_stat_pdef = $total_stat_pdef - $add_stat_pdef #update total
# else
# $game_system.se_play($data_system.buzzer_se)
# end
# when 5 #subtract from mdef
# if$subtotal_stat_mdef > 0
# @actor.stat_points += 1
# $subtotal_stat_mdef = $subtotal_stat_mdef - $add_stat_mdef
# $total_stat_mdef = $total_stat_mdef - $add_stat_mdef #update total
# else
# $game_system.se_play($data_system.buzzer_se)
# end
when 7 #subtract from tech
if$subtotal_stat_tech > 0
@actor.stat_points += 1
$subtotal_stat_tech = $subtotal_stat_tech - $add_stat_tech
$total_stat_tech = $total_stat_tech - $add_stat_tech #update total
else
$game_system.se_play($data_system.buzzer_se)
end
when 8 #subtract from crit
if$subtotal_stat_crit > 0
@actor.stat_points += 1
$subtotal_stat_crit = $subtotal_stat_crit - $add_stat_crit
$total_stat_crit = $total_stat_crit - $add_stat_crit #update total
else
$game_system.se_play($data_system.buzzer_se)
end
when 9 #subtract from agi
if$subtotal_stat_agi > 0
@actor.stat_points += 1
$subtotal_stat_agi = $subtotal_stat_agi - $add_stat_agi
$total_stat_agi = $total_stat_agi - $add_stat_agi #update total
else
$game_system.se_play($data_system.buzzer_se)
end
when 10 #subtract from spr
if$subtotal_stat_spr > 0
@actor.stat_points += 1
$subtotal_stat_spr = $subtotal_stat_spr - $add_stat_spr
$total_stat_spr = $total_stat_spr - $add_stat_spr #update total
else
$game_system.se_play($data_system.buzzer_se)
end
end
@hero_window.refresh
@herostatus_window.refresh
@ap_add_window.refresh
return
end
if Input.repeat?(Input::RIGHT) #add AP
if @actor.stat_points > 0
$game_system.se_play($data_system.cursor_se)
case @ap_add_window.index
when 0 #add to maxhp
@actor.stat_points -= 1
$subtotal_stat_maxhp = $subtotal_stat_maxhp + $add_stat_maxhp #update subtotal
$total_stat_maxhp = $total_stat_maxhp + $add_stat_maxhp #update total
when 1 #add to maxsp
@actor.stat_points -= 1
$subtotal_stat_maxsp = $subtotal_stat_maxsp + $add_stat_maxsp
$total_stat_maxsp = $total_stat_maxsp + $add_stat_maxsp
#when 3 #add to atk
# @actor.stat_points -= 1
# $subtotal_stat_atk = $subtotal_stat_atk + $add_stat_atk
# $total_stat_atk = $total_stat_atk + $add_stat_atk
# when 4 #add to pdef
# @actor.stat_points -= 1
# $subtotal_stat_pdef = $subtotal_stat_pdef + $add_stat_pdef
# $total_stat_pdef = $total_stat_pdef + $add_stat_pdef
# when 5 #add to mdef
# @actor.stat_points -= 1
# $subtotal_stat_mdef = $subtotal_stat_mdef + $add_stat_mdef
# $total_stat_mdef = $total_stat_mdef + $add_stat_mdef
when 7 #add to tech
@actor.stat_points -= 1
$subtotal_stat_tech = $subtotal_stat_tech + $add_stat_tech
$total_stat_tech = $total_stat_tech + $add_stat_tech
when 8 #add to crit
@actor.stat_points -= 1
$subtotal_stat_crit = $subtotal_stat_crit + $add_stat_crit
$total_stat_crit = $total_stat_crit + $add_stat_crit
when 9 #add to agi
@actor.stat_points -= 1
$subtotal_stat_agi = $subtotal_stat_agi + $add_stat_agi
$total_stat_agi = $total_stat_agi + $add_stat_agi
when 10 #add to spr
@actor.stat_points -= 1
$subtotal_stat_spr = $subtotal_stat_spr + $add_stat_spr
$total_stat_spr = $total_stat_spr + $add_stat_spr
end
@hero_window.refresh
@herostatus_window.refresh
@ap_add_window.refresh
else
$game_system.se_play($data_system.buzzer_se)
end
return
end
end
# --------------------------------
def update_alertconfirm
if Input.trigger?(Input::B) #cancel
$game_system.se_play($data_system.cancel_se)
@alert_window.visible = false
@alertconfirm_window.active = false
@alertconfirm_window.visible = false
@confirm_window.active = true
@confirm_window.index = 0
return
end
if Input.trigger?(Input::C)
case @alertconfirm_window.index
when 0 #when confirm adds distributed AP to stats permanently
$game_system.se_play($data_system.decision_se)
@actor.maxhp = $total_stat_maxhp
@actor.maxsp = $total_stat_maxsp
@actor.hp = @actor.maxhp #restores the hero's hp to max
@actor.sp = @actor.maxsp #restores the hero's sp to max
#@actor.base_atk = $total_stat_atk
#@actor.base_pdef = $total_stat_pdef
#@actor.base_mdef = $total_stat_mdef
@actor.str = $total_stat_tech
@actor.dex = $total_stat_crit
@actor.agi = $total_stat_agi
@actor.int = $total_stat_spr
$scene = Scene_Status.new(@actor_index)
when 1 #cancel
$game_system.se_play($data_system.cancel_se)
@alert_window.visible = false
@alertconfirm_window.active = false
@alertconfirm_window.visible = false
@confirm_window.active = true
@confirm_window.index = 0
end
end
end
end
I hope this is the right sub forum for this .
Well that aside this script basically allows you to have the players Strength as their Attack power when they have no weapons equiped isntead of magically losing all of their attack powers for having no weapon.
To use it's very simple just put it above main and look for this in the script:
WEAPON_ANIMATION_ID = 4
Then change the number 4 to the ID of the animation you want it to have when the player attacks with no weapon.
#======================================================================
========
# TDS Attack with no weapon
# Version: 1.0
# This script aliases the base_atk method and the animation2_id method.
#==============================================================================
#------------------------------------------------------------------------------
# This script allows to attack with now weapons.
#==============================================================================
# When no weapon is equiped animation ID
WEAPON_ANIMATION_ID = 4
#==============================================================================
# ** Game_Actor
#------------------------------------------------------------------------------
# This class handles the actor. It's used within the Game_Actors class
# ($game_actors) and refers to the Game_Party class ($game_party).
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# * Get Basic Attack Power
#--------------------------------------------------------------------------
alias tds_no_weapon_attack_base_atk base_atk
def base_atk
tds_no_weapon_attack_base_atk
weapon = $data_weapons[@weapon_id]
return weapon != nil ? weapon.atk : base_str
end
#--------------------------------------------------------------------------
# * Get Offensive Animation ID for Normal Attacks
#--------------------------------------------------------------------------
alias tds_no_weapon_attack_animation2_id animation2_id
def animation2_id
tds_no_weapon_attack_animation2_id
weapon = $data_weapons[@weapon_id]
return weapon != nil ? weapon.animation2_id : WEAPON_ANIMATION_ID
end
end
Battle Report
Version: 1.6
Introduction
A script that shows the battle result like in the Final Fantasy games.
Features
Scrolling down Exp
Edits:
Exp Bars filling up
Possible displaying of Facesets instead of Charactersets
Exp scrolling down faster, depending on how much exp you gain after battle.
Play a ME as long as you want in the result window.
Script:
class Game_Actor < Game_Battler
def exp=(exp)
@exp = [[exp, 9999999].min, 0].max
while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
@level += 1
# NEW - David
$d_new_skill = nil
for j in $data_classes[@class_id].learnings
if j.level == @level
learn_skill(j.skill_id)
# NEW - David
skill = $data_skills[j.skill_id]
$d_new_skill = skill.name
end
end
end
while @exp < @exp_list[@level]
@level -= 1
end
@hp = [@hp, self.maxhp].min
@sp = [@sp, self.maxsp].min
end
#--------------------------------------------------------------------------
# * Get the current EXP
#--------------------------------------------------------------------------
def now_exp
return @exp - @exp_list[@level]
end
#--------------------------------------------------------------------------
# * Get the next level's EXP
#--------------------------------------------------------------------------
def next_exp
return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
end
end
class Window_LevelUp < Window_Base
#----------------------------------------------------------------
def initialize(actor, pos)
#change this to false to show the actor's graphic
@face = false
@actor = actor
y = (pos * 120)
super(280, y, 360, 120)
self.contents = Bitmap.new(width - 32, height - 32)
self.back_opacity = 255
if $d_dum == false
refresh
end
end
#----------------------------------------------------------------
def dispose
super
end
#----------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.size = 18
if @face == true
draw_actor_face(@actor, 4, 0)
else
draw_actor_graphic(@actor, 50, 80)
end
draw_actor_name(@actor, 111, 0)
draw_actor_level(@actor, 186, 0)
show_next_exp = @actor.level == 99 ? "---" : "#{@actor.next_exp}"
min_bar = @actor.level == 99 ? 1 : @actor.now_exp
max_bar = @actor.level == 99 ? 1 : @actor.next_exp
draw_slant_bar(115, 80, min_bar, max_bar, 190, 6, bar_color = Color.new(0, 100, 0, 255), end_color = Color.new(0, 255, 0, 255))
self.contents.draw_text(115, 24, 300, 32, "Exp:#{@actor.now_exp}")
self.contents.draw_text(115, 48, 300, 32, "Level Up:" + show_next_exp)
end
#----------------------------------------------------------------
def level_up
self.contents.font.color = system_color
self.contents.draw_text(230, 48, 80, 32, "LEVEL UP!")
end
#----------------------------------------------------------------
def update
super
end
end # of Window_LevelUp
#=================================
#Window_EXP
# Written by: David Schooley
#=================================
class Window_EXP < Window_Base
#----------------------------------------------------------------
def initialize(exp)
super(0, 0, 280, 60)
self.contents = Bitmap.new(width - 32, height - 32)
self.back_opacity = 255
refresh(exp)
end
#----------------------------------------------------------------
def dispose
super
end
#----------------------------------------------------------------
def refresh(exp)
self.contents.clear
self.contents.font.color = system_color
self.contents.draw_text(0, 0, 150, 32, "Exp Earned:")
self.contents.font.color = normal_color
self.contents.draw_text(180, 0, 54, 32, exp.to_s, 2)
end
#----------------------------------------------------------------
def update
super
end
end # of Window_EXP
#=================================
#Window_Money_Items
# Written by: David Schooley
#=================================
class Window_Money_Items < Window_Base
#----------------------------------------------------------------
def initialize(money, treasures)
@treasures = treasures
super(0, 60, 280, 420)
self.contents = Bitmap.new(width - 32, height - 32)
self.back_opacity = 255
refresh(money)
end
#----------------------------------------------------------------
def dispose
super
end
#----------------------------------------------------------------
def refresh(money)
@money = money
self.contents.clear
self.contents.font.color = system_color
self.contents.draw_text(4, 4, 100, 32, "Items Found:")
self.contents.font.color = normal_color
y = 32
for item in @treasures
draw_item_name(item, 4, y)
y += 32
end
cx = contents.text_size($data_system.words.gold).width
self.contents.font.color = normal_color
self.contents.draw_text(4, 340, 220-cx-2, 32, $game_party.gold.to_s, 2)
self.contents.font.color = normal_color
self.contents.draw_text(4, 300, 220-cx-2, 32, "+ " + @money.to_s, 2)
self.contents.font.color = system_color
self.contents.draw_text(124-cx, 340, cx + 100, 32, $data_system.words.gold, 2)
end
def update
super
end
end # of Window_Money_Items
class Scene_Battle
alias raz_battle_report_main main
alias raz_battle_report_be battle_end
def main
# NEW - David
#$battle_end = false
@lvup_window = []
@show_dummies = true # Show dummy windows or not?
raz_battle_report_main
# NEW - David
@lvup_window = nil
@level_up = nil
@ch_stats = nil
@ch_compare_stats = nil
Audio.me_stop
end
def battle_end(result)
raz_battle_report_be(result)
# NEW - David
@status_window.visible = false
@spriteset.dispose
Graphics.transition
if result == 0
display_lv_up(@exp, @gold, @treasures)
loop do
Graphics.update
Input.update
if Input.trigger?(Input::C)
break
end
end
trash_lv_up
end
end
def start_phase5
@phase = 5
$game_system.me_play($game_system.battle_end_me)
$game_system.bgm_play($game_temp.map_bgm)
exp = 0
gold = 0
treasures = []
for enemy in $game_troop.enemies
unless enemy.hidden
exp += enemy.exp
gold += enemy.gold
if rand(100) < enemy.treasure_prob
if enemy.item_id > 0
treasures.push($data_items[enemy.item_id])
end
if enemy.weapon_id > 0
treasures.push($data_weapons[enemy.weapon_id])
end
if enemy.armor_id > 0
treasures.push($data_armors[enemy.armor_id])
end
end
end
end
treasures = treasures[0..5]
# NEW - David
@treasures = treasures
@exp = exp
@gold = gold
for item in treasures
case item
when RPG::Item
$game_party.gain_item(item.id, 1)
when RPG::Weapon
$game_party.gain_weapon(item.id, 1)
when RPG::Armor
$game_party.gain_armor(item.id, 1)
end
end
@phase5_wait_count = 10
end
def update_phase5
if @phase5_wait_count > 0
@phase5_wait_count -= 1
if @phase5_wait_count == 0
# NEW - David
$game_temp.battle_main_phase = false
end
return
end
# NEW - David
battle_end(0)
end
def display_lv_up(exp, gold, treasures)
$d_dum = false
d_extra = 0
i = 0
for actor in $game_party.actors
# Fill up the Lv up windows
@lvup_window[i] = Window_LevelUp.new($game_party.actors[i], i)
i += 1
end
# Make Dummies
if @show_dummies == true
$d_dum = true
for m in i..3
@lvup_window[m] = Window_LevelUp.new(m, m)
end
end
@exp_window = Window_EXP.new(exp)
@m_i_window = Window_Money_Items.new(gold, treasures)
@press_enter = nil
gainedexp = exp
@level_up = [0, 0, 0, 0]
@d_new_skill = ["", "", "", ""]
@d_breakout = false
@m_i_window.refresh(gold)
wait_for_OK
@d_remember = $game_system.bgs_memorize
Audio.bgs_play("Audio/SE/032-Switch01", 100, 300)
# NEW - David
max_exp = exp
value = 28
if exp < value
value = exp
end
if value == 0
value = 1
end
for n in 0..gainedexp - (max_exp / value)
exp -= (max_exp / value)
if @d_breakout == false
Input.update
end
for i in 0...$game_party.actors.size
actor = $game_party.actors[i]
if actor.cant_get_exp? == false
last_level = actor.level
actor.exp += (max_exp / value)
# Fill up the Lv up windows
if @d_breakout == false
@lvup_window[i].refresh
@exp_window.refresh(exp)
end
if actor.level > last_level
@level_up[i] = 5
Audio.se_play("Audio/SE/056-Right02.ogg", 70, 150)
if $d_new_skill
@d_new_skill[i] = $d_new_skill
end
end
if @level_up[i] == 0
@d_new_skill[i] = ""
end
if @level_up[i] > 0
@lvup_window[i].level_up
end
if Input.trigger?(Input::C) or exp <= 0
@d_breakout = true
end
end
if @d_breakout == false
if @level_up[i] >0
@level_up[i] -= 1
end
Graphics.update
end
end
if @d_breakout == true
for i in 0...$game_party.actors.size
actor = $game_party.actors[i]
if actor.cant_get_exp? == false
actor.exp += exp
end
end
exp = 0
break
end
end
Audio.bgs_stop
@d_remember = $game_system.bgs_restore
for i in 0...$game_party.actors.size
@lvup_window[i].refresh
end
@exp_window.refresh(exp)
Audio.se_play("Audio/SE/006-System06.ogg", 70, 150)
$game_party.gain_gold(gold)
@m_i_window.refresh(0)
Graphics.update
end
def trash_lv_up
# NEW - David
i=0
for i in 0 ... 4
@lvup_window[i].visible = false
end
@exp_window.visible = false
@m_i_window.visible = false
@lvup_window = nil
@exp_window = nil
@m_i_window = nil
end
# Wait until OK key is pressed
def wait_for_OK
loop do
Input.update
Graphics.update
if Input.trigger?(Input::C)
break
end
end
end
end
class Window_Base < Window
def draw_actor_face(actor, x, y)
bitmap = RPG::Cache.picture("Faces/" + actor.character_name)
self.contents.blt(x, y, bitmap, Rect.new(0,0,96,96))
end
#--------------------------------------------------------------------------
# * Draw Slant Bar(by SephirothSpawn)
#--------------------------------------------------------------------------
def draw_slant_bar(x, y, min, max, width = 152, height = 6,
bar_color = Color.new(150, 0, 0, 255), end_color = Color.new(255, 255, 60, 255))
# Draw Border
for i in 0..height
self.contents.fill_rect(x + i, y + height - i, width + 1, 1, Color.new(50, 50, 50, 255))
end
# Draw Background
for i in 1..(height - 1)
r = 100 * (height - i) / height + 0 * i / height
g = 100 * (height - i) / height + 0 * i / height
b = 100 * (height - i) / height + 0 * i / height
a = 255 * (height - i) / height + 255 * i / height
self.contents.fill_rect(x + i, y + height - i, width, 1, Color.new(r, b, g, a))
end
# Draws Bar
for i in 1..( (min / max.to_f) * width - 1)
for j in 1..(height - 1)
r = bar_color.red * (width - i) / width + end_color.red * i / width
g = bar_color.green * (width - i) / width + end_color.green * i / width
b = bar_color.blue * (width - i) / width + end_color.blue * i / width
a = bar_color.alpha * (width - i) / width + end_color.alpha * i / width
self.contents.fill_rect(x + i + j, y + height - j, 1, 1, Color.new(r, g, b, a))
end
end
end
end
Instructions
Place this script above main. Make a folder in the pictures folder and call it Faces. When using a face picture, make sure it's named like the character's file. To turn facesets on search for @face = false and set it to true to turn facesets on.
FAQ
None yet.
Compatibility
May be incompatible with your CBS.
Is incompatible with Cogwheels RTAB script and please don't ask it to be merged, as I won't do it.
Credits and Thanks
I only want to say that this script was made by illustrationism not by me.
I only made the edits.
Thanks to neonshadow for fixing a bug.
This post has been edited by Raziel: Sep 13 2006, 03:17 PM
not sure if this already exists here.
if it does please just delete this topic or something.
i found this great script for up to 99 save slots on xp!
just replace Scene_File with this.
class Scene_File
SAVEFILE_MAX = 99
# -------------------
def initialize(help_text)
@help_text = help_text
end
# -------------------
def main
@help_window = Window_Help.new
@help_window.set_text(@help_text)
@savefile_windows = []
@cursor_displace = 0
for i in 0..3
@savefile_windows.push(Window_SaveFile.new(i, make_filename(i), i))
end
@file_index = 0
@savefile_windows[@file_index].selected = true
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@help_window.dispose
for i in @savefile_windows
i.dispose
end
end
# -------------------
def update
@help_window.update
for i in @savefile_windows
i.update
end
if Input.trigger?(Input::C)
on_decision(make_filename(@file_index))
$game_temp.last_file_index = @file_index
return
end
if Input.trigger?(Input::B)
on_cancel
return
end
if Input.repeat?(Input::DOWN)
if Input.trigger?(Input::DOWN) or @file_index < SAVEFILE_MAX - 1
if @file_index == SAVEFILE_MAX - 1
$game_system.se_play($data_system.buzzer_se)
return
end
@cursor_displace += 1
if @cursor_displace == 4
@cursor_displace = 3
for i in @savefile_windows
i.dispose
end
@savefile_windows = []
for i in 0..3
f = i - 2 + @file_index
name = make_filename(f)
@savefile_windows.push(Window_SaveFile.new(f, name, i))
@savefile_windows[i].selected = false
end
end
$game_system.se_play($data_system.cursor_se)
@file_index = (@file_index + 1)
if @file_index == SAVEFILE_MAX
@file_index = SAVEFILE_MAX - 1
end
for i in 0..3
@savefile_windows[i].selected = false
end
@savefile_windows[@cursor_displace].selected = true
return
end
end
if Input.repeat?(Input::UP)
if Input.trigger?(Input::UP) or @file_index > 0
if @file_index == 0
$game_system.se_play($data_system.buzzer_se)
return
end
@cursor_displace -= 1
if @cursor_displace == -1
@cursor_displace = 0
for i in @savefile_windows
i.dispose
end
@savefile_windows = []
for i in 0..3
f = i - 1 + @file_index
name = make_filename(f)
@savefile_windows.push(Window_SaveFile.new(f, name, i))
@savefile_windows[i].selected = false
end
end
$game_system.se_play($data_system.cursor_se)
@file_index = (@file_index - 1)
if @file_index == -1
@file_index = 0
end
for i in 0..3
@savefile_windows[i].selected = false
end
@savefile_windows[@cursor_displace].selected = true
return
end
end
end
# -------------------
def make_filename(file_index)
return "Save#{file_index + 1}.rxdata"
end
# -------------------
end
and replace the Window_SaveFile initialize method with this
you can edit the 99 part in the first script to however many save slots you want.
remember!
this is not mine, i simply found this!
should work with almost everything ive tried!
Instructions
Very simple really, just paste the script right above main and thats it XD
Also, you must go into your database and put the name of the item before the description e.g. "Potion: Heals character by 500". In the end i thought it would be more beneficial to make it like this rather then call upon another window to display the name.
#==============================================================================
# Icon Inventory System - Scripted By Mac
#------------------------------------------------------------------------------
# This window displays the Icons and the amount of the item you have.
#==============================================================================
class Window_Item < Window_Selectable
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(0, 63, 640, 417)
@column_max = 10
refresh
self.index = 0
# If in battle, move window to center of screen
# and make it semi-transparent
if $game_temp.in_battle
self.y = 64
self.height = 256
self.back_opacity = 160
end
end
#--------------------------------------------------------------------------
# * Get Item
#--------------------------------------------------------------------------
def item
return @data[self.index]
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
# Add item
for i in 1...$data_items.size
if $game_party.item_number(i) > 0
@data.push($data_items[i])
end
end
# Also add weapons and items if outside of battle
unless $game_temp.in_battle
for i in 1...$data_weapons.size
if $game_party.weapon_number(i) > 0
@data.push($data_weapons[i])
end
end
for i in 1...$data_armors.size
if $game_party.armor_number(i) > 0
@data.push($data_armors[i])
end
end
end
# If item count is not 0, make a bit map and draw all items
@item_max = @data.size
if @item_max > 0
self.contents = Bitmap.new(width - 32, row_max * 32)
for i in 0...@item_max
draw_item(i)
end
end
end
#--------------------------------------------------------------------------
# * Draw Item
# index : item number
#--------------------------------------------------------------------------
def draw_item(index)
item = @data[index]
case item
when RPG::Item
number = $game_party.item_number(item.id)
when RPG::Weapon
number = $game_party.weapon_number(item.id)
when RPG::Armor
number = $game_party.armor_number(item.id)
end
if item.is_a?(RPG::Item) and
$game_party.item_can_use?(item.id)
self.contents.font.color = normal_color
else
self.contents.font.color = disabled_color
end
x = 4 + index % 10 * (32 + 32)
y = index / 10 * 32
rect = Rect.new(x, y, self.width / @column_max - 32, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
bitmap = RPG::Cache.icon(item.icon_name)
opacity = self.contents.font.color == normal_color ? 255 : 128
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
self.contents.draw_text(x, y + 9, 24, 32, number.to_s, 2)
end
#--------------------------------------------------------------------------
# * Help Text Update
#--------------------------------------------------------------------------
def update_help
@help_window.set_text(self.item == nil ? "" : self.item.description)
end
end
Credits
Me! XD
by Near Fantastica & Fuso
Credit due: Fuso made the main part of this script all I did was make it work… Fuso needs as much credit or more then I do for this script…
Features:
NO MORE CUSTOM MOVEMENTS ~! This script uses path finding to return the shortest path from the START XY to the END XY then uses the custom movement to move the character… You can chain this path finds together to path link between 2 points or more...
As well an Error message will be displayed if you try to send an event to a place it can not get to…. “Target Is Unreachable for Event ID�
index = the index of the event
repeat = set the repeat flag to true and the define movement will repeat false it will not repeat..
skippable = set skippable flag to true and the event will move ever when blocked
NOTE : This is not wanted in must cases that is why its defaulted to false
repeat = set the repeat flag to true and the define movement will repeat false it will not repeat..
skippable = set skippable flag to true and the event will move ever when blocked
NOTE : This is not wanted in must cases that is why its defaulted to false
src_x = source x
src_y = source y
trg_x = target x
trg_y = target y
How to use:
You need to setup a movement event before you can add a path or commands this is done with the $AEMS.setup(index, repeat) command then you can add a command or a path this is done by $AEMS.add_command(index, code, parameters = []) or $AEMS.add_paths(index, src_x, src_y, trg_x, trg_y) commands. Now you can add as many commands and paths as you want to event by adding more of these… this is called path linking… then when you are ready to start the movement use $AEMS.start_movement(index)
Now this can be done in 2 places in the events command window or in the custom movement of an event. If you do it in the movement window to start use this
return $AEMS.start_movement(index) or the code will not work right…
As well I found out something interesting if you have a repeating movement event using this movement with a defined wait the wait will repeat everytime… but if you add a normal move event wait it will only operate once… this can be a good things to add this delay so not all the events start at once yet do not repeat that wait later…
#======================================
# â–� Advanced Event Movement System
#------------------------------------------------------------------------------
#  By: Near Fantastica
# Date: 23/3/05
#
# Advanced Event Movement using Path Fiding and the Game
# Characters force_move_route method
#======================================
class AEMS
#--------------------------------------------------------------------------
def initialize
@event_route = []
@player_route = nil
end
#--------------------------------------------------------------------------
def setup_event(index, repeat, skippable = false)
@event_route[index] = RPG::MoveRoute.new
@event_route[index].repeat = repeat
@event_route[index].skippable = skippable
@event_route[index].list.clear
end
#--------------------------------------------------------------------------
def add_command_event(index, code, parameters = [])
@event_route[index].list.push RPG::MoveCommand.new(code,parameters)
end
#--------------------------------------------------------------------------
def start_movement_event(index)
@event_route[index].list.push RPG::MoveCommand.new(0)
$game_map.events[index].move_route = @event_route[index]
$game_map.events[index].move_route_index = 0
end
#--------------------------------------------------------------------------
def add_paths_event(index, src_x,src_y,trg_x,trg_y)
paths = $game_map.find_short_paths(src_x,src_y,trg_x,trg_y)
if paths == nil
print "Target Is Unreachable for Event " + index.to_s
return
end
for i in 0...paths.size
case paths[i]
when 2
@event_route[index].list.push RPG::MoveCommand.new(4)
when 4
@event_route[index].list.push RPG::MoveCommand.new(2)
when 6
@event_route[index].list.push RPG::MoveCommand.new(3)
when 8
@event_route[index].list.push RPG::MoveCommand.new(1)
end
end
end
#--------------------------------------------------------------------------
def setup_player(repeat, skippable = false)
@player_route = RPG::MoveRoute.new
@player_route.repeat = repeat
@player_route.skippable = skippable
@player_route.list.clear
end
#--------------------------------------------------------------------------
def add_command_player(code, parameters = [])
@player_route.list.push RPG::MoveCommand.new(code,parameters)
end
#--------------------------------------------------------------------------
def start_movement_player
@player_route.list.push RPG::MoveCommand.new(0)
$game_player.move_route = @player_route
$game_player.move_route_index = 0
end
#--------------------------------------------------------------------------
def add_paths_player(src_x,src_y,trg_x,trg_y)
paths = $game_map.find_short_paths(src_x,src_y,trg_x,trg_y)
if paths == nil
print "Target Is Unreachable for Player "
return
end
for i in 0...paths.size
case paths[i]
when 2
@player_route.list.push RPG::MoveCommand.new(4)
when 4
@player_route.list.push RPG::MoveCommand.new(2)
when 6
@player_route.list.push RPG::MoveCommand.new(3)
when 8
@player_route.list.push RPG::MoveCommand.new(1)
end
end
end
end
#======================================
# â–� Path Finding
#------------------------------------------------------------------------------
#  By: Fuso
#======================================
class Game_Map
#--------------------------------------------------------------------------
attr_accessor :events
#--------------------------------------------------------------------------
def initialize
@events = {}
end
#--------------------------------------------------------------------------
UP = 2
LEFT = 4
RIGHT = 6
DOWN = 8
#--------------------------------------------------------------------------
def find_short_paths(src_x,src_y,trg_x,trg_y,depth = 100, self_event = nil, option_close = false)
return [] if not (passable?(trg_x, trg_y, UP, self_event) or
passable?(trg_x, trg_y, LEFT, self_event) or
passable?(trg_x, trg_y, RIGHT, self_event) or
passable?(trg_x, trg_y, DOWN, self_event))
# Paths will hold the succeeding paths.
paths = []
# path_map will hold what paths has already been visited, to prevent that we attempt to
# walk on the same tile twice.
path_map = [src_x + src_y / 10000.0]
trackers = []
new_trackers = [[src_x, src_y, []]]
if not option_close
depth.times {
trackers = new_trackers
new_trackers = []
for tracker in trackers
if tracker[0] == trg_x and tracker[1] == trg_y
paths.push tracker[2].compact
next
end
path_map.push tracker[0] + tracker[1] / 10000.0
if passable?(tracker[0], tracker[1], DOWN, self_event) and
passable?(tracker[0], tracker[1] - 1, UP) and
not path_map.include? tracker[0] + (tracker[1] - 1) / 10000.0
path_map.push tracker[0] + (tracker[1] - 1) / 10000.0
new_trackers.push [tracker[0], tracker[1] - 1, [tracker[2], UP].flatten]
end
if passable?(tracker[0], tracker[1], RIGHT, self_event) and
passable?(tracker[0] - 1, tracker[1], LEFT) and
not path_map.include? tracker[0] - 1 + tracker[1] / 10000.0
path_map.push tracker[0] - 1 + tracker[1] / 10000.0
new_trackers.push [tracker[0] - 1, tracker[1], [tracker[2], LEFT].flatten]
end
if passable?(tracker[0], tracker[1], LEFT, self_event) and
passable?(tracker[0] + 1, tracker[1], RIGHT) and
not path_map.include? tracker[0] + 1 + tracker[1] / 10000.0
path_map.push tracker[0] + 1 + tracker[1] / 10000.0
new_trackers.push [tracker[0] + 1, tracker[1], [tracker[2], RIGHT].flatten]
end
if passable?(tracker[0], tracker[1], UP, self_event) and
passable?(tracker[0], tracker[1] + 1, DOWN) and
not path_map.include? tracker[0] + (tracker[1] + 1) / 10000.0
path_map.push tracker[0] + (tracker[1] + 1) / 10000.0
new_trackers.push [tracker[0], tracker[1] + 1, [tracker[2], DOWN].flatten]
end
end
break if paths.size > 0
}
else
paths_distance = 10000 ** 2 * 2
depth.times {
trackers = new_trackers
new_trackers = []
for tracker in trackers
if tracker[0] == trg_x and tracker[1] == trg_y
if paths_distance > 0
paths_distance = 0
paths.clear
end
paths.push tracker[2].compact
next
end
distance = (tracker[0] - trg_x) ** 2 + (tracker[1] - trg_y) ** 2
if distance <= paths_distance
if distance < paths_distance
paths.clear
paths_distance = distance
end
paths.push tracker[2].compact
end
path_map.push tracker[0] + tracker[1] / 10000.0
if passable?(tracker[0], tracker[1], DOWN, self_event) and
passable?(tracker[0], tracker[1] - 1, UP) and
not path_map.include? tracker[0] + (tracker[1] - 1) / 10000.0
path_map.push tracker[0] + (tracker[1] - 1) / 10000.0
new_trackers.push [tracker[0], tracker[1] - 1, [tracker[2], UP].flatten]
end
if passable?(tracker[0], tracker[1], RIGHT, self_event) and
passable?(tracker[0] - 1, tracker[1], LEFT) and
not path_map.include? tracker[0] - 1 + tracker[1] / 10000.0
path_map.push tracker[0] - 1 + tracker[1] / 10000.0
new_trackers.push [tracker[0] - 1, tracker[1], [tracker[2], LEFT].flatten]
end
if passable?(tracker[0], tracker[1], LEFT, self_event) and
passable?(tracker[0] + 1, tracker[1], RIGHT) and
not path_map.include? tracker[0] + 1 + tracker[1] / 10000.0
path_map.push tracker[0] + 1 + tracker[1] / 10000.0
new_trackers.push [tracker[0] + 1, tracker[1], [tracker[2], RIGHT].flatten]
end
if passable?(tracker[0], tracker[1], UP, self_event) and
passable?(tracker[0], tracker[1] + 1, DOWN) and
not path_map.include? tracker[0] + (tracker[1] + 1) / 10000.0
path_map.push tracker[0] + (tracker[1] + 1) / 10000.0
new_trackers.push [tracker[0], tracker[1] + 1, [tracker[2], DOWN].flatten]
end
end
break if distance == 0 and paths.size > 0
}
end
route = paths[0]
return route
end
end
#======================================
class Scene_Title
#--------------------------------------------------------------------------
alias aems_scene_title_update update
#--------------------------------------------------------------------------
def update
$AEMS = AEMS.new
aems_scene_title_update
end
end
#======================================
class Game_Character
attr_accessor :move_route
attr_accessor :move_route_index
end
Geändert von Jerome Denis Andre (20.08.2007 um 14:06 Uhr)