Jump to content
Rpg²S Forum
  • 0

Problema con lo script KGC_RankConception


elle92
 Share

Question

Salve a tutti finalmente riesco a rimettere le mani sul mio progetto anche se per poco=(non ho nemmeno iniziato che già sono iniziati i problemixD,cmq ho trovato questo script giapponese che permetterebbe di cambiare la posizione del personaggio in battaglia legata alla classe,nel senso che fa scegliere se mettere il personaggio avanti(in prima linea),in mezzo o indietro,è quell'opzione che si sceglie nel database nella sezione classi.Lo script funziona(perchè visualizza anche una picture che indica la posizione attuale) solo che non riesco a cambiare tra le varie posizioni per colpa della lingua>_> da quanto ho capito bisogna creare un'abilità e settare gli attributi nella sezione Sistema del database,ma dopo svariati tentativi ancora nulla posto lo script,così magari chi è più esperto guardando lo script ci capisce qualcosa^^' inoltre ho lasciato anche alcuni commenti con alcuni termini che ho tradotto(alla meglio),ho anche provato a cercarlo oltre che in questo sito anche in altri siti(anche spagnolixD),ma niente non sono riuscito a trovarlo al di fuori dei siti jappo>__<.Grazie in anticipo^_^

 

 

 

#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

#_/ ◆ 隊列概念 - KGC_RankConception ◆

#_/ ◇ Last update : 2008/05/11 ◇

#_/----------------------------------------------------------------------------

#_/ 戦闘時に隊列・射程の概念を追加します。

#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

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

# ★ カスタマイズ項目 ★

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

module KGC

# ◆射程未設定時の射程距離 #->L'intervallo di gamma quando non configurato

RC_DEFAULT_RANGE = 4

# ◆隊列用画像

# "Graphics/Pictures" から読み込む。拡張子省略可。

RC_RANK_IMAGE = "position"

# ◆隊列画像表示位置補正値

# 通常は 120。

# ≪多人数パーティ≫などを併用する時は微調整。

RC_RANK_OFFSET = 120

end

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

$imported = {} if $imported == nil

$imported["RankConception"] = true

if $game_special_elements == nil

$game_special_elements = {}

$data_system = load_data("Data/System.rxdata")

end

# 隊列属性

$game_special_elements["rank"] = $data_system.elements.index("隊列") #->rank

# 射程属性

$game_special_elements["range"] = /射程(\d)/ #->range

# 隊列移動属性

$game_special_elements["move_rank"] = /(前|中|後)衛移動/ #-> Mamoru mossa (dopo il | | di fronte)

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

# ■ Game_Actor

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

class Game_Actor < Game_Battler

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

# ● セットアップ

# actor_id : アクター ID

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

alias setup_KGC_RankConception setup

def setup(actor_id)

setup_KGC_RankConception(actor_id)

# 隊列を初期化

@position = $data_classes[@class_id].position

end

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

# ● 隊列の取得

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

def position

@position = $data_classes[@class_id].position if @position == nil

return @position

end

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

# ● 隊列の設定

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

def position=(p)

@position = p

end

end

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

 

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

# ■ Game_Battler (分割定義 2)

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

class Game_Battler

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

# ● 射程有効判定

# attacker : 攻撃者

# action : 処理行動

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

def within_range?(attacker, action = nil)

# 射程を取得

if action != nil

for element in action.element_set.compact

element_name = $data_system.elements[element]

# 射程属性を持っている場合

if $game_special_elements["range"] =~ element_name

range = $1.to_i if $1 != nil

break

end

end

end

# 射程が無い場合

if action == nil || range == nil

range = KGC::RC_DEFAULT_RANGE

end

# 攻撃者の隊列を取得

if attacker.is_a?(Game_Actor)

a_pos = attacker.position

else

if $game_special_elements["rank"] != nil

case $data_enemies[attacker.id].element_ranks[$game_special_elements["rank"]]

when 1..2 # 前衛(A,B)

a_pos = 0

when 3 # 中衛©

a_pos = 1

when 4..6 # 後衛(D,E,F)

a_pos = 2

end

else

a_pos = 1

end

end

# 攻撃対象の隊列を取得

if self.is_a?(Game_Actor)

t_pos = self.position

else

if $game_special_elements["rank"] != nil

case $data_enemies[self.id].element_ranks[$game_special_elements["rank"]]

when 1..2 # 前衛(A,B)

t_pos = 0

when 3 # 中衛©

t_pos = 1

when 4..6 # 後衛(D,E,F)

t_pos = 2

end

else

t_pos = 1

end

end

# 有効射程を判定

return a_pos + t_pos <= range

end

end

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

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

# ■ Game_Battler (分割定義 3)

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

class Game_Battler

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

# ● 通常攻撃の効果適用

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

alias attack_effect_KGC_RankConception attack_effect

def attack_effect(attacker)

# 射程外の場合

action = attacker.is_a?(Game_Actor) ? ($imported["EquipExtension"] ?

$data_weapons[attacker.weapon_id(attacker.attack_count)] :

$data_weapons[attacker.weapon_id]) : nil

unless self.within_range?(attacker, action)

# ダメージに "Miss" を設定

self.damage = "Miss"

# クリティカルフラグをクリア

self.critical = false

# 偽を返す

return false

end

# 元の処理を実行

return attack_effect_KGC_RankConception(attacker)

end

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

# ● スキルの効果適用

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

alias skill_effect_KGC_RankConception skill_effect

def skill_effect(user, skill)

# 射程外の場合

unless self.within_range?(user, skill)

# ダメージに "Miss" を設定

self.damage = "Miss"

# クリティカルフラグをクリア

self.critical = false

# 偽を返す

return false

end

# 隊列移動属性判定

for element in skill.element_set.compact

element_name = $data_system.elements[element]

# 射程属性を持っている場合

if $game_special_elements["move_rank"] =~ element_name

move_position = $1

break

end

end

# 隊列移動属性を持っていない場合

if move_position == nil

# 元の処理を実行

return skill_effect_KGC_RankConception(user, skill)

end

# クリティカルフラグをクリア

self.critical = false

# スキルの効果範囲が HP 1 以上の味方で、自分の HP が 0、

# またはスキルの効果範囲が HP 0 の味方で、自分の HP が 1 以上の場合

if ((skill.scope == 3 || skill.scope == 4) && self.hp == 0) ||

((skill.scope == 5 || skill.scope == 6) && self.hp >= 1)

# メソッド終了

return false

end

# 有効フラグをクリア

@effective = false

# コモンイベント ID が有効の場合は有効フラグをセット

@effective |= skill.common_event_id > 0

# 第一命中判定

hit = skill.hit

if skill.atk_f > 0

hit *= user.hit / 100

end

hit_result = (rand(100) < hit)

# 不確実なスキルの場合は有効フラグをセット

@effective |= hit < 100

# 命中の場合

if hit_result == true

# ステート変化

@state_changed = false

effective |= states_plus(skill.plus_state_set)

effective |= states_minus(skill.minus_state_set)

# 指定位置に移動

case move_position

when "前" #-> prima

if self.is_a?(Game_Actor)

self.position = 0

else

self.element_ranks[$game_special_elements["rank"]] = 1

end

when "中" #-> in

if self.is_a?(Game_Actor)

self.position = 1

else

self.element_ranks[$game_special_elements["rank"]] = 3

end

when "後" #->più tardi/dopo

if self.is_a?(Game_Actor)

self.position = 2

else

self.element_ranks[$game_special_elements["rank"]] = 4

end

end

# 戻る

return true

end

return false

end

end

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

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

# ■ Window_BattleStatus

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

class Window_BattleStatus < Window_Base

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

# ● 名前の描画

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

alias draw_actor_name_KGC_RankConception draw_actor_name unless $@

def draw_actor_name(actor, x, y)

draw_actor_name_KGC_RankConception(actor, x, y)

draw_actor_position(actor, x, y, KGC::RC_RANK_OFFSET)

end

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

# ● 隊列の描画

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

def draw_actor_position(actor, x, y, width)

image = RPG::Cache.picture(KGC::RC_RANK_IMAGE)

src_rect = Rect.new(actor.position * 32, 0, 32, 32)

self.contents.blt(x + width - 32, y, image, src_rect)

end

end

 

 

 

Posto anche le istruzioni giapponesi,io ho provato a tradurle con il traduttore,ma con scarsi risultati^^'

 

 

 

 

隊列によって、距離が次のように決まります。

 前衛: 0 中衛: 1 後衛: 2

アクターの場合は、クラスで指定した隊列を使用します。

エネミーの場合は隊列という属性を作成し、「属性有効度」で設定します。

属性有効度がA, Bの場合は「前衛」、C の場合は「中衛」、D, E, F の場合は「後衛」扱いになります。

攻撃時に、↑で定義した攻撃者・防御者の距離を加算し、それが射程内ならば攻撃判定、射程外の場合はミスとなります。

例えば、攻撃者が前衛・防御者が後衛の場合、両者の距離を足すと 0 + 2 = 2 となり、射程が 2 以上の攻撃しか届かなくなります。

攻撃射程は射程xという属性で指定することができます。

 例:射程3

攻撃に射程属性が指定されていない場合、カスタマイズ項目の DEFAULT_RANGE が攻撃射程となります。

アクターの隊列は、(前|中|後)衛移動という属性をセットしたスキルによって変更できます。

例えば前衛移動属性をセットしたスキルの場合、使用すると対象を前衛へ移動させます。

現在の隊列は、戦闘ステータスの名前右側の隊列記号から判別できます。

隊列記号用の画像は、下のものを使用してください。

左から順に「前衛」「中衛」「後衛」を表します。

画像を自作する場合は、32x32を横に三つ並べて作成してください。

 

 

Progetti in Corso:
 

[spoiler]

The Devil's Sonata
Il mio primo progetto con l'XP,attualmente in pausa per vari motivi,quindi ne approfitto per riorganizzare le idee visto che ad ogni passo avanti nel progetto,mi accorgo dei vari errori che ci sono^^'

Status:
Storia: 70% ->Tutta scritta nella mia testa dall'inizio alla fine,mancano gli ultimi dettagli e ovviamente come realizzarli.
Mapping: 15% -> Essendo poco pratico lascio la costruzione di Città e Dungeon alla fine per ora mi concentro sulle altre cose,inizierò quando ne avrò bisogno per la storia.
Eventi: 30% -> Per eventi intendo anche i vari dialoghi tra i personaggi principali il 30% è per gli eventi di gioco(ciclio giorno/notte,mostri,skill ecc..)
Quest: 1% -> Per "Quest" si intende tutto ciò che è secondario dalla semplici missioni ai dialoghi con gli NPC...
Script: 70% ->Anche se sto pensando di cambiare Battle Systems per vari problemi ciò farebbe scendere la % a 30-40%
Database: 30% -> Ci sono tutti i PG, e quasi tutti gli oggetti,armi e skill, mancano i nemici e alcuni boss.
Completamento: 30-35% -> Più o meno la base c'è,ma manca ancora molto il tutto è reso più difficile a causa della mia inesperienza con gli script,mapping e incompetenza generalexD l'unica cosa in cui sono bravo è la grafica,anche se quella usata nel gioco non mi piace molto infatti anche quella è da rivedere..



Per Maggiori dettagli vi invito a visitare il topic del progetto:
http://www.rpg2s.net/forum/index.php?showtopic=14695

Sono ben accette critiche(costruttivexD) e consigli di ogni genere!^_^

[/spoiler]
 

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

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...