|
  |
Skill Requirement System 1.1 |
|
|
|
|
Mar 30 2008, 01:47 PM
|
Level 6

Group: Member
Posts: 75
Type: None
RM Skill: Beginner

|
We both change Scene_Battle.execute_action_skill for different reasons. I'm not entirely up to speed with aliases yet. Try this and let me know if it fixes it: CODE ##################################### # Check for requirements for skills # ##################################### class Game_Actor < Game_Battler
def hands_free if weapons[0]==nil if @armor1_id[0]==0 return 2 elsif weapons.length==2 if weapons[1].two_handed return 0 else return 1 end else return 1 end elsif weapons[0].two_handed or @armor1_id!=0 return 0 else return 1 end end
def skill_can_use?(skill) #Usual checks return false unless skill_learn?(skill) return false unless skill.is_a?(RPG::Skill) return false unless movable? return false if silent? and skill.spi_f > 0 return false if calc_mp_cost(skill) > mp if skill.id != 0 skill_note=$data_skills[skill.id].note #Check for weapon type skill_needs = getTag(skill_note,"weapon_type") #weapon type string if skill_needs != nil return false unless @weapon_id!=0 return false unless hasTagValue($data_weapons[@weapon_id].note,"weapon_type",skill_needs) end #Check for item presence skill_needs = getTag(skill_note,"item_present") #item id if skill_needs != nil return false unless $game_party.has_item?($data_items[skill_needs.to_i],true) end #Check for item consumption skill_needs = getTag(skill_note,"item_consume") #item id if skill_needs !=nil skill_needs_num = getTagAdditionalValue(skill_note,"item_consume",2) #number if skill_needs_num == nil skill_needs_num = 1 end return false unless $game_party.item_number($data_items[skill_needs.to_i])>=skill_needs_num.to_i end #Check for HP exceeds skill_needs = getTag(skill_note,"hp_percent_exceed") #percent if skill_needs !=nil return false unless (100.0 * @hp/maxhp)>=skill_needs.to_f end #Check for HP below skill_needs = getTag(skill_note,"hp_percent_below") #percent if skill_needs != nil return false unless (100.0 * @hp/maxhp)<skill_needs.to_f end #Check for MP exceeds skill_needs = getTag(skill_note,"mp_percent_exceed") #percent if skill_needs != nil return false unless (100.0 * @mp/maxmp)>=skill_needs.to_f end #Check for MP below skill_needs = getTag(skill_note,"mp_percent_below") #percent if skill_needs != nil return false unless (100.0* @mp/maxmp)<skill_needs.to_f end #Check for free hand skill_needs = hasTag(skill_note,"free_hand") #boolean if skill_needs return false unless hands_free>=1 end #Check for dual weapons skill_needs = hasTag(skill_note,"dual_weapon") #boolean if skill_needs return false unless weapons[0]!=nil and weapons[1]!=nil end #Check for two-handed weapon skill_needs = hasTag(skill_note,"two_handed_weapon") #boolean if skill_needs return false unless ( weapons[0]!= nil and weapons[0].two_handed) or (weapons[1] != nil and weapons[1].two_handed) end end if $game_temp.in_battle return skill.battle_ok? else return skill.menu_ok? end end def calc_mp_cost(skill) base_cost=skill.mp_cost mp_prop=getTag(skill.note,"mp_percent_exceed") if mp_prop!=nil mp_lose=getTagAdditionalValue(skill.note,"mp_percent_exceed",2) if mp_lose.eql?("true") base_cost=(mp_prop.to_f/100.0 * maxmp).to_i end end if half_mp_cost return base_cost / 2 else return base_cost end end end
class Scene_Battle < Scene_Base #-------------------------------------------------------------------------- # * Execute Battle Action: Skill #-------------------------------------------------------------------------- alias skill_req_execute_action_skill execute_action_skill def execute_action_skill skill_req_execute_action_skill skill = @active_battler.action.skill #consume items required skill_needs = getTag(skill.note,"item_consume") if skill_needs != nil num_items = getTagAdditionalValue(skill.note,"item_consume",2) if num_items==nil num_items=1 end $game_party.lose_item($data_items[skill_needs.to_i],num_items.to_i,true) end end end
|
|
|
|
|
|
|
|
|
Mar 30 2008, 02:59 PM
|

Level 4

Group: Member
Posts: 58
Type: Developer
RM Skill: Beginner

|
QUOTE (Queex @ Mar 30 2008, 11:32 AM)  Hmm. I don't know about that. I don't get an error my end. Are you using any other scripts that affect Scene_Battle at all? That line is taken unaltered from the default code so I have no idea why it may cause a syntax error. Erg! That could be it! I am using DerVVulfman's battlebacks script and Lomexi's Battle Theme adjuster... (@_@)! ..I will take a look at it later when I have more time--unless anyone already knows what the conflict might be.
__________________________
Story - 85% Database - 55% Scripts - 90% Maps - 8% Graphics - 38% Original Music - 20%
|
|
|
|
|
|
|
|
|
Mar 30 2008, 04:07 PM
|
Level 6

