I am sorry if this is in the wrong place, but the last thread I turned up when looking for answers to this issue was in this part of the forums and dated 2013.
Very new to the program, and extremely fearful of ruby, but I'm trying!
The self-effect script from the tutorial 3.5 (https://www.rpgmakerweb.com/support/products/tutorials) gives me the error
I consulted doctor google, and was directed to a thread here with a few possible causes and fixes, including a very thoughtful post with a revised script. The cause is that it bugs out if there is any note attached to a skill other than one for the script (if the thread is correct, I don't know enough to be able to tell myself). I did a little test battling and it seems to point in that direction.
When "Attack" is used by anything (enemy or player) it bugs immediately, when I tried a move where self-effect is used, the animation played out and it didn't freeze up until the enemy tried 'Attack'.
I've tried: the original script from the tutorial, the revised one in the thread linked below, and a fix the user mobychan recommended: adding the line "next if scan.nil?" above the problem line.
Any ideas? I'd hate to have learned as much as I have to just throw my arms up and quit over something this silly, I'd really like to get this working. Sorry if I've missed something painfully obvious, misplaced this post, or done some other dumb thing. Thanks
Thread I referenced so much:
https://forums.rpgmakerweb.com/index.php?threads/newbie-needs-help-with-tutorial-3-5.2957/
EDIT: i should probly put the script in, huh.
Very new to the program, and extremely fearful of ruby, but I'm trying!
The self-effect script from the tutorial 3.5 (https://www.rpgmakerweb.com/support/products/tutorials) gives me the error
I consulted doctor google, and was directed to a thread here with a few possible causes and fixes, including a very thoughtful post with a revised script. The cause is that it bugs out if there is any note attached to a skill other than one for the script (if the thread is correct, I don't know enough to be able to tell myself). I did a little test battling and it seems to point in that direction.
When "Attack" is used by anything (enemy or player) it bugs immediately, when I tried a move where self-effect is used, the animation played out and it didn't freeze up until the enemy tried 'Attack'.
I've tried: the original script from the tutorial, the revised one in the thread linked below, and a fix the user mobychan recommended: adding the line "next if scan.nil?" above the problem line.
Any ideas? I'd hate to have learned as much as I have to just throw my arms up and quit over something this silly, I'd really like to get this working. Sorry if I've missed something painfully obvious, misplaced this post, or done some other dumb thing. Thanks
Thread I referenced so much:
https://forums.rpgmakerweb.com/index.php?threads/newbie-needs-help-with-tutorial-3-5.2957/
EDIT: i should probly put the script in, huh.
Code:
#===============================================================================
# Skill Self Effects
# By Jet10985 (Jet)
# Requested by Touchfuzzy
#===============================================================================
# This script will allow you to specify a skill's effects tot arget the user
# instead of the target, on skills that don't already effect the user.
# This script has: 0 customization options.
#===============================================================================
# Overwritten Methods:
# None
#-------------------------------------------------------------------------------
# Aliased methods:
# Game_Battler: item_effect_apply
#===============================================================================
=begin
To specify the effects, use this notetag in the skill's notebox:
<self effect: 1>
or
<self effect: 1, 2, 3> to specify more than 1 effect
--------------------------------------------------------------------------------
Use of this script could be as the following.
You make a "Berserk Strike" skill, which does 200% damage to an enemy.
You make the 2nd effect "Defense Down 50%" and want it applied to the user.
You'd use this notetag: <self effect: 2>
=end
class RPG::Skill
def self_effects
if @self_effects.nil?
@self_effects = []
self.note.each_line {|a|
scan = a.scan(/<self[ ]*effect[ ]*\:[ ]*(\d+(?:[ ]*,[ ]*\d+)*)>/i)
scan[0][0].scan(/\d+/).each {|b|
@self_effects.push(@effects[b.to_i - 1]) if b.to_i >= 1
}
}
end
@self_effects
end
end
class Game_Battler
alias jet3745_item_effect_apply item_effect_apply
def item_effect_apply(user, item, effect, reffed = false)
if item.is_a?(RPG::Skill) && item.self_effects.include?(effect) && !reffed
user.item_effect_apply(user, item, effect, true)
return
end
jet3745_item_effect_apply(user, item, effect)
end
end