Jump to content
Rpg²S Forum
  • 0

Visualizzare Variabili


tidus00
 Share

Question

Come da titolo, cerco uno script che mi faccia visuallizare il numero di una variabile su mappa, ma non tramite messaggio ma tramite animazione tipo danno da battaglia... tipo come nello Xas che escono i danni! Ecco, mi servirebbe uno script che farebbe lo stesso effetto, solo che invece di dare danni, deve mostrare solo il numero della variabile. Grazie! ;)

http://i46.tinypic.com/260qs1l.jpghttp://i48.tinypic.com/21owyt0.jpghttp://i45.tinypic.com/oj12x5.jpg

http://i45.tinypic.com/oj12x5.jpghttp://i48.tinypic.com/2qanw9v.jpghttp://i45.tinypic.com/oj12x5.jpg

http://i49.tinypic.com/2cpdkb8.jpg

 

http://i47.tinypic.com/vpyfix.jpg http://i45.tinypic.com/jago40.jpg http://img231.imageshack.us/img231/8504/tidus1.png

 

non esco l'ora che veda

Un gioco così ben fatto da farti sballare la testa! XD

 

 

 

 

http://img27.imageshack.us/img27/8540/dsbar.png

http://img294.imageshack.us/img294/6876/nostalebar.png

http://img90.imageshack.us/img90/2158/tbars.png

http://i40.tinypic.com/soqvb8.jpg

http://i45.tinypic.com/29duu1l.jpg

http://img237.imageshack.us/img237/2482/30275.png

http://img182.imageshack.us/img182/8/rpgxpbarrpgmzv1.png

http://img195.imageshack.us/img195/6998/userbarannette.png

http://i48.tinypic.com/awdylh.jpg

Link to comment
Share on other sites

15 answers to this question

Recommended Posts

  • 0
beh, mettiamo che voglia fare un ABS ad eventi... mi servirebbe per questo, per far vedere il danno!

http://i46.tinypic.com/260qs1l.jpghttp://i48.tinypic.com/21owyt0.jpghttp://i45.tinypic.com/oj12x5.jpg

http://i45.tinypic.com/oj12x5.jpghttp://i48.tinypic.com/2qanw9v.jpghttp://i45.tinypic.com/oj12x5.jpg

http://i49.tinypic.com/2cpdkb8.jpg

 

http://i47.tinypic.com/vpyfix.jpg http://i45.tinypic.com/jago40.jpg http://img231.imageshack.us/img231/8504/tidus1.png

 

non esco l'ora che veda

Un gioco così ben fatto da farti sballare la testa! XD

 

 

 

 

http://img27.imageshack.us/img27/8540/dsbar.png

http://img294.imageshack.us/img294/6876/nostalebar.png

http://img90.imageshack.us/img90/2158/tbars.png

http://i40.tinypic.com/soqvb8.jpg

http://i45.tinypic.com/29duu1l.jpg

http://img237.imageshack.us/img237/2482/30275.png

http://img182.imageshack.us/img182/8/rpgxpbarrpgmzv1.png

http://img195.imageshack.us/img195/6998/userbarannette.png

http://i48.tinypic.com/awdylh.jpg

Link to comment
Share on other sites

  • 0

Naruto quello lo so fare già facilmente, il fatto è che mi servono tanti tanti numeri, e altre tante tante pictures XD

Quindi l'unica è usare un Call Script che faccia apparire/sparire/muovere/cambiare size e color, di scritte e numeri (numeri prelevati dalle variabili che si modificano dagli eventi) >__<

 

Qualcosina sto imparando dell'rgss ma i comandi non li conosco...

Sulle lezioni si arriva a parlare della struttura e dei comandi generici (operatori, if, case, loop, cicli) ma quelli più pesi nope XD

Per questo chiedo sempre tanta roba é.è (e rompo pure parecchio le palle XD)

