I just put Tankentai into my game and I finally figured it out and its great, however; I have a script that I use for Stealing items off of mobs. The problem is it displays the text in the dialog box that no longer exists! (The one that used to tell the damage before putting in the SBS.) It would display text like: "Couldn't steal anything!", "Stole Potion", etc..
If anyone can help me create a new window that displays the steal text it would be great, it doesn't have to be that impressive.. something like this:
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fi43.tinypic.com%2F2qd029g.jpg&hash=9e948a04a652ee511cb8a153f21fe53e91fb9580)
The script already displays the text, it just isn't active under the current sbs. The window should also only pop up when stealing, or even if it can display at the top window.. If anyone can do this it would be much appreciated. Below is the code for the steal script that I'm using. Thanks for looking!
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#_/ ? ?? - KGC_Steal ? VX ?
#_/ ? Last update : 2008/09/13 ?
#_/----------------------------------------------------------------------------
#_/ ????????????????????
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#==============================================================================
# ? ???????? - Customize ?
#==============================================================================
module KGC
module Steal
# ? ????????????????
# %s : ??????
VOCAB_STEAL_NO_ITEM = "%s has nothing to steal!"
# ? ??????????????
VOCAB_STEAL_FAILURE = "Couldn't steal anything!"
# ? ????????????????
# ???? %s : ??????
# ???? %s : ?????
VOCAB_STEAL_ITEM = "%s had an item! Stole %s."
# ? ??????????????
# ???? %s : ??????
# ???? %s : ??
# ???? %s : ??
VOCAB_STEAL_GOLD = "%s?? %s%s ????"
end
end
#???????????????????????????????????????
$imported = {} if $imported == nil
$imported["Steal"] = true
module KGC::Steal
module Regexp
module BaseItem
# ???????
STEAL_PROB_PLUS = /<(?:STEAL_PROB|?????)\s*([\+\-]\d+)[%?]?>/i
end
module Skill
# ??
STEAL = /<(?:STEAL|??)>/i
end
module Enemy
# ?????????
STEAL_OBJECT = /<(?:STEAL|??)\s*([IWAG]):(\d+)\s+(\d+)([%?])?>/i
end
end
end
#???????????????????????????????????????
#==============================================================================
# ? Vocab
#==============================================================================
module Vocab
# ?????????
StealItem = KGC::Steal::VOCAB_STEAL_ITEM
StealGold = KGC::Steal::VOCAB_STEAL_GOLD
StealNoItem = KGC::Steal::VOCAB_STEAL_NO_ITEM
StealFailure = KGC::Steal::VOCAB_STEAL_FAILURE
end
#???????????????????????????????????????
#==============================================================================
# ? RPG::BaseItem
#==============================================================================
class RPG::BaseItem
#--------------------------------------------------------------------------
# ? ????????????
#--------------------------------------------------------------------------
def create_steal_cache
@__steal_prob_plus = 0
self.note.each_line { |line|
case line
when KGC::Steal::Regexp::BaseItem::STEAL_PROB_PLUS
# ???????
@__steal_prob_plus += $1.to_i
end
}
end
#--------------------------------------------------------------------------
# ? ???????
#--------------------------------------------------------------------------
def steal_prob_plus
create_steal_cache if @__steal_prob_plus == nil
return @__steal_prob_plus
end
end
#???????????????????????????????????????
#==============================================================================
# ? RPG::Skill
#==============================================================================
class RPG::Skill < RPG::UsableItem
#--------------------------------------------------------------------------
# ? ????????????
#--------------------------------------------------------------------------
def create_steal_cache
super
@__steal = false
self.note.each_line { |line|
case line
when KGC::Steal::Regexp::Skill::STEAL
# ??
@__steal = true
end
}
end
#--------------------------------------------------------------------------
# ? ??
#--------------------------------------------------------------------------
def steal?
create_steal_cache if @__steal == nil
return @__steal
end
end
#???????????????????????????????????????
#==============================================================================
# ? RPG::Enemy
#==============================================================================
class RPG::Enemy
#--------------------------------------------------------------------------
# ? ????????????
#--------------------------------------------------------------------------
def create_steal_cache
@__steal_objects = []
self.note.each_line { |line|
case line
when KGC::Steal::Regexp::Enemy::STEAL_OBJECT
# ?????????
obj = RPG::Enemy::StealObject.new
case $1.upcase
when "I" # ????
obj.kind = 1
obj.item_id = $2.to_i
when "W" # ??
obj.kind = 2
obj.weapon_id = $2.to_i
when "A" # ??
obj.kind = 3
obj.armor_id = $2.to_i
when "G" # ?
obj.kind = 4
obj.gold = $2.to_i
else
next
end
# ???
if $4 != nil
obj.success_prob = $3.to_i
else
obj.denominator = $3.to_i
end
@__steal_objects << obj
end
}
end
#--------------------------------------------------------------------------
# ? ?????????
#--------------------------------------------------------------------------
def steal_objects
create_steal_cache if @__steal_objects == nil
return @__steal_objects
end
end
#???????????????????????????????????????
#==============================================================================
# ? RPG::Enemy::StealObject
#==============================================================================
class RPG::Enemy::StealObject < RPG::Enemy::DropItem
#--------------------------------------------------------------------------
# ? ??
#--------------------------------------------------------------------------
KIND_ITEM = 1
KIND_WEAPON = 2
KIND_ARMOR = 3
KIND_GOLD = 4
#--------------------------------------------------------------------------
# ? ??????????
#--------------------------------------------------------------------------
attr_accessor :gold # ?
attr_accessor :success_prob # ???
#--------------------------------------------------------------------------
# ? ?????????
#--------------------------------------------------------------------------
def initialize
super
@gold = 0
@success_prob = 0
end
#--------------------------------------------------------------------------
# ? ????
#--------------------------------------------------------------------------
def equal?(obj)
return false unless obj.is_a?(RPG::Enemy::StealObject)
return false if self.gold != obj.gold
return false if self.success_prob != obj.success_prob
return true
end
#--------------------------------------------------------------------------
# ? ?????
#--------------------------------------------------------------------------
def ==(obj)
return self.equal?(obj)
end
end
#???????????????????????????????????????
#==============================================================================
# ? Game_Battler
#==============================================================================
class Game_Battler
#--------------------------------------------------------------------------
# ? ??????????
#--------------------------------------------------------------------------
attr_accessor :steal_objects # ?????????
attr_accessor :stolen_object # ????????????
#--------------------------------------------------------------------------
# ? ?????????
#--------------------------------------------------------------------------
alias initialize_Battler_KGC_Steal initialize
def initialize
initialize_Battler_KGC_Steal
@steal_objects = []
@stolen_object = nil
end
#--------------------------------------------------------------------------
# ? ????????
#--------------------------------------------------------------------------
def steal_prob_plus
return 0
end
#--------------------------------------------------------------------------
# ? ????????
# user : ???????
# skill : ???
#--------------------------------------------------------------------------
alias skill_effect_KGC_Steal skill_effect
def skill_effect(user, skill)
skill_effect_KGC_Steal(user, skill)
make_obj_steal_result(user, skill)
end
#--------------------------------------------------------------------------
# ? ?????????????????
# user : ??????????????
# obj : ??????????
# ??? @stolen_object ??????
#--------------------------------------------------------------------------
def make_obj_steal_result(user, obj)
return unless obj.steal? # ??????
return if @skipped || @missed || @evaded # ????
# ????????
if self.steal_objects.compact.empty?
@stolen_object = :no_item
return
end
@stolen_object = nil
stolen_index = -1
self.steal_objects.each_with_index { |sobj, i|
next if sobj == nil
# ??????
if sobj.success_prob > 0
# ????
next if sobj.success_prob + user.steal_prob_plus < rand(100)
else
# ????
if rand(sobj.denominator) != 0
next if user.steal_prob_plus < rand(100)
end
end
# ????
@stolen_object = sobj
stolen_index = i
if $imported["EnemyGuide"]
# ??????????????
self_id = (self.actor? ? self.id : self.enemy_id)
KGC::Commands.set_enemy_object_stolen(self_id, stolen_index)
end
break
}
if stolen_index != -1
@steal_objects[stolen_index] = nil
end
end
end
#???????????????????????????????????????
#==============================================================================
# ? Game_Actor
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# ? ????????
#--------------------------------------------------------------------------
def steal_prob_plus
n = 0
equips.compact.each { |item| n += item.steal_prob_plus }
return n
end
end
#???????????????????????????????????????
#==============================================================================
# ? Game_Enemy
#==============================================================================
class Game_Enemy < Game_Battler
#--------------------------------------------------------------------------
# ? ?????????
# index : ????????????
# enemy_id : ???? ID
#--------------------------------------------------------------------------
alias initialize_Enemy_KGC_Steal initialize
def initialize(index, enemy_id)
initialize_Enemy_KGC_Steal(index, enemy_id)
@steal_objects = enemy.steal_objects.clone
end
end
#???????????????????????????????????????
#==============================================================================
# ? Scene_Battle
#==============================================================================
class Scene_Battle < Scene_Base
#--------------------------------------------------------------------------
# ? ??????? : ???
#--------------------------------------------------------------------------
alias execute_action_skill_KGC_Steal execute_action_skill
def execute_action_skill
skill = @active_battler.action.skill
if skill.steal?
execute_action_steal
@status_window.refresh
else
execute_action_skill_KGC_Steal
end
end
#--------------------------------------------------------------------------
# ? ??????? : ??
#--------------------------------------------------------------------------
def execute_action_steal
skill = @active_battler.action.skill
text = @active_battler.name + skill.message1
@message_window.add_instant_text(text)
unless skill.message2.empty?
wait(10)
@message_window.add_instant_text(skill.message2)
end
targets = @active_battler.action.make_targets
display_animation(targets, skill.animation_id)
@active_battler.mp -= @active_battler.calc_mp_cost(skill)
$game_temp.common_event_id = skill.common_event_id
for target in targets
target.skill_effect(@active_battler, skill)
display_steal_effects(target, skill)
end
end
#--------------------------------------------------------------------------
# ? ????????
# target : ???
# obj : ??????????
#--------------------------------------------------------------------------
def display_steal_effects(target, obj = nil)
unless target.skipped
line_number = @message_window.line_number
wait(5)
if target.hp_damage != 0 || target.mp_damage != 0
display_critical(target, obj)
display_damage(target, obj)
end
display_stole_object(target, obj)
display_state_changes(target, obj)
if line_number == @message_window.line_number
display_failure(target, obj) unless target.states_active?
end
if line_number != @message_window.line_number
wait(30)
end
@message_window.back_to(line_number)
end
end
#--------------------------------------------------------------------------
# ? ????????????
# target : ???
# obj : ??????????
#--------------------------------------------------------------------------
def display_stole_object(target, obj = nil)
if target.missed || target.evaded
display_steal_failure(target, obj)
return
end
case target.stolen_object
when nil # ????
display_steal_failure(target, obj)
when :no_item # ????????
display_steal_no_item(target, obj)
else
if target.stolen_object.kind == RPG::Enemy::StealObject::KIND_GOLD
# ??
display_steal_gold(target, obj)
else
# ???? or ?? or ??
display_steal_item(target, obj)
end
target.stolen_object = nil
end
end
#--------------------------------------------------------------------------
# ? ???????
# target : ??? (????)
# obj : ??????????
#--------------------------------------------------------------------------
def display_steal_failure(target, obj)
@message_window.add_instant_text(Vocab::StealFailure)
wait(30)
end
#--------------------------------------------------------------------------
# ? ?????????????
# target : ??? (????)
# obj : ??????????
#--------------------------------------------------------------------------
def display_steal_no_item(target, obj)
text = sprintf(Vocab::StealNoItem, target.name)
@message_window.add_instant_text(text)
wait(30)
end
#--------------------------------------------------------------------------
# ? ?????????????
# target : ??? (????)
# obj : ??????????
#--------------------------------------------------------------------------
def display_steal_item(target, obj)
# ??????????
sobj = target.stolen_object
case sobj.kind
when RPG::Enemy::StealObject::KIND_ITEM
item = $data_items[sobj.item_id]
when RPG::Enemy::StealObject::KIND_WEAPON
item = $data_weapons[sobj.weapon_id]
when RPG::Enemy::StealObject::KIND_ARMOR
item = $data_armors[sobj.armor_id]
else
return
end
$game_party.gain_item(item, 1)
text = sprintf(Vocab::StealItem, target.name, item.name)
@message_window.add_instant_text(text)
wait(30)
end
#--------------------------------------------------------------------------
# ? ???????????
# target : ??? (????)
# obj : ??????????
#--------------------------------------------------------------------------
def display_steal_gold(target, obj)
gold = target.stolen_object.gold
$game_party.gain_gold(gold)
text = sprintf(Vocab::StealGold, target.name, gold, Vocab.gold)
@message_window.add_instant_text(text)
wait(30)
end
end
This has been resolved with a bit more searching, if anyone else has this problem the solution is here:
http://www.rpgmakervx.net/index.php?showtopic=3946&pid=47365&mode=threaded&start=
A new problem with Tankentai and the Steal script listed above..
Now when I use a custom Action Sequence.. if <STEAL> (which is used to make the steal script run) is in the notebox with the tankentai action sequence i made it doesn't play.
My notebox loks like this:
<action: STEAL_TANK>
<STEAL>
I think this is where the problem lies, how can I get my action sequence to do the same thing that the note box does??
EDIT: I thought that I found the solution..
This is KGC_Steal Fix by Moonlight:
#==============================================================================
# KGC_Steal Fix for RPG Tankentai Sideview Battle System (3.4)
# By Moonlight
#==============================================================================
# Modifies execute_action_steal method to perform the action sequence
# associated with the steal skill
#==============================================================================
# Installation: Place it above main but below KGC_Steal and
# RPG Tankentai Sideview Battle System scripts
# Rewrites : execute_action_steal, display_steal_effects
#==============================================================================
$imported = {} if $imported == nil
#==============================================================================
# ** Scene_Battle
#------------------------------------------------------------------------------
# This class performs battle screen processing.
#==============================================================================
if $imported["Steal"]
class Scene_Battle < Scene_Base
#--------------------------------------------------------------------------
# ? ??????? : ??
#--------------------------------------------------------------------------
def execute_action_steal
skill = @active_battler.action.skill
if skill.plus_state_set.include?(1)
for member in $game_party.members + $game_troop.members
next if member.immortal
next if member.dead?
member.dying = true
end
else
immortaling
end
return unless @active_battler.skill_can_use?(skill)
targets = @active_battler.action.make_targets
target_decision(skill)
@spriteset.set_action(@active_battler.actor?, @active_battler.index, skill.base_action)
pop_help(skill)
playing_action
@active_battler.mp -= @active_battler.calc_mp_cost(skill) #
$game_temp.common_event_id = skill.common_event_id
for target in targets
display_steal_effects(target, skill)
end
end
#--------------------------------------------------------------------------
# ? ????????
# target : ???
# obj : ??????????
#--------------------------------------------------------------------------
def display_steal_effects(target, obj = nil)
unless target.skipped
line_number = @message_window.line_number
wait(5)
@help_window.visible = false if @help_window != nil
display_stole_object(target, obj)
display_state_changes(target, obj)
if line_number == @message_window.line_number
display_failure(target, obj) unless target.states_active?
end
if line_number != @message_window.line_number
wait(30)
end
@message_window.back_to(line_number)
end
end
end
end # if $imported["Steal"]
Using Moonlight's script I now have it so that Tankentai actually displays the action sequence and also using Woratana's Neo Message System to display the text... but now I think that
KGC Steal Script itself now is not processing correctly because it displays:
"Couldn't steal anything."
(which means the enemy has something to steal)
is being displayed even if the enemy isn't set with anything to steal.. steal also hasn't worked on enemies with items either. It just displays "Couldn't steal anything".
Also the first time Steal is used in a battle, it doesn't process the text.. only the window. If you use Steal a second time then it displays the text stated above.
Any ideas?