Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Bubble shield
#7
To fix your 'compatability' issue between it and Blizzard's script, allow moi to go about a little teaching. Laughing

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. Winking
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)
[Image: QrnbKlx.jpg]
[Image: sGz1ErF.png] [Image: liM4ikn.png] [Image: fdzKgZA.png] [Image: sj0H81z.png]
[Image: QL7oRau.png] [Image: uSqjY09.png] [Image: GAA3qE9.png] [Image: 2Hmnx1G.png] [Image: BwtNdKw.png%5B]
Above are clickable links

Reply }


Messages In This Thread
Bubble shield - by Fenriswolf - 12-14-2019, 11:51 PM
RE: Bubble shield - by Fenriswolf - 12-18-2019, 02:29 PM
RE: Bubble shield - by Melana - 12-19-2019, 04:05 AM
RE: Bubble shield - by DerVVulfman - 12-19-2019, 04:12 AM
RE: Bubble shield - by Fenriswolf - 12-19-2019, 01:21 PM
RE: Bubble shield - by Fenriswolf - 12-19-2019, 08:18 PM
RE: Bubble shield - by DerVVulfman - 12-20-2019, 04:42 AM
RE: Bubble shield - by Fenriswolf - 12-22-2019, 01:03 AM
RE: Bubble shield - by Fenriswolf - 12-27-2019, 11:27 PM



Users browsing this thread: