I'd like to make skills with levels, some possibly passive. I think hot-wiring the SP cost display is probably the way to go, but I'm not sure how to execute it. I've seen someone do a passive skill script but I haven't seen any "skill levels" system, like "Willpower 11" or "Accuracy 9" for example.
can skills be renamed through script during the game?
if that's the case, then an event (like a trainer or save point) could be used to edit the skill name to skill name + variable, and that variable could be used inside the skill's related common event. The problem is the fact that this only works for solo games and would be messy if NPCs also used these skills.
This means the skills have to be tied to the Actors, like the following pseudocode;
$game_actors[Actor_number].data_skills[skill_id].sp_cost
changed to something like
$game_actors[Actor_number].data_skills[skill_id].skill_lvl
so if "throw tofu" was skill #5, and Dave the Tofu thrower was actor #3, maybe it might look something like
$game_actors[3].data_skills[5].skill_lvl
then if you wanted it to be level 2,
$game_actors[3].data_skills[5].skill_lvl = 2
and so on.
I found this semi dead thread through google
http://z11.invisionfree.com/RMXP_Ultimate/index.php?showtopic=90
but the link to the program was an error. This reminds me of something I've seen on here, a passive skill modification. Is anyone good at accessing skill based script? I just realized I have no idea how to separate specialized components of a skill from one actor to another.
like why would Cecil the fighter have Melee 3 while Tim the battle mage has Melee 1? Is that leveled aspect of a skill a component of the actor?
like cecil.skill[11].level[3] or something?
Is there a way to access this module or append it?
Quote
module RPG
class Skill
def initialize
@id = 0
@name = ""
@icon_name = ""
@description = ""
@scope = 0
@occasion = 1
@animation1_id = 0
@animation2_id = 0
@menu_se = RPG::AudioFile.new("", 80)
@common_event_id = 0
@sp_cost = 0
@power = 0
@atk_f = 0
@eva_f = 0
@str_f = 0
@dex_f = 0
@agi_f = 0
@int_f = 100
@hit = 100
@pdef_f = 0
@mdef_f = 100
@variance = 15
@element_set = []
@plus_state_set = []
@minus_state_set = []
end
attr_accessor :id
attr_accessor :name
attr_accessor :icon_name
attr_accessor :description
attr_accessor :scope
attr_accessor :occasion
attr_accessor :animation1_id
attr_accessor :animation2_id
attr_accessor :menu_se
attr_accessor :common_event_id
attr_accessor :sp_cost
attr_accessor :power
attr_accessor :atk_f
attr_accessor :eva_f
attr_accessor :str_f
attr_accessor :dex_f
attr_accessor :agi_f
attr_accessor :int_f
attr_accessor :hit
attr_accessor :pdef_f
attr_accessor :mdef_f
attr_accessor :variance
attr_accessor :element_set
attr_accessor :plus_state_set
attr_accessor :minus_state_set
end
end
I want to add these two parts:
attr_accessor :skill_level
@skill_level = 0 and then modify the skill window display.
I tripped over something based on RO and job skills but I can't get the thing to work (probably because it's way over my head), so I think kitbashing it is probably the way to go. If i can store a variable related to a skill and then print N + var in the window skin, then it should work. I'm going to see if I can do that now, as a test run, probably using a stat for filler.
Edit:
ok, i've had some subtle success:
in Window_Skill below
#--------------------------------------------------------------------------
# * Acquiring Skill
#--------------------------------------------------------------------------
def skill
return @data[self.index]
endI added this.
#--------------------------------------------------------------------------
# * Acquiring Skill Level by shintashi
#--------------------------------------------------------------------------
def skill_level
return 1
end
Then I modified/added the following lines in red.
Quoteself.contents.draw_text(x + 28, y, 204, 32, skill.name, 0)
self.contents.draw_text(x + 182, y, 48, 32, skill.sp_cost.to_s, 2)
self.contents.draw_text(x + 240, y, 48, 32, "LV " + skill_level.to_s, 2)
This displays stuff like
Heal_____80__LV 1
in the skill window, which is a nice start. I think If I can change "skill_level" to be some actual value similar to .sp_cost, and the actor, then I should be set.
ok, so I've revised this
#--------------------------------------------------------------------------
# * Acquiring Skill Level by shintashi
#--------------------------------------------------------------------------
def skill_level
return 1
end
to look like this:
#--------------------------------------------------------------------------
# * Acquiring Skill Level by shintashi
#--------------------------------------------------------------------------
def skill_level
return @actor.base_agi
end
And now it displays unique values for each actor. This I see as an improvement because I didn't know how to address variables in this file until now. Since I know how to create new attributes, this could be used for each character, but I still have to separate the skills. This I believe is what they call a multidimensional array - something I suck at.
Edit: modified window to these settings:
self.contents.draw_text(x + 160, y, 48, 32, skill.sp_cost.to_s, 2)
self.contents.draw_text(x + 220, y, 60, 32, "lv " + skill_level.to_s, 2)
p $data_skills[1].sp_cost
$data_skills[1].sp_cost = 10
p $game_actors[1].skills[0]
a = $game_actors[1].skills[0]
p $data_skills[a]
I think I've found some success in understanding skills.
ok, so I've figured out a means to construct new skills DURING PLAY which may allow players to design their own custom skills.
the skills are stored as numbers with regard to actors, so an actor's file only indicates if he/she has it, not what it does. meanwhile each and every attribute of a skill can be edited during play using a combination of input number and a hack of name change. with a little tinkering and an algorithm, you could have a spell/power/skill creator available. you could even edit skills on the fly for efficiency.
Quote from: shintashi on October 27, 2010, 03:20:44 PM
ok, so I've figured out a means to construct new skills DURING PLAY which may allow players to design their own custom skills.
the skills are stored as numbers with regard to actors, so an actor's file only indicates if he/she has it, not what it does. meanwhile each and every attribute of a skill can be edited during play using a combination of input number and a hack of name change. with a little tinkering and an algorithm, you could have a spell/power/skill creator available. you could even edit skills on the fly for efficiency.
I've run tests and this seems to work like a charm. First you have to have some open slots in your skill list, second you have to know where those open slots are. For example, if you open up slots 81-100, you have to be aware you are editing slot 81, for example. Here's a demo skill, created using event scripts. It's broken into two parts because event scripts don't allow much length.
a = $data_skills[81]
a.name = "Flameblade"
a.icon_name = "050-Skill07"
a.mdef_f = 0
a.scope = 1
a.animation1_id = 7
a.animation2_id = 27
a.occasion = 1
a = $data_skills[81]
a.atk_f = 100
a.power = 145
a.description = "A burning blade"
a.sp_cost = 40
ok, so I've figured out the name of a skill can be edited with a variable attached like Heal 1, Heal 2, Heal 3, or even Heal 47. This can be done by appending the title:
p $data_skills[1].name
Control variables:[001:skill_level] = 0
a = $game_variables[1]
$data_skills[1].name = "heal" + " " +
a.to_s
I should also mention I figured out how to get an if..else working in my skill level display, so There's two ways of displaying a skill level in the status menu. The one mentioned applies to all skills, the new if...else method could be unique to each character. The hard part is getting each character's skills to have levels.
Btw you can append the module with class RPG::Skill.
Quote from: Ness on October 28, 2010, 03:42:54 AM
Btw you can append the module with class RPG::Skill.
Could you give an example? I've been rattling my brain for days how to append the skill module with a @skill_level. I'm guessing RPG::Skill.push(skill_level) or something like that;
But I realized that since everyone and their dog gets the same skill level, setting up skill levels means I'd have to make two sets of skills. One for the actor and one for the NPCs.
Here's my current experiment... I'm trying to figure out how to make an array really long.
#===============================================
# Experiment II
#===============================================
class Game_Actor
#-----------------------------------------------
# attribute accessor
#-----------------------------------------------
attr_accessor :skill_levels
#-----------------------------------------------
# initialization and definition - I'm still confused about the skill value
#-----------------------------------------------
def initialize(skill_levels)
x = $data_skills.length
for i in 1..x
# @skills_levels = $game_actors[actor_id].skills[i]
@skill_levels = []
# end # end for loop
end # end definition
end # end class
I just realized I was running into a conflict with MA's (*args) edit in main.
def skill_lvl
x = @actor.skills.length
for i in 0..x
return @actor.skills[i]
end
end
I'm really not sure what this is doing but it looks like it spits out the skill number next to the skill, except it only spits out the first skill, so if you have more than one skill, they will all display the same number. I'm not sure why that is, but it sucks.