STEW'S PROFILE
Stew
0
Search
Need help editing Threat System script (XP)
So I am working on integrating Fanatist's Threat System script into my game and I've come across a minor snag.
My goal is to move the threat gauge down so it's below the HP counter. I'd also like add the letters EF (Enemy Focus) to the left of the threat number.
My first and biggest problem is that while I have been able to move the Threat counter, it only moves to the correct spot for the first player character. The other two move down but are too far to the left.
My second problem is that I just don't know how to pop the desired "EF" in there. I can do without this if I need to, but I'd like to have it there.
If anyone with more experience might be up for taking a gander at the script (below) I'd appreciate the help.
(I used Hide rather Code because Code was giving me some weird problem where it stretches out so that it's unreadable.)
The portion I edited
The full script
My goal is to move the threat gauge down so it's below the HP counter. I'd also like add the letters EF (Enemy Focus) to the left of the threat number.
My first and biggest problem is that while I have been able to move the Threat counter, it only moves to the correct spot for the first player character. The other two move down but are too far to the left.
My second problem is that I just don't know how to pop the desired "EF" in there. I can do without this if I need to, but I'd like to have it there.
If anyone with more experience might be up for taking a gander at the script (below) I'd appreciate the help.
(I used Hide rather Code because Code was giving me some weird problem where it stretches out so that it's unreadable.)
The portion I edited
#============================================================================== # ** Window_BattleStatus #------------------------------------------------------------------------------ # Modded to show threat beside actor's name. #============================================================================== class Window_BattleStatus #-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- alias threat_display_refresh refresh def refresh threat_display_refresh for i in 0...$game_party.actors.size actor = $game_party.actors next if actor.threat == 0 actor_x = i * 160 + 4 actor_x += self.contents.text_size(actor.name).width + 4 self.contents.draw_text(actor_x, 0, 160, 170, "(#{actor.threat})") end end end end if ThreatConfig::THREAT_WINDOW]
The full script
#==============================================================================
# ** Threat System
#------------------------------------------------------------------------------
# by Fantasist
# Version: 1.2
# Date: 23-Oct-2011
#------------------------------------------------------------------------------
# Version History:
#
# 1.0 - First version (13-July-2009)
# 1.1 - Fixed Force Action bug and added enemy-specific threat ignore (21-Oct-2011)
# 1.2 - Added disable by switch, threat by damage, fixed a display bug
#------------------------------------------------------------------------------
# Description:
#
# During battle, enemies will choose their targets based on their "threat"
# rather than randomly. The threat for an actor changes depending on what they
# do. For example, attacking raises threat and defending decreases threat.
#------------------------------------------------------------------------------
# Compatibility:
#
# Might be incompatible with other battle systems or battle addons.
#------------------------------------------------------------------------------
# Instructions:
#
# Place this script anywhere above "Main" and below "Scene_Debug".
#------------------------------------------------------------------------------
# Configuration:
#
# Scroll down a bit and you'll see the configuration.
#
# ATTACK_THREAT: Threat to increase when actor attacks
# DEFEND_THREAT: Threat to decrease when actor defends (read THREAT_BY_DAMAGE)
# THREAT_CHANCE: The chance of enemies attacking based on threat
# THREAT_SWITCH: Turn this ON to temporarily disable the threat system
# THREAT_BY_DAMAGE: When "true", an actor's threat increases by the damage
# caused to enemies. Enabling this ignores ATTACK_THREAT.
# When defending, actor's threat is divided by DEFEND_THREAT.
# THREAT_DISPLAY: Display players' threats besides their name
# THREAT_WINDOW: Whether to enable or disable threat window
# To enable it, set it to "true". If you want to set it's
# position and width, you can also set it to an array with
# it's X position, Y position and width (eg: ).
# ENEMY_IGNORE: List of enemy IDs which ignore the threat system
#
# Skill Threat Configuration:
#
# Look for "SKILL THREAT CONFIG BEGIN" and follow the example.
# In the given example:
#
# when 57 then
#
# the skill 57 (Cross Cut) increases user's threat by 10 and decreases the
# rest of the party's threat by 2.
#
# Item Threat Configuration:
#
# Works exactly the same as skill threat configuration.
#------------------------------------------------------------------------------
# Credits:
#
# Fantasist, for making this script
# KCMike20, for requesting this script
#
# Thanks:
#
# Blizzard, for helping me
# winkio, for helping me
# Jackolas, for pointing out a bug
# yuhikaru, for fixing force action bug
# Fenriswolf, for requesting enemy ignore list
# Kagutsuchi, for requesting threat-by-damage feature
#------------------------------------------------------------------------------
# Notes:
#
# If you have any problems, suggestions or comments, you can find me at:
#
# forum.chaos-project.com
#
# Enjoy ^_^
#==============================================================================
#==============================================================================
# ** ThreatConfig module
#------------------------------------------------------------------------------
# Module for settings and configuration of the Threat system.
#==============================================================================
module ThreatConfig
#--------------------------------------------------------------------------
# * Config
#--------------------------------------------------------------------------
ATTACK_THREAT = 10 # Threat to increase when actor attacks
DEFEND_THREAT = 10 # Threat to decrease when actor defends
THREAT_CHANCE = 100 # The chance of enemies attacking based on threat
THREAT_SWITCH = 25 # ID of switch which disables threat system when ON
THREAT_BY_DAMAGE = true # Threat is increased based on damage caused
THREAT_DISPLAY = true # Display player's threat besides their name
THREAT_WINDOW = false # Whether to enable or disable threat window
ENEMY_IGNORE = # List of enemy IDs which ignore the threat system
#--------------------------------------------------------------------------
# * Configure skill threats
#--------------------------------------------------------------------------
def self.get_skill_threat(skill_id)
threat = case skill_id
#========================================================================
# SKILL THREAT CONFIG BEGIN
#========================================================================
when 57 then # Cross Cut
when 61 then # Leg Sweep
when 7 then # Fire
# when skill_ID then
#========================================================================
# SKILL THREAT CONFIG END
#========================================================================
else false
end
return threat
end
#--------------------------------------------------------------------------
# * Configure item threats
#--------------------------------------------------------------------------
def self.get_item_threat(item_id)
threat = case item_id
#========================================================================
# ITEM THREAT CONFIG BEGIN
#========================================================================
when 1 then # Potion
# when item_ID then
#========================================================================
# ITEM THREAT CONFIG END
#========================================================================
else false
end
return threat
end
#--------------------------------------------------------------------------
# * Configure enemy ignore IDs
#--------------------------------------------------------------------------
end
#==============================================================================
# ** Game_Actor
#------------------------------------------------------------------------------
# Added the threat attribute.
#==============================================================================
class Game_Actor
#--------------------------------------------------------------------------
# * Initialize threat attribute
#--------------------------------------------------------------------------
alias game_actor_threat_setup setup
def setup(actor_id)
@threat = 0
game_actor_threat_setup(actor_id)
end
#--------------------------------------------------------------------------
# * Get the threat attribute
#--------------------------------------------------------------------------
attr_reader :threat
#--------------------------------------------------------------------------
# * Set the threat attribute
#--------------------------------------------------------------------------
def threat=(val)
val = 0 if val < 0
@threat = val
end
end
#==============================================================================
# ** Game_Party
#------------------------------------------------------------------------------
# Modified random actor selection to select by threat.
#==============================================================================
class Game_Party
#--------------------------------------------------------------------------
# * Choose actor by threat
#--------------------------------------------------------------------------
alias choose_actor_threat_orig random_target_actor
def random_target_actor(hp0 = false)
if $game_switches
return choose_actor_threat_orig(hp0)
end
if $scene.active_battler.is_a?(Game_Enemy) &&
ThreatConfig::ENEMY_IGNORE.include?($scene.active_battler.id)
return choose_actor_threat_orig(hp0)
end
if rand(100) >= ThreatConfig::THREAT_CHANCE
return choose_actor_threat_orig(hp0)
else
return threat_target_actor(hp0)
end
end
#--------------------------------------------------------------------------
# * Calculate threat and choose actor
#--------------------------------------------------------------------------
def threat_target_actor(hp0=false)
# Collect valid actors
targets =
for actor in @actors
next unless (!hp0 && actor.exist?) || (hp0 && actor.hp0?)
targets.push(actor)
end
# Get actors with maximum threat
targets.sort! {|a, b| b.threat - a.threat}
targets = targets.find_all {|a| a.threat == targets.threat}
# Choose random
target = targets
return target
end
end
#==============================================================================
# ** Game_Battler
#------------------------------------------------------------------------------
# Added attack and skill threat handling.
#==============================================================================
class Game_Battler
#--------------------------------------------------------------------------
# * Attack Threat
#--------------------------------------------------------------------------
alias attack_effect_threat attack_effect
def attack_effect(attacker)
result = attack_effect_threat(attacker)
if attacker.is_a?(Game_Actor) && self.damage.is_a?(Numeric) && self.damage > 0
if ThreatConfig::THREAT_BY_DAMAGE
attacker.threat += self.damage
else
attacker.threat += ThreatConfig::ATTACK_THREAT
end
end
return result
end
#--------------------------------------------------------------------------
# * Skill Threat
#--------------------------------------------------------------------------
alias skill_effect_threat skill_effect
def skill_effect(user, skill)
result = skill_effect_threat(user, skill)
threat = user.is_a?(Game_Actor) && ThreatConfig.get_skill_threat(skill.id)
if threat && self.damage.is_a?(Numeric) && self.damage > 0
user_threat, party_threat = threat, threat
for actor in $game_party.actors
threat_plus = actor.id == user.id ? user_threat : party_threat
actor.threat += threat_plus
end
if ThreatConfig::THREAT_BY_DAMAGE
user.threat -= user_threat
user.threat += self.damage
end
end
return result
end
end
#==============================================================================
# ** Scene_Battle
#------------------------------------------------------------------------------
# Added defend and item threat handling and realtime target selection.
#==============================================================================
class Scene_Battle
attr_reader :active_battler
#--------------------------------------------------------------------------
# * Defend Threat
#--------------------------------------------------------------------------
alias basic_action_threat_result make_basic_action_result
def make_basic_action_result
if @active_battler.current_action.basic == 1 && @active_battler.is_a?(Game_Actor)
if ThreatConfig::THREAT_BY_DAMAGE
@active_battler.threat /= ThreatConfig::DEFEND_THREAT
else
@active_battler.threat -= ThreatConfig::DEFEND_THREAT
end
end
basic_action_threat_result
end
#--------------------------------------------------------------------------
# * Item Threat
#--------------------------------------------------------------------------
alias item_action_threat_result make_item_action_result
def make_item_action_result
item_action_threat_result
threat = @active_battler.is_a?(Game_Actor) && ThreatConfig.get_item_threat(@item.id)
if threat
user_threat, party_threat = threat, threat
for actor in $game_party.actors
threat_plus = actor.id == @active_battler.id ? user_threat : party_threat
actor.threat += threat_plus
end
end
end
#--------------------------------------------------------------------------
# * Choose target actor in realtime
#--------------------------------------------------------------------------
alias update_phase4_step2_choose_actor_realtime update_phase4_step2
def update_phase4_step2
# Fore action fix by yuhikaru
# If there is no force action this turn
if $game_temp.forcing_battler == nil
@active_battler.make_action if @active_battler.is_a?(Game_Enemy)
end
update_phase4_step2_choose_actor_realtime
end
#--------------------------------------------------------------------------
# * Clear threats before battle
#--------------------------------------------------------------------------
alias clear_threats_battle_main main
def main
$game_party.actors.each {|actor| actor.threat = 0}
clear_threats_battle_main
end
end
if ThreatConfig::THREAT_DISPLAY
#==============================================================================
# ** Window_BattleStatus
#------------------------------------------------------------------------------
# Modded to show threat beside actor's name.
#==============================================================================
class Window_BattleStatus
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
alias threat_display_refresh refresh
def refresh
threat_display_refresh
for i in 0...$game_party.actors.size
actor = $game_party.actors
next if actor.threat == 0
actor_x = i * 160 + 4
actor_x += self.contents.text_size(actor.name).width + 4
self.contents.draw_text(actor_x, 0, 160, 170, "(#{actor.threat})")
end
end
end
end
if ThreatConfig::THREAT_WINDOW
#==============================================================================
# ** Window_Threat
#------------------------------------------------------------------------------
# This window displays the threats of actors in the party.
#==============================================================================
class Window_Threat < Window_Base
H = 18
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
a = ThreatConfig::THREAT_WINDOW
if a.is_a?(Array)
x, y, w = a, a, a
else
x, y, w = 0, 64, 160
end
super(x, y, w, 32 + H + $game_party.actors.size * H)
@threats =
$game_party.actors.each {|a| @threats.push(a.threat)}
self.contents = Bitmap.new(w-32, self.height-32)
self.contents.font.size = H
self.contents.font.bold = H <= 22
self.opacity = 160
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.draw_text(0, 0, self.width-32, H, 'Threats', 1)
$game_party.actors.each_with_index {|a, i| y_off = H
self.contents.draw_text(0, y_off + i*H, self.width-32, H, a.name)
self.contents.draw_text(0, y_off + i*H, self.width-32, H, @threats.to_s, 2)}
end
#--------------------------------------------------------------------------
# * Update
#--------------------------------------------------------------------------
def update
flag = false
$game_party.actors.each_with_index {|a, i|
@threats = a.threat if a.threat != @threats
flag = true}
refresh if flag
end
end
#==============================================================================
# ** Scene_Battle
#------------------------------------------------------------------------------
# Modded to handle threat window.
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
alias threat_win_init main
def main
@threat_win = Window_Threat.new
threat_win_init
@threat_win.dispose
end
#--------------------------------------------------------------------------
# * Update
#--------------------------------------------------------------------------
alias threat_win_upd update
def update
@threat_win.update
threat_win_upd
end
end
end
# ** Threat System
#------------------------------------------------------------------------------
# by Fantasist
# Version: 1.2
# Date: 23-Oct-2011
#------------------------------------------------------------------------------
# Version History:
#
# 1.0 - First version (13-July-2009)
# 1.1 - Fixed Force Action bug and added enemy-specific threat ignore (21-Oct-2011)
# 1.2 - Added disable by switch, threat by damage, fixed a display bug
#------------------------------------------------------------------------------
# Description:
#
# During battle, enemies will choose their targets based on their "threat"
# rather than randomly. The threat for an actor changes depending on what they
# do. For example, attacking raises threat and defending decreases threat.
#------------------------------------------------------------------------------
# Compatibility:
#
# Might be incompatible with other battle systems or battle addons.
#------------------------------------------------------------------------------
# Instructions:
#
# Place this script anywhere above "Main" and below "Scene_Debug".
#------------------------------------------------------------------------------
# Configuration:
#
# Scroll down a bit and you'll see the configuration.
#
# ATTACK_THREAT: Threat to increase when actor attacks
# DEFEND_THREAT: Threat to decrease when actor defends (read THREAT_BY_DAMAGE)
# THREAT_CHANCE: The chance of enemies attacking based on threat
# THREAT_SWITCH: Turn this ON to temporarily disable the threat system
# THREAT_BY_DAMAGE: When "true", an actor's threat increases by the damage
# caused to enemies. Enabling this ignores ATTACK_THREAT.
# When defending, actor's threat is divided by DEFEND_THREAT.
# THREAT_DISPLAY: Display players' threats besides their name
# THREAT_WINDOW: Whether to enable or disable threat window
# To enable it, set it to "true". If you want to set it's
# position and width, you can also set it to an array with
# it's X position, Y position and width (eg: ).
# ENEMY_IGNORE: List of enemy IDs which ignore the threat system
#
# Skill Threat Configuration:
#
# Look for "SKILL THREAT CONFIG BEGIN" and follow the example.
# In the given example:
#
# when 57 then
#
# the skill 57 (Cross Cut) increases user's threat by 10 and decreases the
# rest of the party's threat by 2.
#
# Item Threat Configuration:
#
# Works exactly the same as skill threat configuration.
#------------------------------------------------------------------------------
# Credits:
#
# Fantasist, for making this script
# KCMike20, for requesting this script
#
# Thanks:
#
# Blizzard, for helping me
# winkio, for helping me
# Jackolas, for pointing out a bug
# yuhikaru, for fixing force action bug
# Fenriswolf, for requesting enemy ignore list
# Kagutsuchi, for requesting threat-by-damage feature
#------------------------------------------------------------------------------
# Notes:
#
# If you have any problems, suggestions or comments, you can find me at:
#
# forum.chaos-project.com
#
# Enjoy ^_^
#==============================================================================
#==============================================================================
# ** ThreatConfig module
#------------------------------------------------------------------------------
# Module for settings and configuration of the Threat system.
#==============================================================================
module ThreatConfig
#--------------------------------------------------------------------------
# * Config
#--------------------------------------------------------------------------
ATTACK_THREAT = 10 # Threat to increase when actor attacks
DEFEND_THREAT = 10 # Threat to decrease when actor defends
THREAT_CHANCE = 100 # The chance of enemies attacking based on threat
THREAT_SWITCH = 25 # ID of switch which disables threat system when ON
THREAT_BY_DAMAGE = true # Threat is increased based on damage caused
THREAT_DISPLAY = true # Display player's threat besides their name
THREAT_WINDOW = false # Whether to enable or disable threat window
ENEMY_IGNORE = # List of enemy IDs which ignore the threat system
#--------------------------------------------------------------------------
# * Configure skill threats
#--------------------------------------------------------------------------
def self.get_skill_threat(skill_id)
threat = case skill_id
#========================================================================
# SKILL THREAT CONFIG BEGIN
#========================================================================
when 57 then # Cross Cut
when 61 then # Leg Sweep
when 7 then # Fire
# when skill_ID then
#========================================================================
# SKILL THREAT CONFIG END
#========================================================================
else false
end
return threat
end
#--------------------------------------------------------------------------
# * Configure item threats
#--------------------------------------------------------------------------
def self.get_item_threat(item_id)
threat = case item_id
#========================================================================
# ITEM THREAT CONFIG BEGIN
#========================================================================
when 1 then # Potion
# when item_ID then
#========================================================================
# ITEM THREAT CONFIG END
#========================================================================
else false
end
return threat
end
#--------------------------------------------------------------------------
# * Configure enemy ignore IDs
#--------------------------------------------------------------------------
end
#==============================================================================
# ** Game_Actor
#------------------------------------------------------------------------------
# Added the threat attribute.
#==============================================================================
class Game_Actor
#--------------------------------------------------------------------------
# * Initialize threat attribute
#--------------------------------------------------------------------------
alias game_actor_threat_setup setup
def setup(actor_id)
@threat = 0
game_actor_threat_setup(actor_id)
end
#--------------------------------------------------------------------------
# * Get the threat attribute
#--------------------------------------------------------------------------
attr_reader :threat
#--------------------------------------------------------------------------
# * Set the threat attribute
#--------------------------------------------------------------------------
def threat=(val)
val = 0 if val < 0
@threat = val
end
end
#==============================================================================
# ** Game_Party
#------------------------------------------------------------------------------
# Modified random actor selection to select by threat.
#==============================================================================
class Game_Party
#--------------------------------------------------------------------------
# * Choose actor by threat
#--------------------------------------------------------------------------
alias choose_actor_threat_orig random_target_actor
def random_target_actor(hp0 = false)
if $game_switches
return choose_actor_threat_orig(hp0)
end
if $scene.active_battler.is_a?(Game_Enemy) &&
ThreatConfig::ENEMY_IGNORE.include?($scene.active_battler.id)
return choose_actor_threat_orig(hp0)
end
if rand(100) >= ThreatConfig::THREAT_CHANCE
return choose_actor_threat_orig(hp0)
else
return threat_target_actor(hp0)
end
end
#--------------------------------------------------------------------------
# * Calculate threat and choose actor
#--------------------------------------------------------------------------
def threat_target_actor(hp0=false)
# Collect valid actors
targets =
for actor in @actors
next unless (!hp0 && actor.exist?) || (hp0 && actor.hp0?)
targets.push(actor)
end
# Get actors with maximum threat
targets.sort! {|a, b| b.threat - a.threat}
targets = targets.find_all {|a| a.threat == targets.threat}
# Choose random
target = targets
return target
end
end
#==============================================================================
# ** Game_Battler
#------------------------------------------------------------------------------
# Added attack and skill threat handling.
#==============================================================================
class Game_Battler
#--------------------------------------------------------------------------
# * Attack Threat
#--------------------------------------------------------------------------
alias attack_effect_threat attack_effect
def attack_effect(attacker)
result = attack_effect_threat(attacker)
if attacker.is_a?(Game_Actor) && self.damage.is_a?(Numeric) && self.damage > 0
if ThreatConfig::THREAT_BY_DAMAGE
attacker.threat += self.damage
else
attacker.threat += ThreatConfig::ATTACK_THREAT
end
end
return result
end
#--------------------------------------------------------------------------
# * Skill Threat
#--------------------------------------------------------------------------
alias skill_effect_threat skill_effect
def skill_effect(user, skill)
result = skill_effect_threat(user, skill)
threat = user.is_a?(Game_Actor) && ThreatConfig.get_skill_threat(skill.id)
if threat && self.damage.is_a?(Numeric) && self.damage > 0
user_threat, party_threat = threat, threat
for actor in $game_party.actors
threat_plus = actor.id == user.id ? user_threat : party_threat
actor.threat += threat_plus
end
if ThreatConfig::THREAT_BY_DAMAGE
user.threat -= user_threat
user.threat += self.damage
end
end
return result
end
end
#==============================================================================
# ** Scene_Battle
#------------------------------------------------------------------------------
# Added defend and item threat handling and realtime target selection.
#==============================================================================
class Scene_Battle
attr_reader :active_battler
#--------------------------------------------------------------------------
# * Defend Threat
#--------------------------------------------------------------------------
alias basic_action_threat_result make_basic_action_result
def make_basic_action_result
if @active_battler.current_action.basic == 1 && @active_battler.is_a?(Game_Actor)
if ThreatConfig::THREAT_BY_DAMAGE
@active_battler.threat /= ThreatConfig::DEFEND_THREAT
else
@active_battler.threat -= ThreatConfig::DEFEND_THREAT
end
end
basic_action_threat_result
end
#--------------------------------------------------------------------------
# * Item Threat
#--------------------------------------------------------------------------
alias item_action_threat_result make_item_action_result
def make_item_action_result
item_action_threat_result
threat = @active_battler.is_a?(Game_Actor) && ThreatConfig.get_item_threat(@item.id)
if threat
user_threat, party_threat = threat, threat
for actor in $game_party.actors
threat_plus = actor.id == @active_battler.id ? user_threat : party_threat
actor.threat += threat_plus
end
end
end
#--------------------------------------------------------------------------
# * Choose target actor in realtime
#--------------------------------------------------------------------------
alias update_phase4_step2_choose_actor_realtime update_phase4_step2
def update_phase4_step2
# Fore action fix by yuhikaru
# If there is no force action this turn
if $game_temp.forcing_battler == nil
@active_battler.make_action if @active_battler.is_a?(Game_Enemy)
end
update_phase4_step2_choose_actor_realtime
end
#--------------------------------------------------------------------------
# * Clear threats before battle
#--------------------------------------------------------------------------
alias clear_threats_battle_main main
def main
$game_party.actors.each {|actor| actor.threat = 0}
clear_threats_battle_main
end
end
if ThreatConfig::THREAT_DISPLAY
#==============================================================================
# ** Window_BattleStatus
#------------------------------------------------------------------------------
# Modded to show threat beside actor's name.
#==============================================================================
class Window_BattleStatus
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
alias threat_display_refresh refresh
def refresh
threat_display_refresh
for i in 0...$game_party.actors.size
actor = $game_party.actors
next if actor.threat == 0
actor_x = i * 160 + 4
actor_x += self.contents.text_size(actor.name).width + 4
self.contents.draw_text(actor_x, 0, 160, 170, "(#{actor.threat})")
end
end
end
end
if ThreatConfig::THREAT_WINDOW
#==============================================================================
# ** Window_Threat
#------------------------------------------------------------------------------
# This window displays the threats of actors in the party.
#==============================================================================
class Window_Threat < Window_Base
H = 18
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
a = ThreatConfig::THREAT_WINDOW
if a.is_a?(Array)
x, y, w = a, a, a
else
x, y, w = 0, 64, 160
end
super(x, y, w, 32 + H + $game_party.actors.size * H)
@threats =
$game_party.actors.each {|a| @threats.push(a.threat)}
self.contents = Bitmap.new(w-32, self.height-32)
self.contents.font.size = H
self.contents.font.bold = H <= 22
self.opacity = 160
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.draw_text(0, 0, self.width-32, H, 'Threats', 1)
$game_party.actors.each_with_index {|a, i| y_off = H
self.contents.draw_text(0, y_off + i*H, self.width-32, H, a.name)
self.contents.draw_text(0, y_off + i*H, self.width-32, H, @threats.to_s, 2)}
end
#--------------------------------------------------------------------------
# * Update
#--------------------------------------------------------------------------
def update
flag = false
$game_party.actors.each_with_index {|a, i|
@threats = a.threat if a.threat != @threats
flag = true}
refresh if flag
end
end
#==============================================================================
# ** Scene_Battle
#------------------------------------------------------------------------------
# Modded to handle threat window.
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
alias threat_win_init main
def main
@threat_win = Window_Threat.new
threat_win_init
@threat_win.dispose
end
#--------------------------------------------------------------------------
# * Update
#--------------------------------------------------------------------------
alias threat_win_upd update
def update
@threat_win.update
threat_win_upd
end
end
end
Looking for an artist for some detail work
Hi all,
So I recently hired an artist to help me do the coloring and detailing for a character battler. Sadly, they backed out and now I'm looking for someone else to give it a go.
Rather than shoot off messages to random artists I find on Deviant Art, I'm wondering if anyone with talent here might be interested and looking for a bit of cash.
If you worked out there would be potential for more work and of course, a credit in the game
Here is the battler I need finished:
So I recently hired an artist to help me do the coloring and detailing for a character battler. Sadly, they backed out and now I'm looking for someone else to give it a go.
Rather than shoot off messages to random artists I find on Deviant Art, I'm wondering if anyone with talent here might be interested and looking for a bit of cash.
If you worked out there would be potential for more work and of course, a credit in the game
Here is the battler I need finished:
Looking for ideas for my battle screen layout.
So I'm dealing with a minor quandary. I'm making a demo for a game I hope to Kickstart and someday take commercial. Hoping to put my best foot forward I've invested in unique music and am still putting together a nice repertoire of custom art (both hand drawn and pixel) that I'm going to use to make a playable demo.
The thing is, my battle layout is the standard XP one and I think I need something a bit more unique to my project if I'm going to ask people to give me money. My problem is that I have no clue where to go with this.
I actually really like the basic XP layout and don't want to stray too far from that classic Dragon Quest style. That said, I know I need something....
As such I'm turning to you kind folks. I've posted a couple screens from my game below and if anyone has any ideas I'd be much appreciative. Moreover, if anyone has the ambition to help me actually put something together, I'd be willing to compensate them financially. I'm not rich so we're probably talking in the area of like $20, but hey, you can buy a copy of Dragon Quest V for $20, so that's something!
A few pertinent details:
-My art is tailored toward the aforementioned Dragon Quest static battle screens, so it has to fit that.
-The Carmichael character art is currently a placeholder. Another artist did a better piece that's currently being detailed.
-While the mockups have an SP counter there will be no SP in the actual game, just HP.
Let me know your thoughts!
The thing is, my battle layout is the standard XP one and I think I need something a bit more unique to my project if I'm going to ask people to give me money. My problem is that I have no clue where to go with this.
I actually really like the basic XP layout and don't want to stray too far from that classic Dragon Quest style. That said, I know I need something....
As such I'm turning to you kind folks. I've posted a couple screens from my game below and if anyone has any ideas I'd be much appreciative. Moreover, if anyone has the ambition to help me actually put something together, I'd be willing to compensate them financially. I'm not rich so we're probably talking in the area of like $20, but hey, you can buy a copy of Dragon Quest V for $20, so that's something!
A few pertinent details:
-My art is tailored toward the aforementioned Dragon Quest static battle screens, so it has to fit that.
-The Carmichael character art is currently a placeholder. Another artist did a better piece that's currently being detailed.
-While the mockups have an SP counter there will be no SP in the actual game, just HP.
Let me know your thoughts!
Fog effects in battle?
So my artist just finished up a nice night time village background for me. Thing is, there's going to be a sequence in my demo where the village is being burned down and I'd like that to come across in battle. Is there any way to use a fog effect (or something) in battle to create a fiery/smoky haze over the background?
Here's the background for kicks!
Here's the background for kicks!
Anyone played Final Fantasy VI as a PS1 Classic?
FFVI is probably my favorite game and I already own the GBA port. That said, I love my Vita and would prefer to play it on that platform if I could.
I am contemplating downloading the PS1 classic version of the game from the PlayStation Store but I know the PS1 version of FFVI was dogged by painful loading times. I'm wondering if anyone's played it on either the PS3, PSP, or the Vita and could attest to the quality of its performance?
I am contemplating downloading the PS1 classic version of the game from the PlayStation Store but I know the PS1 version of FFVI was dogged by painful loading times. I'm wondering if anyone's played it on either the PS3, PSP, or the Vita and could attest to the quality of its performance?
Hand Drawn/Painted Tilesets
Custom pixel work is rather expensive, much more so in my experience than commissioning a more traditional artist. That said, I'm wondering if there is any precedent of using hand drawn/painted tilesets and sprites in an RPG Maker game.
I've searched around and found some "cel-shaded" tilesets that weren't really and some that were striving for a painted look but I've never seen one that eschews digital art altogether. I'm wondering if there's a particular reason why? Is it not possible or would it just be really difficult to pull off.
Apologies if this is in the wrong forum. It just didn't strike me as a Help/Request sort of question!
I've searched around and found some "cel-shaded" tilesets that weren't really and some that were striving for a painted look but I've never seen one that eschews digital art altogether. I'm wondering if there's a particular reason why? Is it not possible or would it just be really difficult to pull off.
Apologies if this is in the wrong forum. It just didn't strike me as a Help/Request sort of question!
Have a concern about my art assets and could use an opinion.
Hi all!
I'm building up some resources to make a demo for my game and recently I've begun to have some concerns that I might be digging myself into a bit of a hole. I have commissioned some talented artists to make custom battle backgrounds, battlers, etc for my game but as the work comes along I'm starting to worry that maybe it won't mesh well with the more standard pixel art that will be making up the game outside of battle... I will fess up to not being super experienced about these matters and was hoping I could get some opinions.
Here's an example of the art out of battle:
Here's an in battle example:
Thoughts?
I'm building up some resources to make a demo for my game and recently I've begun to have some concerns that I might be digging myself into a bit of a hole. I have commissioned some talented artists to make custom battle backgrounds, battlers, etc for my game but as the work comes along I'm starting to worry that maybe it won't mesh well with the more standard pixel art that will be making up the game outside of battle... I will fess up to not being super experienced about these matters and was hoping I could get some opinions.
Here's an example of the art out of battle:
Here's an in battle example:
Thoughts?
Odd issue as a result of scripting (XP)
Hi all.
I've recently been playing around with the Sacrifice HP script made by LockeZ along with a script that removes SP from the game.
The problem I'm having, and I can only guess that it's as a result of my adding these scripts to the game is that when a character's HP hits zero, they can now perform actions. If all player characters die you still get a game over, but until that happens death is fairly inconsequential! Kind of puts a damper on the experience!
The two scripts can be found below. They were made to work with one another. I'm just hoping someone with more experience than I could take a gander and see if there's anything present that could be the root of the problem.
I've recently been playing around with the Sacrifice HP script made by LockeZ along with a script that removes SP from the game.
The problem I'm having, and I can only guess that it's as a result of my adding these scripts to the game is that when a character's HP hits zero, they can now perform actions. If all player characters die you still get a game over, but until that happens death is fairly inconsequential! Kind of puts a damper on the experience!
The two scripts can be found below. They were made to work with one another. I'm just hoping someone with more experience than I could take a gander and see if there's anything present that could be the root of the problem.
module LockeZ
# Do not remove this line
HP_Sacrifice_Action = {'Skill' => {}, 'Item' => {}}
# Do not remove this line
# Below here are the lines you can change to control which actions
# cost HP, and how much.
# Format for each line:
# ---------------------
# HP_Sacrifice_Action =
# And here is what each of those things means:
# action_type = Should be set to 'Skill' or 'Item'
# id = ID number of the skill/item that costs HP
#
# chance = chance of damaging self
# formula = How the amount lost is calculated. Must be 'integer' or 'percent'.
# amount = Amount of HP lost, based on formula. If formula is set to
# integer, this is the actual amount lost. If it's set to percent,
# this is the percent lost.
# anim_id = ID of the animation shown over the user; leave nil or 0 for
# no animation
# pop = true or false, whether the sacrificed amount pops up visually
# over the user's head like damage.
# can_kill = true or false. If false the skill will not reduce the user below
# 1 HP. If true it can kill the user.
end
#==============================================================================
# ** Don't modify anything below this point.
#==============================================================================
#==============================================================================
# ** Scene_Battle
#------------------------------------------------------------------------------
# This class performs battle screen processing.
#==============================================================================
class Scene_Battle
include LockeZ
#--------------------------------------------------------------------------
# These 2 methods makes the script compatible with the default battle system.
#--------------------------------------------------------------------------
alias make_skill_action_result_hp_sacrifice make_skill_action_result
def make_skill_action_result
make_skill_action_result_hp_sacrifice
action = @active_battler.current_action
if action != nil and HP_Sacrifice_Action.include?(action.skill_id)
sacrifice_hp(@active_battler, HP_Sacrifice_Action.dup)
end
end
alias make_item_action_result_hp_sacrifice make_item_action_result
def make_item_action_result
make_item_action_result_hp_sacrifice
action = @active_battler.current_action
if action != nil and HP_Sacrifice_Action.include?(action.item_id)
sacrifice_hp(@active_battler, HP_Sacrifice_Action.dup)
end
end
#--------------------------------------------------------------------------
# This method makes the script compatible with Atoa's Custom Battle System.
#--------------------------------------------------------------------------
if respond_to?('step4_part3')
alias step4_part3_hp_sacrifice step4_part3
end
def step4_part3(battler)
step4_part3_hp_sacrifice(battler)
action = battler.now_action
if action != nil and HP_Sacrifice_Action != nil and
HP_Sacrifice_Action.include?(action_id(action))
sacrifice_hp(battler, HP_Sacrifice_Action.dup)
end
end
#--------------------------------------------------------------------------
# Sacrifice HP
# battler : active battler
# action : action
#--------------------------------------------------------------------------
def sacrifice_hp(battler, action)
if action >= rand(100)
if action == 'integer'
hp_sacrificed = action.to_i
elsif action == 'percent'
hp_sacrificed = (battler.maxhp * action / 100).to_i
end
if action == false
hp_sacrificed = .min
end
if hp_sacrificed != 0
if !respond_to?('step4_part3_hp_sacrifice')
# This line happens only in the DBS
# Atoa's CBS does this automatically for all damage
battler.hp -= hp_sacrificed
end
battler.damage = hp_sacrificed
battler.animation_id = action.nil? ? 0 : action
battler.damage_pop = action
@status_window.refresh
end
end
end
end
# Do not remove this line
HP_Sacrifice_Action = {'Skill' => {}, 'Item' => {}}
# Do not remove this line
# Below here are the lines you can change to control which actions
# cost HP, and how much.
# Format for each line:
# ---------------------
# HP_Sacrifice_Action =
# And here is what each of those things means:
# action_type = Should be set to 'Skill' or 'Item'
# id = ID number of the skill/item that costs HP
#
# chance = chance of damaging self
# formula = How the amount lost is calculated. Must be 'integer' or 'percent'.
# amount = Amount of HP lost, based on formula. If formula is set to
# integer, this is the actual amount lost. If it's set to percent,
# this is the percent lost.
# anim_id = ID of the animation shown over the user; leave nil or 0 for
# no animation
# pop = true or false, whether the sacrificed amount pops up visually
# over the user's head like damage.
# can_kill = true or false. If false the skill will not reduce the user below
# 1 HP. If true it can kill the user.
end
#==============================================================================
# ** Don't modify anything below this point.
#==============================================================================
#==============================================================================
# ** Scene_Battle
#------------------------------------------------------------------------------
# This class performs battle screen processing.
#==============================================================================
class Scene_Battle
include LockeZ
#--------------------------------------------------------------------------
# These 2 methods makes the script compatible with the default battle system.
#--------------------------------------------------------------------------
alias make_skill_action_result_hp_sacrifice make_skill_action_result
def make_skill_action_result
make_skill_action_result_hp_sacrifice
action = @active_battler.current_action
if action != nil and HP_Sacrifice_Action.include?(action.skill_id)
sacrifice_hp(@active_battler, HP_Sacrifice_Action.dup)
end
end
alias make_item_action_result_hp_sacrifice make_item_action_result
def make_item_action_result
make_item_action_result_hp_sacrifice
action = @active_battler.current_action
if action != nil and HP_Sacrifice_Action.include?(action.item_id)
sacrifice_hp(@active_battler, HP_Sacrifice_Action.dup)
end
end
#--------------------------------------------------------------------------
# This method makes the script compatible with Atoa's Custom Battle System.
#--------------------------------------------------------------------------
if respond_to?('step4_part3')
alias step4_part3_hp_sacrifice step4_part3
end
def step4_part3(battler)
step4_part3_hp_sacrifice(battler)
action = battler.now_action
if action != nil and HP_Sacrifice_Action != nil and
HP_Sacrifice_Action.include?(action_id(action))
sacrifice_hp(battler, HP_Sacrifice_Action.dup)
end
end
#--------------------------------------------------------------------------
# Sacrifice HP
# battler : active battler
# action : action
#--------------------------------------------------------------------------
def sacrifice_hp(battler, action)
if action >= rand(100)
if action == 'integer'
hp_sacrificed = action.to_i
elsif action == 'percent'
hp_sacrificed = (battler.maxhp * action / 100).to_i
end
if action == false
hp_sacrificed = .min
end
if hp_sacrificed != 0
if !respond_to?('step4_part3_hp_sacrifice')
# This line happens only in the DBS
# Atoa's CBS does this automatically for all damage
battler.hp -= hp_sacrificed
end
battler.damage = hp_sacrificed
battler.animation_id = action.nil? ? 0 : action
battler.damage_pop = action
@status_window.refresh
end
end
end
end
class Window_Base < Window
def draw_actor_sp(actor, x, y, width = 144)
return
end
end
class Window_Skill < Window_Selectable
def draw_item(index)
skill = @data
if @actor.skill_can_use?(skill.id)
self.contents.font.color = normal_color
else
self.contents.font.color = disabled_color
end
x = 4 + index % 2 * (288 + 32)
y = index / 2 * 32
rect = Rect.new(x, y, self.width / @column_max - 32, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
bitmap = RPG::Cache.icon(skill.icon_name)
opacity = self.contents.font.color == normal_color ? 255 : 128
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
self.contents.draw_text(x + 28, y, 204, 32, skill.name, 0)
self.contents.draw_text(x + 232, y, 48, 32, (LockeZ::HP_Sacrifice_Action?LockeZ::HP_Sacrifice_Action:0).to_s, 2)
end
end
def draw_actor_sp(actor, x, y, width = 144)
return
end
end
class Window_Skill < Window_Selectable
def draw_item(index)
skill = @data
if @actor.skill_can_use?(skill.id)
self.contents.font.color = normal_color
else
self.contents.font.color = disabled_color
end
x = 4 + index % 2 * (288 + 32)
y = index / 2 * 32
rect = Rect.new(x, y, self.width / @column_max - 32, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
bitmap = RPG::Cache.icon(skill.icon_name)
opacity = self.contents.font.color == normal_color ? 255 : 128
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
self.contents.draw_text(x + 28, y, 204, 32, skill.name, 0)
self.contents.draw_text(x + 232, y, 48, 32, (LockeZ::HP_Sacrifice_Action?LockeZ::HP_Sacrifice_Action:0).to_s, 2)
end
end
Changing the battle screen layout (XP)
Just a curiosity.
Is there any way, script or otherwise, that people know of to alter the layout of XP's standard battle screen? I like simple turn-based combat but I'm looking for a battle screen that's a tad different from the standard one. Any recommendations would be appreciated! :)
Is there any way, script or otherwise, that people know of to alter the layout of XP's standard battle screen? I like simple turn-based combat but I'm looking for a battle screen that's a tad different from the standard one. Any recommendations would be appreciated! :)
How do people port their games?
Hi all.
I am slowly inching toward making a game but I would eventually like to sell it. Forgive me, I know some frown on the whole "make an RPG Maker game for profit" thing but I'm of the mind that if I can do something I enjoy and make money doing it, then why the bleep not?
Any who, I have seen in my research people mentioning porting their projects using Unity and I was wondering if anyone knew exactly how this is done? I'm not so confused mechanics wise (there are simple add-ons you can buy to add in RPG mechanics)but more terrain wise. All the 2D stuff I've found (I bought UniTile) seems to be tailored toward making sidescrollers and such. I'd like to create a game of the top down variety and haven't had much luck figuring that out.
I am slowly inching toward making a game but I would eventually like to sell it. Forgive me, I know some frown on the whole "make an RPG Maker game for profit" thing but I'm of the mind that if I can do something I enjoy and make money doing it, then why the bleep not?
Any who, I have seen in my research people mentioning porting their projects using Unity and I was wondering if anyone knew exactly how this is done? I'm not so confused mechanics wise (there are simple add-ons you can buy to add in RPG mechanics)but more terrain wise. All the 2D stuff I've found (I bought UniTile) seems to be tailored toward making sidescrollers and such. I'd like to create a game of the top down variety and haven't had much luck figuring that out.