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 | 
 

 Rei Self Variable

Topik sebelumnya Topik selanjutnya Go down 
Rei Self Variable Empty2009-05-25, 13:42
PostRei Self Variable
#1
reijubv 
Kai Runes
Kai Runes
reijubv

Kosong
Posts : 1476
Thanked : 33
Engine : RMVX
Awards:

Rei Self Variable Vide
Rei Self Variable
Versi: V.1.0
Tipe: Variable


VX punya Self Switch, tapi ga punya Self Variable, jadi yah, inilah self variable untuk yg mau pakai...

Mav ini pake b.ing scriptnya, tapi pertama kali dipost di sini, blum di forum laen, hehe...



Fitur


  • Cuma ngbikin tiap event bisa punya variable sendiri yg g akan konflik ma variable lainnya



Screenshots

Gmana ceritanya variable harus pakai screenshot?


Demo

Tinggal baca komen2 yg ada di scriptnya, gampang dimengerti ko..


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
#==============================================================================
# ** Scene_Title
#------------------------------------------------------------------------------
#  This class performs the title screen processing.
#==============================================================================
class Scene_Title < Scene_Base
  #--------------------------------------------------------------------------
  # * Create Game Objects
  #--------------------------------------------------------------------------
  alias reisvcgo create_game_objects unless method_defined?('reisvcgo')
  def create_game_objects
    $game_self_variables = Self_Variables.new
    reisvcgo
  end
end
#==============================================================================
# ** Scene_File
#------------------------------------------------------------------------------
#  This class performs the save and load screen processing.
#==============================================================================
class Scene_File < Scene_Base
  #--------------------------------------------------------------------------
  # * Read Save Data
  #    file : file object for reading (opened)
  #--------------------------------------------------------------------------
  alias reirsdread_save_data unless method_defined?('reirsd')
  def read_save_data(file)
    reirsdread_save_data(file)
    $game_self_variables = Marshal.load(file)
  end
  #--------------------------------------------------------------------------
  # * Read Save Data
  #    file : file object for reading (opened)
  #--------------------------------------------------------------------------
  alias reiwsdread_save_data unless method_defined?('reiwsd')
  def write_save_data(file)
  reiwsdread_save_data(file)
  Marshal.dump($game_self_variables,  file)
  end
end



Credits


  • reijubv



Terakhir diubah oleh reijubv tanggal 2010-07-25, 18:04, total 5 kali diubah (Reason for editing : update V.2.0 scriptnya....)
Rei Self Variable Empty2009-05-25, 15:05
PostRe: Rei Self Variable
#2
bradhawk 
Admin
Admin
bradhawk

Level 5
Posts : 637
Thanked : 8
Skill : Beginner

Rei Self Variable Vide
weh weh, script lagi :P gud gud...
om, kalo post script pake tag code, caranyah [ code ] [ /code ]
seph, meskipun blon tak coba...
Rei Self Variable Empty2009-05-25, 16:32
PostRe: Rei Self Variable
#3
dnasman 
Admin
Kodok Ganteng Indonesia™

AdminKodok Ganteng Indonesia™
dnasman

Kosong
Posts : 1361
Thanked : 21
Engine : RMXP
Skill : Intermediate
Type : Event Designer
Awards:

Rei Self Variable Vide
huahaha!!! script baru lagee!! nice om rei! kebetulan lagi ada project sampingan di VX yg diharuskan menggunakan variable banyak :D :D

btw pemakaiannya dijelasin lebih lanjut dunk, soalny rada ga ngerti gimana (bhs inggrisku masih acak kadut sich :P )

keep up the good work :thumbup:
Rei Self Variable Empty2009-05-25, 17:31
PostRe: Rei Self Variable
#4
fjakf 
Banned by Admin
Banned by Admin
fjakf

Kosong
Posts : 217
Thanked : 1
Engine : Other
Type : Developer

Rei Self Variable Vide
Wah! buat sendiri yah? keren bro :D!. Keep working lah! :p
Rei Self Variable Empty2009-05-26, 17:33
PostRe: Rei Self Variable
#5
dnasman 
Admin
Kodok Ganteng Indonesia™

