Request for small (hopefully) fix for Skill Equip add-on script

C.W. Plainview

Veteran
Veteran
Joined
Nov 14, 2012
Messages
143
Reaction score
45
First Language
English
Primarily Uses
I am using Yami's Skill Equip (http://forums.rpgmakerweb.com/index.php?/topic/6727-skill-equip/) and Engr. Adiktuzmiko's Passive States Add-on (http://forums.rpgmakerweb.com/index.php?/topic/25936-yes-skill-equip-add-on-passive-states/).

Both scripts work fantastic! However, I have come across a small problem with, I think, the Passive States add-on script:

This happens when unequipping a passive skill that increases the character's max HP by 150%. It eventually goes away and reverts back to 200 HP, when it refreshes after twenty steps. However, in that time, it is possible to enter battle like this!

I have tested both scripts in a clean project and the issue still occurs.

All I'm looking for is, hopefully, a small fix that makes it so that when passive skills like this are unequipped, the effects of those skills are removed immediately.

If you need anymore information, just let me know.
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,671
Reaction score
2,993
First Language
Tagalog
Primarily Uses
You could maybe try this snippet

Code:
class Game_Actor    alias refresh_passive_states_adik_fix refresh_passive_states_adik  def refresh_passive_states_adik    refresh_passive_states_adik_fix    refresh  endend
 

C.W. Plainview

Veteran
Veteran
Joined
Nov 14, 2012
Messages
143
Reaction score
45
First Language
English
Primarily Uses
Engr. Adiktuzmiko,

Getting a couple of errors.

The first (done in the clean project with only your script plus the original script):

Script 'Game_Actor' line 171: NoMethod Error occured.

undefined method `collect' for nil:NilClass
The second issue, in my other project, seems to be causing a compatibility issue with Fomar's Dual Wield Free Hands script (http://pastebin.com/raw.php?i=sewHVQZ7):

Script 'Fomar0153_Dual_Wield_Free_Hands' line 43: NoMethodError occured.

undefined method `each_with_index' for nil:NilClass
Thoughts? I hate to throw compatibility issues into the mix. Hope it isn't too much of a problem.
 
Last edited by a moderator:

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,671
Reaction score
2,993
First Language
Tagalog
Primarily Uses
Those aren't from my script, mine doesn't have any collect method, nor does it use it...


PS: Make sure the snippet was below the add-on script btw.
 
Last edited by a moderator:

C.W. Plainview

Veteran
Veteran
Joined
Nov 14, 2012
Messages
143
Reaction score
45
First Language
English
Primarily Uses
The snippet was below the add-on script.

Just tested in another clean project. Using only the original Skill Equip script and Add-on script, making no configurations whatsoever to them. Testing those two alone works fine. Once I add the snippet below the add-on, I get that same error (the first one I listed).
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,671
Reaction score
2,993
First Language
Tagalog
Primarily Uses
Hmmm. weird... the line in question has something to with the equip variable of Game_Actor... It somehow takes the equips variable as nil or something.


When are you actually having the error?
 
Last edited by a moderator:

C.W. Plainview

Veteran
Veteran
Joined
Nov 14, 2012
Messages
143
Reaction score
45
First Language
English
Primarily Uses
As soon as I select "New Game" from the title screen.
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,671
Reaction score
2,993
First Language
Tagalog
Primarily Uses
Ah yes... It makes sense now, seems like I'm causing it to refresh before equips are even set up...

Try to change refresh to refresh unless @equips.nil?
 

C.W. Plainview

Veteran
Veteran
Joined
Nov 14, 2012
Messages
143
Reaction score
45
First Language
English
Primarily Uses
Like this?

class Game_Actor alias refresh_passive_states_adik_fix refresh_passive_states_adik def refresh_passive_states_adik refresh_passive_states_adik_fix refresh unless @equips.nil endendI think I might be doing something wrong, because this returns this error (again, as soon as I hit "New Game"):

Script 'Refresh' line 6: NoMethodError occured.

undefined method `nil' for nil:NilClass
 
Last edited by a moderator:

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,671
Reaction score
2,993
First Language
Tagalog
Primarily Uses
Uhm, I said .nil? You fprgot the question mark
 

C.W. Plainview

Veteran
Veteran
Joined
Nov 14, 2012
Messages
143
Reaction score
45
First Language
English
Primarily Uses
Oops. Thought that was just part of the sentence.

Adding a question mark causes a SystemStack Error. stack level too deep. Again, right when I select New Game.
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,671
Reaction score
2,993
First Language
Tagalog
Primarily Uses
Hmmm...

Then delete refresh and just use these directly

hp = [[hp,mhp].min,0].max

mp = [[mp,mmp].min,0].max
 

C.W. Plainview

Veteran
Veteran
Joined
Nov 14, 2012
Messages
143
Reaction score
45
First Language
English
Primarily Uses
Apologies for my continued ignorance (I really having no coding knowledge whatsoever), but what do you mean by use directly?

Like this?

class Game_Actor alias refresh_passive_states_adik_fix refresh_passive_states_adik def refresh_passive_states_adik refresh_passive_states_adik_fix hp = [[hp,mhp].min,0].max mp = [[mp,mmp].min,0].max endendUsing this snippet causes this error upon selecting New Game:

Script 'Game_Actor' line 336: TypeError occured.

no implicit conversion from nil to integer

Thanks for bearing with me, by the way.
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,671
Reaction score
2,993
First Language
Tagalog
Primarily Uses
Hmmmm... So its running even while actor isnt yet initialized fully... Hmmm...

Try to add this before the hp and mp lines

return if hp.nil?
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,671
Reaction score
2,993
First Language
Tagalog
Primarily Uses
Which error?

Or you could try mhp.nil?
 
Last edited by a moderator:

C.W. Plainview

Veteran
Veteran
Joined
Nov 14, 2012
Messages
143
Reaction score
45
First Language
English
Primarily Uses
Which error?
Script 'Game_Actor' line 336: TypeError occured.

no implicit conversion from nil to integer

Here is the snippet I used, just to make sure I'm configuring it correctly:

class Game_Actor alias refresh_passive_states_adik_fix refresh_passive_states_adik def refresh_passive_states_adik refresh_passive_states_adik_fix return if hp.nil? hp = [[hp,mhp].min,0].max return if mp.nil? mp = [[mp,mmp].min,0].max endendUsing mhp.nil? yields that same error.
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,671
Reaction score
2,993
First Language
Tagalog
Primarily Uses
Nooooo... It should just be

return if mhp.nil?

hp = blah

mp =blah

What is that line in Game_Actor?
 

C.W. Plainview

Veteran
Veteran
Joined
Nov 14, 2012
Messages
143
Reaction score
45
First Language
English
Primarily Uses
Nooooo... It should just be

return if mhp.nil?

hp = blah

mp =blah
Ah, I see. So like this, then:

class Game_Actor alias refresh_passive_states_adik_fix refresh_passive_states_adik def refresh_passive_states_adik refresh_passive_states_adik_fix return if mhp.nil? hp = [[hp,mhp].min,0].max mp = [[mp,mmp].min,0].max endendStill returns the same error.

This is line 336 in Game_Actor:

$data_classes[@class_id]
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,671
Reaction score
2,993
First Language
Tagalog
Primarily Uses
Then just do this, for quick fix, not really recommended but oh well

Code:
class Game_Actor    alias refresh_passive_states_adik_fix refresh_passive_states_adik  def refresh_passive_states_adik    refresh_passive_states_adik_fix    begin      hp = [[hp,mhp].min,0].max      mp = [[mp,mmp].min,0].max    rescue      p "Debug: it would error so we stopped it so the game can continue"    end   endend
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

I couldn't have Taco Bell, so I grabbed a giant piece of strawberry cheesecake instead.
Guys one of our Animal Crossing Villagers (Sherb) just told us that he hoped that the villager who was having her birthday had as memorable of a birthday as his sixth birthday. Which was "the one where the clown went into our house and never came back" and that "his mother says she still sometimes hears the honking in the walls".
My tutor has been furloughed for 8 weeks. If we are too... sucks, but it's a lot of game making time...
Social distancing extended for another week. Personally I'm cool, but this is depressing.
GOOOOD MOOORNING!
APRIL WILL BE BETTER!

Forum statistics

Threads
95,571
Messages
930,167
Members
125,853
Latest member
sokka
Top