Equip Locker
Versi: 1.0
Tipe: Equipments
PengenalanA friend of mine(nightrider, siapa lagi?) requested something to lock an equipment for actors. Making this kind of thing won't hurt much, I think.
Fitur- Largely configureable, even in midgame
- High compatibility, maybe.
- Can lock more than 1 equip slots.
- Simple.
ScreenshotsNo need of screenshots. I didn't hack the interface, so graphically there's no change.
DemoNo need.
Scripts- Spoiler:
- Code:
-
=begin
================================================================================
Equip Locker v1.0
by wltr3565
================================================================================
A friend of mine requested something to lock an equipment for actors. Making
this kind of thing won't hurt much, I think.
================================================================================
Features:
- Largely configureable, even in midgame
- High compatibility, maybe.
- Can lock more than 1 equip slots.
- Simple.
================================================================================
How it will work:
The listed slots to lock will make adjusting the equipment of an actor in the
told slot impossible until the lock is removed.
================================================================================
How to Use:
Configure the starting lock below. There's some script commands that let you to
readjust the locks in mid game:
- add_lock(actor_id, slot)
This will add a new slot to lock. actor_id is the actor's id for the
locking. slot is the slot you wish to lock.
- remove_lock(actor_id, slot)
This will remove the assigned slot from locking. actor_id is the actor's id
to remove the lock for. slot is the slot you wish to unlock.
- clear_lock(actor_id)
This will make the assigned actor to have his/her locks removed completely.
To put simply, he/she can adjust anything again, like this script never
exists.
================================================================================
Install:
Insert this above main and below any equip scene-related scripts.
================================================================================
Terms of Use:
Credit me, wltr3565, or not is up to you. Just don't claim that this is made by
you, and crediting me will be nice. Giving me a free copy of your game will be
very nice too.
================================================================================
Thanks:
NightRider: Requested this kind of thing.
================================================================================
=end
#===============================================================================
# COMMENCING COMPATIBILITY FLAG
#===============================================================================
$imported = {} if $imported == nil
$imported["wltr3565's_Equip_Locker"] = true
#===============================================================================
# END COMPATIBILITY FLAG
#===============================================================================
module WLTR
module WEAPON_LOCK_SETUP
"=============================================================================="
" DO NOT TOUCH BELOW!!!!"
"=============================================================================="
LOCK_SLOT = []
"=============================================================================="
#===============================================================================
# This will adjust the locks for each actors in the start of the game. The
# format of making one is like this:
#
# LOCK_SLOT[id] = [slots in array]
#
# That will adjust the locks for actor with the assigned id. Example:
#
# LOCK_SLOT[5] = [1, 2]
#
# That will make actor id 5 unable to change his/her second weapon/shield and
# body armor (by default equipment)
#===============================================================================
LOCK_SLOT[1] = [0, 1, 2]
LOCK_SLOT[2] = [0, 1]
LOCK_SLOT[3] = [2]
end
end
"=============================================================================="
" BELOW IS TOO DANGEROUS TO READ WITHOUT PROPER SCRIPTING SKILLS. THEREFOR, "
" EDIT AT YOUR OWN RISK! "
"=============================================================================="
class Game_Actor < Game_Battler
attr_accessor :equip_lock_list
alias lock_initialize initialize
def initialize(actor_id)
lock_initialize(actor_id)
@equip_lock_list = WLTR::WEAPON_LOCK_SETUP::LOCK_SLOT[self.id]
@equip_lock_list = [] if @equip_lock_list == nil
end
end
class Game_Interpreter
def add_lock(actor_id, slot)
$game_actors[actor_id].equip_lock_list.push(slot)
$game_actors[actor_id].equip_lock_list.uniq!
end
def remove_lock(actor_id, slot)
$game_actors[actor_id].equip_lock_list.delete(slot)
$game_actors[actor_id].equip_lock_list.uniq!
end
def clear_lock(actor_id)
$game_actors[actor_id].equip_lock_list.clear
end
end
class Scene_Equip < Scene_Base
alias block_equip_selection update_equip_selection
def update_equip_selection
if Input.trigger?(Input::C)
index = @equip_window.index
if @actor.equip_lock_list.include?(index)
Sound.play_buzzer
return
end
end
block_equip_selection
end
end
#===============================================================================
#
# END OF SCRIPT
#
#===============================================================================
Terms of UseCredit me, wltr3565, or not is up to you. Just don't claim that this is made by
you, and crediting me will be nice. Giving me a free copy of your game will be
very nice too.
ThanksNightRider: Requested this kind of thing.
Maaf, malas translasi