AdminKodok Ganteng Indonesia™
dnasman

Kosong
Posts : 1361
Thanked : 21
Engine : RMXP
Skill : Intermediate
Type : Event Designer
Awards:

Rei Self Variable Vide
kk rei, boleh nanya2 ga? klo misalny kita mw menampilkan variable2 tsb kedalam sebuah message gimana? kan klo variable biasa tinggal gunain \v[var id]

thnx!
Rei Self Variable Empty2009-05-27, 13:54
PostRe: Rei Self Variable
#6
Notorius 
Veteran
Veteran
Notorius

Level 5
Posts : 1408
Thanked : 0
Engine : RMVX
Skill : Intermediate
Type : Event Designer

Rei Self Variable Vide
Memang ga bisa yah?

Ga dijelasin di Script neh? #-#
Rei Self Variable Empty2009-05-27, 18:17
PostRe: Rei Self Variable
#7
reijubv 
Kai Runes
Kai Runes
reijubv

Kosong
Posts : 1476
Thanked : 33
Engine : RMVX
Awards:

Rei Self Variable Vide
oia, ya...
Blum bisa untuk messagenya kk, aku bru nyadar...
Hehe,,,

Script ini sebenernya aku pake buat ngbikin smacem cooldown buat pengambilan rumput2an obat di game aku....

cara pakainya,
1.buat event (atau kalau udah ada, buka eventnya)
2.klik kanan, insert (atau apa, lupa lgi,) di halaman terakhir, dibawah, ada "Advanced"
disitu ada "Script", klik.
3.ada kotak yg kebuka, ketik didalam kotak itu :
(2 baris dibawah ini yg kdu dmasukin, fungsinya untuk mengeset variabel itu ke value, value bisa apa aja, angka, text, variabel lain, benda, dsb)

key = [$game_map.map_id , @event_id]
$game_self_variables[key] = value

(2 baris tersebut msukin aja,$game_map.map_id adalah map Id yang dimana player berada sekarang, buat map lain, msukin aja ID mapnya, misalnya 1, 2 ,3..
trus buat @event_id adalah event dimana script ini djalankan, kalau mau ganti variablenya event lain, ganti aja ma Id eventnya...)
4. untuk dipakai di conditional branch, atau untuk menyuruh game membaca isi variabel nya, pakai baris dibawah ini :

$game_self_variables[[$game_map.map_id , @event_id]]

($game_map.map_id dan @event_id sama dengan no.3)

CONTOH PEMAKAIAN :

" aku mau ngeset variabel yang dimiliki event id 1 di map dengan Id 2 dengan max hp yg dimiliki anggota party nomor 1"
maka aku mengetik ini di script command di eventnya :

key = [2 , 1]
$game_self_variables[key] = $game_party.members[0].maxhp

" atau kalau aku males ngetik baris pertama, aku ketik aja ini "

$game_self_variables[[2,1]] = $game_party.members[0].maxhp

"loh, ko malah jadi ada baris ketiga?"
misal, jadi kyk gini :


$game_self_variables[[2,1]] = $game_party.mem
bers[0].maxhp

bakal eror....

jadi solusinya...

"aku ketik ini aja deh "

key = [2 , 1]
value = $game_party.members[0].maxhp
$game_self_variables[key] = value

"nah kan hemat tempat"

begitu, smoga membantu..


OIA, SCRIPT DIUPDATE KE V.2.0!!
Alasan: Versi pertama aku bikin setengah hati, jadi EROR SEMUA.
Rei Self Variable Empty2009-05-27, 18:31
PostRe: Rei Self Variable
#8
Notorius 
Veteran
Veteran
Notorius

Level 5
Posts : 1408
Thanked : 0
Engine : RMVX
Skill : Intermediate
Type : Event Designer

Rei Self Variable Vide
*wuing²* newbiescripter ini (boro2 scripter :eneg: )
kagak ngerdie...
Yang jelas adain tuh view-var-in-messagewindow ato apalah
Rei Self Variable Empty
PostRe: Rei Self Variable
#9
Sponsored content 




Rei Self Variable Vide
 

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 :: RMVX Scripts-