http://i30.tinypic.com/xehois.gif

} 2rA - web site {

E' disponibile il primo capitolo completo di 2rA!

} 2rA: Capitolo I {

Link to comment
Share on other sites

  • 0

ma poi, mettiamo che le scritte di danni le faccio a numeri con le picture, come faccio a fare uscire sempre il danno sopra l'eroe o sopra il nemico? :Ok:

 

Urge uno script o uno scripter... :wacko:

Edited by tidus00

http://i46.tinypic.com/260qs1l.jpghttp://i48.tinypic.com/21owyt0.jpghttp://i45.tinypic.com/oj12x5.jpg

http://i45.tinypic.com/oj12x5.jpghttp://i48.tinypic.com/2qanw9v.jpghttp://i45.tinypic.com/oj12x5.jpg

http://i49.tinypic.com/2cpdkb8.jpg

 

http://i47.tinypic.com/vpyfix.jpg http://i45.tinypic.com/jago40.jpg http://img231.imageshack.us/img231/8504/tidus1.png

 

non esco l'ora che veda

Un gioco così ben fatto da farti sballare la testa! XD

 

 

 

 

http://img27.imageshack.us/img27/8540/dsbar.png

http://img294.imageshack.us/img294/6876/nostalebar.png

http://img90.imageshack.us/img90/2158/tbars.png

http://i40.tinypic.com/soqvb8.jpg

http://i45.tinypic.com/29duu1l.jpg

http://img237.imageshack.us/img237/2482/30275.png

http://img182.imageshack.us/img182/8/rpgxpbarrpgmzv1.png

http://img195.imageshack.us/img195/6998/userbarannette.png

http://i48.tinypic.com/awdylh.jpg

Link to comment
Share on other sites

  • 0

Per quello puoi usare lo script per mostrare più di 50 picture, lo trovi qui. Puoi far apparire le pic tramite call script, ti basta settare due variabili che segnino sempre le coordinate del pg, e poi usi la sintassi ...

Aspè complicato a parole faccio un esempio.

 

Mettiamo che tu abbia le pic con le cifre da 0 a 9 (magari rosse per segnare i danni) e che tu le abbia chiamate

rednum_0 rednum_1 rednum_2 e così via fino a 9

 

Mettiamo che la variabile 001 prenda le X del pg e la variabile 002 prenda le Y

 

Mettiamo che la variabile 003 contenga le "UNITA'" del danno, la variabile 004 contenga le "DECINE" del danno e che la

variabile 005 contenga le "CENTINAIA" del danno.

 

Mettiamo che tra una cifra e l'altra tu voglia dare 1 pixel vuoto di spazio e che ogni pic occupi 4 pixel

 

Con quello script ti basta fare tramite Call script così:

 

x_pg= $game_variables[1]*32

y_pg= $game_variables[2]*32-48

nomedellapic= "rednum_" +$game_variables[3].to_s

$game_screen.pictures[1].show(nomedellapic, 1,x_pg, y_pg, 100, 100, 255, 0)

 

x_pg= $game_variables[1]*32-5

y_pg= $game_variables[2]*32-48

nomedellapic= "rednum_" +$game_variables[4].to_s

$game_screen.pictures[2].show(nomedellapic, 1,x_pg, y_pg, 100, 100, 255, 0)

 

x_pg= $game_variables[1]*32-10

y_pg= $game_variables[2]*32-48

nomedellapic= "rednum_" +$game_variables[5].to_s

$game_screen.pictures[3].show(nomedellapic, 1,x_pg, y_pg, 100, 100, 255, 0)

 

E dovrebbero apparirti i danni sulla capoccia del pg (più o meno, non ho fatto prove e contro prove). Se

guardi sul topic appropriato trovi tutte le istruzioni che servono ^^

Il fatto è che poi devi dare il comando di muoverli (di solito i danni vanno verso l'alto prima di sparire) e poi di farli sparire [ci sono anche questi di comandi eh] e diventa un pò complesso se magari devi far apparire tanti danni, ogni

volta gestirli tutti manualmente è pesante!

http://i30.tinypic.com/xehois.gif

} 2rA - web site {

E' disponibile il primo capitolo completo di 2rA!

} 2rA: Capitolo I {

Link to comment
Share on other sites

  • 0
ecco perchè servirebbe uno script... :wacko:

http://i46.tinypic.com/260qs1l.jpghttp://i48.tinypic.com/21owyt0.jpghttp://i45.tinypic.com/oj12x5.jpg

http://i45.tinypic.com/oj12x5.jpghttp://i48.tinypic.com/2qanw9v.jpghttp://i45.tinypic.com/oj12x5.jpg

http://i49.tinypic.com/2cpdkb8.jpg

 

http://i47.tinypic.com/vpyfix.jpg http://i45.tinypic.com/jago40.jpg http://img231.imageshack.us/img231/8504/tidus1.png

 

non esco l'ora che veda

Un gioco così ben fatto da farti sballare la testa! XD

 

 

 

 

http://img27.imageshack.us/img27/8540/dsbar.png

http://img294.imageshack.us/img294/6876/nostalebar.png

http://img90.imageshack.us/img90/2158/tbars.png

http://i40.tinypic.com/soqvb8.jpg

http://i45.tinypic.com/29duu1l.jpg

http://img237.imageshack.us/img237/2482/30275.png

http://img182.imageshack.us/img182/8/rpgxpbarrpgmzv1.png

http://img195.imageshack.us/img195/6998/userbarannette.png

http://i48.tinypic.com/awdylh.jpg

Link to comment
Share on other sites

  • 0

Sopra il main:

class Game_Character  #--------------------------------------------------------------------------  # * Variabili d'istanza pubbliche.  #--------------------------------------------------------------------------  attr_accessor :damage  attr_accessor :critical  attr_accessor :damage_popend class Sprite_Character   alias tsldmgnchr_sprtchrctr_pdt update  #--------------------------------------------------------------------------  # * Aggiornamento della classe.  #--------------------------------------------------------------------------  def update	tsldmgnchr_sprtchrctr_pdt	if @character.damage_pop	  damage(@character.damage, @character.critical)	  @character.damage = nil	  @character.critical = false	  @character.damage_pop = false	end   endend

Per far apparire i danni sull'eroe usare

$game_player.damage = NUMERODANNO o STRINGA$game_player.damage_pop = true

si può usare anche

$game_player.critical = true

se si vuole far apparire la scritta "CRITICAL" insieme al danno.

 

Per far apparire danni su un evento usare invece

$game_map.events[IDEVENTO].damage = NUMERODANNO o STRINGA$game_map.events[IDEVENTO].damage_pop = true

stessa cosa per il critico

$game_map.events[IDEVENTO].critical = true

Con un numero negativo le scritte diventano verdi per far capire che il danno è curativo.

Link to comment
Share on other sites

  • 0

santo subito! XD

 

Solo una cosa, non si può aggiungere una stringa per far cambiare il font dei danni? Quello standard non mi attizza... :-/

Poi ti volevo chiedere se è possibile far uscire anche delle parole, al posto di numeri...

Edited by tidus00

http://i46.tinypic.com/260qs1l.jpghttp://i48.tinypic.com/21owyt0.jpghttp://i45.tinypic.com/oj12x5.jpg

http://i45.tinypic.com/oj12x5.jpghttp://i48.tinypic.com/2qanw9v.jpghttp://i45.tinypic.com/oj12x5.jpg

http://i49.tinypic.com/2cpdkb8.jpg

 

http://i47.tinypic.com/vpyfix.jpg http://i45.tinypic.com/jago40.jpg http://img231.imageshack.us/img231/8504/tidus1.png

 

non esco l'ora che veda

Un gioco così ben fatto da farti sballare la testa! XD

 

 

 

 

http://img27.imageshack.us/img27/8540/dsbar.png

http://img294.imageshack.us/img294/6876/nostalebar.png

http://img90.imageshack.us/img90/2158/tbars.png

http://i40.tinypic.com/soqvb8.jpg

http://i45.tinypic.com/29duu1l.jpg

http://img237.imageshack.us/img237/2482/30275.png

http://img182.imageshack.us/img182/8/rpgxpbarrpgmzv1.png

http://img195.imageshack.us/img195/6998/userbarannette.png

http://i48.tinypic.com/awdylh.jpg

Link to comment
Share on other sites

  • 0

Problema o___o

 

Quando faccio visualizzare il danno si sente un fastidiosissimo (MOLTO FASTIDIOSO) effetto sonoro System02 O___O"

 

In un gioco come il mio STONA tantissimo, e non è neanche collegato a quello del database, che cambiandolo sento sempre System02 O___O

 

Non riesco a trovare soluzione alcuna é__è

 

Help me!

 

EDIT_________

 

Errore mio era un altro evento che dava problemi *O*

Scusate il disturbo *fade out*

Edited by nihil-omen

http://i30.tinypic.com/xehois.gif

} 2rA - web site {

E' disponibile il primo capitolo completo di 2rA!

} 2rA: Capitolo I {

Link to comment
Share on other sites

  • 0

Ok necessito un grandissimo aiuto ora o____o

Ho trovato questo FIGHISSIMO script per cambiare font dei danni e la stringa del Critical...

E l'ho inserito dunque nel progetto :D

 

Il fatto è che quando inizia la battaglia, dopo un po' di danni visualizzati (alcuni vengono visualizzati ad alta frequenza, per i danni della mitragliatrice per esempio) mi si impalla il gioco e mi dice:

 

Script 'Display Damage' line 128: NoMethodError occurred.

undefined method 'visible=' for nil:NilClass

 

o____o

Come si risolve?

Ecco lo script

 

#======================================================================# ■ RPG::Sprite#------------------------------------------------------------------------------# Change the damage display# # By Squall // squall@rmxp.ch# released on the 30th march at rmxp.org#============================================================================== class RPG::Sprite < ::Sprite  #--------------------------------------------------------------------------  # ● initialize  #--------------------------------------------------------------------------  def initialize(viewport = nil)	super(viewport)	@_whiten_duration = 0	@_appear_duration = 0	@_escape_duration = 0	@_collapse_duration = 0	@_damage_durations = []	@_animation_duration = 0	@_blink = false  end  #--------------------------------------------------------------------------  # ● dispose  #--------------------------------------------------------------------------  def dispose	dispose_damage(0...@_damage_durations.size)	dispose_animation	dispose_loop_animation	super  end  #--------------------------------------------------------------------------  # ● effect?  #--------------------------------------------------------------------------  def effect?	damage_duration = 0	for value in @_damage_durations	  damage_duration += value	end	@_whiten_duration > 0 or	@_appear_duration > 0 or	@_escape_duration > 0 or	@_collapse_duration > 0 or	damage_duration > 0 or	@_animation_duration > 0  end  #--------------------------------------------------------------------------  # ● damage  #--------------------------------------------------------------------------  def damage(value, critical)	dispose_damage(0...@_damage_durations.size)	@_damage_sprites = []	if value.is_a?(Numeric)	  damage_string = value.abs.to_s	else	  damage_string = value.to_s	end	if critical	  damage_string += "Elude!"	end 	for i in 0...damage_string.size	  letter = damage_string[i..i]	  bitmap = Bitmap.new(48, 48)	  bitmap.font.size = 18	  bitmap.font.name = "Tahoma"	  bitmap.font.color.set(0, 0, 0)	  bitmap.draw_text(-1, 12-1, 48, 48, letter, 1)	  bitmap.draw_text(+1, 12-1, 48, 48, letter, 1)	  bitmap.draw_text(-1, 12+1, 48, 48, letter, 1)	  bitmap.draw_text(+1, 12+1, 48, 48, letter, 1)	  if value.is_a?(Numeric) and value < 0		bitmap.font.color.set(176, 255, 144)	  else		bitmap.font.color.set(255, 255, 255)	  end	  bitmap.draw_text(0, 12, 48, 48, letter, 1) 	  @_damage_sprites[i] = ::Sprite.new(self.viewport)	  @_damage_sprites[i].bitmap = bitmap	  @_damage_sprites[i].visible = false	  @_damage_sprites[i].ox = 16	  @_damage_sprites[i].oy = 16	  @_damage_sprites[i].x = self.x - self.ox / 2 + i * 12	  @_damage_sprites[i].y = self.y - self.oy / 2	  @_damage_sprites[i].z = 3000	  @_damage_durations[i] = 40 + i * 2	end  end  #--------------------------------------------------------------------------  # ● dispose_damage  #--------------------------------------------------------------------------  def dispose_damage(index)	return if @_damage_sprites == nil	if @_damage_sprites[index].is_a?(::Sprite) and @_damage_sprites[index].bitmap != nil	  @_damage_sprites[index].bitmap.dispose	  @_damage_sprites[index].dispose	  @_damage_durations[index] = 0	end  end  #--------------------------------------------------------------------------  # ● update  #--------------------------------------------------------------------------  def update	super	if @_whiten_duration > 0	  @_whiten_duration -= 1	  self.color.alpha = 128 - (16 - @_whiten_duration) * 10	end	if @_appear_duration > 0	  @_appear_duration -= 1	  self.opacity = (16 - @_appear_duration) * 16	end	if @_escape_duration > 0	  @_escape_duration -= 1	  self.opacity = 256 - (32 - @_escape_duration) * 10	end	if @_collapse_duration > 0	  @_collapse_duration -= 1	  self.opacity = 256 - (48 - @_collapse_duration) * 6	end	for i in 0...@_damage_durations.size	  damage_sprite = @_damage_sprites[i]	  next if @_damage_durations[i] == nil	  if @_damage_durations[i] > 0		@_damage_durations[i] -= 1		damage_sprite.visible = (@_damage_durations[i] <= 40) # <----------- QUESTA E' LA LINEA 128!!		case @_damage_durations[i] 		when 38..39		  damage_sprite.y -= 4		when 36..37		  damage_sprite.y -= 2		when 34..35		  damage_sprite.y += 2		when 28..33		  damage_sprite.y += 4		end		damage_sprite.opacity = 256 - (12 - @_damage_durations[i]) * 32		if @_damage_durations[i] == 0		  dispose_damage(i)		end	  end	end	if @_animation != nil and (Graphics.frame_count % 2 == 0)	  @_animation_duration -= 1	  update_animation	end	if @_loop_animation != nil and (Graphics.frame_count % 2 == 0)	  update_loop_animation	  @_loop_animation_index += 1	  @_loop_animation_index %= @_loop_animation.frame_max	end	if @_blink	  @_blink_count = (@_blink_count + 1) % 32	  if @_blink_count < 16		alpha = (16 - @_blink_count) * 6	  else		alpha = (@_blink_count - 16) * 6	  end	  self.color.set(255, 255, 255, alpha)	end	@@_animations.clear  endend

 

Ho provato a cambiare 40 con 80 o numeri più alti, sperando di risolvere, ma nisba =3="

Cosa devo fare?

Eliminando lo script poi ilproblema non lo da, ma apparte il font più bello (che è lo stesso di tutto il gioco, non voglio rinunciarci) mi permette di cambiare anche la scritta del critical, che nel mio caso va a sostituire quella del classico MISS!

Insomma, si può eliminare il problema? O al limite, si possono portare le modifiche che questo script fa al font e alla stringa_critical in uno script che non dia quel problema? Grazie mille per l'attenzione :)

Edited by nihil-omen

http://i30.tinypic.com/xehois.gif

} 2rA - web site {

E' disponibile il primo capitolo completo di 2rA!

} 2rA: Capitolo I {

Link to comment
Share on other sites

  • 0

Per la stringa del miss!, basta che la metti al posto del numero di danni inferti/curati, quindi usando il codice di Sleeping, la chiamata dei danni diventerebbe:

# per il giocatore$game_player.damage = "ELUDE!"# per gli eventi mappa$game_map.events[IDEVENTO].damage = "ELUDE!"

 

Per cambiare il font invece, cambiane il nome (e la grandezza o i colori, eventualmente) in questo pezzo di codice, da inserire nel tuo progetto, al posto di quello script

class RPG::Sprite < ::Sprite	def damage(value, critical)	  dispose_damage	  if value.is_a?(Numeric)		damage_string = value.abs.to_s	  else		damage_string = value.to_s	  end	  bitmap = Bitmap.new(160, 48)	  bitmap.font.name = "Tahoma"	  bitmap.font.size = 32	  bitmap.font.color.set(0, 0, 0)	  bitmap.draw_text(-1, 12-1, 160, 36, damage_string, 1)	  bitmap.draw_text(+1, 12-1, 160, 36, damage_string, 1)	  bitmap.draw_text(-1, 12+1, 160, 36, damage_string, 1)	  bitmap.draw_text(+1, 12+1, 160, 36, damage_string, 1)	  if value.is_a?(Numeric) and value < 0		bitmap.font.color.set(176, 255, 144)	  else		bitmap.font.color.set(255, 255, 255)	  end	  bitmap.draw_text(0, 12, 160, 36, damage_string, 1)	  if critical		bitmap.font.size = 20		bitmap.font.color.set(0, 0, 0)		bitmap.draw_text(-1, -1, 160, 20, "CRITICAL", 1)		bitmap.draw_text(+1, -1, 160, 20, "CRITICAL", 1)		bitmap.draw_text(-1, +1, 160, 20, "CRITICAL", 1)		bitmap.draw_text(+1, +1, 160, 20, "CRITICAL", 1)		bitmap.font.color.set(255, 255, 255)		bitmap.draw_text(0, 0, 160, 20, "CRITICAL", 1)	  end	  @_damage_sprite = ::Sprite.new(self.viewport)	  @_damage_sprite.bitmap = bitmap	  @_damage_sprite.ox = 80	  @_damage_sprite.oy = 20	  @_damage_sprite.x = self.x	  @_damage_sprite.y = self.y - self.oy / 2	  @_damage_sprite.z = 3000	  @_damage_duration = 40	endend

Tahoma l'ho inserito io, in origine era Arial Black . . .

 


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

  • 0

AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA *_____________*

Grandissimooooooooooooooooooo *____________*

Ti adoro sempre più XD

 

Grazie a te ho appena finito di prorgammare gli attacchi fisici :)

Dal 17 passo a quelli magici (ho gli esami prima T.T) :D

Ma ormai il peggio è fatto ^^

http://i30.tinypic.com/xehois.gif

} 2rA - web site {

E' disponibile il primo capitolo completo di 2rA!

} 2rA: Capitolo I {

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