Jump to content
Rpg²S Forum

Merit Experience Gain


shuuchan
 Share

Recommended Posts

Merit Experience Gain

Descrizione

Stanchi della divisione "paritaria" dei Punti Esperienza alla fine delle battaglie?

Con questo script gli eroi del gruppo guadagnano EXP in base all'effettiva efficacia in combattimento: così un personaggio addormentato, paralizzato, o che pensa solo a difendersi, riceverà molti meno EXP di un eroe molto attivo! ^^

Questo sistema garantisce una certa varietà anche agli incontri casuali: per esempio è possibile far avanzare rapidamente di livello un personaggio, costringendolo in battaglia a fare il lavoro sporco tutto da solo... mentre gli altri stanno beati a guardare. ^^

Inoltre è possibile impostare diversi valori per accelerare/rallentare l'avanzamento di Combattenti/Incantatori, ecc., e molto altro.

Dal momento che stavo sviluppando lo script per il mio "Twilight War", e che mi costava poco adattarlo, ho deciso di postarlo qui, sperando possa interessare a qualcuno.
:biggrin:

 

Autore

Shuuchan

(C'est moi!)

 

Allegati

Ecco lo script:

 

Istruzioni per l'uso

Inserire lo script sotto "Materials". Seguire le indicazioni all'interno dello script per le (poche) impostazioni da effettuare.

 

 

 

#===============================================================================

# ** Merit Experience Gain

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

# by Shuuchan

# versione 1.0

# 18-07-2008

# RGSS2 / RPG Maker VX

#===============================================================================

 

#===============================================================================

# Inserire questo script sotto "Materials" nella sezione "Script Editor"

#===============================================================================

 

#===============================================================================

# Definizione variabili: NON TOCCARE!! -_*

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

class Game_Actor < Game_Battler

attr_accessor :merit

attr_accessor :gain_rate

attr_accessor :act_kind

attr_accessor :ritard

attr_accessor :solit

attr_accessor :extrabattle_exp

attr_accessor :extraexp_mult

attr_accessor :special_exp_item

attr_accessor :mult_item

#===============================================================================

 

#===============================================================================

# ___________________________

# ** IMPOSTAZIONI GENERALI **

#

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

# ** Descrizione del funzionamento dello script:

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

#

# Questo script permette di suddividere i punti esperienza tra gli eroi del

# proprio gruppo in proporzione ai meriti del singolo eroe in battaglia. In tal

# modo eroi che si difendono passivamente o sono penalizzati nell'agire (per

# paralisi, cecità, ecc.) ottengono meno EXP di quelli che si sono... impegnati

# più a fondo! ^^

# Per tornare al metodo di distribuzione classico basterà usare il seguente Call

# Script:

#

# $merit_exp = false

#

# Questo può essere utile per l'assegnazione di punti esperienza di Boss, ecc.

# Per riattivare lo script basterà poi usare lo stesso Call Script con "true",

# ovvero: $merit_exp = true

#

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

# ** Descrizione delle categorie di personaggi

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

#

# É possibile diversificare il guadagno di punti esperienza da eroe ad eroe,

# assegnando ai personaggi le seguenti categorie:

#

# COMBATTENTI: ideale per i Guerrieri e per quelle classi che fanno un uso quasi

# nullo di abilità. Guadagnano punti esperienza soprattutto con

# la semplice azione "Attacco".

# SEMI_COMBAT: quasi come i Combattenti, ma con l'uso di qualche abilità.

# Ideale per Paladini e classi simili.

# INCANTATORI: ideale per i Maghi e per quelle classi che fanno uso di un'ampia

# gamma di abilità. Guadagnano EXP soprattutto tramite l'uso di

# "Abilità", specialmente di quelle offensive.

# SEMI_INCANT: quasi come gli Incantatori, ma con una maggiore propensione per

# l'attacco normale. Ideale per i Sacerdoti, e per quelle classi

# che hanno più abilità "di utilità" che offensive.

# MULTICLASSE: una via di mezzo tra Semi_Incantatori e Semi_Combattenti.

#

# Per assegnare una determinata categoria ad un personaggio basta inserirne l'ID

# nella sezione qui sotto. Se, per esempio, volessi inserire gli eroi n° 1, 3

# e 7 tra i Combattenti e il n° 4 tra gli Incantatori, dovrei scrivere:

#

# COMBATTENTI = [1, 3, 7]

# INCANTATORI = [4]

#

# Gli eroi non inseriti nelle categorie appartengono alla categoria "standard",

# che non garantisce bonus sugli EXP né per l'uso di abilità né per l'attacco.

# Quindi un eroe "standard" riceverà in genere meno EXP se inserito in una

# compagnia di eroi "categorizzati". É comunque possibile creare compagnie

# costituite esclusivamente di eroi "standard".

 

COMBATTENTI = [1,2]

SEMI_COMBAT = []

MULTICLASSE = []

SEMI_INCANT = []

INCANTATORI = [3,4]

 

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

# ** Bilanciamento per la distribuzione dei Punti Esperienza

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

#

# Lo script è stato concepito per essere bilanciato e garantire, a parità di

# "meriti" in battaglia, più o meno la stessa quantità di EXP a tutti gli eroi.

# In ogni caso è possibile modificare il seguente parametro per eventuali

# aggiustamenti.

#

BILANCIAM = 0 # Impostabile da -5 a 5. Numeri negativi favoriscono gli

# Incantatori e sfavoriscono i Combattenti durante la

# distribuzione dei punti esperienza. Viceversa numeri

# positivi favoriscono i Combattenti a scapito degli

# Incantatori. Su "0" gli Incantatori sono lievemente

# svantaggiati (come in quasi tutti i giochi di ruolo

# "occidentali", che controbilanciano la potenza degli

# "incantesimi" rallentando l'avanzamento di livello di

# chi li lancia).

 

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

# ** Altre Impostazioni

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

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

 

RITARDATARI = true # Se impostato su "true" favorisce gli eroi con livello più

# basso durante la distribuzione dei punti esperienza.

# Ideale per evitare che singoli eroi molto forti diventino

# troppo in fretta di alto livello, lasciando indietro gli

# altri membri del gruppo.

 

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

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

 

SOLITARIO = false # Se impostato su "true" favorisce gruppi con pochi eroi,

# che quindi guadagneranno più punti esperienza rispetto a

# gruppi numerosi.

 

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

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

 

$MAX_DMG = 400 # Massimo danno/guarigione considerato durante la

# distribuzione di punti esperienza. Danni o guarigioni di

# maggior consistenza saranno ricondotti a questo valore,

# e l'eccedenza non verrà calcolata per la spartizione

# degli EXP.

# Utile per evitare che abilità molto potenti consentano di

# guadagnare un eccessivo numero di EXP.

 

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

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

 

EXP_ITEM = true # Se impostato su "true", gli eroi aumenteranno un po'

# il proprio "merito" in battaglia anche usando degli

# oggetti.

 

ITEM_MULTIPLIER = 5 # Impostabile da 1 in su (è comunque sconsigliabile

# inserire valori più grandi di 20).

# Controlla la quantità di EXP ottenuti usando oggetti

# in battaglia: maggiore il valore, maggiori gli EXP

# ottenuti.

 

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

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

 

EXTRA_BATTLE_EXP = true # Se impostato su "true", gli eroi guadagneranno una

# piccola quantità di punti esperienza utilizzando

# abilità anche fuori da una battaglia.

 

EXTRA_EXP_MULTIPLIER = 1 # Impostabile da 1 in su (è comunque sconsigliabile

# inserire valori più grandi di 5).

# Controlla la quantità di EXP ottenuti tramite

# l'EXTRA_BATTLE_EXP: maggiore il valore, maggiori

# i punti esperienza ottenuti per l'uso di abilità

# fuori da una battaglia.

 

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

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

# ** FINE DELLE IMPOSTAZIONI **

#===============================================================================

 

 

def setup(actor_id)

actor = $data_actors[actor_id]

@actor_id = actor_id

@name = actor.name

@character_name = actor.character_name

@character_index = actor.character_index

@face_name = actor.face_name

@face_index = actor.face_index

@class_id = actor.class_id

@weapon_id = actor.weapon_id

@armor1_id = actor.armor1_id

@armor2_id = actor.armor2_id

@armor3_id = actor.armor3_id

@armor4_id = actor.armor4_id

@level = actor.initial_level

@exp_list = Array.new(101)

make_exp_list

@exp = @exp_list[@level]

@skills = []

 

@merit = 0

@ritard = RITARDATARI

@solit = SOLITARIO

@special_exp_item = EXP_ITEM

@mult_item = ITEM_MULTIPLIER

@extrabattle_exp = EXTRA_BATTLE_EXP

@extraexp_mult = EXTRA_EXP_MULTIPLIER

 

equilibrio = BILANCIAM

 

if COMBATTENTI.include?(actor_id)

act_kind = 1

@gain_rate = 10 + (equilibrio +1)

elsif INCANTATORI.include?(actor_id)

act_kind = 2

@gain_rate = 10 - (equilibrio +1)

elsif SEMI_COMBAT.include?(actor_id)

act_kind = 3

@gain_rate = 10 + (equilibrio +1)/2

elsif SEMI_INCANT.include?(actor_id)

act_kind = 4

@gain_rate = 10 - (equilibrio +1)/2

elsif MULTICLASSE.include?(actor_id)

act_kind = 5

@gain_rate = 10

else

act_kind = 0

@gain_rate = 10

end

 

for i in self.class.learnings

learn_skill(i.skill_id) if i.level <= @level

end

clear_extra_values

recover_all

end

 

end

 

#===============================================================================

class Scene_Title < Scene_Base

 

alias specialexp_cr_game_obj create_game_objects

 

def create_game_objects

specialexp_cr_game_obj

$specialexp_min_lev = 200

$merit_exp = true

end

end

 

#===============================================================================

class Game_Battler

 

alias specialexp_att_effect attack_effect

 

def attack_effect(attacker)

specialexp_att_effect(attacker)

if @hp_damage.abs < $MAX_DMG

mer = @hp_damage.abs

else

mer = $MAX_DMG

end

if attacker.is_a?(Game_Actor)

if (attacker.ritard == true) and ($specialexp_min_lev < 200 and $specialexp_min_lev > 0)

pialla = ((attacker.level) - $specialexp_min_lev + 1).to_f

else

pialla = 1

end

attacker.merit += (mer.to_f/pialla + (attacker.gain_rate).to_f*10).round

if (attacker.act_kind == 1)

attacker.merit += ((mer.to_f/pialla) * (attacker.gain_rate).to_f/10).round

elsif (attacker.act_kind == 3)

attacker.merit += (((mer.to_f/pialla) * ((attacker.gain_rate).to_f/10)*2)/3).round

elsif (attacker.act_kind == 5)

attacker.merit += (((mer.to_f/pialla) * (attacker.gain_rate).to_f/10)/2).round

elsif (attacker.act_kind == 4)

attacker.merit += (((mer.to_f/pialla) * (attacker.gain_rate).to_f/10)/3).round

elsif attacker.act_kind == 2

attacker.merit -= (mer.to_f/pialla) * (1/((20 - attacker.gain_rate).to_f)).round

end

end

end

 

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

alias specialexp_sk_effect skill_effect

 

def skill_effect(user, skill)

specialexp_sk_effect(user, skill)

if @hp_damage.abs < $MAX_DMG

mer = @hp_damage.abs + @mp_damage.abs

else

mer = $MAX_DMG

end

if user.is_a?(Game_Actor)

if ($game_temp.in_battle == false) and (user.extrabattle_exp == true)

tempexp = ((user.level) * (user.extraexp_mult) * (user.gain_rate).to_f/10).round

user.gain_exp(tempexp, true)

end

if (user.ritard == true) and ($specialexp_min_lev < 200 and $specialexp_min_lev > 0)

pialla = ((user.level) - $specialexp_min_lev + 1).to_f

else

pialla = 1

end

user.merit += (mer.to_f/(2 * pialla) + (user.gain_rate).to_f*10).round

if (user.act_kind == 2)

user.merit += (mer.to_f/(2 * pialla) * ((user.gain_rate).to_f/10)).round

elsif (user.act_kind == 4)

user.merit += ((mer.to_f/(2 * pialla) * (((user.gain_rate).to_f/10))*2)/3).round

elsif (user.act_kind == 5)

user.merit += ((mer.to_f/(2 * pialla) * ((user.gain_rate).to_f/10))/2).round

elsif (user.act_kind == 3)

user.merit += ((mer.to_f/(2 * pialla) * ((user.gain_rate).to_f/10))/3).round

elsif user.act_kind == 1

user.merit -= ((mer.to_f/(2 * pialla)) * (1/((20 - user.gain_rate).to_f))).round

end

end

end

 

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

alias specialexp_it_effect item_effect

 

def item_effect(user, item)

specialexp_it_effect(user, item)

if user.is_a?(Game_Actor)

if (user.ritard == true) and ($specialexp_min_lev < 200 and $specialexp_min_lev > 0)

pialla = ((user.level) - $specialexp_min_lev + 1).to_f

else

pialla = 1

end

if (user.level > 10) or (user.level <= 0)

molt_ogg = 10

else

molt_ogg = user.level

end

if user.special_exp_item == true

user.merit += ((molt_ogg).to_f/pialla) * (20 * user.mult_item) * ((user.gain_rate).to_f/10).round

end

end

end

end

 

 

#===============================================================================

class Scene_Battle < Scene_Base

 

alias specialexp_start process_battle_start

 

def process_battle_start

$specialexp_min_lev = 200

for eroe in $game_party.members

eroe.merit = 0

$specialexp_min_lev = eroe.level if eroe.level < $specialexp_min_lev

end

specialexp_start

end

 

def process_victory

@info_viewport.visible = false

@message_window.visible = true

RPG::BGM.stop

$game_system.battle_end_me.play

unless $BTEST

$game_temp.map_bgm.play

$game_temp.map_bgs.play

end

display_gold

display_drop_items

display_specialexp_level_up

battle_end(0)

end

 

def display_gold

gold = $game_troop.gold_total

$game_party.gain_gold(gold)

text = sprintf(Vocab::Victory, $game_party.name)

$game_message.texts.push('\|' + text)

if gold > 0

text = sprintf(Vocab::ObtainGold, gold, Vocab::gold)

$game_message.texts.push('\.' + text)

end

wait_for_message

end

 

def display_specialexp_level_up

total_exp = $game_troop.exp_total

total_merit = 0

membri = 0

$game_message.new_page

for actor in $game_party.existing_members

total_merit += actor.merit

membri += 1

membri = 2 if actor.solit

end

for actor in $game_party.existing_members

if $merit_exp == true

autoexp_a = total_exp * ((actor.merit).to_f / total_merit.to_f) * membri

else

autoexp_a = total_exp

end

exp_a = autoexp_a.round

if exp_a > 0

nome = actor.name + ": "

text = sprintf(Vocab::ObtainExp, exp_a)

$game_message.texts.push('\.' + nome + text)

end

end

for actor in $game_party.existing_members

if $merit_exp == true

autoexp_b = total_exp * ((actor.merit).to_f / total_merit.to_f) * membri

else

autoexp_b = total_exp

end

exp_b = autoexp_b.round

last_level = actor.level

last_skills = actor.skills

actor.gain_exp(exp_b, true)

end

wait_for_message

end

 

end

 

#===============================================================================

# FINE DELLO SCRIPT

#===============================================================================

 

 

 

Compatibilità

Questo sistema dovrebbe essere compatibile con la maggior parte dei BS (sia frontali che laterali), purché strutturati a turni come il BS standard dell'RPGVX.

Lo script NON É COMPATIBILE con gli ABS, e in generale con quei BS che modificano pesantemente la struttura a turni.

 

Bugs e Conflitti Noti

Incompatibilità con gli ABS

 

Altri Dettagli

Fatemi sapere se ci sono problemi, e se vi piace il sistema.

 

EDIT: come al solito nella fretta avevo postato la versione precedente a quella definitiva. Quella presente ora è quella corretta...

Edited by shuuchan

Screen Contest (by Sakura & Shuuchan):

http://rpg2s.net/gif/SCContest3Oct.gif http://rpg2s.net/gif/SCContest3Oct.gif http://rpg2s.net/gif/SCContest2Oct.gif

 

http://i67.servimg.com/u/f67/13/37/20/58/th/gc_r2s10.gif

Bacheca Premi

http://www.rpg2s.net/gif/GC_premio3.gif http://www.rpg2s.net/gif/GC_premio3.gif http://www.rpg2s.net/gif/GC_grafica3.gif http://www.rpg2s.net/gif/GC_grafica1.gif http://www.rpg2s.net/gif/GC_programmazione3.gif http://www.rpg2s.net/gif/GC_programmazione1.gif http://www.rpg2s.net/gif/GC_musica2.gif http://www.rpg2s.net/gif/GC_bestoftool1.gif

 

http://www.rpg2s.net/gif/GC_premio3.gif 3° classificato "Premio BS"

 

http://www.rpg2s.net/gif/GC_premio3.gif 3° classificato "Premio innovazione"

 

http://www.rpg2s.net/gif/GC_grafica3.gif 3° classificato "Miglior Grafica in assoluto"

 

http://www.rpg2s.net/gif/GC_grafica1.gif 1° classificato "Miglior Grafica RmVX"

 

http://www.rpg2s.net/gif/GC_programmazione3.gif 3° classificato "Miglior Programmazione in assoluto"

 

http://www.rpg2s.net/gif/GC_programmazione1.gif 1° classificato "Miglior Programmazione RmVX"

 

http://www.rpg2s.net/gif/GC_musica2.gif 2° classificato "Miglior Colonna Sonora"

 

http://www.rpg2s.net/gif/GC_bestoftool1.gif 1° classificato "Miglior Gioco RmVX"

http://i87.servimg.com/u/f87/13/37/20/58/banner10.png

Scarica la demo ver. 0.2:

RTP non incluse (19 MB) - richiede RMVX ver. 1.02 - Download

Versione completa (52 MB) - Download

Link to comment
Share on other sites

Però!Bravo Shu, ottima idea, cosi chi ha davvero meritato si prende l'esperienza giusta!!Ottimo lavoro!=D

http://www.freankexpo.net/signature/1129.png

2986.png

BIM_Banner3.png

Premi RpgMaker

 


http://www.rpg2s.net/forum/uploads/monthly_01_2017/msg-293-0-48316500-1483794996.jpghttp://www.rpg2s.net/dax_games/r2s_regali2.pngContesthttp://rpg2s.net/gif/SCContest1Oct.gifhttp://rpg2s.net/gif/SCContest3Oct.gifhttp://rpg2s.net/gif/SCContest2Oct.gifhttp://rpg2s.net/gif/SCContest3Oct.gifhttp://rpg2s.net/gif/SCContest3Oct.gifhttp://rpg2s.net/gif/SCContest3Oct.gifhttp://rpg2s.net/gif/SCContest2Oct.gifhttp://rpg2s.net/gif/SCContest3Oct.gifhttp://rpg2s.net/gif/SCContest1Oct.gifhttp://rpg2s.net/gif/SCContest2Oct.gif http://rpg2s.net/gif/SCContest1Oct.gif http://rpg2s.net/gif/SCContest2Oct.gif http://rpg2s.net/gif/SCContest2Oct.gifhttp://rpg2s.net/gif/SCContest1Oct.gifhttp://www.rpg2s.net/awards/bestpixel2.jpghttp://www.rpg2s.net/awards/bestresourCSist2.jpghttp://www.rpg2s.net/awards/mostproductive1.jpghttp://i42.servimg.com/u/f42/13/12/87/37/iconap13.pnghttp://i42.servimg.com/u/f42/13/12/87/37/iconap14.pnghttp://i42.servimg.com/u/f42/13/12/87/37/iconap15.pnghttp://i42.servimg.com/u/f42/13/12/87/37/iconap16.pnghttp://i42.servimg.com/u/f42/13/12/87/37/screen10.pnghttp://www.rpgmkr.net/contest/screen-contest-primo.pnghttp://www.makerando.com/forum/uploads/jawards/iconawards3.png

Link to comment
Share on other sites

Grazie!

...ma il lavoro non era ottimo, visto che la versione postata non era quella corretta! :biggrin:

É che lavorando finiscono sul desktop varie versioni, e non mi ricordo mai qual è quella definitiva...

 

Ora ho provveduto, e lo script nel topic è quello giusto.

Screen Contest (by Sakura & Shuuchan):

http://rpg2s.net/gif/SCContest3Oct.gif http://rpg2s.net/gif/SCContest3Oct.gif http://rpg2s.net/gif/SCContest2Oct.gif

 

http://i67.servimg.com/u/f67/13/37/20/58/th/gc_r2s10.gif

Bacheca Premi

http://www.rpg2s.net/gif/GC_premio3.gif http://www.rpg2s.net/gif/GC_premio3.gif http://www.rpg2s.net/gif/GC_grafica3.gif http://www.rpg2s.net/gif/GC_grafica1.gif http://www.rpg2s.net/gif/GC_programmazione3.gif http://www.rpg2s.net/gif/GC_programmazione1.gif http://www.rpg2s.net/gif/GC_musica2.gif http://www.rpg2s.net/gif/GC_bestoftool1.gif

 

http://www.rpg2s.net/gif/GC_premio3.gif 3° classificato "Premio BS"

 

http://www.rpg2s.net/gif/GC_premio3.gif 3° classificato "Premio innovazione"

 

http://www.rpg2s.net/gif/GC_grafica3.gif 3° classificato "Miglior Grafica in assoluto"

 

http://www.rpg2s.net/gif/GC_grafica1.gif 1° classificato "Miglior Grafica RmVX"

 

http://www.rpg2s.net/gif/GC_programmazione3.gif 3° classificato "Miglior Programmazione in assoluto"

 

http://www.rpg2s.net/gif/GC_programmazione1.gif 1° classificato "Miglior Programmazione RmVX"

 

http://www.rpg2s.net/gif/GC_musica2.gif 2° classificato "Miglior Colonna Sonora"

 

http://www.rpg2s.net/gif/GC_bestoftool1.gif 1° classificato "Miglior Gioco RmVX"

http://i87.servimg.com/u/f87/13/37/20/58/banner10.png

Scarica la demo ver. 0.2:

RTP non incluse (19 MB) - richiede RMVX ver. 1.02 - Download

Versione completa (52 MB) - Download

Link to comment
Share on other sites

Complimenti shuu ormai insieme a eikichi state diventando gli scripter ufficiali del VX :biggrin:

http://img145.imageshack.us/img145/3703/2597sg7.png

http://img229.imageshack.us/img229/9955/mozillafirefoxuser4zj.png

http://i213.photobucket.com/albums/cc264/badbunny699/dexterza5.png

http://img359.imageshack.us/img359/220/clipboard028ar.jpg

http://img402.imageshack.us/img402/9318/virgilflyvy0.gif AsD Fan

http://i67.servimg.com/u/f67/13/07/24/89/banner12.png

Prossimamente...

Link to comment
Share on other sites

Davvero ottimo, bravo :D.

http://th09.deviantart.net/fs26/150/f/2008/091/7/3/Rule_of_Rose__brush__by_maelstromb.png

Coming http://i56.tinypic.com/fu56c6.png Soon...

http://fc06.deviantart.net/fs47/f/2009/163/8/a/Polka_from_Eternal_Sonata_by_oOLuccianaOo.pnghttp://fc00.deviantart.com/fs34/f/2008/306/2/d/Icon_Hojo_by_Sasori_donna.gif

Link to comment
Share on other sites

  • 1 year later...

Grazie infinite per l’utilissimo script! Purtroppo credo di avere un piccolo problema di compatibilità con il LEVEL UP DISPLAY WINDOW di BigEd781. Non m’intendo di script, per cui non so se il problema è risolvibile semplicemente cambiando l’ordine degli script nell’Editor. Se potessi aiutarmi ti sarei molto grato. Ti riporto di séguito lo script del Level Up Display Window, che attualmente si trova SOTTO il tuo Merit Experience Gain. Grazie in ogni caso per il tuo lavoro!

 

Il problema consiste nel fatto che il Level Up Display Window non funziona più.

 

 

#-------------------- Level Up Stat and Display Window --------------------

#------------------------------ By BigEd781 -------------------------------

# www.rpgrevolution.com

#

module LevelUpDisplayConfig

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

# * General Configuration Options

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

#The windowskin file name, minus the extension

WINDOWSKIN_NAME = 'Window'

#The sound effect name that is played when the window is displayed

LEVEL_UP_SE = 'Item1'

#The sound effect volume

LEVEL_UP_SE_VOLUME = 75

#Display the skill window?

USE_SKILL_WINDOW = true

#The title text used in the "New Skills" window (if not nil)

#For example, NEW_SKILL_TITLE_TEXT = 'Abilities'

NEW_SKILL_TITLE_TEXT = nil

#Show the actor's sprite?

USE_SPRITE_GRAPHIC = false

#Opacity of the main window

WINDOW_OPACITY = 160

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

# * Stat Window Configuration

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

#The color of the actor's name in the window (blue by default)

NAME_COLOR = Color.new(120,170,220)

#The color of the actor's level in the window (gold by default)

LEVEL_COLOR = Color.new(245,240,170)

#The color of the actor's stat names in the window (gold by default)

STAT_COLOR = Color.new(245,240,170)

#The color of the actor's old stat values (white by default)

OLD_STAT_COLOR = Color.new(255,255,255)

#The color of the actor's new stat values, if a net gain (green by default)

NEW_STAT_VAL_COLOR = Color.new(200,240,170)

#The color of the actor's new stat values, if a net loss (red by default)

STAT_VAL_LOSS_COLOR = Color.new(220, 135, 135)

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

# * Skill Window Configuration

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

#The color of the text in the skills title window

SKILL_TITLE_COLOR = Color.new(245,240,170)

#The color of the new skills text in the skills window

SKILL_WINDOW_FONT_COLOR = Color.new(200,240,170)

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

# * There is no need to modify the constants below

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

STAT_WINDOW_WIDTH = 320

SKILL_WINDOW_WIDTH = 165

WINDOW_HEIGHT = 220

SUB_WINDOW_HEIGHT = 45

 

end

 

include LevelUpDisplayConfig

#==========================================================================

# * Window_LevelUpdate

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

# The main window that appears in battle when a level is gained.

# Displays stat info, faceset, and (optionally) the actor sprite.

#==========================================================================

class Window_LevelUpdate < Window_Base

 

def initialize(actor)

w = STAT_WINDOW_WIDTH

h = WINDOW_HEIGHT

if USE_SKILL_WINDOW

super(272 - (w / 2) - (SKILL_WINDOW_WIDTH / 2), 50, w, h)

else

super(272 - (w / 2), 50, w, h)

end

self.windowskin = Cache.system(WINDOWSKIN_NAME)

self.back_opacity = 160

@actor = actor

@animation_index = 0

@arrow = Cache.picture('level_up_arrow')

@y_offset = 12 #give some room under level display

#begin drawing new level and old stat text

@col_one_offset = 0

#Draw old stats

@col_two_offset = @col_one_offset + 60

#begin drawing Faceset/sprite and skills gained

@col_four_offset = 0

#begin drawing Faceset/sprite graphics

@col_five_offset = 190

#play the sound effect

se = RPG::SE.new(LEVEL_UP_SE, LEVEL_UP_SE_VOLUME)

se.play

#calculates the offet for drawing level info

calc_level_offsets

setup_name_window

draw_stat_names

draw_old_stat_values

draw_arrows

draw_new_stat_values

draw_actor_rep

update

end

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

# * Create and display the name window

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

def setup_name_window

@name_window = Window_Base.new(self.x + 20, self.y - 30 , fit_to_text(@actor.name), SUB_WINDOW_HEIGHT)

@name_window.windowskin = Cache.system(WINDOWSKIN_NAME)

@name_window.back_opacity = 245

@name_sprite = Sprite.new

@name_sprite.bitmap = Bitmap.new(@name_window.width, @name_window.height)

@name_sprite.bitmap.font.color = NAME_COLOR

@name_sprite.x = @name_window.x + 15

@name_sprite.y = @name_window.y - 10

@name_sprite.z = 300

@name_sprite.bitmap.draw_text(0, 0, @name_sprite.bitmap.width, 60, @actor.name)

end

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

# * Draws the level and stat text (not the values themselves)

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

def draw_stat_names

self.contents.font.color = LEVEL_COLOR

self.contents.draw_text(@col_one_offset, 0, 60, WLH, "Lv.")

self.contents.font.color = STAT_COLOR

self.contents.draw_text(@col_one_offset, y_incr, 60, WLH, Vocab.hp)

self.contents.draw_text(@col_one_offset, y_incr, 60, WLH, Vocab.mp)

self.contents.draw_text(@col_one_offset, y_incr, 60, WLH, Vocab.atk)

self.contents.draw_text(@col_one_offset, y_incr, 60, WLH, Vocab.def)

self.contents.draw_text(@col_one_offset, y_incr, 60, WLH, Vocab.spi)

self.contents.draw_text(@col_one_offset, y_incr, 60, WLH, Vocab.agi)

#reset the font color

self.contents.font.color = Font.default_color

#reset the y_offset to 12

y_incr_reset

end

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

# * Draws the old level and stat values

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

def draw_old_stat_values

self.contents.font.color = OLD_STAT_COLOR

self.contents.draw_text(@col_level_old_offset, 0, 60, WLH, @actor.last_level)

self.contents.draw_text(@col_two_offset, y_incr, 60, WLH, @actor.last_hp)

self.contents.draw_text(@col_two_offset, y_incr, 60, WLH, @actor.last_mp)

self.contents.draw_text(@col_two_offset, y_incr, 60, WLH, @actor.last_atk)

self.contents.draw_text(@col_two_offset, y_incr, 60, WLH, @actor.last_def)

self.contents.draw_text(@col_two_offset, y_incr, 60, WLH, @actor.last_spi)

self.contents.draw_text(@col_two_offset, y_incr, 60, WLH, @actor.last_agi)

#reset the font color

self.contents.font.color = Font.default_color

#reset the y_offset to 12

y_incr_reset

end

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

# * Draws the arrows

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

def draw_arrows

if @actor.last_hp - 100 < 0

@col_three_offset = @col_two_offset + 30

elsif @actor.last_hp - 1000 < 0

@col_three_offset = @col_two_offset + 40

else

@col_three_offset = @col_two_offset + 50

end

draw_arrow(@col_level_arrow_offset, 6) #level

draw_arrow(@col_three_offset, y_incr + 6) #hp

draw_arrow(@col_three_offset, y_incr + 6) #mp

draw_arrow(@col_three_offset, y_incr + 6) #atk

draw_arrow(@col_three_offset, y_incr + 6) #def

draw_arrow(@col_three_offset, y_incr + 6) #spi

draw_arrow(@col_three_offset, y_incr + 6) #agi

calc_col_four_offset(@col_three_offset)

#reset the y_offset to 12

y_incr_reset

end

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

# * Draws the new level and stat values

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

def draw_new_stat_values

draw_new_stat(@col_level_new_offset, 0, 60, WLH, @actor.last_level, @actor.level)

draw_new_stat(@col_four_offset, y_incr, 60, WLH, @actor.last_hp, @actor.maxhp)

draw_new_stat(@col_four_offset, y_incr, 60, WLH, @actor.last_mp, @actor.maxmp)

draw_new_stat(@col_four_offset, y_incr, 60, WLH, @actor.last_atk, @actor.base_atk)

draw_new_stat(@col_four_offset, y_incr, 60, WLH, @actor.last_def, @actor.base_def)

draw_new_stat(@col_four_offset, y_incr, 60, WLH, @actor.last_spi, @actor.base_spi)

draw_new_stat(@col_four_offset, y_incr, 60, WLH, @actor.last_agi, @actor.base_agi)

self.contents.font.color = Font.default_color

#reset the y_offset to 12

y_incr_reset

end

 

def draw_new_stat(x, y, w, h, prev_val, val)

if val > prev_val #gain

self.contents.font.color = NEW_STAT_VAL_COLOR

elsif val == prev_val #no change

self.contents.font.color = OLD_STAT_COLOR

else #loss

self.contents.font.color = STAT_VAL_LOSS_COLOR

end

self.contents.draw_text(x, y, w, h, val)

end

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

# * Draws the faceset and optionally the actor sprite

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

def draw_actor_rep

draw_actor_face(@actor, @col_five_offset, 0)

if (USE_SPRITE_GRAPHIC)

x_pos = @col_five_offset + ((self.width - @col_five_offset) / 2) - 18

draw_character(@actor.character_name, @actor.character_index, x_pos, 160)

end

end

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

# * Draws an arrow

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

def draw_arrow(x, y)

src_rect = Rect.new(0, 0, @arrow.width, @arrow.height)

self.contents.blt(x, y, @arrow, src_rect)

end

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

# * figures out the spacing for the level text display

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

def calc_level_offsets

@col_level_old_offset = @col_one_offset + 30

if @actor.last_level < 10

@col_level_arrow_offset = @col_level_old_offset + 20

else

@col_level_arrow_offset = @col_level_old_offset + 30

end

@col_level_new_offset = @col_level_arrow_offset + 26

end

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

# * Increments the y counter

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

def y_incr

@y_offset += WLH

return @y_offset

end

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

# * Resets the y counter

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

def y_incr_reset

@y_offset = 12

end

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

# * calculate where to draw col four text (new stat values)

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

def calc_col_four_offset(col_three)

@col_four_offset = col_three + 22

end

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

# * Fit the window width to the text

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

def fit_to_text(text)

w = self.contents.text_size(text).width + 32

return w > 90 ? w : 90

end

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

# * Update the child window position

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

def update_child_window_pos

@name_window.x = self.x + 20

@name_window.y = self.y - 30

@name_sprite.x = @name_window.x + 15

@name_sprite.y = @name_window.y - 10

end

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

# * Destroy the sprite!

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

def dispose

super

@name_window.dispose

@name_sprite.dispose

end

 

end

#============================================================================

# * Window_SkillUpdate

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

# The learned skill window

#============================================================================

class Window_SkillUpdate < Window_Base

 

def initialize(actor, parent_x, parent_y, parent_width)

x = parent_x + parent_width

h = WINDOW_HEIGHT

w = SKILL_WINDOW_WIDTH

super(x, parent_y, w, h)

self.windowskin = Cache.system(WINDOWSKIN_NAME)

self.back_opacity = WINDOW_OPACITY

self.contents.font.color = SKILL_WINDOW_FONT_COLOR

@actor = actor

@skills = []

setup_title_window

populate_skill_list

end

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

# * create the title window

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

def setup_title_window

#check to see if custom text is defined

if NEW_SKILL_TITLE_TEXT == nil

skill_title_text = sprintf("Nuova %s", Vocab.skill)

else

skill_title_text = NEW_SKILL_TITLE_TEXT

end

middle_parent = self.x + (self.width / 2)

w = fit_to_text(skill_title_text)

h = SUB_WINDOW_HEIGHT

x = middle_parent - (w / 2)

y = self.y - 30

@title_window = Window_Base.new(x, y, w, h)

@title_window.windowskin = Cache.system(WINDOWSKIN_NAME)

@title_window.back_opacity = 255

@title_sprite = Sprite.new

@title_sprite.bitmap = Bitmap.new(@title_window.width, @title_window.height)

@title_sprite.bitmap.font.color = SKILL_TITLE_COLOR

@title_sprite.x = @title_window.x + 15

@title_sprite.y = @title_window.y + 4

@title_sprite.z = 300

@title_sprite.bitmap.draw_text(0, 0, @title_sprite.bitmap.width, 32, skill_title_text)

end

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

# * My edit of draw_item_name.

# Necessary because the default one changes the font color.

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

def draw_my_item_name(item, x, y, enabled = true)

if item != nil

draw_icon(item.icon_index, x, y, enabled)

self.contents.font.color.alpha = enabled ? 255 : 128

self.contents.draw_text(x + 24, y, 172, WLH, item.name)

end

end

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

# * draw all of the skills that were learned

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

def populate_skill_list

skills = @actor.last_learned_skills

y = 0

for skill in skills

draw_my_item_name(skill, 0, y)

y += 32

end

end

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

# * Fit the window width to the text

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

def fit_to_text(text)

return self.contents.text_size(text).width + 32

end

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

# * Kill the sprite!

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

alias :eds_old_dispose :dispose

def dispose

eds_old_dispose

@title_window.dispose

@title_sprite.dispose

end

 

end

#==========================================================================

# * Game_Actor

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

# overrides -

# * display_level_up (if DISPLAY_DEF_MESSAGE is set to false in config)

#==========================================================================

class Game_Actor < Game_Battler

 

attr_reader :last_level

attr_reader :last_hp

attr_reader :last_mp

attr_reader :last_atk

attr_reader :last_def

attr_reader :last_spi

attr_reader :last_agi

attr_reader :last_learned_skills

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

# * Change Experience

# exp : New experience

# show : Level up display flag

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

alias :eds_old_change_exp :change_exp

def change_exp(exp, show)

#save off the old paramters

prev_skills = skills

@last_level = @level

@last_hp = self.maxhp

@last_mp = self.maxmp

@last_atk = self.atk

@last_def = self.def

@last_spi = self.spi

@last_agi = self.agi

eds_old_change_exp(exp, show)

@last_learned_skills = skills - prev_skills

end

 

if USE_SKILL_WINDOW #below method is only used if we are using the skill window

 

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

# * Show Level Up Message

# new_skills : Array of newly learned skills

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

# If we are not displaying the standard message when

# gaining a level, simply remove the loop that creates

# the learned skills message. Continue to display

# the skills that were learned if we are not in battle.

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

alias :eds_old_display_level_up :display_level_up

def display_level_up(new_skills)

if $game_temp.in_battle

$game_message.new_page

text = sprintf(Vocab::LevelUp, @name, Vocab::level, @level)

$game_message.texts.push(text)

else

eds_old_display_level_up(new_skills)

end

end

 

end #skill window check

 

end

#============================================================================

# * Scene_Battle

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

# overrides -

# * display_level_up

#============================================================================

class Scene_Battle < Scene_Base

 

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

# * Display Level Up

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

def display_level_up

#patch for KGC Equip Learn Skill script

if $imported != nil and $imported["EquipLearnSkill"]

display_master_equipment_skill

end

exp = $game_troop.exp_total

for actor in $game_party.existing_members

last_level = actor.level

last_skills = actor.skills

actor.gain_exp(exp, true)

if actor.level > last_level

win = Window_LevelUpdate.new(actor)

#if we are using the skill window and the skills have changed...

if USE_SKILL_WINDOW && last_skills.length != actor.skills.length

s_win = Window_SkillUpdate.new(actor, win.x, win.y, win.width)

wait_for_message

s_win.dispose if USE_SKILL_WINDOW

else

#move the window back to center screen and update the name window

win.x = 272 - (win.width / 2)

win.update_child_window_pos

wait_for_message

end

win.dispose

end

end

end

end

 

 

Edited by derkunstler
Link to comment
Share on other sites

Sì, non può funzionare perché nel mio script ho inserito un "personale" Level Up Display Window.

Se li copi invertiti rischia di non funzionare il Merit Exp Gain.

 

Provo a vedere cosa si può fare, anche se non garantisco risultati.

Screen Contest (by Sakura & Shuuchan):

http://rpg2s.net/gif/SCContest3Oct.gif http://rpg2s.net/gif/SCContest3Oct.gif http://rpg2s.net/gif/SCContest2Oct.gif

 

http://i67.servimg.com/u/f67/13/37/20/58/th/gc_r2s10.gif

Bacheca Premi

http://www.rpg2s.net/gif/GC_premio3.gif http://www.rpg2s.net/gif/GC_premio3.gif http://www.rpg2s.net/gif/GC_grafica3.gif http://www.rpg2s.net/gif/GC_grafica1.gif http://www.rpg2s.net/gif/GC_programmazione3.gif http://www.rpg2s.net/gif/GC_programmazione1.gif http://www.rpg2s.net/gif/GC_musica2.gif http://www.rpg2s.net/gif/GC_bestoftool1.gif

 

http://www.rpg2s.net/gif/GC_premio3.gif 3° classificato "Premio BS"

 

http://www.rpg2s.net/gif/GC_premio3.gif 3° classificato "Premio innovazione"

 

http://www.rpg2s.net/gif/GC_grafica3.gif 3° classificato "Miglior Grafica in assoluto"

 

http://www.rpg2s.net/gif/GC_grafica1.gif 1° classificato "Miglior Grafica RmVX"

 

http://www.rpg2s.net/gif/GC_programmazione3.gif 3° classificato "Miglior Programmazione in assoluto"

 

http://www.rpg2s.net/gif/GC_programmazione1.gif 1° classificato "Miglior Programmazione RmVX"

 

http://www.rpg2s.net/gif/GC_musica2.gif 2° classificato "Miglior Colonna Sonora"

 

http://www.rpg2s.net/gif/GC_bestoftool1.gif 1° classificato "Miglior Gioco RmVX"

http://i87.servimg.com/u/f87/13/37/20/58/banner10.png

Scarica la demo ver. 0.2:

RTP non incluse (19 MB) - richiede RMVX ver. 1.02 - Download

Versione completa (52 MB) - Download

Link to comment
Share on other sites

Gran bello script! Rende più realistico l'avanzamento di livello dei vari pg e l'esperienza di gioco risulta più profonda...!

Bravo! ^^

Progetti

 

Titolo: Second Darkness

Tool: RPG Maker VX

Status: in lavorazione

-------------------------------------------------------

http://img178.imageshack.us/img178/5395/23231hw2.png

 

http://img90.imageshack.us/img90/236/sonyvaiouser.png

 

http://img232.imageshack.us/img232/9705/windowsvistauser.png

 

http://img190.imageshack.us/img190/8505/firefoxuser.png

 

http://img178.imageshack.us/img178/7489/14883bb5.png

 

http://img17.imageshack.us/img17/6783/photoshopmaster.png

 

http://img17.imageshack.us/img17/9448/starwarsfan.png

 

http://img17.imageshack.us/img17/858/pinkfloydfan.png

 

http://img188.imageshack.us/img188/5360/queenfan.png

 

http://img190.imageshack.us/img190/803/cocacoladrinker.png

-------------------------------------------------------

Problemi con il tuo progetto?

Visita la

Bottega di Vitt!

-------------------------------------------------------

Link to comment
Share on other sites

  • 4 months later...

Non so se è un'info utile, ma l'ho appena testato su ATB1.1f + SBS3.3d e funziona ottimamente anche in modalità ACTIVE (barre sempre attive).

Peccato che come già segnalato non funzioni insieme al "Level Up Stat and Display Window" di BigEd781... sarebbe stato perfetto.

Edited by Shiryo
Link to comment
Share on other sites

  • 9 months later...

scusate il necropost, anzitutto, fantastico script, complimenti, però un problema, in battaglia ho provato a fare un evento nel quale subentra un altro attore, ebbene quando prova ad attaccare, crasha dandomi questo errore:

 

Script 'Merit Exp Gain' line 295: FloatDomainError occured

 

Infinity

 

qualcuno può aiutarmi perfavore ?

Edited by Magnus Snake
"E Tutto quello che chiederete con fede nella preghiera, lo otterrete"Gesù (Matteo 21,22)
http://i41.tinypic.com/2qn9pcp.png

Link to comment
Share on other sites

In ruby quell'errore viene generato quando un numero float viene diviso per 0 . . .

 

Non ho il VX e non posso approfondire, ma mi sembra un buon punto di partenza . . .

 


SCRIPT RGSS (RPG Maker XP) VINTAGE LIBRARY [2018+]


Breaking (in ogni senso) News: "Treno deraglia per via del seno di Sakurai Aoi . . ." - Info nello spoiler !!

 


http://afantasymachine.altervista.org/_altervista_ht/NOOOOOOOOOilMIOtreninooooo_500.gif


Non riesco a smettere di essere affascinato da immagini come questa . . .

http://anime.vl-vostok.ru/art/photos2011/17/78049800/wall_VladAnime_WWA_1885-1680x1050.jpg


Alcuni wallpapers che faccio ruotare sul mio vecchio PC . . .


http://afantasymachine.altervista.org/_altervista_ht/gits_window.jpg

http://afantasymachine.altervista.org/_altervista_ht/madoka_group01.jpg
http://afantasymachine.altervista.org/_altervista_ht/arisu_picipici_01.jpg
http://afantasymachine.altervista.org/_altervista_ht/phantom_wp01_einzwei.jpg


La parte più spassosa della mia vita è quando gli altri cercano di spiegarmi i miei pensieri . . .


BBCode Testing


Typeface & Size



Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...