Jump to content
Rpg²S Forum
  • 0

Strano bug in uno script


Exim Gealbhonn
 Share

Question

Ho scritto questo script affinché rappresentasse in una lista una serie di caratteristiche di oggetti presenti all'interno di un array globale. Il punto è che non sono non li stampa, ma bensì non passa neanche dal "draw text" rpg maker. Non so che fare

 

comunque lo script è questo

module CC 
  Neos=["Neos", "/Pictures/Neos", 1]
end 


class Game_Interpreter
  include CC
end

class Game_Event < Game_Character
  include CC
end
class Card 
  attr_reader :nome
  def intialize
    @nome=""
    @immagine=""
    @effect_id=-1
  end
  
  def nome(nome)
    @nome=nome
  end

  def effetto(effetto)
    @effetto=effetto
  end
  
  def immagine(immagine)
    @immagine=immagine
  end
  
  def restituisci nome
    return @nome
  end
  
    
end

class Game_Party < Game_Unit
  attr_accessor :party_deck
  attr_accessor :party_cards
  
  include CC
  alias duel_initialize initialize
  def initialize
    @party_deck=[]
    @party_cards=[]
    duel_initialize
  end
  
  def add_card(card)
    card_obj=Card.new
    card_obj.nome(card[0])

   card_obj.immagine(card[1])
   card_obj.effetto(card[2])
    @party_cards.push(card_obj)
  end
  
  def remove_card(card)
    @party_deck.delete(card) #da sistemare
  end
  
 
    
end


  
  
  
  
class Window_Cards < Window_Selectable
  def initialize(x,y,w,h)
    super
    @cards=$game_party.party_cards
    print $game_party.party_cards
    self.index=0
    refresh
  end
  
  def item_max
   if @data==nil 
     return 0 
   else
      return $game_party.party_cards.size
      end
    end
    
    def draw_item(index)
    rect =item_rect(index)
    card= @cards[index]
    draw_text(rect, card.restituisci_nome)
  end
end


  
 class Scene_MenuDeck < Scene_Base
   def start
     super
     crea_finestra_carte
   end
   
   def crea_finestra_carte
     @finestra_carte=Window_Cards.new(0,0,Graphics.height-150,Graphics.height)
    @finestra_carte.activate
    @finestra_carte.set_handler(:cancel, method(:attiva_deck))
    @finestra_carte.set_handler(:ok, method(:aggiungi_carta))
  end
  def attiva_deck
  end
  def aggiungi_carta
  end
end
  

e funziona così, do ad un npc questo comando, per esempio con "Neos che è l'unico settato nello script) tramite script ad evento

$game_party.add_card(CC::Neos)

Faccio partire la scena Menu_deck e dovrebbe comparirmi l'opzione con su scritto neos (ed altri se si aggiungono nuovi mostri etc.)

Ma non funge, ma sembra giusto :/

Edited by Sora Keyblade
Link to comment
Share on other sites

1 answer to this question

Recommended Posts

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