The RPG Maker Resource Kit

RMRK RPG Maker Creation => Requests => Script Request => Topic started by: Winterfell on June 01, 2014, 10:17:22 PM

Title: Alternate Attack Algorithms scrips problems
Post by: Winterfell on June 01, 2014, 10:17:22 PM
I have a problem with rpgmaker XP 1.05 and the Alternate Attack Algorithms scripts. I have the same problem with Xelias's script AND Phoenixfire's script.

I has tested each scripts in a empty project.

For PhoenixFire

[spoiler]http://rmrk.net/index.php/topic,48835.0.html[/spoiler]

NoMethodError
Undefined method "*" for nil:NilClass

And for Xelias

[spoiler]http://forum.chaos-project.com/index.php/topic,4947.0.html[/spoiler]

NoMethodError
Undefined method "*=" for nil:NilClass

I'm not an expert in script but i don't really understand why the software make an error for that, although Game_battler 1 use that "*" without problem
Title: Re: Alternate Attack Algorithms scrips problems
Post by: Zexion on June 02, 2014, 05:05:42 AM
It usually means that it can't multiply because it doesn't exist/is equal to nil.
Title: Re: Alternate Attack Algorithms scrips problems
Post by: Winterfell on June 02, 2014, 06:48:57 AM
Ok but why ? The scripts seems to not have problems in general and the both doesn't work in a new installation of rpgmakerxp and a new project. I don't understand Oo
Title: Re: Alternate Attack Algorithms scrips problems
Post by: Zexion on June 02, 2014, 10:36:19 PM
Actually there might be something wrong with 1.05 of xp. I remember writing a script and getting an error because I did:
def something(arg1=0,arg2)
It was fixed by doing:
def something(arg1 = 0, arg2 = 0)
So as you can see, it was an out of place syntax error, as the first version was ripped from my old 1.02 project, which worked. I think it also caused random '*' errors aswell. You have to mess with the syntax a bit, or downgrade, which is what I did.
Title: Re: Alternate Attack Algorithms scrips problems
Post by: Winterfell on June 02, 2014, 11:19:25 PM
I have a steam release, so i can't downgrade, or i don't know how. I will try to modify the syntax...
Title: Re: Alternate Attack Algorithms scrips problems
Post by: PhoenixFire on June 03, 2014, 01:53:19 AM
I would actually be curious to know if either of you come up with a solution to this one. I never heard of that issue, but if there's a way to make this compatible with 1.05 too, I'll be updating my scripts with that..
Title: Re: Alternate Attack Algorithms scrips problems
Post by: Winterfell on June 03, 2014, 08:05:27 AM
I'm not enough skilled into Ruby and RGSS to modify. :/

I don't thing it's a problem of syntax of "*=" because we can find that sort of code :

def maxhp
    n = [[base_maxhp + @maxhp_plus, 1].max, 999999].min
    for i in @states
      n *= $data_states[i].maxhp_rate / 100.0
    end
    n = [[Integer(n), 1].max, 999999].min
    return n
  end


And there a no problem :/