XP 스크립트

KGC
$game_special_elements = {}
$imported = {}
$data_states = load_data("Data/States.rxdata")
$data_system = load_data("Data/System.rxdata")

위 스크립트는 어느 KGC 스크립트 보다 위에 있어야 됩니다


SG 필수1
#=============================================================================
# ** SG Settings Control
#=============================================================================
# sandgolem
# Version 3 (beta)
# 1.06.06
#=============================================================================
#
# Thanks Prexus, Saucetenuto, SephirothSpawn & Trickster!
# This script wouldn't exist without their help
#
#=============================================================================
#
# To check for updates or find more scripts, visit:
# http://www.gamebaker.com/rmxp/scripts/
#
# To use this script, copy it and insert it in a new section above "Main",
# under the default scripts and the SDK if you're using it.
#
# This script -MUST- be above all the SG Scripts, other than Loading Screen
# This script controls and saves all settings for the SG Scripts
#
# Have problems? You can leave me a message at:
# http://www.gamebaker.com/users/sandgolem
#
#=============================================================================
#
# These commands are explained better on pages where they're most useful.
#
# Commands added, can be used in event script:
#  sg_on('name')                    - turns that name to true
#  sg_on('name','name2','name3')
#  sg_off('name')                    - turns that name to false (off)
#  sg_off('name','name2','name3')
#  sg_st('word','name')              - turns name to the first value
#    or sg_st(#,'name','name2','name3')
#  sg_vst(var,'name1')              - Sets 'name' to what's in the variable
#  sg_vst(var,'name1','name2','name3')
#  sg_ar('name','','',#,...)        - creates a new array, replacing another
#                                      that has the same name
#  sg_ast('name','word','newword')  - turns the spot where word is in the
#                                      array to the newword
#  sg_ast('name',#,'newword') or    - turns what's placed at spot # in the
#    sg_ast('name',#,#)                array to the third option. Note: The
#                                      arrays start at 0, not 1
#  sg_2var(variable,'name')          - Should only be used for #s
#                                      Turns the variable to what's in 'name'
#  sg_2var(variable,'name','name2','name3')
#
# These are used to alter $game_sg in a more friendly way for non-scripters.
# Each command is for one setting ONLY. The ones with multiple names are for
# larger ones, like this:
#  $game_sg['encounter']['var'] = 5 would be sg_st(5,'encounter','var')
#
# You may also find a call script fix useful, allows lines to continue to the
# next:  http://www.gamebaker.com/rmxp/scripts/call-script-fix.htm
#
#=============================================================================

if $sg_loaded != true
  $data_sg = {}
end

$sg_defaults = {}

class SG_Start
  def construct(i)
    if $sg_defaults[i] == false
      $game_sg[i] = false
    elsif $sg_defaults[i] == nil
      $game_sg[i] = nil
    elsif $sg_defaults[i] == true
      $game_sg[i] = true
    elsif $sg_defaults[i].is_a?(Fixnum)
      $game_sg[i] = $sg_defaults[i]
    else
      $game_sg[i] = $sg_defaults[i].clone
    end
  end
 
  def start_game
    $game_sg = {}
    sg_temp = $sg_defaults.keys
    for i in 0...sg_temp.size
      construct(sg_temp[i])
    end
  end
end

class Scene_Title
  alias sandgolem_settings_title_newgame command_new_game
  def command_new_game
    sg_temp = SG_Start.new
    sg_temp.start_game
    sg_temp = nil
    sandgolem_settings_title_newgame
  end
end

def sg_makesetting(name,name2,name3,setting)
  if name2 == nil
    $game_sg[name.downcase] = setting
  elsif name3 == nil
    $game_sg[name.downcase][name2.downcase] = setting
  elsif name3 != nil
    $game_sg[name.downcase][name2.downcase][name3.downcase] = setting
  end
end

def sg_on(name,name2=nil,name3=nil)
  sg_makesetting(name,name2,name3,true)
end
 
def sg_off(name,name2=nil,name3=nil)
  sg_makesetting(name,name2,name3,false)
  return true # 10 bonus points if you know why this is there! :)
end
 
def sg_st(set,name,name2=nil,name3=nil)
  sg_makesetting(name,name2,name3,set)
  return true # same reason, just incase
end

def sg_set(name,set) # Compatability
  sg_makesetting(name,nil,nil,set)
  return true # same reason, just incase
end

def sg_vst(set,name,name2=nil,name3=nil)
  sg_makesetting(name,name2,name3,$game_variables[set])
end

def sg_ar(array_name_string, *args)
  for i in 0...args.size
    if args[i].is_a?(String)
      args[i] = args[i].chomp
    end
  end
  $game_sg[array_name_string.downcase] = args
end

