Jump to content
Rpg²S Forum
  • 0

Mostrare i valori parziali e totali delle stat


Luke85
 Share

Question

Vorrei integrare nella scheda "status" alcune funzionalità dello script "stat points distribution" che potete trovare qui: http://www.rpgmakervx.net/index.php?showtopic=30962

ci sono ad esempio queste righe:

 

self.contents.draw_text(10,120,100,20,Vocab::atk)

self.contents.draw_text(10,140,100,20,(actor.atk-bonus_atk).to_s+" + "+bonus_atk.to_s)

 

dove viene mostrata la parola "attacco" e poi l'attacco di base (totale - bonus oggetti) e di fianco l'attacco aggiunto dagli oggetti (bonus oggetti)

ad esempio, se ho 10 in attacco e una spada mi da 3, esce:

 

Attacco 10 + 3

 

per usare quelle variabili "bonus_atk" lo script inizializza ciò:

 

#1) prende le 5 cose equipaggiate

 

weapon = $data_weapons[actor.weapon_id]

shield = $data_armors[actor.armor1_id]

helm =$data_armors[actor.armor2_id]

body =$data_armors[actor.armor3_id]

accessory =$data_armors[actor.armor4_id]

 

#2) setta il bonus a zero per inizializzarlo

 

bonus_atk = 0

 

#3) se le 5 cose sono equipaggiate, ne somma i bonus attacco individuali mettendoli in bonus_atk

 

if weapon

bonus_atk += weapon.atk

end

 

if shield

bonus_atk += shield.atk

end

 

if helm

bonus_atk += helm.atk

end

 

if body

bonus_atk += body.atk

end

 

if accessory

bonus_atk += accessory.atk

end

 

lo script funziona molto bene e questo è solo un estratto.

tuttavia, prendendo questa parte e mettendola nel menu status da me modificato, mi da un errore dicendo che "non è stato definito il metodo o la classe Actor". Ma, che io sappia, ciò non avviene nemmeno nell'altro script, che ho esaminato da cima a fondo. Eppure l'altro funziona senza bloccarsi, come potete constatare provandolo dal link ad inizio post.

 

Dunque: che succede? come posso mostrare questa cosa (che ovviamente ripeterò per le altre 3 stat) nella mia finestra status modificata, senza dover usare una finestra in più da menu rappresentata dallo script stat point distribution?

 

Grazie!!! :rovatfl:

Edited by Luke85
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...