Ir a contenido

0

Script de hotel


3 las respuestas a este tema

#1 Sampi

    Paladin

  • voidzonero
  • 130 Mensajes:
  • Location:Delante de mi escritorio con apuntes de mates
  • Interests:dot Hack, Shin Megami Tensei y intentar aprovar bachiller
  • Genero:Chico
  • Nivel maker: Experto
  • Especialidad: Mapeo

Publicado el 03 September 2006 - 12:32 AM

Ponerlo encima de main y para llamarlo usar esto
CODE
$scene = Scene_Inn.new(15, 15,"welcome", "owner", � "rest", "go
away" , "cya later", "not enough money", 10, "it cost 10 dollar", "I
will kill u if u don't rest today in peace")

Puedes cambiar los comandos

CODE
#=======================================
#Scene_Inn===============================
#created by rpgmaker=======================
#=======================================
class Scene_Inn
def initialize(x, y,message, picture,  command1, command2, goodbye, lessmoney, price, set_price, whatnext)
    @x = x # The x position for the selection window
      @y = y # The y position for the selection window
        @message = message # Message display
        @picture = picture # sprite for inn keeper, can be left blank, u add ""
  @command1 = command1 # option one
  @command2 = command2  #option two
  @goodbye = goodbye # Message that will be shown when leaving Inn
  @lessmoney = lessmoney # If Price is less
  @price = price # Cost for the inn
  @set_price = set_price # Show message for price
  @whatnext = whatnext # Show what next when u select No
  end

def main
@spriteset = Spriteset_Map.new
@sprite = Sprite.new
@sprite.bitmap = RPG::Cache.picture(@picture)
@sprite.x = 63
@sprite.y = 95
@sprite.opacity = 100
@sprite.z = 300
@dummy_window = Window_Base.new(55, 90, 95, 90)
@inn_window = Window_Help.new
@inn_window .x = 150
@inn_window .y = 90
@inn_window .width = 400
@inn_window .height = 90
@inn_window .set_text(@message) # Message display
@selection = Window_Command.new(160, [@command1, @command2]) # Command display
@selection.x = @x
@selection.y = @y
@selection.visible = true
@selection.active = true
@option = Window_Command.new(160, ["Yes", "No"])
@option.x = @selection.x
@option.y = @selection.y
@option.visible = false
@option.active = false
 @money = Window_CurrentMoney.new
@money.x = 360
@money.y = 290
@tone = Tone.new(0, 225, 225, 0)
   Graphics.transition
  loop do
    Graphics.update
    Input.update
    update
    if $scene != self
      break
    end
  end
 
  Graphics.freeze
  @tone.update
  @spriteset.dispose
  @sprite.dispose
  @dummy_window.dispose
  @inn_window.dispose
  @selection.dispose
  @option.dispose
  @money.dispose
end


def update
   @spriteset.update
  @sprite.update
  @dummy_window.update
  @inn_window.update
  @selection.update
  @option.update
  @money.update
  if @selection.active
    update_selection
    return
  end
  if @option.active
    update_options
    return
  end
end

def update_selection
 
  #Return to the map
  if Input.trigger?(Input::B)
     $game_system.se_play($data_system.cancel_se)
     $scene = Scene_Map.new
     return
   end
 
   #Trigger Selected actions
   if Input.trigger?(Input::C)
      $game_system.se_play($data_system.decision_se)
      case @selection.index
      when 0 #Open options
      @selection.visible = false
      @selection.active = false
      @option.active = true
      @option.visible = true
      @inn_window .set_text(@set_price)
        when 1 # Close Options
          @inn_window .set_text(@goodbye) # Goodbye message display
          $msg.delay(20) # Wait for some frame and close
          $scene = Scene_Map.new #Go to map
        end
      end
    end
   
     def change_back
          $game_screen.start_tone_change(Tone.new(0, 0, 0, 0), 20)
          end
   
    def update_options
      @value = $game_party.gold
      if Input.trigger?(Input::B)
     $game_system.se_play($data_system.cancel_se)
     @option.active = false
     @option.visible = false
     @selection.active = true
     @selection.visible = true
     return
   end
   if Input.trigger?(Input::C)
     $game_system.se_play($data_system.decision_se)
     if @value < @price
       $game_system.se_play($data_system.buzzer_se)
       @inn_window .set_text(@lessmoney) # Show if money is not enough
       return
     end
      case @option.index
      when 0 #Heal player
         Audio.me_play("Audio/ME/" + "014-Inn01", 80, 80)
          $game_screen.start_tone_change(Tone.new(-255,-255,-255,0), 10)
        @value  -= @price
        $game_party.gold = @value
        @money.refresh
        for i in 0...$game_party.actors.size
          @actor = $game_party.actors[i]
          @actor.hp = @actor.maxhp
          @actor.sp = @actor.maxsp
        end
          delay(15)
          Graphics.transition(100)
           $game_screen.start_tone_change(Tone.new(0,0,0,0), 10)
        @inn_window .set_text(@goodbye) # Goodbye message display
        delay(25) # Wait for some frame and close
        $scene = Scene_Map.new #Go to map
        when 1 # Close Options
          @inn_window .set_text(@whatnext)
         @option.active = false
     @option.visible = false
     @selection.active = true
     @selection.visible = true
        end
   end
 
 
    end
end #End of Class


Aqui el ejemplo



#2 xXDarkDragonXx

    Lost in Ethereal Reverie

  • Moderador Power!
  • 1,505 Mensajes:
  • Location:America 4ever! lol Mucho sarcasmo...
  • Interests:Jugar Castlevania: Symphony of the Night, salir al cine, escuchar Rock, la Ley del Vago
  • Genero:Chico
  • Nivel maker: Experto
  • Especialidad: Mapeo

Publicado el 03 September 2006 - 04:46 AM

Que vagos. Eso se hace por eventos. Pero buen aporte.

#3 Fegarur

    Vago

  • Moderador Power!
  • 2,331 Mensajes:
  • Genero:Chico
  • Nivel maker: Experto
  • Especialidad: Guion

Publicado el 03 September 2006 - 07:29 AM

Un buen script para vagos, pero la verdad es que me queda mucho mejor con eventos. Y de hecho es más cómodo...

#4 Soramar0

    StarFolk

  • Moderador Power!
  • 1,033 Mensajes:
  • Location:Venezuela
  • Interests:El Futboll, El anime genero Seinem, joder con la gente.
  • Genero:Chico
  • Nivel maker: Experto
  • Especialidad: Scripting

Publicado el 03 September 2006 - 08:31 AM

otro script para flojos xD.png voidzoneros flojeen!