def sg_ast(array_name_string, changing, new)
  sg_temp = $game_sg[array_name_string]
  sg_temp2 = 0
  if changing.is_a?(String)
    loop do
      if sg_temp2 > sg_temp.size
        p 'Setting to change with sg_ast does not exist! Contact game creator'
        p 'Array named:', array_name_string, sg_temp
        p 'Attempted to change:', changing
        return
      end
      if sg_temp[sg_temp2] == changing
        sg_temp[sg_temp2] = new.chomp
        $game_sg[array_name_string] = sg_temp
        return
      end
      sg_temp2 += 1
    end
  else
    sg_temp[changing] = new.chomp
    $game_sg[array_name_string] = sg_temp
  end
end

def sg_2var(sg1,sg2,sg3=nil,sg4=nil)
  if sg2.is_a?(String)
    sg2 = sg2.downcase
  end
  if sg3 == nil
    $game_variables[sg1] = $game_sg[sg2].to_i
  else
    if sg3.is_a?(String)
      sg3 = sg3.downcase
    end
    if sg4 == nil
      $game_variables[sg1] = $game_sg[sg2][sg3].to_i
    else
      if sg4.is_a?(String)
        sg4 = sg4.downcase
      end
      $game_variables[sg1] = $game_sg[sg2][sg3][sg4].to_i
    end
  end
end

begin
  SDK.log("SG Settings Control", "sandgolem", 3, "1.06.06")
  @sg_temp == true
 
  class Scene_Save < Scene_File
    alias sandgolem_control_save_write write_data
    def write_data(file)
      sandgolem_control_save_write(file)
      Marshal.dump($game_sg, file)
    end
  end
 
  class Scene_Load < Scene_File     
    alias sandgolem_control_load_read read_data   
    def read_data(file)
      sg_temp = SG_Start.new
      sg_temp.start_game
      sandgolem_control_load_read(file)
      if !file.eof
        $game_sg = Marshal.restore(file)
        sg_temp2 = $sg_defaults.keys
        for i in 0...sg_temp2.size
          if !$game_sg.has_key?(sg_temp2[i])
            sg_temp.construct(sg_temp2[i])
          end
        end
      end
      sg_temp = nil
    end 
  end
  rescue
  if @sg_temp != true # if no sdk
   
    class Scene_Save < Scene_File
      alias sandgolem_control_save_write write_save_data
      def write_save_data(file)
        sandgolem_control_save_write(file)
        Marshal.dump($game_sg, file)
      end
    end
   
    class Scene_Load < Scene_File
      alias sandgolem_control_load_read read_save_data
        def read_save_data(file)
        sg_temp = SG_Start.new
        sg_temp.start_game
        sandgolem_control_load_read(file)
        if !file.eof
          $game_sg = Marshal.restore(file)
          sg_temp2 = $sg_defaults.keys
          for i in 0...sg_temp2.size
            if !$game_sg.has_key?(sg_temp2[i])
              sg_temp.construct(sg_temp2[i])
            end
          end
        end
        sg_temp = nil
      end
    end
  end
  @sg_temp = nil
end

SG 필수 2
#=============================================================================
# ** SG Window Control
#=============================================================================
# sandgolem
# Version 2
# 18.06.06
#=============================================================================
#
# Thanks Saucetenuto, SephirothSpawn & Trickster!
# This script wouldn't exist without their help
#
#=============================================================================

# This script is used to display windows in their various settings, and is
# not required for all of the SG Scripts to work

# Display types:

#  0 or nothing = Icon on left
#  1            = Icon on right, with string a little ahead
#  2            = Icon on right, with string on left
#  3            = Text name on right, same as default gold window
#  4            = Text name on right, better spacing
#  5            = Text name on right, with string on left
#  6            = Text name on left
#  7            = Text name on left, followed by a :
#  8            = Icon only, centered in the window
#  9            = Text only, centered in the window
#  10          = String only, centered in the window
#  11          = Icon on right, with string a little more ahead

#=============================================================================
#
# To check for updates or find more scripts, visit:
# http://www.gamebaker.com/rmxp/scripts/
#
# To use this script, copy it and insert it in a new section above "Main",
# but under the default scripts and the SDK if you're using it. This script
# MUST be above all the SG Scripts that require it
#
# Have problems? You can leave me a message at:
# http://www.gamebaker.com/users/sandgolem
#
#=============================================================================

begin
  SDK.log("SG Window Control", "sandgolem", 2, "18.06.06")
  rescue
end

