Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

 
Reply to this topicStart new topic
> Another YEM challenge, Trying to add a tag <equip_stat: +x%> for skills
SuperWeirdo
post May 18 2011, 06:45 PM
Post #1


Level 1
Group Icon

Group: Member
Posts: 5
Type: None
RM Skill: Intermediate




I've tried to copy a bit what's seen in the YEM equipment overhaul script since there is an identical tag for equipments but I just can't get it to work

I've tried to add this to the script:

module skill
module YEM
module REGEXP
module BASEITEM

SKILL_SLOTS = /<(?:SKILL_SLOTS|skill slots):[ ]*([\+\-]\d+)>/i
TYPE_SLOTS = /<(.*)[ ](?:SLOTS|slot):[ ]*([\+\-]\d+)>/i

end # BASEITEM
module SKILL

LIMIT_TYPE1 = /<(?:LIMIT_TYPE|limit type):[ ](.*)>/i
LIMIT_TYPE2 = /<(?:LIMIT_TYPE|limit type):[ ](.*),[ ](\d+)>/i

***ADDED**
EQUIP_STATS_PER = /<(?:EQUIP|equipped)[ ](.*):[ ]*([\+\-]\d+)([%ï¼…])>/i

***end****
EQUIP_STATS = /<(?:EQUIP|equipped)[ ](.*):[ ]*([\+\-]\d+)>/i
EQUIP_STATE = /<(?:EQUIP_STATE|equip state):[ ]*(\d+(?:\s*,\s*\d+)*)>/i

SKILL_TYPE = /<(?:SKILL_TYPE|skill type):[ ](.*)>/i
COPY_TYPE = /<(?:COPY_TYPE|copy type):[ ](.*)>/i
CANNOT_COPY = /<(?:CANNOT_COPY|cannot copy|cant copy)>/i

end # SKILL
end # REGEXP
end # YEM


another modification
class RPG::Skill < RPG::UsableItem

#--------------------------------------------------------------------------
# public instance variables
#--------------------------------------------------------------------------
attr_accessor :cannot_copy
attr_accessor :copy_type
attr_accessor :equip_bonuses
attr_accessor :limit_type
attr_accessor :skill_type
attr_accessor :equip_stat_per

#--------------------------------------------------------------------------
# common cache: yem_cache_skill_ses
#--------------------------------------------------------------------------
def yem_cache_skill_ses
return if @cached_skill_ses; @cached_skill_ses = true
@cannot_copy = false
@copy_type = []
@skill_type = ["ALL"] if @skill_type == nil
@limit_type = {} if @limit_type == nil

***ADDED**
@equip_stat_per ={ :hp => 0, :mp => 0, :atk => 0, :def => 0, :spi => 0,
:agi => 0, :hit => 0, :eva => 0, :cri => 0, :odds => 0}
****END****

@equip_bonuses = { :maxhp => 0, :maxmp => 0, :atk => 0, :def => 0,
:spi => 0, :res => 0, :dex => 0, :agi => 0, :hit => 0, :eva => 0,
:cri => 0, :odds => 0, :states => [] }
#---


Finally
when YEM::REGEXP::SKILL::EQUIP_STAT_PER
case $1.upcase
when "HP","MAXHP"; @equip_stat_per[:hp] = $2.to_i
when "MP","MAXMP"; @equip_stat_per[:mp] = $2.to_i
when "ATK"; @equip_stat_per[:atk] = $2.to_i
when "DEF"; @equip_stat_per[:def] = $2.to_i
when "SPI"; @equip_stat_per[:spi] = $2.to_i
when "AGI"; @equip_stat_per[:agi] = $2.to_i
when "HIT"; @equip_stat_per[:hit] = $2.to_i
when "EVA"; @equip_stat_per[:eva] = $2.to_i
when "CRI"; @equip_stat_per[:cri] = $2.to_i
when "ODDS"; @equip_stat_per[:odds] = $2.to_i
end


The error I get is this:

Script 'YEM Skill Equip System' line 356 : NameError occured

unitialized constant
YEM::REGEXP::SKILL::EQUIP_STAT_PER

If someone already knows what's missing for this modification to work that would be awesome

**EDIT**

Turns out the error I got was because I had made a typo with my EQUIP_STAT_PER however even with the error gone it unfortunately still doesn't work sad.gif Help is still needed friends !

This post has been edited by SuperWeirdo: May 20 2011, 05:31 PM
Go to the top of the page
 
+Quote Post
   
Twilight
post May 19 2011, 06:14 AM
Post #2


Real name, Lily White
Group Icon

Group: Revolutionary
Posts: 227
Type: Developer
RM Skill: Advanced




It's better to use the auto state function and make a state that adds +x% of a stat. Simpler and less of a hassle.
Go to the top of the page
 
