[SOLVED] Blizz-ABS Trying to Give Exp to guard?

Started by lpjz2, May 15, 2012, 02:24:31 pm

Previous topic - Next topic

lpjz2

May 15, 2012, 02:24:31 pm Last Edit: May 16, 2012, 12:41:34 pm by lpjz2
So im working with Blizz-ABS and everything is working fine apart from this...

I added a new monster (lizzard) and when i attack him and kill him i get 2 xp, works fine. However when a guard (npc) kills him i think its trying to give the guard some exp crashing my game...

Heres what my game looks like before the guard attacks the lizard :

Before


And when the guard attacks and kills the lizard :

After

G_G

While this probably isn't the best solution to use and you'll have to wait until it gets fixed in the official version, add this snippet above Blizz-ABS and it should fix your problem.
Class Game_Enemy < Game_Battler
  def exp=(n)
  end
end

winkio

Change the line after the error (line 2055) from

bat.exp += exp if !bat.cant_get_exp?


to

bat.exp += exp if !bat.cant_get_exp? && bat.is_a?(Game_Actor)

Blizzard

Or:

class Game_Enemy
  def cant_get_exp?
    return true
  end
end
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

winkio

all usable fixes, but the correct behavior is to only distribute EXP to the actors, thus checking for the actor as a condition is the best choice.

Blizzard

Of course. I was just being a smartass by providing an alternative and rather hacky solutio.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

lpjz2

Quote from: winkio on May 15, 2012, 07:07:45 pm
Change the line after the error (line 2055) from

bat.exp += exp if !bat.cant_get_exp?


to

bat.exp += exp if !bat.cant_get_exp? && bat.is_a?(Game_Actor)



Thankyou :) worked perfectly!