• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Garbage data is being written to trainers.txt; what is "T_mAfmAEmA"?

Mugendai

Glitchologist
  • 11
    Posts
    13
    Years
    • Seen Apr 17, 2014
    Upon trying to create a new trainer using Pokemon Essentials' automated process, Derxwna and I get the following error:

    ---------------------------
    Touhoumon Faith & Prayer Version 1.8
    ---------------------------
    Exception: RuntimeError Message: Undefined item constant name: T_MAFMAEMA Name must consist only of letters, numbers, and underscores and can't begin with a number. Make sure the item is defined in PBS/items.txt. File PBS/trainers.txt, line 6 DIGLETT,10,T_mAfmAEmA,T_mAfmAEmA,T_mAfmAEmA,T_mAfmAEmA,T_mAfmAEmA,,0 Compiler:924:in `pbGetConst' Compiler:932:in `parseItem' Compiler:1412:in
    `pbCompileTrainers' Compiler:1398:in `each' Compiler:1398:in `pbCompileTrainers' Compiler:1375:in `loop' Compiler:1477:in `pbCompileTrainers' Compiler:3965:in `pbCompileAllData' Compiler:4083 This exception was logged in C:\Users\Owner\Saved Games/Touhoumon Faith _ Prayer Version 1_8/errorlog.txt. Press Ctrl+C to copy this message to the clipboard.
    ---------------------------
    OK
    ---------------------------
    Upon examination of the trainers.txt file, we see stuff like:

    Code:
    #-------------------
    CAMPER
    Liam
    2
    DIGLETT,10,T_mAfmAEmA,T_mAfmAEmA,T_mAfmAEmA,T_mAfmAEmA,T_mAfmAEmA,,0
    BONSLY,11,T_mAfmAEmA,T_mAfmAEmA,T_mAfmAEmA,T_mAfmAEmA,T_mAfmAEmA,,0
    #-------------------
    LEADER_Brock
    Brock
    2,FULLRESTORE,FULLRESTORE
    GEODUDE,12,T_mAfmAEmA,DEFENSECURL,HEADSMASH,ROCKPOLISH,ROCKTHROW,0,0,,,,20
    ONIX,14,SITRUSBERRY,HEADSMASH,ROCKTHROW,RAGE,ROCKTOMB,0,0,,true,,20,,Rocky
    #-------------------
    YOUNGSTER
    Ben
    2
    RATTATA,11,T_mAfmAEmA,T_mAfmAEmA,T_mAfmAEmA,T_mAfmAEmA,T_mAfmAEmA
    EKANS,11,T_mAfmAEmA,T_mAfmAEmA,T_mAfmAEmA,T_mAfmAEmA,T_mAfmAEmA
    #-------------------
    CAMPER
    Jeff
    2
    SPEAROW,16,T_mAfmAEmA,T_mAfmAEmA,T_mAfmAEmA,T_mAfmAEmA,T_mAfmAEmA
    SENTRET,16,T_mAfmAEmA,T_mAfmAEmA,T_mAfmAEmA,T_mAfmAEmA,T_mAfmAEmA
    when it should look like:

    Code:
    #-------------------
    CAMPER
    Liam
    2
    DIGLETT,10
    BONSLY,11
    #-------------------
    LEADER_Brock
    Brock
    2,FULLRESTORE,FULLRESTORE
    GEODUDE,12,,DEFENSECURL,HEADSMASH,ROCKPOLISH,ROCKTHROW,0,0,,,,20
    ONIX,14,SITRUSBERRY,HEADSMASH,ROCKTHROW,RAGE,ROCKTOMB,0,0,,true,,20,,Rocky,,19
    #-------------------
    YOUNGSTER
    Ben
    2
    RATTATA,11
    EKANS,11
    #-------------------
    CAMPER
    Jeff
    2
    SPEAROW,16
    SENTRET,16
    I've searched through all of the files and scripts for "T_mAfmAEmA", but I only found it in the trainers.txt file after it has been corrupted, so it is kind of mysterious.
     

    Derxwna Kapsyla

    Derxwna "The Badman" Kapsyla
  • 437
    Posts
    12
    Years
    Like I told Mugendai recently, my assumption is that it has to do with the scripts. The problem is, I really don't want to go replacing over 600 lines of code on an unsure guess, a procedure which'd take hours to do (given my attention span), I only want to touch the scripts on a guarantee that I screwed something up when porting over (Which I likely did)
     

    Nickalooose

    --------------------
  • 1,309
    Posts
    16
    Years
    • Seen Dec 28, 2023
    Other than the fact you may have edited the editor scripts... There is nothing else that could be wrong... Check:
    Code:
    def pbSaveTrainerBattles()
      data=load_data("Data/trainers.dat") rescue nil
      return if !data
      File.open("PBS/trainers.txt","wb"){|f|
         f.write("\# "+_INTL("See the documentation on the wiki to learn how to edit this file."))
         f.write("\r\n")
         for trainer in data
           trname=getConstantName(PBTrainers,trainer[0]) rescue pbGetTrainerConst(trainer[0]) rescue nil
           next if !trname
           f.write("\#-------------------\r\n")
           f.write(sprintf("%s\r\n",trname))
           trainername=trainer[1] ? trainer[1].gsub(/,/,";") : "???"
           if trainer[4]==0
             f.write(sprintf("%s\r\n",trainername))
           else
             f.write(sprintf("%s,%d\r\n",trainername,trainer[4]))
           end
           f.write(sprintf("%d",trainer[3].length))
           for i in 0...8
             itemname=getConstantName(PBItems,trainer[2][i]) rescue pbGetItemConst(trainer[2][i]) rescue nil
             f.write(sprintf(",%s",itemname)) if trainer[2][i]
           end
           f.write("\r\n")
           for poke in trainer[3]
             maxindex=0
             towrite=[]
             thistemp=getConstantName(PBSpecies,poke[TPSPECIES]) rescue pbGetSpeciesConst(poke[TPSPECIES]) rescue ""
             towrite[TPSPECIES]=thistemp
             towrite[TPLEVEL]=poke[TPLEVEL].to_s
             thistemp=getConstantName(PBItems,poke[TPITEM]) rescue pbGetItemConst(poke[TPITEM]) rescue ""
             towrite[TPITEM]=thistemp
             thistemp=getConstantName(PBMoves,poke[TPMOVE1]) rescue pbGetMoveConst(poke[TPMOVE1]) rescue ""
             towrite[TPMOVE1]=thistemp
             thistemp=getConstantName(PBMoves,poke[TPMOVE2]) rescue pbGetMoveConst(poke[TPMOVE2]) rescue ""
             towrite[TPMOVE2]=thistemp
             thistemp=getConstantName(PBMoves,poke[TPMOVE3]) rescue pbGetMoveConst(poke[TPMOVE3]) rescue ""
             towrite[TPMOVE3]=thistemp
             thistemp=getConstantName(PBMoves,poke[TPMOVE4]) rescue pbGetMoveConst(poke[TPMOVE4]) rescue ""
             towrite[TPMOVE4]=thistemp
             towrite[TPABILITY]=(poke[TPABILITY] ? poke[TPABILITY].to_s : "")
             towrite[TPGENDER]=(poke[TPGENDER] ? poke[TPGENDER].to_s : "")
             towrite[TPFORM]=(poke[TPFORM] && poke[TPFORM]!=TPDEFAULTS[TPFORM] ? poke[TPFORM].to_s : "")
             towrite[TPSHINY]=(poke[TPSHINY] ? "true" : "")
             towrite[TPNATURE]=(poke[TPNATURE] ? getConstantName(PBNatures,poke[TPNATURE]) : "")
             towrite[TPIV]=(poke[TPIV] && poke[TPIV]!=TPDEFAULTS[TPIV] ? poke[TPIV].to_s : "")
             towrite[TPHAPPINESS]=(poke[TPHAPPINESS] && poke[TPHAPPINESS]!=TPDEFAULTS[TPHAPPINESS] ? poke[TPHAPPINESS].to_s : "")
             towrite[TPNAME]=(poke[TPNAME] ? poke[TPNAME] : "")
             towrite[TPSHADOW]=(poke[TPSHADOW] ? "true" : "")
             towrite[TPBALL]=(poke[TPBALL] && poke[TPBALL]!=TPDEFAULTS[TPBALL] ? poke[TPBALL].to_s : "")
             for i in 0...towrite.length
               towrite[i]="" if !towrite[i]
               maxindex=i if towrite[i] && towrite[i]!=""
             end
             for i in 0..maxindex
               f.write(",") if i>0
               f.write(towrite[i])
             end
             f.write("\r\n")
           end
         end
      }
    end
    Or overwrite yours or don't... Whatever, that's the only place I can see a problem being, but that's where I would look anyway
     
    Back
    Top