• Do not use Discord to host any images you post, these links expire quickly! You can learn how to add images to your posts here.
  • Eevee Expo's webhost has been having technical issues since Nov. 20th and you might be unable to connect to our site. Staff are also facing issues connecting, so please send a DM to Cat on-site or through Discord directly for faster service!
Resource icon

Resource [v16/v17/v18/v19/v20/v21] Cable Club 3.7

MakerBlack

Trainer
Member
Joined
Nov 23, 2020
Posts
88
Hello trainers, it's me again! I use EBDX in Essentials v21 and I share problems and solutions that I suffered here. (I don't know if this error repeats itself without EBDX). After several tests I realized that there were problems with UTF-8 encoding when there were special characters in the Trainer and Pokémon names, so here is the solution:
In module CableClub in the method def self.parse_pkmn(record) in the line
Code:
Expand Collapse Copy
pkmn.name = record.str
Replace with:
Ruby:
Expand Collapse Copy
pkmn.name = (record.str).force_encoding(Encoding::UTF_8)

I also decided to do the same when sending information from pkmn.owner.name with:
Code:
Expand Collapse Copy
pkmn.owner.name = (record.str).force_encoding(Encoding::UTF_8)

I suffered the same error regarding the enemy trainer's name, so to fix this, in the class CableClubScreen in the method
def await_partner(connection):
Code:
Expand Collapse Copy
@partner_name = (record.str).force_encoding(Encoding::UTF_8)

After that, everything here seemed to work normally again, if you If you have any thoughts on this, they are welcome!
 

MakerBlack

Trainer
Member
Joined
Nov 23, 2020
Posts
88
Hello, how are you trainers? Vendily, a report, on the python server POKEMON_MAX_NAME_SIZE is set to 10. But there are already Pokemon with names bigger than that.
Corviknight, Slither Wing, Roaring Moon are examples of this.
Hope this helps!
 

MakerBlack

Trainer
Member
Joined
Nov 23, 2020
Posts
88
Hello, in version 21 the level adjustment is not working as it should, because the
LevelAdjustment class received a change in the variables
BothTeams is now BOTH_TEAMS and you would need to add the level recalculator again in self.do_battle.

We are getting better and better!
 

HyruleWarrior

Rookie
Member
Joined
Jan 12, 2025
Posts
2
Could you please provide the code to enter in the self.do_battle function to recalculate the level? I am experiencing the same issue. Thank you!


Hello, in version 21 the level adjustment is not working as it should, because the
LevelAdjustment class received a change in the variables
BothTeams is now BOTH_TEAMS and you would need to add the level recalculator again in self.do_battle.

We are getting better and better!
 

MakerBlack

Trainer
Member
Joined
Nov 23, 2020
Posts
88
Could you please provide the code to enter in the self.do_battle function to recalculate the level? I am experiencing the same issue. Thank you!
Hello! I made a quick adjustment as follows:
First, I saved the levels in oldlevels and then applied the level in:
battle_rules.adjustLevels(player_party, partner_party), then returned the levels in: battle_rules.unadjustLevels(player_party,partner_party,oldlevels)

But I'm still facing some problems, like the logic of returning Pokémon items for battles where the player, when choosing his team, selects the first, second, third out of the sequence of $player.party. Soon I should post here the way I solved this problem.