Group: Member
Posts: 75
Type: None
RM Skill: Beginner

|
I'm using battlebacks (before this script) without problems. Try moving scripts to after main until the problem goes away.
|
|
|
|
|
|
|
|
|
Mar 30 2008, 06:29 PM
|

Level 4

Group: Member
Posts: 58
Type: Developer
RM Skill: Beginner

|
Well, I tried taking out my scripts ONE BY ONE until I was left with just TagNote and the Skill Req script, but still the syntax error on the last line. (!) Finally, I just added "end, end" to the end... and it SEEMS to work (so far so good). CODE display_animation(targets, skill.animation_id) end end I have yet to do much with the actual notes, so we shall see... Anyway, thanks for your helpful demeanor! (And I'll be back if I have more problems that I can't fix on my own! But here's hoping I wont have any!) Regards, AEVH
__________________________
Story - 85% Database - 55% Scripts - 90% Maps - 8% Graphics - 38% Original Music - 20%
|
|
|
|
|
|
|
|
|
Mar 31 2008, 12:51 AM
|
Level 6

Group: Member
Posts: 75
Type: None
RM Skill: Beginner

|
Actually- that shouldn't be the last line. I think you may not have copied all of it. Double check that and see if it works.
|
|
|
|
|
|
|
|
|
Mar 31 2008, 08:28 AM
|

Level 4

Group: Member
Posts: 58
Type: Developer
RM Skill: Beginner

|
QUOTE (Queex @ Mar 31 2008, 03:05 AM)  Actually- that shouldn't be the last line. I think you may not have copied all of it. Double check that and see if it works. Hm, yeah, that was one of the first things I checked when I got the script because I thought the end looked funny. --But I can't seem to get the code box to scroll down any further than that line. I often have trouble with code boxes though...maybe because I'm in Internet Explorer.... I don't suppose I could trouble you to post the full code as a TXT file download?
__________________________
Story - 85% Database - 55% Scripts - 90% Maps - 8% Graphics - 38% Original Music - 20%
|
|
|
|
|
|
|
|
|
Mar 31 2008, 02:07 PM
|
Level 6

Group: Member
Posts: 75
Type: None
RM Skill: Beginner

|
Done- check the original post. That version is the semi-experimental one posted earlier attempting to use an alias, so if there are still problems I'll revert it to the older version.
I intend to upgrade this at some point, after revising TagNote to handle multiple tags of the same type properly.
|
|
|
|
|
|
|
|
|
Apr 1 2008, 08:15 AM
|
Level 6

Group: Member
Posts: 75
Type: None
RM Skill: Beginner

|
I'll fix the script. Tonight, probably. Should be fairly trivial.
Edit: Done. As always, if there are any problems with it let me know. I've cleaned it up a little, too.
This post has been edited by Queex: Apr 1 2008, 10:03 AM
|
|
|
|
|
|
|
|
|
Apr 1 2008, 04:19 PM
|
Level 6

Group: Member
Posts: 75
Type: None
RM Skill: Beginner

|
Umm, it seems to work for me. As ever, check both it and TagNote are the latest version, other scripts, etc. etc. I'll look into it if the problem persists.
|
|
|
|
|
|
|
|
|
Apr 4 2008, 05:03 PM
|
Level 6

Group: Member
Posts: 75
Type: None
RM Skill: Beginner

|
Bump for newer version.
Now uses the revised TagNote script, has a couple of fixes and includes a facility to make sure required items appear in the inventory when testing battles.
|
|
|
|
|
|
|
|
|
Apr 9 2008, 01:15 PM
|

Group: Member
Posts: 1
Type: None
RM Skill: Undisclosed

|
hey is there a way to make one of the requirements being that the actor is under a certain state? like a light arts/dark arts set up if anyone has played FFXI >.>
|
|
|
|
|
|
|
|
|
May 28 2008, 09:16 AM
|

Group: Member
Posts: 3
Type: None
RM Skill: Undisclosed

|
sorry, i'm having problems with the status on the skills for example, if a skill causes atk up, there's an error. it is in line 196. i don't know anything about scripting, but i guess that the error is in all this part: #consume items required skill_needs = get_tag(skill.note,"item_consume") if skill_needs != nil num_items = get_additional_tag(skill.note,"item_consume",2) if num_items==nil num_items=1 end $game_party.lose_item($data_items[skill_needs.to_i],num_items.to_i,true) end end end even so, it's a great job, man
|
|
|
|
|
|
|
|
|
May 29 2008, 05:57 AM
|
Level 6

Group: Member
Posts: 75
Type: None
RM Skill: Beginner

|
I've been side-tracked by other time sinks recently- most notably getting my car past the MOT- so it might be a while before I make any substantial revisions- although thinkabout's suggestions are definitely good choices for inclusion.
As for hjorverdr's problem, I can't see any way that status effects could interfere. Can you verify that the problem isn't present for a skill with identical requirements but no status effect, and that you're using the latest version in the zip file?
|
|
|
|
|
|
|
|
  |
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:
RPG RPG Revolution is an Privacy
Policy and Legal
|
|