Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

ZTBS Battle System Error

Hello everyone! I like different battle system, so I chose Mac's translated Tactical Battle System. But when I use it, the actor phase is perfect, then
the enemy phase and an error message pops up.
Error Message: Script 'ZTBS Battle AI' Line 174: NoMethodError occured.
undefined method 'each' for nil:NilClass.
:evil: grrr.
Here;s Line 174:
Code:
for action in self.actions
Why is this error popping up? It seems when it comes to scripts I'm error prone:rage01: And I can't really continue my game because the battle system is THE battle system. Can somebody please help???
 

Mac

Member

You know you could have just posted on my thread to get quicker attention ^_^

Anway you need to make sure that your ZTBS Battle AI is exactly like this:-

Code:
#==============================================================================
# Zenith Tactical Battle System 
# Event Turn
#------------------------------------------------------------------------------
# This calls upon Common Events for each turn to initialise music.
#==============================================================================
class Scene_Map
  def turn_event
    case $game_map.map_id
#==============================================================================
# ↓↓Battler Turn Set Up↓↓
#==============================================================================
#------------------------------------------------------------------------------
# when Map ID
#   return {Start=> Common Event ID, ...}
#------------------------------------------------------------------------------
#
#   What this does is it defines what happens on the turns of the enemy and
#   the actor in this case it plays music for each side.
#
#   O - This is the start off event so basically if you want something to happen
#   before every battle, you must create a common event and assign it to that
#   common events ID e.g. as below (0=>4)
#
#   Player Turn - This is the players turn as you would have guessed so put 
#   whatever music you would like to play in a common event and tell it to be
#   assigned to that common event ID in this case 2
#
#   Enemy Turn - This is the enemies turn as you would have guessed so put 
#   whatever music you would like to play in a common event and tell it to be
#   assigned to that common event ID in this case 3
#
#==============================================================================
# Common Event Turn Assignment
#==============================================================================

  when 1  # When Map ID
    return {0=>4, "Player Turn"=>2, "Enemy Turn"=>3}

#==============================================================================
# In other cases return with nothing
#==============================================================================
    else
      return {}
    end
  end
  #--------------------------------------------------------------------------
  # ● Battle Event Basis - Let me describe this one actually
  #--------------------------------------------------------------------------
  
  #--------------------------------------------------------------------------
  # This event is activated as the battle is starting up the before hand music
  #--------------------------------------------------------------------------
  def set_turn_event
    common_event = []
    if turn_event.keys.include?("Player Turn") and
       $game_system.tactics_turn != 0
      common_event += $data_common_events[turn_event["Player Turn"]].list
    end
  #--------------------------------------------------------------------------
  # This event is activated as the players take their turn
  #--------------------------------------------------------------------------
    if turn_event.keys.include?("Player Turn") and
       $game_system.tactics_phase == 1
      common_event += $data_common_events[turn_event["Player Turn"]].list
    end
  #--------------------------------------------------------------------------
  # This event is activated as the enemies take their turn
  #--------------------------------------------------------------------------
    if turn_event.keys.include?("Enemy Turn") and
       $game_system.tactics_phase == 2
      common_event += $data_common_events[turn_event["Enemy Turn"]].list
    end
    event_id = turn_event[$game_system.tactics_turn]
    if event_id != nil
      common_event += $data_common_events[event_id].list
    end
    if common_event.size > 0
      $game_system.map_interpreter.setup(common_event, 0)
    end
  end
end

Any wrong changes to it will mess up the battle turns, try replacing it with that, if that doesn't work, zip me a demo and send me it and i will sort it.
 

coco

Member

ah,i´ve resolved my problem,it was in the class script^^
I´ve forgot to put an level in the monster^^
Thanks for the help
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top