Ruby:
Expand Collapse Copy
def self.do_battle(connection, client_id, seed, battle_rules, player_party, partner, partner_party)
    $player.heal_party # Avoids having to transmit damaged state.
    partner_party.each{|pkmn| pkmn.heal} # back to back battles desync without it.
    oldlevels = battle_rules.adjustLevels(player_party, partner_party)
    olditems  = player_party.transform { |p| p.item_id }
    olditems2 = partner_party.transform { |p| p.item_id }
    if !DISABLE_SKETCH_ONLINE
      oldmoves  = player_party.transform { |p| p.moves.dup }
      oldmoves2 = partner_party.transform { |p| p.moves.dup }
    end
    if PluginManager.installed?("Terastal Phenomenon") ||
       PluginManager.installed?("[DBK] Terastallization")
      old_tera = $player.tera_charged?
      $player.tera_charged = true
    end
    scene = BattleCreationHelperMethods.create_battle_scene
    battle = Battle_CableClub.new(connection, client_id, scene, player_party, partner_party, partner, seed)
    battle.items = []
    battle.internalBattle = false
    battle_rules.applyBattleRules(battle)
    battle_rules.adjustLevels(player_party, partner_party)
    trainerbgm = pbGetTrainerBattleBGM(partner)
    EventHandlers.trigger(:on_start_battle)
    # XXX: Configuring Online Battle Rules
    setBattleRule("environment", :None)
    setBattleRule("weather", :None)
    setBattleRule("terrain", :None)
    setBattleRule("backdrop", "indoor1")
    BattleCreationHelperMethods.prepare_battle(battle)
    $game_temp.clear_battle_rules
    battle.time = 0
    exc = nil
    outcome = 0
    pbBattleAnimation(trainerbgm, (battle.singleBattle?) ? 1 : 3, [partner]) {
      pbSceneStandby {
        begin
          outcome = battle.pbStartBattle
        rescue Connection::Disconnected
          scene.pbEndBattle(0)
          exc = $!
        ensure
          battle_rules.unadjustLevels(player_party, partner_party, oldlevels)
          if PluginManager.installed?("Terastal Phenomenon") ||
             PluginManager.installed?("[DBK] Terastallization")
            $player.tera_charged = old_tera
          end
          player_party.each_with_index do |pkmn, i|
            pkmn.heal
            pkmn.makeUnmega
            pkmn.makeUnprimal
            pkmn.item = olditems[i]
            if !DISABLE_SKETCH_ONLINE
              pkmn.moves.clear
              oldmoves[i].each_with_index {|move,i| pkmn.moves[i]=move}
            end
            pkmn.unmax if PluginManager.installed?("ZUD Mechanics")
            if PluginManager.installed?("[DBK] Dynamax")
               if pkmn.dynamax?
                 pkmn.makeUndynamaxForm
                 pkmn.makeUndynamax
                 pkmn.calc_stats
               end
            end
            if PluginManager.installed?("Terastal Phenomenon") ||
               PluginManager.installed?("[DBK] Terastallization")
              pkmn.terastallized = false if pkmn&.tera?
            end
          end
          partner_party.each_with_index do |pkmn, i|
            pkmn.heal
            pkmn.makeUnmega
            pkmn.makeUnprimal
            pkmn.item = olditems2[i]
            if !DISABLE_SKETCH_ONLINE
              pkmn.moves.clear
              oldmoves2[i].each_with_index {|move,i| pkmn.moves[i]=move}
            end
            pkmn.unmax if PluginManager.installed?("ZUD Mechanics")
            if PluginManager.installed?("[DBK] Dynamax")
               if pkmn.dynamax?
                 pkmn.makeUndynamaxForm
                 pkmn.makeUndynamax
                 pkmn.calc_stats
               end
            end
            if PluginManager.installed?("Terastal Phenomenon") ||
               PluginManager.installed?("[DBK] Terastallization")
              pkmn.terastallized = false if pkmn&.tera?
            end
          end
        end
      }
    }
    raise exc if exc
    case outcome
    when 1
      $stats.online_battles_wins+=1
    when 2
      $stats.online_battles_lost+=1
    end
  end
 

HyruleWarrior

Rookie
Member
Joined
Jan 12, 2025
Posts
2
The code you provided works perfectly for me. Thank you so much for your help!




Hello! I made a quick adjustment as follows:
First, I saved the levels in oldlevels and then applied the level in:
battle_rules.adjustLevels(player_party, partner_party), then returned the levels in: battle_rules.unadjustLevels(player_party,partner_party,oldlevels)

But I'm still facing some problems, like the logic of returning Pokémon items for battles where the player, when choosing his team, selects the first, second, third out of the sequence of $player.party. Soon I should post here the way I solved this problem.

