12-20-2019, 04:42 AM
(This post was last modified: 12-20-2019, 05:15 AM by DerVVulfman.)
To fix your 'compatability' issue between it and Blizzard's script, allow moi to go about a little teaching.
There are two ways to add new material to a method in Ruby Scripting. You either rewrite the whole method or you use the 'alias' technique which allows you to append new material without the need of rewriting the whole method.
The first method, the one where you rewrite a method, is destructive. For example, if you have two scripts that alter the 'attack_battler' method, and the last script in your list rewrites the method.... erm, all the prior ones are overwritten and ignored. A rewrite of the method is not preferred, but sometimes it is the only way to achieve what is desired.
The second method, the one using the alias techinique, is additive. For example, if you have two scripts that alter the 'attack_battler' method, and the last script in your list aliases new content.... Well, that material from the previous script is still present and the new aliased content joins it! It is more preferred, but can be prone to crashing if the script's author didn't take stack overflow into consideration. A rarity, but certain authors do ignore it.
NOW.... About the two scripts.
The one that Melana supplied rewrites the 'attack_effect' and 'skill_effect' methods as well as the 'slip_damage_effect' method. You can find these in the original code just by looking for the 'SDK.overwrite' statements. So this uses the first method of scripting, the rewrite method technique.
The second one, the one by blizzard, uses the alias technique upon the 'skill_effect' method. This is the more preferred technique and should be placed after the first. In fact, if you have any other script that alters 'skill_effect', this script should be last in the list. Why? Because blizzard added extra parameters into his 'skill_effect' call.
Normally, the skill_effect looks like this:
def skill_effect(user, skill)
Blizzard's variation looks like this:
def skill_effect(user, skill, override_reflect = !$scene.is_a?(Scene_Battle))
He added a new 'override_reflect' parameter that changes how things work. And any other script that aliases 'skill_effect' and gets posted after this will have the "wrong number of arguments (3 for 2)" error.
And I take it that your edit is to this?
So... PWS_PERCENT will then be a fixed value for all shields or whatever it is. Sounds right, but I haven't examined the script. I'm just looking at it while working on forum stuff.
There are two ways to add new material to a method in Ruby Scripting. You either rewrite the whole method or you use the 'alias' technique which allows you to append new material without the need of rewriting the whole method.
The first method, the one where you rewrite a method, is destructive. For example, if you have two scripts that alter the 'attack_battler' method, and the last script in your list rewrites the method.... erm, all the prior ones are overwritten and ignored. A rewrite of the method is not preferred, but sometimes it is the only way to achieve what is desired.
The second method, the one using the alias techinique, is additive. For example, if you have two scripts that alter the 'attack_battler' method, and the last script in your list aliases new content.... Well, that material from the previous script is still present and the new aliased content joins it! It is more preferred, but can be prone to crashing if the script's author didn't take stack overflow into consideration. A rarity, but certain authors do ignore it.
NOW.... About the two scripts.
The one that Melana supplied rewrites the 'attack_effect' and 'skill_effect' methods as well as the 'slip_damage_effect' method. You can find these in the original code just by looking for the 'SDK.overwrite' statements. So this uses the first method of scripting, the rewrite method technique.
The second one, the one by blizzard, uses the alias technique upon the 'skill_effect' method. This is the more preferred technique and should be placed after the first. In fact, if you have any other script that alters 'skill_effect', this script should be last in the list. Why? Because blizzard added extra parameters into his 'skill_effect' call.
Normally, the skill_effect looks like this:
def skill_effect(user, skill)
Blizzard's variation looks like this:
def skill_effect(user, skill, override_reflect = !$scene.is_a?(Scene_Battle))
He added a new 'override_reflect' parameter that changes how things work. And any other script that aliases 'skill_effect' and gets posted after this will have the "wrong number of arguments (3 for 2)" error.
And I take it that your edit is to this?
Code:
if state_id == PWS_ID
@pws_hp = Integer(self.maxhp * PWS_PERCENT)
end
So... PWS_PERCENT will then be a fixed value for all shields or whatever it is. Sounds right, but I haven't examined the script. I'm just looking at it while working on forum stuff.