Per 2016, RMID pindah ke RMID Discord (Invite link dihapus untuk mencegah spambot -Theo @ 2019). Posting sudah tidak bisa dilakukan lagi.
Mohon maaf atas ketidaknyamanannya dan mohon kerjasamanya.

Share | 
 

 [PORT][Xp] Rei Self Variable

Topik sebelumnya Topik selanjutnya Go down 
[PORT][Xp] Rei Self Variable Empty2011-01-12, 12:29
Post[PORT][Xp] Rei Self Variable
#1
LiTTleDRAgo 
Senior
Senior
LiTTleDRAgo

Level 5
Posts : 712
Thanked : 27
Engine : RMXP
Skill : Skilled
Type : Scripter
Awards:
[PORT][Xp] Rei Self Variable Vide
Rei Self Variable
Versi: konvert-an
Tipe: Variable


Pengenalan

Cuma Hasil Convert dari thread ini :
http://www.rpgmakerid.com/t155-rei-self-variable

Iseng aja dipost karena lagi bete


Scripts

Code:
#==============================================================================
# ** Rei Self_Variable by reijubv V.2.0 (Rewritted)
#------------------------------------------------------------------------------
#  This class handles event's owned variables.
#  The instance of this class is referenced by $game_self_variables.
#==============================================================================
class Self_Variables
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    @data = {}
  end
  #--------------------------------------------------------------------------
  # * Get Self Variable value
  #--------------------------------------------------------------------------
  #  How to use : Write this to event's script command
  #  $game_self_variables[[$game_map.map_id , @event_id]]
  #--------------------------------------------------------------------------
  def [](key)
    return @data[key] == nil ? 0 : @data[key]
  end
  #--------------------------------------------------------------------------
  # * Set Self Variable Value
  #  value  = value you want to set in this variable
  #--------------------------------------------------------------------------
  #  How to use : Write this to event's script command
  #  key = [$game_map.map_id , @event_id]
  #  $game_self_variables[key] = value
  #--------------------------------------------------------------------------
  def []=(key, value)
    @data[key] = value
  end
end

class Scene_Title
  alias_method :or_new_game, :command_new_game

  def command_new_game; or_new_game
    $game_self_variables = Self_Variables.new
  end
end

class Scene_Save < Scene_File
  alias_method :or_write, :write_save_data

  def write_save_data(file); or_write(file)
    Marshal.dump($game_self_variables, file)
  end
end

class Scene_Load < Scene_File
  alias_method :or_read, :read_save_data

  def read_save_data(file); or_read(file)
    $game_self_variables = Marshal.load(file)
  end
end

Cara penggunaannya sama kyk yg di VX


Credits


  • Kasi aja creditnya ke kk reijubv
[PORT][Xp] Rei Self Variable Empty2011-01-12, 12:55
PostRe: [PORT][Xp] Rei Self Variable
#2
nisamerica 
Living Skeleton
nisamerica

Kosong
Posts : 1668
Thanked : 25
Engine : RMVX
Skill : Very Beginner
Type : Artist
Awards:


[PORT][Xp] Rei Self Variable Vide
Waw, waw, bagus neh, ampe ngeconvert dari script VX lain :D

Ini tampaknya akan berguna, keep up the good work :thumbup:
 

[PORT][Xp] Rei Self Variable

Topik sebelumnya Topik selanjutnya Kembali Ke Atas 

Similar topics

+
Halaman 1 dari 1

Permissions in this forum:Anda tidak dapat menjawab topik
RPGMakerID :: Scripts & Event Systems :: RMXP Scripts-