Jump to content
Rpg²S Forum

Michael xp

Utenti
  • Posts

    9
  • Joined

  • Last visited

Posts posted by Michael xp

  1. Ciao, l'altro giorno mi è venuta l'idea di inserire nel mio gioco il mini-game che si trova nei pokèmon, ovvero il casinò. Ora ho cercato un pò in giro per internet, ma non ho trovato nulla. Volevo sapere se esiste o no, e se esiste dove poterlo prendere e usare nel mio gioco. Oppure se si può creare con uno scrpt.

    Grazie in anticipo.

  2. Girando per internet ho trovato questo script che separa gli oggetti a seconda che siano armi o oggetti vari

     

    module Filter_Items

    #SPECIAL_ITEM = [id1, id2...] id degli oggetti rari

    SPECIAL_ITEMS = [78, 79, 60, 57]

    SPECIAL_WEAPONS = []

    SPECIAL_ARMORS = []

    end

    class Window_Choise < Window_Selectable

    def initialize

    super(0, 64, 640, 64, 81, 82)

    commands = ["Oggetti", "Armi", "Rarita'"]

    @item_max = commands.size

    @commands = commands

    @column_max = 3

    self.contents = Bitmap.new(width - 32, height - 32)

    refresh

    self.index = 0

    end

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

    # ● Aggiornamento

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

    def refresh

    self.contents.clear

    for i in 0...@item_max

    draw_item(i, normal_color)

    end

    end

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

    # ● Disegna un oggetto

    # index : Numero dell'oggetto

    # color : Colore del personaggio

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

    def draw_item(index, color)

    self.contents.font.color = color

    self.contents.font.name = "Arial"

    self.contents.font.size = 24

    rect = Rect.new(4 + index*220, 0, self.contents.width - 8, 32)

    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))

    self.contents.draw_text(rect, @commands[index])

    end

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

    # ● Cancellazione di un oggetto

    # index : Numero dell'oggetto

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

    def disable_item(index)

    draw_item(index, disabled_color)

    end

    end

     

     

    Ora fino a ieri mi funzionava tutto correttamente, ma oggi i mi da un errore sulla riga 9

     

    Errore script "Separare_ogg" sulle linea nove del tipo "Argoument Error" wrong number of arguments (6 for 4 )

     

    Non so che fare, xke questo tipo di separatore oggetti mi serve!!

    Grazie

  3. Girando in internet ho trovato questo scripts. Però, dato che non sono molto ferrato, non riesco a farlo partire..

     

    Istruzioni:

    1)Inserire questo script sopra main

    2)Modificare i seguenti valori:

    $mappe_interni (le mappe che non dovranno diventare scure durante la notte)

    $special_events (gli eventi come Natale etc)

    3)Per far avanzare il tempo, basta scrivere (anche da evento):

    $timeControl.add_time "01:02:03"

    In questo esempio il tempo avanzerà di un ora, 2 minuti e 3 secondi.

    Il massimo è 23:59:59

     

    4)Per conoscere l'ora scrivere:

    timeControl.what_time?

    Ritorno: "10:02:24"

    il ritorno sarà una stringa

     

    5)Per sapere se ci sono eventi speciali:

    $timeControl.special_event?

    Ritorno: "Natale"(nome evento)

     

    6)Per conoscere altre cose:

    $timeControl.sec | Secondi

    $timeControl.min | Minuti

    $timeControl.ora | Ore

    $timeControl.gg | Giorno

    $timeControl.mm | Mese

    $timeControl.aaaa | Anno

     

    Compatibile:

    ScriptFiles:

    -Standard Scripts RPGMaker Xp 1.01

    -Standard Scripts RPGMaker Xp 1.02

    -TimeOut 2 Scripts

     

    Script:

    -BS Laterale

    -BS ATB

    -Ogni tipo di menù

    ###################################

    =end

     

     

    $mappe_interni = [2]

    $special_events = [[25,12,0,"Natale"],

    [12,9,2006,"Demo TimeOut 2",true], #come primo elemento il giorno, secondo il mese, terzo l'anno che però

    [1,1,0,"Nuovo Anno!"], #non verrà considerato se come 5° ci sarà l'elemento "true". come 4° ci sarà il nome

    [31,12,0,"Ultimo giorno dell'anno"]] #dell'evento

     

    class TimeControl

    def today_is?(gga,mma,aaaaa)

    return (@giorno == gga and @mese.numero = mma and @anno = aaaaa)

    end

     

    def what_time?

    return sprintf("%02d:%02d:%02d",@ora,@minuto,@secondo)

    end

     

    def initialize

    @initialized = true

    @secondo = 0

    @minuto = 0

    @ora = 0

    @giorno = 1

    @ggiorno = 1

    @nome_gg = "Lunedì"

    @mese = Mese.new

    @mese.numero = 1

    @mese.nome = "Gennaio"

    @mese.durata = 32

    @mese.bisestile = false

    @anno = 2006

    @giorn = ["Domenica","Lunedì","Martedì","Mercoledì","Giovedì","Venerdì","Sabato"]

    @mesi = ["",

    "Gennaio","Febbraio","Marzo",

    "Aprile","Maggio","Giugno",

    "Luglio", "Agosto","Settembre",

    "Ottobre","Novembre","Dicembre"]

    @durata =[0,31,28,31,30,31,30,31,31,30,31,30,31]

    update

    end

     

    def special_event?

    for i in $special_events

    if i[4]

    if today_is?(i[0],i[1],i[2])

    return i[3]

    end

    else

    if today_is?(i[0],i[1],@anno)

    return i[3]

    end

    end

    end

    end

     

    def add_time(format)

    secondo = @secondo

    minuto = @minuto

    ora = @ora

    secondo += format[6,2].to_i

    minuto += format[3,2].to_i

    ora += format[0,2].to_i

    secondo %= 60

    minuto %= 60

    ora %= 24

    until (@ora == ora and @minuto == minuto and secondo == secondo)

    update

    end

    end

    #Esportazione

    def sec

    return @secondo

    end

    def min

    return @minuto

    end

    def ora

    return @ora

    end

    def gg

    return @giorno

    end

    def nome_gg

    return @nome_gg

    end

    def mm

    return @mese

    end

    def aaaa

    return @anno

    end

     

    def update

    @secondo += 1

    @secondo %= 60

    if @secondo == 0

    @minuto += 1

    @minuto %= 60

    if @minuto == 0

    @ora += 1

    @ora %= 24

    if @ora == 0

    @ggiorno += 1

    @giorno += 1

    @nome_gg = @giorn[@ggiorno%7]

    @giorno %= @mese.durata

    if @giorno == 0

    @giorno = 1

    @mese.numero += 1

    @mese.nome = @mesi[@mese.numero]

    @mese.bisestile = (@anno%4 == 0)

    @mese.durata = (@mese.numero == 2 and @mese.bisestile) ? @durata[@mese.numero]+2 : @durata[@mese.numero]+1

    @mese.numero %= 12

    if @mese.numero == 0

    @mese.numero = 1

    @mese.nome = @mesi[@mese.numero]

    @anno += 1

    end

    end

    end

    end

    end

    return if $game_screen == nil

    return if $mappe_interni.include?($game_map.map_id)

    duration = (@initialized ? 0 : 200)

    @initialized = false

    if @ora.between?(0,4)

    $game_screen.start_tone_change(Tone.new(-170,-170,-170,0), duration)

    elsif @ora.between?(6,8)

    $game_screen.start_tone_change(Tone.new(-85,-68,-18,0), duration)

    elsif @ora.between?(8,11)

    $game_screen.start_tone_change(Tone.new(-68,-34,-18,0), duration)

    elsif @ora.between?(11,17)

    $game_screen.start_tone_change(Tone.new(0,0,0,0), duration)

    elsif @ora.between?(17,18)

    $game_screen.start_tone_change(Tone.new(-34,-51,-136,0), duration)

    elsif @ora.between?(18,20)

    $game_screen.start_tone_change(Tone.new(-85,-68,-18,0), duration)

    elsif @ora >= 20

    $game_screen.start_tone_change(Tone.new(-170,-170,-170,0), duration)

    end

    end

    end

     

    class Mese

    attr_accessor :numero

    attr_accessor :nome

    attr_accessor :durata

    attr_accessor :bisestile

    def initialize

    @numero = 1

    @nome = ""

    @durata = 30

    @bisestile = false

    end

    end

     

    class Scene_Title

    alias cngt command_new_game

    def command_new_game

    $timeControl = TimeControl.new

    cngt

    end

    end

     

    class Scene_Save

    alias wsdt write_save_data

    def write_save_data(file)

    wsdt(file)

    Marshal.dump($timeControl,file)

    end

    end

     

    class Scene_Load

    alias lsdt read_save_data

    def read_save_data(file)

    lsdt(file)

    $timeControl = Marshal.load(file)

    end

    end

     

    class Window_Time < Window_Base

    def initialize

    super(340,0,300,128)

    self.contents = Bitmap.new(300-32,128-32)

    refresh

    end

    def refresh

    self.contents.clear

    self.contents.font.color = normal_color

    str = sprintf("%02d:%02d:%02d",$timeControl.ora.to_s,$timeControl.min.to_s ,$timeControl.sec.to_s)

    self.contents.draw_text(0,0,100,32,str)

    self.contents.draw_text(0,32,100,32,$timeControl.nome_gg)

    self.contents.draw_text(0,64,200,32,$timeControl.gg.to_s + "° "+$timeControl.mm.nome + " "+$timeControl.aaaa.to_s)

    self.opacity = 160

    end

    end

     

    class Scene_Map

    def main

    # Make sprite set

    @time = Window_Time.new

    @spriteset = Spriteset_Map.new

    # Make message window

    @message_window = Window_Message.new

    @wait = 50

    # Transition run

    Graphics.transition

    # Main loop

    loop do

    # Update game screen

    Graphics.update

    # Update input information

    Input.update

    # Frame update

    update

    # Abort loop if screen is changed

    if $scene != self

    break

    end

    end

    # Prepare for transition

    Graphics.freeze

    # Dispose of sprite set

    @spriteset.dispose

    @time.dispose

    # Dispose of message window

    @message_window.dispose

    # If switching to title screen

    if $scene.is_a?(Scene_Title)

    # Fade out screen

    Graphics.transition

    Graphics.freeze

    end

    end

    alias aggiorna update

    def update

    @wait -= 1

    if @wait == 0

    @wait = 50

    $timeControl.update

    end

    @time.refresh

    @time.update

    aggiorna

    end

    end

     

     

    Grazie in anticipo. Se non dovesse funzionare mi sapreste consigliare un buon scripts per il ciclo giorno notte??

    Grazie ancora

×
×
  • Create New...