Posts: 494
Threads: 9
Joined: Sep 2013
(02-12-2014, 04:41 AM)DerVVulfman Wrote: Been a while since I discussed the charactersets for my game's paperdoll system. Turns out that I needed more space between frames so weapons could extend a bit further. But EEP... that's a lot of charsets as I had a couple dozen eye sets, dozens of hair styles, and so on. There is that AND the fact the charactersets are custom ones with over 140 frames in each file.
Instead of manually editing every single file, and thus risking mis-aligned frames, I've been working on a script to read and adjust each characterset. It reads the image, spaces each character by blitting them in order, and then saving the resulting image. So far, it does that AND retains the alpha channel. I could use it right now, and just replace the hardwired filename I have in the current script. Glad to know you managed to dodge a bullet there. I mean, editing all those files would've been a monumental task.
I feel like mentioning that I was thinking of making the non-magical skills of my game use HP instead of SP, like in the Shin Megami Tensei and Persona series. Then I realized that there wouldn't be a way to display how much HP is required for the skill since the default Database only can show SP costs.
Bummer. Perhaps I'll just add the HP consumption to the skill's description.
Posts: 422
Threads: 23
Joined: Aug 2011
I actually wrote a "Show HP cost in Window_Skill" script, if you'd like it. it is basically
Code: #draw costs
if skill.hp_cost == 0
self.contents.draw_text(x + 232, y, 48, 32, skill.sp_cost.to_s, 2)
else
self.contents.font.color = text_color(2)
self.contents.draw_text(x + 232, y, 48, 32, skill.hp_cost.to_s + $data_system.words.hp, 2)
end
It is compatible with VVulf's skills cost HP script.
Posts: 494
Threads: 9
Joined: Sep 2013
Nice. Can you make it compatible with this script?
Code: #==============================================================================
# HP Sacrifice
# By LockeZ
#==============================================================================
# This script allows you to create skills and items that cost HP when used.
#
# Compatible with the default battle system.
# Compatible with Tankentai.
#
# Contact me at ff3lockez@yahoo.com with questions.
#==============================================================================
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[action_type][id] = [chance, formula, amount, anim_id, pop, can_kill]
# 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.
# Example Skills
HP_Sacrifice_Action['Skill'][28] = [100, 'integer', 250, nil, true, false]
# The "Darkness" spell (spell #28) now costs 250 HP to cast. It won't
# reduce the caster below 1 HP.
HP_Sacrifice_Action['Skill'][30] = [100, 'integer', 500, nil, true, false]
# The "Mass Darkness" spell (spell #30) now costs 500 HP to cast. It can
# kill the caster.
HP_Sacrifice_Action['Item'][10] = [100, 'percent', 100, 51, false, true]
# The "Full Tonic" item (item #10) now costs 100% of the user's max HP.
# In other words, it always kills the user. Animation 51 is shown.
# The amount of damage isn't shown.
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.
#--------------------------------------------------------------------------
unless respond_to?('step4_part3')
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['Skill'].include?(action.skill_id)
sacrifice_hp(@active_battler, HP_Sacrifice_Action['Skill'][action.skill_id].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['Item'].include?(action.item_id)
sacrifice_hp(@active_battler, HP_Sacrifice_Action['Item'][action.item_id].dup)
end
end
end
#--------------------------------------------------------------------------
# Sacrifice HP
# battler : active battler
# action : action
#--------------------------------------------------------------------------
def sacrifice_hp(battler, action)
if action[0] >= rand(100)
if action[1] == 'integer'
hp_sacrificed = action[2].to_i
elsif action[1] == 'percent'
hp_sacrificed = (battler.maxhp * action[2] / 100).to_i
end
if action[5] == false
hp_sacrificed = [battler.hp - 1, hp_sacrificed].min
end
if hp_sacrificed != 0
# This line happens only in the DBS
# Atoa's CBS does this automatically for all damage
battler.hp -= hp_sacrificed
battler.damage = hp_sacrificed
battler.animation_id = action[3].nil? ? 0 : action[3]
battler.damage_pop = action[4]
@status_window.refresh
end
end
end
end
I opted to use this script instead of DVV's as I wanted to set the HP consumption to a percentage of the character's total HP instead of a fixed amount. Also, should I include that within the script or as a stand-alone script?
Posts: 422
Threads: 23
Joined: Aug 2011
This is why I like DVV's scripts, they are easy to use and reuse. Why doesn't this script add onto the skills definition like his does? Who knows.
....anywho, here is this. You can place it wherever you'd like.
Code: #==============================================================================
# ** Window_Skill
#------------------------------------------------------------------------------
# This window displays usable skills on the skill and battle screens.
#==============================================================================
class Window_Skill < Window_Selectable
#--------------------------------------------------------------------------
# * Draw Item (Rewrite for HP costs.
# index : item number
#--------------------------------------------------------------------------
def draw_item(index)
skill = @data[index]
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)
#draw costs
if LockeZ::HP_Sacrifice_Action['Skill'].include?(skill.id)
self.contents.font.color = text_color(2) #hp in red.
action = LockeZ::HP_Sacrifice_Action['Skill'][skill.id];
if action[1] == 'integer'
cost = action[2].to_i
self.contents.draw_text(x + 232, y, 48, 32, cost.to_s, 2)
elsif action[1] == 'percent'
cost = action[2].to_i
self.contents.draw_text(x + 232, y, 48, 32, cost.to_s + "%", 2)
end
else
self.contents.draw_text(x + 232, y, 48, 32, skill.sp_cost.to_s, 2)
end
end
end
Posts: 494
Threads: 9
Joined: Sep 2013
A hundred thanks!
Thinking about it, I'll add a NPC explaining that non-magical skills consume hp just to avoid confusion.
Posts: 11,235
Threads: 650
Joined: May 2009
Things are slowly but surely going with my game, inserting a stamina and exertion system into it. If you jump, run or swing a weapon.... (or push a rock), you get tired. If you slowly crawl, take time out to pick a lock, or something stealthy, you get ... whatever (your bar runs out).
Hud system has gotta be next. And remember... it changes depending on what character you play... like my menus.
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)
Above are clickable links
Posts: 797
Threads: 24
Joined: Feb 2010
Sounds like your game has some replay value right there, DerVV =)
I've been spending a lot of time (and some points) on a side projekt that I'm working on with someone as of late anf I'm currently considdering to find and commission an artist for the project. ...And possibly a scripter too, the menu is just not doing it for a two-character-only game.
My main project however that I have been working on for years has been untouched in a long, long time. Not because I don't want to work on it, but every time I open it up I realize how much progress I've lost and then I no longer feel like working on that.
Also, it turns out it is surprisingly difficult to find something when you're specifically looking for it. =b
Friendship is born at that moment when one person says to another: "What! You, too? Thought I was the only one." (C.S. Lewis)
For the time you're laughing, there's nothing wrong in the world. (Colin Mochrie)
If it's funny, make sure people laugh. If it's not funny, make it funny (unless it's actually really serious). (silvercheers)
Please don't spell my name "Yamina-chan". It's all small. Thank you =D
Posts: 11,235
Threads: 650
Joined: May 2009
Final touches to my fun little stamina system are being made. If you jump, you lose physical stamina. If you pick a lock, you may lose some mental patience stamina (for lack of a better word). If you climb a wall, you may lose both (more for physical stamina likely). Heck, if you wanna pick pocket someone or harvest some plants (LAST to adjust), you lose some points.
HUD designing is gonna be next, the moment I fix the harvest system to drain ya.
You don't wanna spend all day harvesting plants and wear your self out only to encounter a freakin' monster horde.
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)
Above are clickable links
Posts: 937
Threads: 101
Joined: May 2009
Since I haven't been active with the ReGaL team, there is lots of catching up for Kain to do. It seems like the project might be bigger than itself though as the team has been discussing coming up with a Ruby++ as a foundation. My opinions are mixed on this, but overall it does sound like a good idea. Maybe.
To elaborate, Ruby is built on the C language, so I'm assuming Matz might've started it prior to C++ becoming more relevant.
All the dialog for my project's story has been modified from it's basic "script" to being conformed for proper message box display, accounting for factors such as the font and whether or not the dialog in question will be using a face portrait. I figure it's a better use of my time than sitting idly in my futile attempt to get some tilesets and maps done.
A couple new tunes have been started which are turning out rather exceptionally! Hopefully once they're finished they can be ranked upon the "masterpiece" tracks, but we'll see.
Posts: 11,235
Threads: 650
Joined: May 2009
Can't help it. I know.
Back to some RGSS coding I go.
Looking at GubID's Isometric View,
gotta ask if he released a version two.
Yeah, I made that Isometric View patch for the Lycan ABS, but I wanna see if GubID had a more up-to-date one than what we have linked in the forum. Besides that, I have another Iso View add-on in the works that some others have seen.
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)
Above are clickable links
|