Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Simple fishing script
#1
This is a locked, single-post thread from Creation Asylum. Archived here to prevent its loss.
No support is given. If you are the owner of the thread, please contact administration.


Ok when you go up to water and press d you will start fishing, depending on your settings you will find different stuff!

First put this above main and call it Fishing
Code:
#==============================================================================
# â–�  fishing
#------------------------------------------------------------------------------
#  デ�ッグ画��処� を行� クラス��。
#==============================================================================

class Fishing
#----------------------------------------------------------------------------
# Start
#----------------------------------------------------------------------------
def initialize
   @fw = Window_Fish.new
   $fm = "Fishing..."
   @fw.refresh
   delay(60)
   fish
end
#----------------------------------------------------------------------------
# Fishing!
#----------------------------------------------------------------------------
def fish
   delay(40)
   @fr = rand(4)#this number inside the brackets indicate how many things there are. and remeber it starts from 0 so if you have 5 things you have to have 4
   case @fr
   when 0
     $game_player.animation_id =  98
     $fm = "Hey! I got one! 10 pounds!"
     @fw.refresh
     $game_party.gain_item(33, 1)#the item number of the fish is here
     delay(60)
   when 1
     $fm = "Darn its just a rock!"
     @fw.refresh
     delay(60)
   when 2
     $fm = " Yuck! an old boot!"
     @fw.refresh
     delay(60)
   when 3
     $game_player.animation_id =  98
     $fm = "Hey! I got one! 20 pounds!"
     @fw.refresh
     $game_party.gain_item(34, 1)
     delay(60)
   when 4
     $fm = "Darn! no fish!"
     @fw.refresh
     delay(60)
   end
   @fw.dispose
end
#----------------------------------------------------------------------------
# Delay
#----------------------------------------------------------------------------
def delay(wait)
   count = Graphics.frame_count
   while wait + count >= Graphics.frame_count
     Graphics.update
   end
end
end

Ok now see the section fish in this section you control what you catch. it is pretty self explanitory.
next find this in Scene_Map
Code:
# B ボタンã?Œæ� ¼ã?•ã‚Œã?Ÿå� ´å?ˆ
   if Input.trigger?(Input::B)
     # イベント実行中ã?‹ãƒ¡ãƒ‹ãƒ¥ãƒ¼ç¦?止中ã?§ã?ªã?‘ã‚Œã?°
     unless $game_system.map_interpreter.running? or
            $game_system.menu_disabled
       # メニュー呼ã?³å‡ºã?—フラグã?¨ SE æ¼”å¥?フラグをセット
       $game_temp.menu_calling = true
       $game_temp.menu_beep = true
     end
   end

and under it insert this:
Code:
# FISHING
   # if z pushed call fishing
   if Input.trigger?(Input::Z)
     fishing
   end
   # FISHING

Now insert this anywhere inbetween def update and def transfer_player
Code:
#--------------------------------------------------------------------------
# â—? Fishing
#--------------------------------------------------------------------------
def fishing
   character = $game_player
   case character.direction
   when 2
     lx = character.x
     ly = character.y + 1
   when 4
     lx = character.x - 1
     ly = character.y
   when 6
     lx = character.x + 1
     ly = character.y
   when 8
     lx = character.x
     ly = character.y - 1
   end
   if $game_map.terrain_tag(lx,ly) == 1
     Fishing.new
   else
     Audio.se_play("Audio/SE/057-Wrong01")
   end
end

and now make a new script under window_base and insert this:
Code:
#==============================================================================
# â–�  Window_Fish
#------------------------------------------------------------------------------
#  Fishy!
#==============================================================================

class Window_Fish < Window_Base
#--------------------------------------------------------------------------
# â—? Start
#--------------------------------------------------------------------------
def initialize
   super(0, 406, 640, 64)
   self.contents = Bitmap.new(width - 32, height - 32)
   self.contents.font.name = $defaultfonttype
   self.contents.font.size = $defaultfontsize
   self.opacity = 0
   $fm = " "
   refresh
end
#--------------------------------------------------------------------------
# â—? Refresh
#--------------------------------------------------------------------------
def refresh
   self.contents.clear
   self.contents.font.color = normal_color
   self.contents.draw_text(4, 0, 640, 32, $fm)
end
end

and just set water tiles to terrain type 1!

and credit to dragonslayer for the delay script! thanks!

TADA!

TK
}


Possibly Related Threads…
Thread Author Replies Views Last Post
  Change character script jaigai 0 2,737 11-19-2006, 01:00 PM
Last Post: jaigai
  Just a modification of Abyssos' facs script lumina... 0 2,589 11-01-2006, 01:00 PM
Last Post: lumina...
  Credit Script 1.1 acoole 0 2,416 10-24-2006, 01:00 PM
Last Post: acoole
  Script Dev Kit Nick 0 2,793 10-15-2006, 01:00 PM
Last Post: Nick
  Collection of Simple Bar Minigames sasuke89 0 2,324 10-03-2006, 01:00 PM
Last Post: sasuke89
  Opening Image script sasuke89 0 2,020 07-24-2006, 01:00 PM
Last Post: sasuke89
  Change Color of The diferent Status Script MASTERLOKI 0 2,267 07-18-2006, 01:00 PM
Last Post: MASTERLOKI
  Simple Inn Tsunokiette 0 1,599 06-28-2006, 01:00 PM
Last Post: Tsunokiette
  Event Name and ID Search Script Hadriel 0 2,026 06-21-2006, 01:00 PM
Last Post: Hadriel
  Currency Script Split 0 2,273 05-18-2006, 01:00 PM
Last Post: Split



Users browsing this thread: