Chaos Project

RPG Maker => RPG Maker Scripts => Script Troubleshooting => Topic started by: Satoh on October 24, 2008, 06:14:50 pm

Title: I really wanted to get by without help but.... oh well...
Post by: Satoh on October 24, 2008, 06:14:50 pm
Level-up/ EXP gain notifier for BlizzABS

#=============================================================================
# * EXP Notifier for BlizzABS
#=============================================================================
# ** Display EXP
#-----------------------------------------------------------------------------
class Game_System
  def b_abs_exp_display #this script should use damage_pop to display gained EXP
    BlizzABS.player.actors.each {|actor|
      if @level != actor.final_level
        actor.battler.damage = exp_result(enemy).to_i #unless actor.cant_get_exp?
        # display text
        actor.battler.damage_pop = true #unless actor.cant_get_exp?
      end}
  end

#-----------------------------------------------------------------------------
# ** Removal of enemy call addition
#-----------------------------------------------------------------------------
  alias satoh_remove_enemy_mod remove_enemy
  def remove_enemy(enemy)
    satoh_remove_enemy_mod(enemy)
    b_abs_exp_display
  end
end


It screams random errors at me as soon as I kill and enemy...

Things I have been told are not defined:

actor
enemy
cant_get_exp?
implicitly convert nil to integer
final_level
Title: Re: I really wanted to get by without help but.... oh well...
Post by: Shadonking on October 24, 2008, 06:23:12 pm
ok i'll just test what youve given me, then i'll get back to you

EDIT

this may take some time.
Title: Re: I really wanted to get by without help but.... oh well...
Post by: Satoh on October 24, 2008, 06:35:27 pm
Thanks, I put it under the custom EXP and BlizzABS in my .hack game demo.... (which is hosted and posted now)
Title: Re: I really wanted to get by without help but.... oh well...
Post by: Shadonking on October 24, 2008, 06:56:11 pm
ok for those that may also want to help this is the error i keep getting, is it the same as you Satoh.

(http://img207.imageshack.us/img207/6404/errorjd8.png)

it cant seem to find what the final level it for the actor. help :plz:
Title: Re: I really wanted to get by without help but.... oh well...
Post by: Satoh on October 24, 2008, 07:00:11 pm
yep... gotten that more than a few times.... eventually I commented actor.final_level out and wrote 99 in front of it... that only served to give me a different error though....
Title: Re: I really wanted to get by without help but.... oh well...
Post by: ozoke on October 24, 2008, 09:01:46 pm
Edit. nvm just read the script my suggestion wouldnt work
Title: Re: I really wanted to get by without help but.... oh well...
Post by: Blizzard on October 25, 2008, 06:14:56 am
You need 2 more conditions. Replace the condition in b_abs_exp_display with this one:

actor.battler != nil && !actor.battler.dead? && actor.battler.level < actor.battler.final_level


The array BlizzABS.player.actors does not contain the party members but the characters on the map. I would, in fact, suggest that you change the whole part since you don't need to access the characters on the map but the actors.

    $game_party.actors.each {|actor|
      if actor.level != actor.final_level && !actor.cant_get_exp?
        actor.damage = exp_result(enemy).to_i
        # display text
        actor.damage_pop = true
      end}
Title: Re: I really wanted to get by without help but.... oh well...
Post by: Shadonking on October 25, 2008, 12:54:59 pm
i still cant get it to work, it might be the way im putting in the changes. could you place the changes in the script and post it for us. thanks
Title: Re: I really wanted to get by without help but.... oh well...
Post by: Blizzard on October 25, 2008, 03:18:13 pm
LOL! I found another problem, Satoh forgot to carry over the enemy parameter into the b_abs_exp_display method. xD Try this here:

#=============================================================================
# * EXP Notifier for BlizzABS
#=============================================================================
# ** Display EXP
#-----------------------------------------------------------------------------
class Game_System
  def b_abs_exp_display(enemy) #this script should use damage_pop to display gained EXP
    $game_party.actors.each {|actor|
      if actor.level != actor.final_level && !actor.cant_get_exp?
        actor.damage = exp_result(enemy).to_i
        # display text
        actor.damage_pop = true
      end}
  end

#-----------------------------------------------------------------------------
# ** Removal of enemy call addition
#-----------------------------------------------------------------------------
  alias satoh_remove_enemy_mod remove_enemy
  def remove_enemy(enemy)
    satoh_remove_enemy_mod(enemy)
    b_abs_exp_display(enemy)
  end
end
Title: Re: I really wanted to get by without help but.... oh well...
Post by: Satoh on October 25, 2008, 04:10:46 pm
Haha... forgive me I'm still a noob....

I'll try it out now, sorry to keep relying on you all... but then I suppose it gets you all extra credit, ne?


Script 'EXP_Notifier_ABS' line 9: NoMethodError occurred.

undefined method `final_level' for #<Game_Actor:0x3878158>


You were using it with blizzABS right?

This is annoying me now...
Title: Re: I really wanted to get by without help but.... oh well...
Post by: Blizzard on October 25, 2008, 04:55:54 pm
Right, Game_Actor doesn't have final_level defined. Instead of using "actor.final_level" use "$data_actors[actor.id].final_level". ^_^

Don't worry about it, we all live to learn. You can see me making mistakes all the time, don't you? ;)
Title: Re: I really wanted to get by without help but.... oh well...
Post by: Satoh on October 25, 2008, 05:40:32 pm
Ok, something is going wrong here....

the script DOES show the correct EXP upon enemy death.... however, for some reason the script quadruples the amount of exp added to each player... I'm still testing scenerios, it may be that its adding exp for each party member to every party member...

IE: 4 possible party members x 5 exp = 20 exp for all party members...

OR

it could just be multiplying it by four for some unknown reason...
Title: Re: I really wanted to get by without help but.... oh well...
Post by: Blizzard on October 25, 2008, 05:44:27 pm
Didn't your original script do that when changing exp_result? I think the problem is there. exp_result gets called too often. Try this:

  def b_abs_exp_display(enemy) #this script should use damage_pop to display gained EXP
    exp = exp_result(enemy).to_i
    $game_party.actors.each {|actor|
      if actor.level != actor.final_level && !actor.cant_get_exp?
        actor.damage = exp
        # display text
        actor.damage_pop = true
      end}
  end


You should maybe edit your original script not to use exp_result to add EXP but only to calculate it. Then again, I might be remembering it wrong.
Title: Re: I really wanted to get by without help but.... oh well...
Post by: Satoh on October 25, 2008, 06:26:56 pm
well, now it gives out 2x EXP while still displaying.

However... I was looking at the level-up script in BlizzABS and I think I should do something similar to that instead...

For the moment I'm gonna formulate several plans and run around in lazy circles ranting about pancakes...