class Window_Base < Window
 
  def sg_draw_window(type,width,icon,text,string)
    if icon == nil
      icon = RPG::Cache.icon('049-Skill06')
    else
      icon = RPG::Cache.icon(icon)
    end
    if string == nil
      string = ' '
    end
    if text == nil
      text = ''
    end
    width -= 32
    cx = contents.text_size(text).width
    self.contents.clear
    case type.to_i
    when 0
      self.contents.draw_text(4, 0, width-8, 32, string, 2)
      src_rect = Rect.new(0, 0, 32, 32)
      self.contents.blt(0, 4, icon, src_rect)
    when 1
      self.contents.draw_text(4, 0, width-28, 32, string, 2)
      src_rect = Rect.new(0, 0, 32, 32)
      self.contents.blt(width-24, 4, icon, src_rect)
    when 2
      self.contents.draw_text(4, 0, width, 32, string)
      src_rect = Rect.new(0, 0, 32, 32)
      self.contents.blt(width-24, 4, icon, src_rect)
    when 3
      self.contents.draw_text(4, 0, width-8-cx, 32, string, 2)
      self.contents.font.color = system_color
      self.contents.draw_text(width-4-cx, 0, cx, 32, text, 2)
    when 4
      self.contents.draw_text(4, 0, width-14-cx, 32, string, 2)
      self.contents.font.color = system_color
      self.contents.draw_text(width-4-cx, 0, cx, 32, text, 2)
    when 5
      self.contents.draw_text(4, 0, width, 32, string)
      self.contents.font.color = system_color
      self.contents.draw_text(width-4-cx, 0, cx, 32, text, 2)
    when 6
      self.contents.draw_text(4, 0, width-8, 32, string, 2)
      self.contents.font.color = system_color
      self.contents.draw_text(4, 0, cx, 32, text)
    when 7
      self.contents.draw_text(4, 0, width-8, 32, string, 2)
      self.contents.font.color = system_color
      self.contents.draw_text(4, 0, cx, 32, text)
      self.contents.draw_text(cx+4, 0, 8, 32, ':')
    when 8
      cx = width / 2 - 12
      src_rect = Rect.new(0, 0, 32, 32)
      self.contents.blt(cx, 4, icon, src_rect)
    when 9
      self.contents.draw_text(0, 0, width, 32, text, 1)
    when 10
      self.contents.draw_text(0, 0, width, 32, string, 1)
    when 11
      self.contents.draw_text(4, 0, width-34, 32, string, 2)
      src_rect = Rect.new(0, 0, 32, 32)
      self.contents.blt(width-24, 4, icon, src_rect)
    end
  end
end

SG 스크립트 처음꺼는 어느 SG 스크립트보다 위에 있어야 되며
두번째꺼는 없어도 되는게 있지만, 없으면 안되는게 있으니,
첫번째거 바로 아래 넣는것을 추천

Who's 백호

?

이상혁입니다.

http://elab.kr


List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 습작 2012.12.24 6153
161 기타 레벨9999만들기스크립 23 해파리 2009.04.10 3344
160 스탯 포인트 시스템 3차수정 ( ' 백호 ' 님이 올리신 자료 수정.) 26 카이어덱터 2010.01.04 3346
159 이동 및 탈것 최단경로 찾아가기 - (마우스 사용) 18 file 허걱 2009.02.02 3353
158 아이템 아이템 인벤토리 2 file 백호 2009.02.22 3356
157 파티 [최강전사님 제공] 파티가 따라오게 하는 스크립트 24 file 아방스 2007.11.09 3365
156 전투 ATB전투 5 백호 2009.02.22 3369
155 메뉴 [자작]명성치 사용 스크립트 16 Rainsy 2009.03.22 3390
154 기타 한글 입력 스크립트 입니다. (vx -> xp) 23 file 헤르코스 2009.04.18 3397
153 메뉴 스탯올리기 시스템 (액알가능) 27 file 백호 2009.02.22 3404
152 이동 및 탈것 멈췄을때 행동. 17 file Bera 2010.10.17 3408
151 기타 FPLE 2 - First Person Labyrinth Explorer by MGC 1 Alkaid 2012.01.17 3415
150 메시지 ◆메세지 윈도우 개조 -KGC_MessageAlter◆ 3 백호 2009.02.22 3422
149 미니맵 미니맵(중복률100%? 한글번역!) 17 백호 2009.02.21 3423
148 HUD 맵이름표시 ps인간 2009.01.23 3441
147 미니맵 던전용 미니맵 스크립트[사용법 추가] 16 file 배포 2008.03.02 3443
146 이동 및 탈것 3D 캐릭 스크립트 7 백호 2009.02.22 3443
145 능력치 올리기 스크립트 21 file 아방스 2007.11.09 3447
144 전투 CTB by Charlie Fleed 3.2 - FF10 스타일의 전투 시스템 7 Alkaid 2010.10.14 3449
143 미니맵 스크립트 이용하여 미니맵 만들기 16 file 아방스 2007.11.09 3452
142 메뉴 자작 메뉴 스크립트들(L's Simple CMS and menu scenes) (SDK 호환?) 10 Alkaid 2010.09.02 3455
Board Pagination Prev 1 ... 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 Next
/ 52