Ruby:
Expand Collapse Copy
def self.do_battle(connection, client_id, seed, battle_rules, player_party, partner, partner_party)
    $player.heal_party # Avoids having to transmit damaged state.
    partner_party.each{|pkmn| pkmn.heal} # back to back battles desync without it.
    oldlevels = battle_rules.adjustLevels(player_party, partner_party)
    olditems  = player_party.transform { |p| p.item_id }
    olditems2 = partner_party.transform { |p| p.item_id }
    if !DISABLE_SKETCH_ONLINE
      oldmoves  = player_party.transform { |p| p.moves.dup }
      oldmoves2 = partner_party.transform { |p| p.moves.dup }
    end
    if PluginManager.installed?("Terastal Phenomenon") ||
       PluginManager.installed?("[DBK] Terastallization")
      old_tera = $player.tera_charged?
      $player.tera_charged = true
    end
    scene = BattleCreationHelperMethods.create_battle_scene
    battle = Battle_CableClub.new(connection, client_id, scene, player_party, partner_party, partner, seed)
    battle.items = []
    battle.internalBattle = false
    battle_rules.applyBattleRules(battle)
    battle_rules.adjustLevels(player_party, partner_party)
    trainerbgm = pbGetTrainerBattleBGM(partner)
    EventHandlers.trigger(:on_start_battle)
    # XXX: Configuring Online Battle Rules
    setBattleRule("environment", :None)
    setBattleRule("weather", :None)
    setBattleRule("terrain", :None)
    setBattleRule("backdrop", "indoor1")
    BattleCreationHelperMethods.prepare_battle(battle)
    $game_temp.clear_battle_rules
    battle.time = 0
    exc = nil
    outcome = 0
    pbBattleAnimation(trainerbgm, (battle.singleBattle?) ? 1 : 3, [partner]) {
      pbSceneStandby {
        begin
          outcome = battle.pbStartBattle
        rescue Connection::Disconnected
          scene.pbEndBattle(0)
          exc = $!
        ensure
          battle_rules.unadjustLevels(player_party, partner_party, oldlevels)
          if PluginManager.installed?("Terastal Phenomenon") ||
             PluginManager.installed?("[DBK] Terastallization")
            $player.tera_charged = old_tera
          end
          player_party.each_with_index do |pkmn, i|
            pkmn.heal
            pkmn.makeUnmega
            pkmn.makeUnprimal
            pkmn.item = olditems[i]
            if !DISABLE_SKETCH_ONLINE
              pkmn.moves.clear
              oldmoves[i].each_with_index {|move,i| pkmn.moves[i]=move}
            end
            pkmn.unmax if PluginManager.installed?("ZUD Mechanics")
            if PluginManager.installed?("[DBK] Dynamax")
               if pkmn.dynamax?
                 pkmn.makeUndynamaxForm
                 pkmn.makeUndynamax
                 pkmn.calc_stats
               end
            end
            if PluginManager.installed?("Terastal Phenomenon") ||
               PluginManager.installed?("[DBK] Terastallization")
              pkmn.terastallized = false if pkmn&.tera?
            end
          end
          partner_party.each_with_index do |pkmn, i|
            pkmn.heal
            pkmn.makeUnmega
            pkmn.makeUnprimal
            pkmn.item = olditems2[i]
            if !DISABLE_SKETCH_ONLINE
              pkmn.moves.clear
              oldmoves2[i].each_with_index {|move,i| pkmn.moves[i]=move}
            end
            pkmn.unmax if PluginManager.installed?("ZUD Mechanics")
            if PluginManager.installed?("[DBK] Dynamax")
               if pkmn.dynamax?
                 pkmn.makeUndynamaxForm
                 pkmn.makeUndynamax
                 pkmn.calc_stats
               end
            end
            if PluginManager.installed?("Terastal Phenomenon") ||
               PluginManager.installed?("[DBK] Terastallization")
              pkmn.terastallized = false if pkmn&.tera?
            end
          end
        end
      }
    }
    raise exc if exc
    case outcome
    when 1
      $stats.online_battles_wins+=1
    when 2
      $stats.online_battles_lost+=1
    end
  end
 
Back
Top