+Quote Post
   
Night5h4d3
post May 19 2011, 06:19 AM
Post #3


The past tense
Group Icon

Group: +Gold Member
Posts: 1,199
Type: Scripter
RM Skill: Undisclosed




You said you fixed some typo's, but I don't know if you updated the snippet afterward, so I'll try to mention all that I'm seeing

CODE
EQUIP_STATS_PER = /<(?:EQUIP|equipped)[ ](.*):[ ]*([\+\-]\d+)([%ï¼…])>/i

First off, you're missing a : between |equipped) and []
Secondly, are you sure you want unicode characters in there? I'm seeing "ï¼"


__________________________
Got 30 minutes? Then you've enough time to play this awesome game:

- potentially promising project page
- thanks holder
My growing space of user-bars:

about me:







I made the following!





Go to the top of the page
 
+Quote Post
   
SuperWeirdo
post May 19 2011, 01:17 PM
Post #4


Level 1
Group Icon

Group: Member
Posts: 5
Type: None
RM Skill: Intermediate




QUOTE (Twilight @ May 19 2011, 07:14 AM) *
It's better to use the auto state function and make a state that adds +x% of a stat. Simpler and less of a hassle.


Unfortunately the +% for state doesn't work in my game and that's before I modified anything ex: ­<maxhp: +5%> doesnt do anything.

Snippets found in the YEM Equiment Overhaul Script
STAT_PER = /<(.*):[ ]*([\+\-]\d+)([%%])>/i

Snippets found in the YEM Skill Equip script
EQUIP_STATS = /<(?:EQUIP|equipped)[ ](.*):[ ]*([\+\-]\d+)>/i

So I tried to fuse the two snippets above

As for the typos for the snippets I'll look into it when I'm home but I'm really grateful for the help you're all trying to give me
Go to the top of the page
 
+Quote Post
   
SuperWeirdo
post May 19 2011, 07:56 PM
Post #5


Level 1
Group Icon

Group: Member
Posts: 5
Type: None
RM Skill: Intermediate




By the way, am I the only one who can't get the tag <stat: +x%> function for states ? This function is clearly documented in the custom states section of the Melody Engine 1 script and yet it has never worked for me using the melody 1.00m demo.
Go to the top of the page
 
+Quote Post
   
Twilight
post May 19 2011, 08:02 PM
Post #6


Real name, Lily White
Group Icon

Group: Revolutionary
Posts: 227
Type: Developer
RM Skill: Advanced




you likely haven't set it up right
<atk: 110%> raise attack by 10%
<atk: 90%> lowers attack by 10%
also changing lines in the code can and will break things unless you know what you're doing

You also need to take into consideration the value of your stats as a 10% increase in Max HP when it's at 100 will only raise it by (Max HP /10 ) or a value of 10

This post has been edited by Twilight: May 19 2011, 08:04 PM
Go to the top of the page
 
+Quote Post
   
SuperWeirdo
post May 20 2011, 07:10 AM
Post #7


Level 1
Group Icon

Group: Member
Posts: 5
Type: None
RM Skill: Intermediate




QUOTE (Twilight @ May 19 2011, 08:02 PM) *
you likely haven't set it up right
<atk: 110%> raise attack by 10%
<atk: 90%> lowers attack by 10%
also changing lines in the code can and will break things unless you know what you're doing

You also need to take into consideration the value of your stats as a 10% increase in Max HP when it's at 100 will only raise it by (Max HP /10 ) or a value of 10


I've tried that and it worked. However, for some reason I can't get the state to stack even with <max stack: x> I'm still wondering if it's because the <stat: x%> actually boosts the paremeter or if it sets it to the value. On the first case, it should be stackable on the second case, it wouldn't change anything to stack it.

By the way, since the changes I tried to make didn't work, I've reverted back to vanilla YEM.
Anyway if anyone is aware of a way to modify YEM in order for it to support <stat: +x%> either for skills or states, that would be awesome.
Go to the top of the page
 
+Quote Post
   
Twilight
post May 21 2011, 04:59 AM
Post #8


Real name, Lily White
Group Icon

Group: Revolutionary
Posts: 227
Type: Developer
RM Skill: Advanced




Stacking only works when you're casting the state, auto states don't have that feature.
Go to the top of the page
 
+Quote Post
   
SuperWeirdo
post May 21 2011, 07:44 AM
Post #9


Level 1
Group Icon

Group: Member
Posts: 5
Type: None
RM Skill: Intermediate




QUOTE (Twilight @ May 21 2011, 05:59 AM) *
Stacking only works when you're casting the state, auto states don't have that feature.


I tried making individual states and it worked perfectly. Problem solved and thank you Twilight
Go to the top of the page
 
+Quote Post
   

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 20th May 2013 - 05:04 AM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker