Jump to content
New account registrations are disabed. This website is now an archive. Read more here.
  • 0
mb777

need some help bluemagic script

Question

hi guys im new here.

 

this problem its making mi head blow up , i dotn know at all the language of scripting, so please can you help me with this? i just downloaded this bluemagic (mog) script and it worked very good, the party members learned the spells and all, but just 1 problem and it fucked all

 

when monster cast spells to themselves (Heals, buffs, etc) the game crashes and this error show up

 

post-23002-0-41280000-1339646001_thumb.png

 

and here is the script

 

 

#_______________________________________________________________________________

# MOG_Blue Magic V1.3

#_______________________________________________________________________________

# By Moghunter

# http://www.atelier-rgss.com

#_______________________________________________________________________________

# Permite que os personagens aprendam as magias dos inimigos.

# Para definir quais magias serão aprendidas devemos criar um

# atributo com o nome de "Blue Skill" e atribuir à habilidade

# desejada, e após isso criar uma classe com o nome de "Blue Mage"

# e atribuí-lo aos personagens que poderão aprender as magias.

#_______________________________________________________________________________

module MOG

#Nome da classe que poderá aprender as magias.

CLASS_LEARN = "Blue Mage"

#Nome do atributo do banco do dados.(Skills que poderão ser

#aprendidas)

ELE_LEARN = "Blue Skill"

#Texto apresentado quando se aprende a Magia.

TEXT_LEARN = "Learned"

#Definição do som quando se aprende a Magia.

SE_LEARN = "086-Action01"

end

#===============================================================================

# Scene_Battle

#===============================================================================

class Scene_Battle

#--------------------------------------------------------------------------

# Update Status

#--------------------------------------------------------------------------

alias mog55_update_phase4_step6 update_phase4_step6

def update_phase4_step6

if @active_battler.is_a?(Game_Enemy) and @active_battler.current_action.kind == 1

for tr in @target_battlers

if not tr.dead?

learn_skill(tr,@active_battler.current_action.skill_id)

end

end

end

mog55_update_phase4_step6

end

#--------------------------------------------------------------------------

# learn_skill

#--------------------------------------------------------------------------

def learn_skill(tr, skill_id)

unless tr.skill_learn?(skill_id)

if @skill.element_set.include?($data_system.elements.index(MOG::ELE_LEARN)) and

tr.class_name == MOG::CLASS_LEARN

tr.learn_skill(skill_id)

tr.damage = MOG::TEXT_LEARN

tr.damage_pop = true

Audio.se_play("Audio/SE/" + MOG::SE_LEARN, 100, 100) rescue nil

end

return true

end

return false

end

end

$mog_rgss_Blue_Magic = true

 

what i can do to fix it :( ?

Share this post


Link to post
Share on other sites

6 answers to this question

Recommended Posts

  • 0

Looks like the author didn't account for the fact that enemies can use skills on themselves (as you know)

 

Tell me if this works for you:

#_______________________________________________________________________________
# MOG_Blue Magic V1.3            
#_______________________________________________________________________________
# By Moghunter            
# http://www.atelier-rgss.com
#_______________________________________________________________________________
# Permite que os personagens aprendam as magias dos inimigos.
# Para definir quais magias serão aprendidas devemos criar um
# atributo com o nome de "Blue Skill" e atribuir à habilidade
# desejada, e após isso criar uma classe com o nome de "Blue Mage"
# e atribuí-lo aos personagens que poderão aprender as magias.
#_______________________________________________________________________________
module MOG
 #Nome da classe que poderá aprender as magias.  
 CLASS_LEARN = "Blue Mage"  
 #Nome do atributo do banco do dados.(Skills que poderão ser
 #aprendidas)
 ELE_LEARN = "Blue Skill"
 #Texto apresentado quando se aprende a Magia.
 TEXT_LEARN = "Learned"
 #Definição do som quando se aprende a Magia.
 SE_LEARN = "056-Right02"
end
#===============================================================================
# Scene_Battle
#===============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
# Update Status
#--------------------------------------------------------------------------  
 alias mog55_update_phase4_step6 update_phase4_step6 
 def update_phase4_step6
   if @active_battler.is_a?(Game_Enemy) and @active_battler.current_action.kind == 1
     for tr in @target_battlers  
       next if tr.is_a?(Game_Enemy)
       if not tr.dead?
         learn_skill(tr,@active_battler.current_action.skill_id)
       end
     end
   end    
 mog55_update_phase4_step6  
 end  
#--------------------------------------------------------------------------
# learn_skill
#--------------------------------------------------------------------------  
 def learn_skill(tr, skill_id)
   unless tr.skill_learn?(skill_id)
     if @skill.element_set.include?($data_system.elements.index(MOG::ELE_LEARN)) and
       tr.class_name == MOG::CLASS_LEARN
       tr.learn_skill(skill_id)
       tr.damage = MOG::TEXT_LEARN
       tr.damage_pop = true
       Audio.se_play("Audio/SE/" + MOG::SE_LEARN, 100, 100) rescue nil    
     end
   return true
   end
 return false
 end  
end  
$mog_rgss_Blue_Magic = true

 

* Note: It probably looks nearly identical to the existing code, which is because all I added was one line, to skip attempts for allowing an enemy to learn a skill

Share this post


Link to post
Share on other sites
  • 0

Also he should probably use a code wrap around any source code as its easier to look at and copy.

Share this post


Link to post
Share on other sites
  • 0

Hmmm, to be honest I hadn't tested the script. So I just tested it, and it *seems* to work for me.

 

Did you replace your script with mine or just add mine in there (so you have both scripts)?

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...