Wie wärs,indem wir einfach einen News Thread für Skripte eröffnen. Immer wenn ein User ein interessantes Script entdeckt, kann er ja eine News mit Link reinschreiben. Es ist immer wieder eine Schinderei ,sich auf allen Seiten stundenlang umschauen zu müssen.
...
Man könnte einen extra Vorstellthread erstellen, wo dann wirklich nur Scripte vorgestellt werden.
Alle anderen Posts sollten in einen seperaten Diskussionsthread verschoben werden (bzw. gleich in diesen gepostet werden).
Dass wäre zwar sehr übersichtlich, aber würde dann darauf hinausaufen, dass es in diesem Unterforum nur diese zwei Threads gibt.
Wäre es dann nicht gleich besser ein Skrit-biete-Forum und ein allgemeines RGSS-Fragen-Forum zu machen?
Aber bitte kein Script-suche/biete-Forum, denn dann gehen die Scripte wieder zwischen den ganzen Anfragen unter.
Ich denke, daß größte Problem dieses Threads war es, daß kein Moderator ihn genau kontrolliert hat und der Threadersteller eben keine Möglichkeit hatte ihn entsprechend zu moderieren.
Vom Konzept her sollten hier nur Skripte rein, die man wirklich als "Pflicht" oder eben Standard ansehen kann, was mMn nur einige wenige sind. Tatsächlich wurde der Thread aber dazu gebraucht alle möglichen interessanten Skripte zu posten, sowie alle möglichen Fragen rund um diese Skripte zu stellen.
Zitat
Wie wärs,indem wir einfach einen News Thread für Skripte eröffnen. Immer wenn ein User ein interessantes Script entdeckt, kann er ja eine News mit Link reinschreiben. Es ist immer wieder eine Schinderei ,sich auf allen Seiten stundenlang umschauen zu müssen.
...
Gott, bitte nein. Es gibt viele Skripte die an den verschiedensten Stellen vorgestellt wurden, wenn wir so einen News-Thread haben wird es mMn zwangsläufig dazu führen, daß viele Skripte mehrfach vorgestellt werden weil der eine es im Forum A entdeckt hat und der andere aber im Forum B und keiner der User genügend Ruby-Kentnisse oder Lust hatte zu überprüfen ob es nicht eventuell dieselben Skripte sind.
Was Sinn machen würde wäre ein Übersichtsthread wo wichtige Links zusammen gefasst werden. Das könnten Links der Kategorie "Wie lerne ich Ruby/RGSS?" sein, große XP-Seiten auf denen es viele Skripte gibt, sowie eventuell direkte Skript-Links zu Skripten die extrem oft nachgefragt werden (Vollbild zB). Das wichtigste wäre hier aber, daß sich ein Moderator um diesen Thread kümmert, damit der Thread nicht nur gepinnt, sondern auch geschlossen wird und dabei dennoch beizeiten aktualisiert wird.
(Eigenwerbung: Im Quartier haben wir einen solchen Thread, der zeigt wie ich mir das vorstelle Klick mich!)
Von Skriptvorstellungen gefundener Skripte halte ich sowieso relativ wenig, es sei denn es ist wirklich ein exotisches/besonderes Skript und die Quelle ist recht unbekannt (irgend eine japanische seite zB). Wenn aber jeder meint die neuste Menü-änderung von rmxp.org hier vorstellen zu müssen, geht die Übersicht sowieso direkt wieder flöten.
Zitat
Bitte nicht. Links haben gerne mal die Angewohnheit zu toten Links zu werden und es macht keinen Spaß sich durch 50 tote Links zu klicken, das habe ich bei XP-Scripten oft genug erlebt.
...
Was daran lag, daß rmxp.net die bekannteste und größte englische Skript-quelle massive Hoster/Domain-Probleme hatte und auch rmxp.org die Nachfolgeseite oft unter Hackerangriffen und Ausfällen zu leiden hatte. Wenn wir auf Links verzichten und die Skripte direkt posten geht mit Sicherheit irgendwo und irgendwann die ursprüngliche Quelle unter.
Zitat
Dass wäre zwar sehr übersichtlich, aber würde dann darauf hinausaufen, dass es in diesem Unterforum nur diese zwei Threads gibt.
Wäre es dann nicht gleich besser ein Skrit-biete-Forum und ein allgemeines RGSS-Fragen-Forum zu machen?
Aber bitte kein Script-suche/biete-Forum, denn dann gehen die Scripte wieder zwischen den ganzen Anfragen unter.
...
Ich habe nicht das Gefühl, daß in diesem Forum irgend ein Thread in einer Flut von Anfragen untergeht. Im Vergleich zum anderen Technick-Forum ist hier sogar relativ wenig los, irgend eine Aufspaltung oder Einführung weiterer Unterforen wäre unsinniger Overkill.
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)
Darf man vielleicht fragen wohin das Ringmenüscript gehört???
Ausserdem Schätze ich haben sich einige Buchstaben in Zeichen verwandelt.
Der Link darüber funktioniert nicht und genauso wie das 99 SaveSlots script.
Darf man vielleicht fragen wohin das Ringmenüscript gehört???
Ausserdem Schätze ich haben sich einige Buchstaben in Zeichen verwandelt.
Der Link darüber funktioniert nicht und genauso wie das 99 SaveSlots script.
...
Das Saveslot-Skript funktioniert. Man muss nur die Anweisungen befolgen und es richtig einfügen.
Ich weiß, dass das hier kein Diskussionstheard ist und ich hoffe es ist nicht all zu schlimm, dass ich jetzt frage.
Ich habe das 99 Speicherslotskript ausprobiert und es funktioniert auch soweit. Allerdings werden jetzt keine Bezeichnungen, wie File 1;2;3 usw. mehr angezeigt und die Spielzeit fehlt auch. Ich weiß nicht woran das liegen könnte, weil es laut Skript, glaube ich, doch eigentlich angezeitgt werden sollte. Ich hoffe mir kann jemand helfen.
Gut es ist nicht lebensnotwendig aber hier hab ich mal das Skript vom sogenannten...
=begin
Mode07 on the Map!
Includes:
Mode07 v0.6
Overworld Sprite Resize
Written by mewsterus
Special Thanks:
Fanha Giang (for a reverse engineered Tilemap class)
--------------------------------------------------------------------------------
Instructions:
--------------------------------------------------------------------------------
To install, just insert this in a descriptive code slot right above Main.
This is different than previous instructions; please read the next paragraph.
If you had a previous install of this script and need an original version of
Spriteset_Map, one can be found at:
http://www.rpg-palace.com/scripts/spriteset_map.txt
To activate Mode07, add [#XX] to the map's name, replacing XX with the
percentage of Mode07 to apply. Greater numbers will result in a more slanted
world.
To activate overworld sprite resize, add [OV] to the map's name. This will make
sprites smaller on that map.
For the purposes of location scripts, these identifiers will not appear.
Examples:
"Overworld[#40]" will result in a slant identical to the second screenshot.
"Underworld[OV]" will resize only the player character to a small size, as if
seen from high above.
"Atthelevelworld[OV][#12]" will result in the player being resized, and a modest
slant of 12%
"JustPlainWorld" will result in the same old map you've always seen.
To add a sky, simply use the panorama with the tileset. Also, events will not
be drawn flat with the map. Any vertical objects such as trees should be put
in events and displayed that way.
You can also add a sky by adding a fog. If you add this, you can make it look
like the first screenshot.
A note on the $strip_size variable; the default value is 8, however there is
extremely minimal, almost nonexistant lag with 16. The screen is extremely
smooth with 4, or even 2. If you're having major problems with lag, you may
need to use 32, but it won't look too pretty.
--------------------------------------------------------------------------------
* Draw_Tilemap v1.72-0.6
Fanha Giang, 02/12/2006 (mm/dd/yyyy)
Edited for Mode07 by mewsterus 08/08/2006 (mm/dd/yyyy)
=end
#===============================================================================
$width = 640 # Screen width (will not change resolution,
$height = 480 # Screen height here for compatibility)
$ov_zoom = 0.6 # Overworld zoom multiplier
$strip_size = 8 # Size of each strip of the map. Higher numbers will lag less.
# Recommended that this number be a power of 2.
# Do not make higher than 64.
$curve = true # Whether the map is curled, for overworlds (old method)
$data_map = load_data("Data/MapInfos.rxdata")
#===============================================================================
class RPG::MapInfo
def name # Definition prevents location scripts from reading anything within
return @name.gsub(/\[.*\]/) {""} # brackets, including the brackets
end
#-----------------------------------------------------------------------------
def original_name
return @name
end
#-----------------------------------------------------------------------------
def overworld?
return @name.scan(/[OV]/).size > 0
end
#-----------------------------------------------------------------------------
def pitch
@name =~ /\[#[ ]*([00-99]+)\]/i
return $1
end
end
#===============================================================================
class Draw_Tilemap # This class controls a set of sprites, with different Z
# values, arranged into horizontal bars
attr_accessor :tileset
attr_accessor :map_data
attr_accessor :priorities
attr_accessor :autotiles
attr_accessor :bitmaps
attr_accessor :pitch
attr_accessor :ox
attr_accessor :oy
attr_accessor :plus_y
INDEX = # Autotile definitions
[
26, 27, 32, 33, 4, 27, 32, 33, 26, 5, 32, 33, 4, 5, 32, 33,
26, 27, 32, 11, 4, 27, 32, 11, 26, 5, 32, 11, 4, 5, 32, 11,
26, 27, 10, 33, 4, 27, 10, 33, 26, 5, 10, 33, 4, 5, 10, 33,
26, 27, 10, 11, 4, 27, 10, 11, 26, 5, 10, 11, 4, 5, 10, 11,
24, 25, 30, 31, 24, 5, 30, 31, 24, 25, 30, 11, 24, 5, 30, 11,
14, 15, 20, 21, 14, 15, 20, 11, 14, 15, 10, 21, 14, 15, 10, 11,
28, 29, 34, 35, 28, 29, 10, 35, 4, 29, 34, 35, 4, 29, 10, 35,
38, 39, 44, 45, 4, 39, 44, 45, 38, 5, 44, 45, 4, 5, 44, 45,
24, 29, 30, 35, 14, 15, 44, 45, 12, 13, 18 ,19, 12, 13, 18, 11,
16, 17, 22, 23, 16, 17, 10, 23, 40, 41, 46, 47, 4, 41, 46, 47,
36, 37, 42, 43, 36, 5, 42, 43, 12, 17, 18, 23, 12, 13, 42, 43,
36, 41, 42, 47, 16, 17, 46, 47, 12, 17, 42, 47, 0, 1, 6, 7
]
X = [0, 1, 0, 1] # Used in 16x16 autotile drawing; left, right, left, right
Y = [0, 0, 1, 1] # Used in 16x16 autotile drawing; up, up, down, down
#-----------------------------------------------------------------------------
def initialize
# Get initial data from Game_Map
@tileset = RPG::Cache.tileset($game_map.tileset_name)
@map_data = $game_map.data
@priorities = $game_map.priorities
@autotiles = []
for i in 0..6
@autotiles[i] = RPG::Cache.autotile($game_map.autotile_names[i])
end
# Provide blank data in proper object form
@ox = 0
@oy = 0
# Bitmaps used for each priority's drawing. Priorities 2-5 are combined.
@bitmaps = [Bitmap.new($game_map.width*32, $game_map.height*32+$strip_size),
Bitmap.new($game_map.width*32, $game_map.height*32+$strip_size),
Bitmap.new($game_map.width*32, $game_map.height*32+$strip_size)]
# Generate blank sprites
@sprites = [[], [], []]
for i in 0..2 # For each layer
for j in 0..$game_map.height * (32 / $strip_size) - 1
# For each horizontal strip of $strip_size height, make a blank sprite
@sprites[i].push(Sprite.new)
@sprites[i][j].bitmap = Bitmap.new($game_map.width*32, $strip_size*2)
@sprites[i][j].x = $width / 2
@sprites[i][j].y = -64
@sprites[i][j].z = -5 + (i * 10)
end
end
@disposed = false
draw
end
#-----------------------------------------------------------------------------
def update
# Retrieve variable values for slant drawing; these values accesible by event
@pitch = $game_map.pitch.to_f
@plus_y = $game_map.plus_y
for i in 0..2 # For each layer
for j in [0, (($height / 2) - (($height * 60) /
@pitch) + @oy) / $strip_size].max.to_i..[@sprites[i].size - 1,
(@oy + $height) / $strip_size].min.to_i
# For each strip within the visible screen, update OX/Y
@sprites[i][j].x = $width / 2
@sprites[i][j].y = j * $strip_size - @oy
unless @pitch == 0 # Apply X Zoom
@sprites[i][j].zoom_x = (@sprites[i][j].y - $height / 2) *
(@pitch / ($height * 25)) + 1
if $curve # Zoom Y values same as X, and compensate
@sprites[i][j].zoom_y = @sprites[i][j].zoom_x
@sprites[i][j].y += $strip_size * (1 - @sprites[i][j].zoom_y) *
((1 - @sprites[i][j].zoom_y) /
(2 * ((@pitch / 100) /
($height / ($strip_size * 2)))) + 0.5)
end
end
@sprites[i][j].ox = @ox + $width / 2
# Add plus_y value; used in airship script
@sprites[i][j].y += @plus_y
end
end
end
#-----------------------------------------------------------------------------
def dispose
# Dispose all sprites
for i in 0..2
for j in @sprites[i]
j.bitmap.dispose
j.dispose
end
end
for i in @bitmaps
i.dispose
end
@tileset.dispose
for i in 0..6
@autotiles[i].dispose
end
@disposed = true
end
#-----------------------------------------------------------------------------
def disposed?
return @disposed
end
#-----------------------------------------------------------------------------
def draw
# Draw each individual position by XY value
for x in 0...@map_data.xsize
for y in 0...@map_data.ysize
draw_position(x, y)
end
end
for i in 0..2 # For each priority
for j in 0..@sprites[i].size - 1
# For each horizontal strip, transfer the bitmap appropriately
@sprites[i][j].bitmap.blt(0, 0, @bitmaps[i],
Rect.new(0, j * $strip_size, $game_map.width * 32, $strip_size * 2))
end
end
end
#-----------------------------------------------------------------------------
def draw_position(x, y)
for layer in 0..2
pos = @map_data[x, y, layer]
@priorities[pos] = 2 if @priorities[pos] > 2 # Round priorities down to 2
if pos >= 384 # If it is a tile
# src_rect = 32x32 Rect on the tileset for source bitmap
src_rect = Rect.new(((pos-384)%8)*32, ((pos-384)/8)*32, 32, 32)
# Transfer source bitmap on the tileset to the current map tile
@bitmaps[@priorities[pos]].blt(x * 32, y * 32, @tileset, src_rect)
elsif pos >= 48 and pos < 384 # If it is an autotile
id = pos / 48 - 1 # Which autotile is used (0-6)
# plus_x is in development for animated autotiles
plus_x = 0 #((@anim / 4) % (@autotiles[id].width / 96)) * 96
for corner in 0..3
h = 4 * (pos % 48) + corner # Used to access INDEX
# src_rect = 16x16 Rect on the autotile for source bitmap
src_rect = Rect.new((INDEX[h]%6)*16+plus_x, (INDEX[h]/6)*16, 16, 16)
# Transfer source bitmap on the autotile to the current 16x16 tile
@bitmaps[@priorities[pos]].blt(x*32+X[corner]*16, y*32+Y[corner]*16,
@autotiles[id], src_rect)
end
end
end
end
end
#===============================================================================
class Game_Map
attr_accessor :pitch
attr_accessor :plus_y
#-----------------------------------------------------------------------------
alias setup_or :setup
def setup(map_id)
setup_or(map_id)
@pitch = $data_map[$game_map.map_id].pitch
@plus_y = 0
end
#-----------------------------------------------------------------------------
def name
return $data_map[@map_id].name
end
end
#===============================================================================
class Sprite_Character < RPG::Sprite
attr_accessor :character
#-----------------------------------------------------------------------------
def initialize(character = nil)
super()
@character = character
update
end
#-----------------------------------------------------------------------------
alias update_or :update
def update
update_or
# Update pitch value, and update zoom values to match
@pitch = $data_map[$game_map.map_id].pitch.to_f
self.zoom_x =
self.zoom_y = ((@character.screen_y - 16) - ($height / 2)) *
(@pitch / ($height * 25)) + 1
# Set sprite coordinates. X value is multiplied by zoom value from the center
self.x = ($width / 2) + ((@character.screen_x - ($width / 2)) * self.zoom_x)
self.y = @character.screen_y
# Add Y value for zoom compensation while in curve mode
if $curve and @pitch != 0
self.y += (8 * (1 - self.zoom_y) * ((1 - self.zoom_y) /
(2 * ((@pitch / 100) / ($height / 16.0))) + 0.5))
end
# Add plus_y value; used in airship script
self.y += $game_map.plus_y unless @character.is_a?(Game_Player)
self.z = @character.screen_z(@ch) - (self.zoom_y < 0.5 ? 1000 : 0)
if $data_map[$game_map.map_id].overworld? and
@character.is_a?(Game_Player) # Multiply zoom by Overworld factor if
self.zoom_x *= $ov_zoom # the map is marked with [OV] and event
self.zoom_y *= $ov_zoom # is a Game_Player
end
end
end
#===============================================================================
class Spriteset_Map
def initialize
# Make viewports
@viewport1 = Viewport.new(0, 0, 640, 480)
@viewport2 = Viewport.new(0, 0, 640, 480)
@viewport3 = Viewport.new(0, 0, 640, 480)
@viewport2.z = 2000
@viewport3.z = 5000
# Make tilemap
@tilemap = Draw_Tilemap.new
# Make panorama plane
@panorama = Plane.new
@panorama.z = -2000
# Make fog plane
@fog = Plane.new
@fog.z = 3000
# Make character sprites
@character_sprites = []
for i in $game_map.events.keys.sort
sprite = Sprite_Character.new($game_map.events[i])
@character_sprites.push(sprite)
end
@character_sprites.push(Sprite_Character.new($game_player))
# Make weather
@weather = RPG::Weather.new(@viewport1)
# Make picture sprites
@picture_sprites = []
for i in 1..50
@picture_sprites.push(Sprite_Picture.new(@viewport2,
$game_screen.pictures[i]))
end
# Make timer sprite
@timer_sprite = Sprite_Timer.new
# Frame update
update
end
#-----------------------------------------------------------------------------
def dispose
# Dispose of tilemap
@tilemap.dispose
# Dispose of panorama plane
@panorama.dispose
# Dispose of fog plane
@fog.dispose
# Dispose of character sprites
for sprite in @character_sprites
sprite.dispose
end
# Dispose of weather
@weather.dispose
# Dispose of picture sprites
for sprite in @picture_sprites
sprite.dispose
end
# Dispose of timer sprite
@timer_sprite.dispose
# Dispose of viewports
@viewport1.dispose
@viewport2.dispose
@viewport3.dispose
end
end
wow leute also ich muss sagen dass das hier ja der reine wahnsinn ist!
diese ganzen scripte sind echt hammer und bin froh dass ihr die hier veröffentlicht!
was würde ich nur ohne euch tun?
Um gute Scripts zu erstellen, braucht man häufig nicht Ruby!!!
Ich habe ein Spiel mit einem Vorspann und animiertem Titel.
Der Trick:
Das sind beides Karten!!!
Bei scenen_Titel gibt es eine Zeile, wo steht:
If Imput C.
Im Klartext:
Wenn Enter gedrückt worden ist.
Jetzt läuft es Automatisch ab.
Es gibt aber noch ein Problen.
Wenn es eine Save.DateiX im Ordner gibt,
ist die Start-Auswahl 1.
Dann habe ich überall Scene_Load.new durch Scene_Game.new erstetz...
Die Karte habe ich dann mit Conditional Branch und Script erstellt...
Der Rest ist euch überlassen!!!
Dies ist ein gutes Beispiel für Change-not-All-by-Adrian2000
Am Ende sieht es genau so aus:
[PHP]
#==============================================================================
# ■ Scene_Title
#------------------------------------------------------------------------------
# タイトル画面の処理を行うクラスです。
#==============================================================================
Gut es ist nicht lebensnotwendig aber hier hab ich mal das Skript vom sogenannten...
=begin
Mode07 on the Map!
Includes:
Mode07 v0.6
Overworld Sprite Resize
Written by mewsterus
Special Thanks:
Fanha Giang (for a reverse engineered Tilemap class)
--------------------------------------------------------------------------------
Instructions:
--------------------------------------------------------------------------------
To install, just insert this in a descriptive code slot right above Main.
This is different than previous instructions; please read the next paragraph.
If you had a previous install of this script and need an original version of
Spriteset_Map, one can be found at:
http://www.rpg-palace.com/scripts/spriteset_map.txt
To activate Mode07, add [#XX] to the map's name, replacing XX with the
percentage of Mode07 to apply. Greater numbers will result in a more slanted
world.
To activate overworld sprite resize, add [OV] to the map's name. This will make
sprites smaller on that map.
For the purposes of location scripts, these identifiers will not appear.
Examples:
"Overworld[#40]" will result in a slant identical to the second screenshot.
"Underworld[OV]" will resize only the player character to a small size, as if
seen from high above.
"Atthelevelworld[OV][#12]" will result in the player being resized, and a modest
slant of 12%
"JustPlainWorld" will result in the same old map you've always seen.
To add a sky, simply use the panorama with the tileset. Also, events will not
be drawn flat with the map. Any vertical objects such as trees should be put
in events and displayed that way.
You can also add a sky by adding a fog. If you add this, you can make it look
like the first screenshot.
A note on the $strip_size variable; the default value is 8, however there is
extremely minimal, almost nonexistant lag with 16. The screen is extremely
smooth with 4, or even 2. If you're having major problems with lag, you may
need to use 32, but it won't look too pretty.
--------------------------------------------------------------------------------
* Draw_Tilemap v1.72-0.6
Fanha Giang, 02/12/2006 (mm/dd/yyyy)
Edited for Mode07 by mewsterus 08/08/2006 (mm/dd/yyyy)
=end
#===============================================================================
$width = 640 # Screen width (will not change resolution,
$height = 480 # Screen height here for compatibility)
$ov_zoom = 0.6 # Overworld zoom multiplier
$strip_size = 8 # Size of each strip of the map. Higher numbers will lag less.
# Recommended that this number be a power of 2.
# Do not make higher than 64.
$curve = true # Whether the map is curled, for overworlds (old method)
$data_map = load_data("Data/MapInfos.rxdata")
#===============================================================================
class RPG::MapInfo
def name # Definition prevents location scripts from reading anything within
return @name.gsub(/\[.*\]/) {""} # brackets, including the brackets
end
#-----------------------------------------------------------------------------
def original_name
return @name
end
#-----------------------------------------------------------------------------
def overworld?
return @name.scan(/[OV]/).size > 0
end
#-----------------------------------------------------------------------------
def pitch
@name =~ /\[#[ ]*([00-99]+)\]/i
return $1
end
end
#===============================================================================
class Draw_Tilemap # This class controls a set of sprites, with different Z
# values, arranged into horizontal bars
attr_accessor :tileset
attr_accessor :map_data
attr_accessor :priorities
attr_accessor :autotiles
attr_accessor :bitmaps
attr_accessor :pitch
attr_accessor :ox
attr_accessor :oy
attr_accessor :plus_y
INDEX = # Autotile definitions
[
26, 27, 32, 33, 4, 27, 32, 33, 26, 5, 32, 33, 4, 5, 32, 33,
26, 27, 32, 11, 4, 27, 32, 11, 26, 5, 32, 11, 4, 5, 32, 11,
26, 27, 10, 33, 4, 27, 10, 33, 26, 5, 10, 33, 4, 5, 10, 33,
26, 27, 10, 11, 4, 27, 10, 11, 26, 5, 10, 11, 4, 5, 10, 11,
24, 25, 30, 31, 24, 5, 30, 31, 24, 25, 30, 11, 24, 5, 30, 11,
14, 15, 20, 21, 14, 15, 20, 11, 14, 15, 10, 21, 14, 15, 10, 11,
28, 29, 34, 35, 28, 29, 10, 35, 4, 29, 34, 35, 4, 29, 10, 35,
38, 39, 44, 45, 4, 39, 44, 45, 38, 5, 44, 45, 4, 5, 44, 45,
24, 29, 30, 35, 14, 15, 44, 45, 12, 13, 18 ,19, 12, 13, 18, 11,
16, 17, 22, 23, 16, 17, 10, 23, 40, 41, 46, 47, 4, 41, 46, 47,
36, 37, 42, 43, 36, 5, 42, 43, 12, 17, 18, 23, 12, 13, 42, 43,
36, 41, 42, 47, 16, 17, 46, 47, 12, 17, 42, 47, 0, 1, 6, 7
]
X = [0, 1, 0, 1] # Used in 16x16 autotile drawing; left, right, left, right
Y = [0, 0, 1, 1] # Used in 16x16 autotile drawing; up, up, down, down
#-----------------------------------------------------------------------------
def initialize
# Get initial data from Game_Map
@tileset = RPG::Cache.tileset($game_map.tileset_name)
@map_data = $game_map.data
@priorities = $game_map.priorities
@autotiles = []
for i in 0..6
@autotiles[i] = RPG::Cache.autotile($game_map.autotile_names[i])
end
# Provide blank data in proper object form
@ox = 0
@oy = 0
# Bitmaps used for each priority's drawing. Priorities 2-5 are combined.
@bitmaps = [Bitmap.new($game_map.width*32, $game_map.height*32+$strip_size),
Bitmap.new($game_map.width*32, $game_map.height*32+$strip_size),
Bitmap.new($game_map.width*32, $game_map.height*32+$strip_size)]
# Generate blank sprites
@sprites = [[], [], []]
for i in 0..2 # For each layer
for j in 0..$game_map.height * (32 / $strip_size) - 1
# For each horizontal strip of $strip_size height, make a blank sprite
@sprites[i].push(Sprite.new)
@sprites[i][j].bitmap = Bitmap.new($game_map.width*32, $strip_size*2)
@sprites[i][j].x = $width / 2
@sprites[i][j].y = -64
@sprites[i][j].z = -5 + (i * 10)
end
end
@disposed = false
draw
end
#-----------------------------------------------------------------------------
def update
# Retrieve variable values for slant drawing; these values accesible by event
@pitch = $game_map.pitch.to_f
@plus_y = $game_map.plus_y
for i in 0..2 # For each layer
for j in [0, (($height / 2) - (($height * 60) /
@pitch) + @oy) / $strip_size].max.to_i..[@sprites[i].size - 1,
(@oy + $height) / $strip_size].min.to_i
# For each strip within the visible screen, update OX/Y
@sprites[i][j].x = $width / 2
@sprites[i][j].y = j * $strip_size - @oy
unless @pitch == 0 # Apply X Zoom
@sprites[i][j].zoom_x = (@sprites[i][j].y - $height / 2) *
(@pitch / ($height * 25)) + 1
if $curve # Zoom Y values same as X, and compensate
@sprites[i][j].zoom_y = @sprites[i][j].zoom_x
@sprites[i][j].y += $strip_size * (1 - @sprites[i][j].zoom_y) *
((1 - @sprites[i][j].zoom_y) /
(2 * ((@pitch / 100) /
($height / ($strip_size * 2)))) + 0.5)
end
end
@sprites[i][j].ox = @ox + $width / 2
# Add plus_y value; used in airship script
@sprites[i][j].y += @plus_y
end
end
end
#-----------------------------------------------------------------------------
def dispose
# Dispose all sprites
for i in 0..2
for j in @sprites[i]
j.bitmap.dispose
j.dispose
end
end
for i in @bitmaps
i.dispose
end
@tileset.dispose
for i in 0..6
@autotiles[i].dispose
end
@disposed = true
end
#-----------------------------------------------------------------------------
def disposed?
return @disposed
end
#-----------------------------------------------------------------------------
def draw
# Draw each individual position by XY value
for x in 0...@map_data.xsize
for y in 0...@map_data.ysize
draw_position(x, y)
end
end
for i in 0..2 # For each priority
for j in 0..@sprites[i].size - 1
# For each horizontal strip, transfer the bitmap appropriately
@sprites[i][j].bitmap.blt(0, 0, @bitmaps[i],
Rect.new(0, j * $strip_size, $game_map.width * 32, $strip_size * 2))
end
end
end
#-----------------------------------------------------------------------------
def draw_position(x, y)
for layer in 0..2
pos = @map_data[x, y, layer]
@priorities[pos] = 2 if @priorities[pos] > 2 # Round priorities down to 2
if pos >= 384 # If it is a tile
# src_rect = 32x32 Rect on the tileset for source bitmap
src_rect = Rect.new(((pos-384)%8)*32, ((pos-384)/8)*32, 32, 32)
# Transfer source bitmap on the tileset to the current map tile
@bitmaps[@priorities[pos]].blt(x * 32, y * 32, @tileset, src_rect)
elsif pos >= 48 and pos < 384 # If it is an autotile
id = pos / 48 - 1 # Which autotile is used (0-6)
# plus_x is in development for animated autotiles
plus_x = 0 #((@anim / 4) % (@autotiles[id].width / 96)) * 96
for corner in 0..3
h = 4 * (pos % 48) + corner # Used to access INDEX
# src_rect = 16x16 Rect on the autotile for source bitmap
src_rect = Rect.new((INDEX[h]%6)*16+plus_x, (INDEX[h]/6)*16, 16, 16)
# Transfer source bitmap on the autotile to the current 16x16 tile
@bitmaps[@priorities[pos]].blt(x*32+X[corner]*16, y*32+Y[corner]*16,
@autotiles[id], src_rect)
end
end
end
end
end
#===============================================================================
class Game_Map
attr_accessor :pitch
attr_accessor :plus_y
#-----------------------------------------------------------------------------
alias setup_or :setup
def setup(map_id)
setup_or(map_id)
@pitch = $data_map[$game_map.map_id].pitch
@plus_y = 0
end
#-----------------------------------------------------------------------------
def name
return $data_map[@map_id].name
end
end
#===============================================================================
class Sprite_Character < RPG::Sprite
attr_accessor :character
#-----------------------------------------------------------------------------
def initialize(character = nil)
super()
@character = character
update
end
#-----------------------------------------------------------------------------
alias update_or :update
def update
update_or
# Update pitch value, and update zoom values to match
@pitch = $data_map[$game_map.map_id].pitch.to_f
self.zoom_x =
self.zoom_y = ((@character.screen_y - 16) - ($height / 2)) *
(@pitch / ($height * 25)) + 1
# Set sprite coordinates. X value is multiplied by zoom value from the center
self.x = ($width / 2) + ((@character.screen_x - ($width / 2)) * self.zoom_x)
self.y = @character.screen_y
# Add Y value for zoom compensation while in curve mode
if $curve and @pitch != 0
self.y += (8 * (1 - self.zoom_y) * ((1 - self.zoom_y) /
(2 * ((@pitch / 100) / ($height / 16.0))) + 0.5))
end
# Add plus_y value; used in airship script
self.y += $game_map.plus_y unless @character.is_a?(Game_Player)
self.z = @character.screen_z(@ch) - (self.zoom_y < 0.5 ? 1000 : 0)
if $data_map[$game_map.map_id].overworld? and
@character.is_a?(Game_Player) # Multiply zoom by Overworld factor if
self.zoom_x *= $ov_zoom # the map is marked with [OV] and event
self.zoom_y *= $ov_zoom # is a Game_Player
end
end
end
#===============================================================================
class Spriteset_Map
def initialize
# Make viewports
@viewport1 = Viewport.new(0, 0, 640, 480)
@viewport2 = Viewport.new(0, 0, 640, 480)
@viewport3 = Viewport.new(0, 0, 640, 480)
@viewport2.z = 2000
@viewport3.z = 5000
# Make tilemap
@tilemap = Draw_Tilemap.new
# Make panorama plane
@panorama = Plane.new
@panorama.z = -2000
# Make fog plane
@fog = Plane.new
@fog.z = 3000
# Make character sprites
@character_sprites = []
for i in $game_map.events.keys.sort
sprite = Sprite_Character.new($game_map.events[i])
@character_sprites.push(sprite)
end
@character_sprites.push(Sprite_Character.new($game_player))
# Make weather
@weather = RPG::Weather.new(@viewport1)
# Make picture sprites
@picture_sprites = []
for i in 1..50
@picture_sprites.push(Sprite_Picture.new(@viewport2,
$game_screen.pictures[i]))
end
# Make timer sprite
@timer_sprite = Sprite_Timer.new
# Frame update
update
end
#-----------------------------------------------------------------------------
def dispose
# Dispose of tilemap
@tilemap.dispose
# Dispose of panorama plane
@panorama.dispose
# Dispose of fog plane
@fog.dispose
# Dispose of character sprites
for sprite in @character_sprites
sprite.dispose
end
# Dispose of weather
@weather.dispose
# Dispose of picture sprites
for sprite in @picture_sprites
sprite.dispose
end
# Dispose of timer sprite
@timer_sprite.dispose
# Dispose of viewports
@viewport1.dispose
@viewport2.dispose
@viewport3.dispose
end
end
Ich liste hier einfach mal die ganzen bereits geposteten Scripte auf. Geupdated wird immer wenn neue Scripte dazu kommen!
#===================================================
# ■ AMS - Advanced Message Script - R4 [Update #2]
#===================================================
# For more infos and update, visit:
# www.dubealex.com (Creation Asylum)
#
# Edited, Fixed and Enhanced by: Dubealex
# Original Script Core by: XRXS Scripter (Jap Dudes)
# HTML Hexadecimal color feature from: Phylomorphis
#
# Special Thanks:
# Rabu: For enabling the Show Face feature in an encrypted project
#
# To found all my new features, search the following: #NEW
# To configure the button to skip the dialog, search: #SKIP_TEXT_CODE
#
# May 18, 2005
#===================================================
LETTER_BY_LETTER_MODE = true #Set the letter by letter mode ON/OFF
#===================================================
# ▼ CLASS AMS Begins
#===================================================
class AMS
attr_accessor :name_box_x_offset
attr_accessor :name_box_y_offset
attr_accessor :font_type
attr_accessor :name_font_type
attr_accessor :font_size
attr_accessor :name_font_size
attr_accessor :message_box_opacity
attr_accessor :name_box_skin
attr_accessor :name_box_text_color
attr_accessor :message_box_text_color
attr_accessor :message_box_skin
attr_accessor :name_box_width
attr_accessor :name_box_height
attr_accessor :message_width
attr_accessor :message_height
attr_accessor :message_x
attr_accessor :message_y_bottom
attr_accessor :message_y_middle
attr_accessor :message_y_top
attr_accessor :event_message_x_ofset
attr_accessor :event_message_y_ofset
def initialize
@name_box_x_offset = 0 #Choose the X axis offset of the name bos. default= 0
@name_box_y_offset = -10 #Choose the Y axis offset of the name bos. default= -10
@name_box_width = 8 #Choose the width of the Name Box. default= 8
@name_box_height = 26 #Choose the height of the Name Box. default= 26
@font_type = "Tahoma" #Choose the Font Name (Case Sensitive) for message box
@name_font_type = "Tahoma" #Choose the Font Name (Case Sensitive) for Name Box
@font_size = 22 #Choose the default Font Size for message box text
@name_font_size = 22 #Choose the deafault Font Size for Name Box text
@name_box_text_color=0 #Choose the Text Color of the Name Box
@message_box_text_color=0 #Choose the Text Color of the Message Box
@message_box_opacity = 160 #Choose the opacity of the message window. Default=160
@message_box_skin = "001-Blue01" #Choose the WindowSkin for the Message Box
@name_box_skin = "001-Blue01" #Choose the WindowSkin for the Name Box
@message_width = 480 #Choose the width size of the message box. Default=480
@message_height = 160 #Choose the height size of the message box. Default=160
@message_x = 80 #Choose the X position of the message box. Default=80
@message_y_bottom = 304 #Choose the Y bottom position of the message box. Default=304
@message_y_middle = 160 #Choose the Y middle position of the message box. Default=160
@message_y_top = 16 #Choose the Y top position of the message box. Default=16
@event_message_x_ofset = 0 #Choose the X position offset of the event message. Default=0
@event_message_y_ofset = 48 #Choose the Y position offset of the event message. Default=48
end
end
#===================================================
# ▲ CLASS AMS Ends
#===================================================
#===================================================
# ▼ Class Window_Message Begins
#===================================================
class Window_Message < Window_Selectable
alias xrxs9_initialize initialize
def initialize
@alex_skip = false
xrxs9_initialize
if $soundname_on_speak == nil then
$soundname_on_speak = ""
end
$gaiji_file = "./Graphics/Gaiji/sample.png"
if FileTest.exist?($gaiji_file)
@gaiji_cache = Bitmap.new($gaiji_file)
else
@gaigi_cache = nil
end
@opacity_text_buf = Bitmap.new(32, 32)
end
#--------------------------------------------------------------------------
alias xrxs9_terminate_message terminate_message
def terminate_message
if @name_window_frame != nil
@name_window_frame.dispose
@name_window_frame = nil
end
if @name_window_text != nil
@name_window_text.dispose
@name_window_text = nil
end
xrxs9_terminate_message
end
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.color = text_color($ams.message_box_text_color)
self.contents.font.name = $ams.font_type
self.contents.font.size = $ams.font_size
self.windowskin = RPG::Cache.windowskin($ams.message_box_skin)
@x = @y = @max_x = @max_y = @indent = @lines = 0
@face_indent = 0
@opacity = 255
@cursor_width = 0
@write_speed = 0
@write_wait = 0
@mid_stop = false
@face_file = nil
@popchar = -2
if $game_temp.choice_start == 0
@x = 8
end
if $game_temp.message_text != nil
@now_text = $game_temp.message_text
if (/\A\\[Ff]\[(.+?)\]/.match(@now_text))!=nil then
@face_file = $1 + ".png"
@x = @face_indent = 128
if FileTest.exist?("Graphics/Pictures/" + $1 + ".png")
self.contents.blt(16, 16, RPG::Cache.picture(@face_file), Rect.new(0, 0, 96, 96))
end
@now_text.gsub!(/\\[Ff]\[(.*?)\]/) { "" }
end
begin
last_text = @now_text.clone
@now_text.gsub!(/\\[Vv]\[([IiWwAaSs]?)([0-9]+)\]/) { convart_value($1, $2.to_i) }
end until @now_text == last_text
@now_text.gsub!(/\\[Nn]\[([0-9]+)\]/) do
$game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : ""
end
#NEW
#Dubealex's Stop Skip Text ON-OFF
@now_text.gsub!(/\\[%]/) { "\100" }
#End new command
#NEW
#Dubealex's Show Monster Name Feature
@now_text.gsub!(/\\[Mm]\[([0-9]+)\]/) do
$data_enemies[$1.to_i] != nil ? $data_enemies[$1.to_i].name : ""
end
#End new command
#NEW
#Dubealex's Show Item Price Feature
@now_text.gsub!(/\\[Pp]rice\[([0-9]+)\]/) do
$data_items[$1.to_i] != nil ? $data_items[$1.to_i].price : ""
end
#End new command
#NEW
#Dubealex's Show Hero Class Name Feature
@now_text.gsub!(/\\[Cc]lass\[([0-9]+)\]/) do
$data_classes[$data_actors[$1.to_i].class_id] != nil ? $data_classes[$data_actors[$1.to_i].class_id].name : ""
end
#End new command
#NEW
#Dubealex's Show Current Map Name Feature
@now_text.gsub!(/\\[Mm]ap/) do
$game_map.name != nil ? $game_map.name : ""
end
#End new command
#NEW
#Dubealex's Choose Name Box Text Color
@now_text.gsub!(/\\[Zz]\[([0-9]+)\]/) do
$ams.name_box_text_color=$1.to_i
@now_text.sub!(/\\[Zz]\[([0-9]+)\]/) { "" }
end
#End new command
name_window_set = false
if (/\\[Nn]ame\[(.+?)\]/.match(@now_text)) != nil
name_window_set = true
name_text = $1
@now_text.sub!(/\\[Nn]ame\[(.*?)\]/) { "" }
end
if (/\\[Pp]\[([-1,0-9]+)\]/.match(@now_text))!=nil then
@popchar = $1.to_i
if @popchar == -1
@x = @indent = 48
@y = 4
end
@now_text.gsub!(/\\[Pp]\[([-1,0-9]+)\]/) { "" }
end
@max_choice_x = 0
if @popchar >= 0
@text_save = @now_text.clone
@max_x = 0
@max_y = 4
for i in 0..3
line = @now_text.split(/\n/)[3-i]
@max_y -= 1 if line == nil and @max_y <= 4-i
next if line == nil
line.gsub!(/\\\w\[(\w+)\]/) { "" }
cx = contents.text_size(line).width
@max_x = cx if cx > @max_x
if i >= $game_temp.choice_start
@max_choice_x = cx if cx > @max_choice_x
end
end
self.width = @max_x + 32 + @face_indent
self.height = (@max_y - 1) * 32 + 64
@max_choice_x -= 68
@max_choice_x -= @face_indent*216/128
else
@max_x = self.width - 32 - @face_indent
for i in 0..3
line = @now_text.split(/\n/)[i]
next if line == nil
line.gsub!(/\\\w\[(\w+)\]/) { "" }
cx = contents.text_size(line).width
if i >= $game_temp.choice_start
@max_choice_x = cx if cx > @max_choice_x
end
end
@max_choice_x += 8
end
@cursor_width = 0
@now_text.gsub!(/\\\\/) { "\000" }
@now_text.gsub!(/\\[Cc]\[([0123456789ABCDEF#]+)\]/) { "\001[#{$1}]" }
@now_text.gsub!(/\\[Gg]/) { "\002" }
@now_text.gsub!(/\\[Ss]\[([0-9]+)\]/) { "\003[#{$1}]" }
@now_text.gsub!(/\\[Aa]\[(.*?)\]/) { "\004[#{$1}]" }
#NEW
#Dubealex's Permanent Color Change
@now_text.gsub!(/\\[Cc]olor\[([0-9]+)\]/) do
$ams.message_box_text_color= $1.to_i
@now_text.sub!(/\\[Cc]\[([0-9]+)\]/) { "" }
end
#End of new command
#NEW
#Dubealex's Font Change Feature
@now_text.gsub(/\\[tt]\[(.*?)\]/) do
buftxt = $1.to_s
$ams.font_type = buftxt
@now_text.sub!(/\\[tt]\[(.*?)\]/) { "" }
end
#End of new command
@now_text.gsub!(/\\[.]/) { "\005" }
@now_text.gsub!(/\\[|]/) { "\006" }
@now_text.gsub!(/\\[>]/) { "\016" }
@now_text.gsub!(/\\[<]/) { "\017" }
@now_text.gsub!(/\\[!]/) { "\020" }
@now_text.gsub!(/\\[~]/) { "\021" }
@now_text.gsub!(/\\[Ee]\[([0-9]+)\]/) { "\022[#{$1}]" }
@now_text.gsub!(/\\[Ii]/) { "\023" }
@now_text.gsub!(/\\[Oo]\[([0-9]+)\]/) { "\024[#{$1}]" }
@now_text.gsub!(/\\[Hh]\[([0-9]+)\]/) { "\025[#{$1}]" }
@now_text.gsub!(/\\[Bb]\[([0-9]+)\]/) { "\026[#{$1}]" }
@now_text.gsub!(/\\[Rr]\[(.*?)\]/) { "\027[#{$1}]" }
reset_window
if name_window_set
color=$ams.name_box_text_color
off_x = $ams.name_box_x_offset
off_y = $ams.name_box_y_offset
space = 2
x = self.x + off_x - space / 2
y = self.y + off_y - space / 2
w = self.contents.text_size(name_text).width + $ams.name_box_width + space
h = $ams.name_box_height + space
@name_window_frame = Window_Frame.new(x, y, w, h)
@name_window_frame.z = self.z + 1
x = self.x + off_x + 4
y = self.y + off_y
@name_window_text = Air_Text.new(x, y, name_text, color)
@name_window_text.z = self.z + 2
end
end
reset_window
if $game_temp.choice_max > 0
@item_max = $game_temp.choice_max
self.active = true
self.index = 0
end
if $game_temp.num_input_variable_id > 0
digits_max = $game_temp.num_input_digits_max
number = $game_variables[$game_temp.num_input_variable_id]
@input_number_window = Window_InputNumber.new(digits_max)
@input_number_window.number = number
@input_number_window.x = self.x + 8
@input_number_window.y = self.y + $game_temp.num_input_start * 32
end
end
#--------------------------------------------------------------------------
def update
super
if @fade_in
self.contents_opacity += 24
if @input_number_window != nil
@input_number_window.contents_opacity += 24
end
if self.contents_opacity == 255
@fade_in = false
end
return
end
@now_text = nil if @now_text == ""
if @now_text != nil and @mid_stop == false
if @write_wait > 0
@write_wait -= 1
return
end
text_not_skip = LETTER_BY_LETTER_MODE
while true
@max_x = @x if @max_x < @x
@max_y = @y if @max_y < @y
if (c = @now_text.slice!(/./m)) != nil
if c == "\000"
c = "\\"
end
if c == "\001"
@now_text.sub!(/\[([0123456789ABCDEF#]+)\]/, "")
temp_color = $1
color = temp_color.to_i
leading_x = temp_color.to_s.slice!(/./m)
if leading_x == "#"
self.contents.font.color = hex_color(temp_color)
next
end
if color >= 0 and color <= 7
self.contents.font.color = text_color(color)
end
next
end
if c == "\002"
if @gold_window == nil and @popchar <= 0
@gold_window = Window_Gold.new
@gold_window.x = 560 - @gold_window.width
if $game_temp.in_battle
@gold_window.y = 192
else
@gold_window.y = self.y >= 128 ? 32 : 384
end
@gold_window.opacity = self.opacity
@gold_window.back_opacity = self.back_opacity
end
c = ""
end
if c == "\003"
@now_text.sub!(/\[([0-9]+)\]/, "")
speed = $1.to_i
if speed >= 0 and speed <= 19
@write_speed = speed
end
c = ""
end
if c == "\004"
@now_text.sub!(/\[(.*?)\]/, "")
buftxt = $1.dup.to_s
if buftxt.match(/\//) == nil and buftxt != "" then
$soundname_on_speak = "Audio/SE/" + buftxt
else
$soundname_on_speak = buftxt.dup
end
c = ""
elsif c == "\004"
c = ""
end
if c == "\005"
@write_wait += 5
c = ""
end
if c == "\006"
@write_wait += 20
c = ""
end
if c == "\016"
text_not_skip = false
c = ""
end
if c == "\017"
text_not_skip = true
c = ""
end
if c == "\020"
@mid_stop = true
c = ""
end
if c == "\021"
terminate_message
return
end
if c == "\023"
@indent = @x
c = ""
end
if c == "\024"
@now_text.sub!(/\[([0-9]+)\]/, "")
@opacity = $1.to_i
color = self.contents.font.color
self.contents.font.name = $ams.font_type
self.contents.font.size = $ams.font_size
self.contents.font.color = Color.new(color.red, color.green, color.blue, color.alpha * @opacity / 255)
c = ""
end
if c == "\025"
@now_text.sub!(/\[([0-9]+)\]/, "")
self.contents.font.size = [[$1.to_i, 6].max, 32].min
c = ""
end
if c == "\026"
@now_text.sub!(/\[([0-9]+)\]/, "")
@x += $1.to_i
c = ""
end
if c == "\027"
@now_text.sub!(/\[(.*?)\]/, "")
@x += ruby_draw_text(self.contents, @x, @y * line_height + (line_height - self.contents.font.size), $1, @opacity)
if $soundname_on_speak != ""
Audio.se_play($soundname_on_speak)
end
c = ""
end
if c == "\030"
@now_text.sub!(/\[(.*?)\]/, "")
self.contents.blt(@x , @y * line_height + 8, RPG::Cache.icon($1), Rect.new(0, 0, 24, 24))
if $soundname_on_speak != ""
Audio.se_play($soundname_on_speak)
end
@x += 24
c = ""
end
if c == "\n"
@lines += 1
@y += 1
@x = 0 + @indent + @face_indent
if @lines >= $game_temp.choice_start
@x = 8 + @indent + @face_indent
@cursor_width = @max_choice_x
end
c = ""
end
if c == "\022"
@now_text.sub!(/\[([0-9]+)\]/, "")
@x += gaiji_draw(4 + @x, @y * line_height + (line_height - self.contents.font.size), $1.to_i)
c = ""
end
#NEW
#Dubealex's Text Skip On/OFF Command
if c == "\100"
if @alex_skip==false
@alex_skip=true
else
@alex_skip=false
end
c = ""
end
#end of new command
if c != ""
self.contents.draw_text(0+@x, 32 * @y, 40, 32, c)
@x += self.contents.text_size(c).width
if $soundname_on_speak != "" then
Audio.se_play($soundname_on_speak)
end
end
#SKIP_TEXT_CODE
# B = Escape, 0 (On The NumPad), X
# C = Enter, Space Bar and C
# A = Shift, Z
if Input.press?(Input::C) # <-- Change the value on that line
if @alex_skip==false
text_not_skip = false
end
end
else
text_not_skip = true
break
end
if text_not_skip
break
end
end
@write_wait += @write_speed
return
end
if @input_number_window != nil
@input_number_window.update
if Input.trigger?(Input::C)
$game_system.se_play($data_system.decision_se)
$game_variables[$game_temp.num_input_variable_id] =
@input_number_window.number
$game_map.need_refresh = true
@input_number_window.dispose
@input_number_window = nil
terminate_message
end
return
end
if @contents_showing
if $game_temp.choice_max == 0
self.pause = true
end
if Input.trigger?(Input::B)
if $game_temp.choice_max > 0 and $game_temp.choice_cancel_type > 0
$game_system.se_play($data_system.cancel_se)
$game_temp.choice_proc.call($game_temp.choice_cancel_type - 1)
terminate_message
end
end
if Input.trigger?(Input::C)
if $game_temp.choice_max > 0
$game_system.se_play($data_system.decision_se)
$game_temp.choice_proc.call(self.index)
end
if @mid_stop
@mid_stop = false
return
else
terminate_message
end
end
return
end
if @fade_out == false and $game_temp.message_text != nil
@contents_showing = true
$game_temp.message_window_showing = true
refresh
Graphics.frame_reset
self.visible = true
self.contents_opacity = 0
if @input_number_window != nil
@input_number_window.contents_opacity = 0
end
@fade_in = true
return
end
if self.visible
@fade_out = true
self.opacity -= 48
if self.opacity == 0
self.visible = false
@fade_out = false
$game_temp.message_window_showing = false
end
return
end
end
#--------------------------------------------------------------------------
def get_character(parameter)
case parameter
when 0
return $game_player
else
events = $game_map.events
return events == nil ? nil : events[parameter]
end
end
#--------------------------------------------------------------------------
def reset_window
#MESSAGE_SIZE
#MESSAGE_POSITION
if @popchar >= 0
events = $game_map.events
if events != nil
character = get_character(@popchar)
x = [[character.screen_x - $ams.event_message_x_ofset - self.width / 2, 4].max, 636 - self.width].min
y = [[character.screen_y - $ams.event_message_y_ofset - self.height, 4].max, 476 - self.height].min
self.x = x
self.y = y
end
elsif @popchar == -1
self.x = -4
self.y = -4
self.width = 648
self.height = 488
else
if $game_temp.in_battle
self.y = 16
else
case $game_system.message_position
when 0
self.y = $ams.message_y_top
when 1
self.y = $ams.message_y_middle
when 2
self.y = $ams.message_y_bottom
end
self.x = $ams.message_x
if @face_file == nil
self.width = $ams.message_width
self.x = $ams.message_x
else
if self.width <= 600
self.width = 600
self.x -=60
end
end
self.height = $ams.message_height
end
end
self.contents = Bitmap.new(self.width - 32, self.height - 32)
self.contents.font.color = text_color($ams.message_box_text_color)
self.contents.font.name = $ams.font_type
self.contents.font.size = $ams.font_size
if @face_file != nil
self.contents.blt(16, 16, RPG::Cache.picture(@face_file), Rect.new(0, 0, 96, 96))
end
if @popchar == -1
self.opacity = 255
self.back_opacity = 0
elsif $game_system.message_frame == 0
self.opacity = 255
self.back_opacity = $ams.message_box_opacity
else
self.opacity = 0
self.back_opacity = $ams.message_box_opacity
end
end
#--------------------------------------------------------------------------
def gaiji_draw(x, y, num)
if @gaiji_cache == nil
return 0
else
if @gaiji_cache.width < num * 24
return 0
end
if self.contents.font.size >= 20 and self.contents.font.size <= 24
size = 24
else
size = self.contents.font.size * 100 * 24 / 2200
end
self.contents.stretch_blt(Rect.new(x, y, size, size), @gaiji_cache, Rect.new(num * 24, 0, 24, 24))
if $soundname_on_speak != "" then
Audio.se_play($soundname_on_speak)
end
return size
end
end
#--------------------------------------------------------------------------
def line_height
return 32
if self.contents.font.size >= 20 and self.contents.font.size <= 24
return 32
else
return self.contents.font.size * 15 / 10
end
end
#--------------------------------------------------------------------------
def ruby_draw_text(target, x, y, str,opacity)
sizeback = target.font.size
target.font.size * 3 / 2 > 32 ? rubysize = 32 - target.font.size : rubysize = target.font.size / 2
rubysize = [rubysize, 6].max
opacity = [[opacity, 0].max, 255].min
split_s = str.split(/,/)
split_s[0] == nil ? split_s[0] = "" : nil
split_s[1] == nil ? split_s[1] = "" : nil
height = sizeback + rubysize
width = target.text_size(split_s[0]).width
target.font.size = rubysize
ruby_width = target.text_size(split_s[1]).width
target.font.size = sizeback
buf_width = [target.text_size(split_s[0]).width, ruby_width].max
width - ruby_width != 0 ? sub_x = (width - ruby_width) / 2 : sub_x = 0
if opacity == 255
target.font.size = rubysize
target.draw_text(x + sub_x, y - target.font.size, target.text_size(split_s[1]).width, target.font.size, split_s[1])
target.font.size = sizeback
target.draw_text(x, y, width, target.font.size, split_s[0])
return width
else
if @opacity_text_buf.width < buf_width or @opacity_text_buf.height < height
@opacity_text_buf.dispose
@opacity_text_buf = Bitmap.new(buf_width, height)
else
@opacity_text_buf.clear
end
@opacity_text_buf.font.size = rubysize
@opacity_text_buf.draw_text(0 , 0, buf_width, rubysize, split_s[1], 1)
@opacity_text_buf.font.size = sizeback
@opacity_text_buf.draw_text(0 , rubysize, buf_width, sizeback, split_s[0], 1)
if sub_x >= 0
target.blt(x, y - rubysize, @opacity_text_buf, Rect.new(0, 0, buf_width, height), opacity)
else
target.blt(x + sub_x, y - rubysize, @opacity_text_buf, Rect.new(0, 0, buf_width, height), opacity)
end
return width
end
end
#--------------------------------------------------------------------------
def convart_value(option, index)
option == nil ? option = "" : nil
option.downcase!
case option
when "i"
unless $data_items[index].name == nil
r = sprintf("\030[%s]%s", $data_items[index].icon_name, $data_items[index].name)
end
when "w"
unless $data_weapons[index].name == nil
r = sprintf("\030[%s]%s", $data_weapons[index].icon_name, $data_weapons[index].name)
end
when "a"
unless $data_armors[index].name == nil
r = sprintf("\030[%s]%s", $data_armors[index].icon_name, $data_armors[index].name)
end
when "s"
unless $data_skills[index].name == nil
r = sprintf("\030[%s]%s", $data_skills[index].icon_name, $data_skills[index].name)
end
else
r = $game_variables[index]
end
r == nil ? r = "" : nil
return r
end
#--------------------------------------------------------------------------
def dispose
terminate_message
if @gaiji_cache != nil
unless @gaiji_cache.disposed?
@gaiji_cache.dispose
end
end
unless @opacity_text_buf.disposed?
@opacity_text_buf.dispose
end
$game_temp.message_window_showing = false
if @input_number_window != nil
@input_number_window.dispose
end
super
end
#--------------------------------------------------------------------------
def update_cursor_rect
if @index >= 0
n = $game_temp.choice_start + @index
self.cursor_rect.set(8 + @indent + @face_indent, n * 32, @cursor_width, 32)
else
self.cursor_rect.empty
end
end
end
#=========================================
# ▲ CLASS Window_Message Ends
#=========================================
#=========================================
# ▼ Class Window_Frame Begins
#=========================================
class Window_Frame < Window_Base
def initialize(x, y, width, height)
super(x, y, width, height)
self.windowskin = RPG::Cache.windowskin($ams.name_box_skin)
self.contents = nil
end
#--------------------------------------------------------------------------
def dispose
super
end
end
#=========================================
# ▲ CLASS Window_Frame Ends
#=========================================
#=========================================
# ▼ CLASS Game_Map Additional Code Begins
#=========================================
class Game_Map
#Dubealex's Addition (from XRXS) to show Map Name on screen
def name
$map_infos[@map_id]
end
end
#=========================================
# ▲ CLASS Game_Map Additional Code Ends
#=========================================
#=========================================
# ▼ CLASS Scene_Title Additional Code Begins
#=========================================
class Scene_Title
#Dubealex's Addition (from XRXS) to show Map Name on screen
$map_infos = load_data("Data/MapInfos.rxdata")
for key in $map_infos.keys
$map_infos[key] = $map_infos[key].name
end
#Dubealex's addition to save data from the AMS in the save files
$ams = AMS.new
end
#=========================================
# ▲ CLASS Scene_Title Additional Code Ends
#=========================================
#=========================================
# ▼ CLASS Window_Base Additional Code Begins
#=========================================
class Window_Base < Window
#Dubealex Addition (from Phylomorphis) to use HTML Hex Code Colors
def hex_color(string)
red = 0
green = 0
blue = 0
if string.size != 6
print("Hex strings must be six characters long.")
print("White text will be used.")
return Color.new(255, 255, 255, 255)
end
for i in 1..6
s = string.slice!(/./m)
if s == "#"
print("Hex color string may not contain the \"#\" character.")
print("White text will be used.")
return Color.new(255, 255, 255, 255)
end
value = hex_convert(s)
if value == -1
print("Error converting hex value.")
print("White text will be used.")
return Color.new(255, 255, 255, 255)
end
case i
when 1
red += value * 16
when 2
red += value
when 3
green += value * 16
when 4
green += value
when 5
blue += value * 16
when 6
blue += value
end
end
return Color.new(red, green, blue, 255)
end
#--------------------------------------------------------------------------
def hex_convert(character)
case character
when "0"
return 0
when "1"
return 1
when "2"
return 2
when "3"
return 3
when "4"
return 4
when "5"
return 5
when "6"
return 6
when "7"
return 7
when "8"
return 8
when "9"
return 9
when "A"
return 10
when "B"
return 11
when "C"
return 12
when "D"
return 13
when "E"
return 14
when "F"
return 15
end
return -1
end
end
#=========================================
# ▲ CLASS Window_Base Additional Code Ends
#=========================================
#=========================================
# ▼ Class Air_Text Begins
#=========================================
class Air_Text < Window_Base
def initialize(x, y, designate_text, color=0)
super(x-16, y-16, 32 + designate_text.size * 12, 56)
self.opacity = 0
self.back_opacity = 0
self.contents = Bitmap.new(self.width - 32, self.height - 32)
w = self.contents.width
h = self.contents.height
self.contents.font.name = $ams.name_font_type
self.contents.font.size = $ams.name_font_size
self.contents.font.color = text_color(color)
self.contents.draw_text(0, 0, w, h, designate_text)
end
#--------------------------------------------------------------------------
def dispose
self.contents.clear
super
end
end
#==========================================
# ▲ CLASS Air_Text Ends
#==========================================
#===================================================
# ▼ CLASS Scene_Save Additional Code Begins
#===================================================
class Scene_Save < Scene_File
alias ams_original_write_save_data write_save_data
def write_save_data(file)
ams_original_write_save_data(file)
Marshal.dump($ams, file)
end
end
#===================================================
# ▲ CLASS Scene_Save Additional Code Ends
#===================================================
#===================================================
# ▼ CLASS Scene_Load Additional Code Begins
#===================================================
class Scene_Load < Scene_File
alias ams_original_read_save_data read_save_data
def read_save_data(file)
ams_original_read_save_data(file)
$ams = Marshal.load(file)
end
end
#===================================================
# ▲ CLASS Scene_Load Additional Code Ends
#===================================================
#======================================
# ■ Anti Event Lag Script
#======================================
# By: Near Fantastica
# Date: 12.06.05
# Version: 3
#======================================
#======================================
# ■ Game_Map
#======================================
class Game_Map
#--------------------------------------------------------------------------
def in_range?(object)
screne_x = $game_map.display_x
screne_x -= 256
screne_y = $game_map.display_y
screne_y -= 256
screne_width = $game_map.display_x
screne_width += 2816
screne_height = $game_map.display_y
screne_height += 2176
return false if object.real_x <= screne_x-32
return false if object.real_x >= screne_width+32
return false if object.real_y <= screne_y-32
return false if object.real_y >= screne_height+32
return true
end
#--------------------------------------------------------------------------
def update
if $game_map.need_refresh
refresh
end
if @scroll_rest > 0
distance = 2 ** @scroll_speed
case @scroll_direction
when 2
scroll_down(distance)
when 4
scroll_left(distance)
when 6
scroll_right(distance)
when 8
scroll_up(distance)
end
@scroll_rest -= distance
end
for event in @events.values
if in_range?(event) or event.trigger == 3 or event.trigger == 4
event.update
end
end
for common_event in @common_events.values
common_event.update
end
@fog_ox -= @fog_sx / 8.0
@fog_oy -= @fog_sy / 8.0
if @fog_tone_duration >= 1
d = @fog_tone_duration
target = @fog_tone_target
@fog_tone.red = (@fog_tone.red * (d - 1) + target.red) / d
@fog_tone.green = (@fog_tone.green * (d - 1) + target.green) / d
@fog_tone.blue = (@fog_tone.blue * (d - 1) + target.blue) / d
@fog_tone.gray = (@fog_tone.gray * (d - 1) + target.gray) / d
@fog_tone_duration -= 1
end
if @fog_opacity_duration >= 1
d = @fog_opacity_duration
@fog_opacity = (@fog_opacity * (d - 1) + @fog_opacity_target) / d
@fog_opacity_duration -= 1
end
end
end
#======================================
# ■ Spriteset_Map
#======================================
class Spriteset_Map
#--------------------------------------------------------------------------
def in_range?(object)
screne_x = $game_map.display_x
screne_x -= 256
screne_y = $game_map.display_y
screne_y -= 256
screne_width = $game_map.display_x
screne_width += 2816
screne_height = $game_map.display_y
screne_height += 2176
return false if object.real_x <= screne_x
return false if object.real_x >= screne_width
return false if object.real_y <= screne_y
return false if object.real_y >= screne_height
return true
end
#--------------------------------------------------------------------------
def update
if @panorama_name != $game_map.panorama_name or
@panorama_hue != $game_map.panorama_hue
@panorama_name = $game_map.panorama_name
@panorama_hue = $game_map.panorama_hue
if @panorama.bitmap != nil
@panorama.bitmap.dispose
@panorama.bitmap = nil
end
if @panorama_name != ""
@panorama.bitmap = RPG::Cache.panorama(@panorama_name, @panorama_hue)
end
Graphics.frame_reset
end
if @fog_name != $game_map.fog_name or @fog_hue != $game_map.fog_hue
@fog_name = $game_map.fog_name
@fog_hue = $game_map.fog_hue
if @fog.bitmap != nil
@fog.bitmap.dispose
@fog.bitmap = nil
end
if @fog_name != ""
@fog.bitmap = RPG::Cache.fog(@fog_name, @fog_hue)
end
Graphics.frame_reset
end
@tilemap.ox = $game_map.display_x / 4
@tilemap.oy = $game_map.display_y / 4
@tilemap.update
@panorama.ox = $game_map.display_x / 8
@panorama.oy = $game_map.display_y / 8
@fog.zoom_x = $game_map.fog_zoom / 100.0
@fog.zoom_y = $game_map.fog_zoom / 100.0
@fog.opacity = $game_map.fog_opacity
@fog.blend_type = $game_map.fog_blend_type
@fog.ox = $game_map.display_x / 4 + $game_map.fog_ox
@fog.oy = $game_map.display_y / 4 + $game_map.fog_oy
@fog.tone = $game_map.fog_tone
i=0
for sprite in @character_sprites
if sprite.character.is_a?(Game_Event)
if in_range?(sprite.character) or sprite.character.trigger == 3 or sprite.character.trigger == 4
sprite.update
i+=1
end
else
sprite.update
i+=1
end
end
#p i
@weather.type = $game_screen.weather_type
@weather.max = $game_screen.weather_max
@weather.ox = $game_map.display_x / 4
@weather.oy = $game_map.display_y / 4
@weather.update
for sprite in @picture_sprites
sprite.update
end
@timer_sprite.update
@viewport1.tone = $game_screen.tone
@viewport1.ox = $game_screen.shake
@viewport3.color = $game_screen.flash_color
@viewport1.update
@viewport3.update
end
end
Geposted von Macros.
#================================================
# Aliases and redefines draw_text so that a sadow is drawn
# Made by: Ultimate Jesus
#================================================
class Bitmap
ShadowIndent = 2 # Size of the shadow (usually 1..3)
ShadowColour = Color.new(0, 0, 0, 200)# the colour of the shadow
# the 4th value is transparency (0-255)
unless @ja_ta_feito == 1 # Fix for F12 Rebot by P@nCHo
alias draw_text_plain draw_text
@ja_ta_feito = 1
end
def draw_text(arg1 = 0, arg2 = 0, arg3 = 0, arg4 = 0, arg5 = 0, arg6 = 0)
if arg1.is_a?(Rect)
x = arg1.x
y = arg1.y
width = arg1.width
height = arg1.height
string = arg2
align = arg3
else
x = arg1
y = arg2
width = arg3
height = arg4
string = arg5
align = arg6
end
colour = self.font.color.dup
self.font.color = ShadowColour
draw_text_plain(x + ShadowIndent, y + ShadowIndent, width, height, string, align)
self.font.color = colour
draw_text_plain(x, y, width, height, string, align)
end
end
Geposted von Hot Blizzard.
Zitat von Jerome Denis Andre
Bei Spielen, die mit den RPG Maker 2000 oder 2003 erstellt wurden, wurden am Anfang immer 1 bis 3 Logos gezeigt. Diese Funktion kann auch in den RPG Maker XP eingebaut werden.
Folgendes Skript wie im Header beschrieben einbauen. Weitere Instruktionen sind ebenfalls im Skript zu finden.
Credits an:
~DeR ErZenGeL~
Source code:
#Im Scene_Title Skript unter
# # Make system object
# $game_system = Game_System.new
#einfügen (Standard: Zeile 33)
#===============================INTROSCREEN 2.0===============================#
$game_system.bgm_play($data_system.title_bgm)
unless introscreen
@sprite = Sprite.new
# Name des Bildes mit Endung in Lila, Anführungszeichen und Klammern
# Diese zwei Punkte sind zu beachten und befolgen:
# hat Größe: max. 640x480 sonst zentriert
# in Ordner: Graphics/Titles
@sprite.bitmap = RPG::Cache.title("001-Title01.png")
# Anzeigeposition x und y des Bildes
@sprite.x = (640 - @sprite.bitmap.width) / 2
@sprite.y = (480 - @sprite.bitmap.height) / 2
# Transparenz des Bildes [Rot]
@sprite.opacity = 255
# Einblendzeit des Bildes [Rot und in Klammern]
Graphics.transition(40)
for i in 0..40
Graphics.update
end
Graphics.freeze
@sprite.bitmap.dispose
@sprite.dispose
# Ausblendzeit des Bildes [Rot und in Klammern]
Graphics.transition(40)
Graphics.freeze
end
# Bei Neustart [F12] kein zweites Anzeigen des Bildes
introscreen = true
Um mehrere Bilder anzuzeigen einfach
@sprite = Sprite.new
@sprite.bitmap = RPG::Cache.title("001-Title01.png")
@sprite.x = (640 - @sprite.bitmap.width) / 2
@sprite.y = (480 - @sprite.bitmap.height) / 2
@sprite.opacity = 255
Graphics.transition(40)
for i in 0..40
Graphics.update
end
Graphics.freeze
@sprite.bitmap.dispose
@sprite.dispose
Graphics.transition(40)
Graphics.freeze
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^^
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
...
Mode07 on the Map!
Includes:
Mode07 v0.6
Overworld Sprite Resize
Written by mewsterus
Special Thanks:
Fanha Giang (for a reverse engineered Tilemap class)
--------------------------------------------------------------------------------
Instructions:
--------------------------------------------------------------------------------
To install, just insert this in a descriptive code slot right above Main.
This is different than previous instructions; please read the next paragraph.
If you had a previous install of this script and need an original version of
Spriteset_Map, one can be found at:
http://www.rpg-palace.com/scripts/spriteset_map.txt
To activate Mode07, add [#XX] to the map's name, replacing XX with the
percentage of Mode07 to apply. Greater numbers will result in a more slanted
world.
To activate overworld sprite resize, add [OV] to the map's name. This will make
sprites smaller on that map.
For the purposes of location scripts, these identifiers will not appear.
Examples:
"Overworld[#40]" will result in a slant identical to the second screenshot.
"Underworld[OV]" will resize only the player character to a small size, as if
seen from high above.
"Atthelevelworld[OV][#12]" will result in the player being resized, and a modest
slant of 12%
"JustPlainWorld" will result in the same old map you've always seen.
To add a sky, simply use the panorama with the tileset. Also, events will not
be drawn flat with the map. Any vertical objects such as trees should be put
in events and displayed that way.
You can also add a sky by adding a fog. If you add this, you can make it look
like the first screenshot.
A note on the $strip_size variable; the default value is 8, however there is
extremely minimal, almost nonexistant lag with 16. The screen is extremely
smooth with 4, or even 2. If you're having major problems with lag, you may
need to use 32, but it won't look too pretty.
--------------------------------------------------------------------------------
* Draw_Tilemap v1.72-0.6
Fanha Giang, 02/12/2006 (mm/dd/yyyy)
Edited for Mode07 by mewsterus 08/08/2006 (mm/dd/yyyy)
=end
#===============================================================================
$width = 640 # Screen width (will not change resolution,
$height = 480 # Screen height here for compatibility)
$ov_zoom = 0.6 # Overworld zoom multiplier
$strip_size = 8 # Size of each strip of the map. Higher numbers will lag less.
# Recommended that this number be a power of 2.
# Do not make higher than 64.
$curve = true # Whether the map is curled, for overworlds (old method)
$data_map = load_data("Data/MapInfos.rxdata")
#===============================================================================
class RPG::MapInfo
def name # Definition prevents location scripts from reading anything within
return @name.gsub(/\[.*\]/) {""} # brackets, including the brackets
end
#-----------------------------------------------------------------------------
def original_name
return @name
end
#-----------------------------------------------------------------------------
def overworld?
return @name.scan(/[OV]/).size > 0
end
#-----------------------------------------------------------------------------
def pitch
@name =~ /\[#[ ]*([00-99]+)\]/i
return $1
end
end
#===============================================================================
class Draw_Tilemap # This class controls a set of sprites, with different Z
# values, arranged into horizontal bars
attr_accessor :tileset
attr_accessor :map_data
attr_accessor :priorities
attr_accessor :autotiles
attr_accessor :bitmaps
attr_accessor :pitch
attr_accessor :ox
attr_accessor :oy
attr_accessor :plus_y
INDEX = # Autotile definitions
[
26, 27, 32, 33, 4, 27, 32, 33, 26, 5, 32, 33, 4, 5, 32, 33,
26, 27, 32, 11, 4, 27, 32, 11, 26, 5, 32, 11, 4, 5, 32, 11,
26, 27, 10, 33, 4, 27, 10, 33, 26, 5, 10, 33, 4, 5, 10, 33,
26, 27, 10, 11, 4, 27, 10, 11, 26, 5, 10, 11, 4, 5, 10, 11,
24, 25, 30, 31, 24, 5, 30, 31, 24, 25, 30, 11, 24, 5, 30, 11,
14, 15, 20, 21, 14, 15, 20, 11, 14, 15, 10, 21, 14, 15, 10, 11,
28, 29, 34, 35, 28, 29, 10, 35, 4, 29, 34, 35, 4, 29, 10, 35,
38, 39, 44, 45, 4, 39, 44, 45, 38, 5, 44, 45, 4, 5, 44, 45,
24, 29, 30, 35, 14, 15, 44, 45, 12, 13, 18 ,19, 12, 13, 18, 11,
16, 17, 22, 23, 16, 17, 10, 23, 40, 41, 46, 47, 4, 41, 46, 47,
36, 37, 42, 43, 36, 5, 42, 43, 12, 17, 18, 23, 12, 13, 42, 43,
36, 41, 42, 47, 16, 17, 46, 47, 12, 17, 42, 47, 0, 1, 6, 7
]
X = [0, 1, 0, 1] # Used in 16x16 autotile drawing; left, right, left, right
Y = [0, 0, 1, 1] # Used in 16x16 autotile drawing; up, up, down, down
#-----------------------------------------------------------------------------
def initialize
# Get initial data from Game_Map
@tileset = RPG::Cache.tileset($game_map.tileset_name)
@map_data = $game_map.data
@priorities = $game_map.priorities
@autotiles = []
for i in 0..6
@autotiles[i] = RPG::Cache.autotile($game_map.autotile_names[i])
end
# Provide blank data in proper object form
@ox = 0
@oy = 0
# Bitmaps used for each priority's drawing. Priorities 2-5 are combined.
@bitmaps = [Bitmap.new($game_map.width*32, $game_map.height*32+$strip_size),
Bitmap.new($game_map.width*32, $game_map.height*32+$strip_size),
Bitmap.new($game_map.width*32, $game_map.height*32+$strip_size)]
# Generate blank sprites
@sprites = [[], [], []]
for i in 0..2 # For each layer
for j in 0..$game_map.height * (32 / $strip_size) - 1
# For each horizontal strip of $strip_size height, make a blank sprite
@sprites[i].push(Sprite.new)
@sprites[i][j].bitmap = Bitmap.new($game_map.width*32, $strip_size*2)
@sprites[i][j].x = $width / 2
@sprites[i][j].y = -64
@sprites[i][j].z = -5 + (i * 10)
end
end
@disposed = false
draw
end
#-----------------------------------------------------------------------------
def update
# Retrieve variable values for slant drawing; these values accesible by event
@pitch = $game_map.pitch.to_f
@plus_y = $game_map.plus_y
for i in 0..2 # For each layer
for j in [0, (($height / 2) - (($height * 60) /
@pitch) + @oy) / $strip_size].max.to_i..[@sprites[i].size - 1,
(@oy + $height) / $strip_size].min.to_i
# For each strip within the visible screen, update OX/Y
@sprites[i][j].x = $width / 2
@sprites[i][j].y = j * $strip_size - @oy
unless @pitch == 0 # Apply X Zoom
@sprites[i][j].zoom_x = (@sprites[i][j].y - $height / 2) *
(@pitch / ($height * 25)) + 1
if $curve # Zoom Y values same as X, and compensate
@sprites[i][j].zoom_y = @sprites[i][j].zoom_x
@sprites[i][j].y += $strip_size * (1 - @sprites[i][j].zoom_y) *
((1 - @sprites[i][j].zoom_y) /
(2 * ((@pitch / 100) /
($height / ($strip_size * 2)))) + 0.5)
end
end
@sprites[i][j].ox = @ox + $width / 2
# Add plus_y value; used in airship script
@sprites[i][j].y += @plus_y
end
end
end
#-----------------------------------------------------------------------------
def dispose
# Dispose all sprites
for i in 0..2
for j in @sprites[i]
j.bitmap.dispose
j.dispose
end
end
for i in @bitmaps
i.dispose
end
@tileset.dispose
for i in 0..6
@autotiles[i].dispose
end
@disposed = true
end
#-----------------------------------------------------------------------------
def disposed?
return @disposed
end
#-----------------------------------------------------------------------------
def draw
# Draw each individual position by XY value
for x in 0...@map_data.xsize
for y in 0...@map_data.ysize
draw_position(x, y)
end
end
for i in 0..2 # For each priority
for j in 0..@sprites[i].size - 1
# For each horizontal strip, transfer the bitmap appropriately
@sprites[i][j].bitmap.blt(0, 0, @bitmaps[i],
Rect.new(0, j * $strip_size, $game_map.width * 32, $strip_size * 2))
end
end
end
#-----------------------------------------------------------------------------
def draw_position(x, y)
for layer in 0..2
pos = @map_data[x, y, layer]
@priorities[pos] = 2 if @priorities[pos] > 2 # Round priorities down to 2
if pos >= 384 # If it is a tile
# src_rect = 32x32 Rect on the tileset for source bitmap
src_rect = Rect.new(((pos-384)%8)*32, ((pos-384)/8)*32, 32, 32)
# Transfer source bitmap on the tileset to the current map tile
@bitmaps[@priorities[pos]].blt(x * 32, y * 32, @tileset, src_rect)
elsif pos >= 48 and pos < 384 # If it is an autotile
id = pos / 48 - 1 # Which autotile is used (0-6)
# plus_x is in development for animated autotiles
plus_x = 0 #((@anim / 4) % (@autotiles[id].width / 96)) * 96
for corner in 0..3
h = 4 * (pos % 48) + corner # Used to access INDEX
# src_rect = 16x16 Rect on the autotile for source bitmap
src_rect = Rect.new((INDEX[h]%6)*16+plus_x, (INDEX[h]/6)*16, 16, 16)
# Transfer source bitmap on the autotile to the current 16x16 tile
@bitmaps[@priorities[pos]].blt(x*32+X[corner]*16, y*32+Y[corner]*16,
@autotiles[id], src_rect)
end
end
end
end
end
#===============================================================================
class Game_Map
attr_accessor :pitch
attr_accessor :plus_y
#-----------------------------------------------------------------------------
alias setup_or :setup
def setup(map_id)
setup_or(map_id)
@pitch = $data_map[$game_map.map_id].pitch
@plus_y = 0
end
#-----------------------------------------------------------------------------
def name
return $data_map[@map_id].name
end
end
#===============================================================================
class Sprite_Character < RPG::Sprite
attr_accessor :character
#-----------------------------------------------------------------------------
def initialize(character = nil)
super()
@character = character
update
end
#-----------------------------------------------------------------------------
alias update_or :update
def update
update_or
# Update pitch value, and update zoom values to match
@pitch = $data_map[$game_map.map_id].pitch.to_f
self.zoom_x =
self.zoom_y = ((@character.screen_y - 16) - ($height / 2)) *
(@pitch / ($height * 25)) + 1
# Set sprite coordinates. X value is multiplied by zoom value from the center
self.x = ($width / 2) + ((@character.screen_x - ($width / 2)) * self.zoom_x)
self.y = @character.screen_y
# Add Y value for zoom compensation while in curve mode
if $curve and @pitch != 0
self.y += (8 * (1 - self.zoom_y) * ((1 - self.zoom_y) /
(2 * ((@pitch / 100) / ($height / 16.0))) + 0.5))
end
# Add plus_y value; used in airship script
self.y += $game_map.plus_y unless @character.is_a?(Game_Player)
self.z = @character.screen_z(@ch) - (self.zoom_y < 0.5 ? 1000 : 0)
if $data_map[$game_map.map_id].overworld? and
@character.is_a?(Game_Player) # Multiply zoom by Overworld factor if
self.zoom_x *= $ov_zoom # the map is marked with [OV] and event
self.zoom_y *= $ov_zoom # is a Game_Player
end
end
end
#===============================================================================
class Spriteset_Map
def initialize
# Make viewports
@viewport1 = Viewport.new(0, 0, 640, 480)
@viewport2 = Viewport.new(0, 0, 640, 480)
@viewport3 = Viewport.new(0, 0, 640, 480)
@viewport2.z = 2000
@viewport3.z = 5000
# Make tilemap
@tilemap = Draw_Tilemap.new
# Make panorama plane
@panorama = Plane.new
@panorama.z = -2000
# Make fog plane
@fog = Plane.new
@fog.z = 3000
# Make character sprites
@character_sprites = []
for i in $game_map.events.keys.sort
sprite = Sprite_Character.new($game_map.events[i])
@character_sprites.push(sprite)
end
@character_sprites.push(Sprite_Character.new($game_player))
# Make weather
@weather = RPG::Weather.new(@viewport1)
# Make picture sprites
@picture_sprites = []
for i in 1..50
@picture_sprites.push(Sprite_Picture.new(@viewport2,
$game_screen.pictures[i]))
end
# Make timer sprite
@timer_sprite = Sprite_Timer.new
# Frame update
update
end
#-----------------------------------------------------------------------------
def dispose
# Dispose of tilemap
@tilemap.dispose
# Dispose of panorama plane
@panorama.dispose
# Dispose of fog plane
@fog.dispose
# Dispose of character sprites
for sprite in @character_sprites
sprite.dispose
end
# Dispose of weather
@weather.dispose
# Dispose of picture sprites
for sprite in @picture_sprites
sprite.dispose
end
# Dispose of timer sprite
@timer_sprite.dispose
# Dispose of viewports
@viewport1.dispose
@viewport2.dispose
@viewport3.dispose
end
end
Ziemlich viele davon sind aber kein "must-have".
AMS, Anti-Lag, Vollbild sind nützliche Skripte, und ich denke ebenfalls,
das man sie benutzen sollte. Aber Quicksave, Ringmenü usw. gehören
hier nicht rein.