- Joined
- May 16, 2014
- Messages
- 140
- Reaction score
- 10
- Primarily Uses
So, I have managed to use text from skill notetags as data before (see below), using examples from scriptors.
But this data has always been based on numerical digits and not arrays, and I'm not really experienced with or can comprehend enough of Regexp processes to figure this out myself.
#Tag items and skills with <armor ignore: x>
#A value of 50 means that an opponent's armor rating will only be
half as effective.
#Do not include the percentage symbol.
module TH
module Armor_Ignores
Regex = /<armor[-_ ]ignore:\s*(\d+)>/i
end
end
#===============================================================================
# ** Rest of script
#===============================================================================
module RPG
class UsableItem < BaseItem
def armor_ignore
return @armor_ignore unless @armor_ignore.nil?
load_notetag_armor_ignore
return @armor_ignore
end
def load_notetag_armor_ignore
res = self.note.match(TH::Armor_Ignores::Regex)
@armor_ignore = res ? res[1].to_i : 0
end
end
end
With this script tidbit example I just posted, I could use in a formula 'item.armor_ignore' for additional processes.
I know that the adjustment to be made would have to be at the
I would like to be able to tag in a skill notetag <secondary effects: [data]>
So if I were to use 'item.secondary_effects' in a formula, it would return the [data] array in the skill's notetag.
An example of an application of this would be for me to make [data] into, say,
[["Poison", 0.3, [1,2], physical, true], ["Burn", 0.15, [1,2], magical, false]]
"Poison" would be the display name for the secondary effect in the battle log, '0.3' would be the base chance of the ailment, [1,2] would be the stat influences of Attack and Luck respectively (meaning that the ATK stat would be normally influential in the effect chance, and the LUK stat would be twice as influential in the effect chance), 'physical' would mean that the chance would be multiplied by the target's Physical damage rate, and 'true' would dictate that the chance would be increased if the skill ended up being critical.
But this data has always been based on numerical digits and not arrays, and I'm not really experienced with or can comprehend enough of Regexp processes to figure this out myself.
#Tag items and skills with <armor ignore: x>
#A value of 50 means that an opponent's armor rating will only be
half as effective.
#Do not include the percentage symbol.
module TH
module Armor_Ignores
Regex = /<armor[-_ ]ignore:\s*(\d+)>/i
end
end
#===============================================================================
# ** Rest of script
#===============================================================================
module RPG
class UsableItem < BaseItem
def armor_ignore
return @armor_ignore unless @armor_ignore.nil?
load_notetag_armor_ignore
return @armor_ignore
end
def load_notetag_armor_ignore
res = self.note.match(TH::Armor_Ignores::Regex)
@armor_ignore = res ? res[1].to_i : 0
end
end
end
With this script tidbit example I just posted, I could use in a formula 'item.armor_ignore' for additional processes.
I know that the adjustment to be made would have to be at the
part.Regex = /<armor[-_ ]ignore:\s*(\d+)>/i
I would like to be able to tag in a skill notetag <secondary effects: [data]>
So if I were to use 'item.secondary_effects' in a formula, it would return the [data] array in the skill's notetag.
An example of an application of this would be for me to make [data] into, say,
[["Poison", 0.3, [1,2], physical, true], ["Burn", 0.15, [1,2], magical, false]]
"Poison" would be the display name for the secondary effect in the battle log, '0.3' would be the base chance of the ailment, [1,2] would be the stat influences of Attack and Luck respectively (meaning that the ATK stat would be normally influential in the effect chance, and the LUK stat would be twice as influential in the effect chance), 'physical' would mean that the chance would be multiplied by the target's Physical damage rate, and 'true' would dictate that the chance would be increased if the skill ended up being critical.
Last edited by a moderator:
