Skip to content

afputils render w/MGA #98

@Zoft123

Description

@Zoft123

Just wanted to report some errors I've encountered when trying to use the render functionality of afputils with Metal Gear Arcade's AFP files in-case you're actively trying to find/fix any reported errors with Bemaniutils.

I will include both the error message + the respective AFP file.

First Error Example:

Info:
afp_training.afp  - training_beta - 1360x768 - 4285 frames
Command used: 
./afputils render  -s --path training_beta --output ./afp/training_beta.gif ./afp/afp_training.afp  
Calculating render parameters...
WARNING: training_beta imports fontset.FONTmarugosSL32P but that SWF is not in our library!
WARNING: training_beta imports fontset.FONTmarugosS32P but that SWF is not in our library!
WARNING: training_beta imports fontset.FONTmgaType3SC36P but that SWF is not in our library!
WARNING: training_beta imports fontset.FONTmarugosSC32PM but that SWF is not in our library!
WARNING: training_beta imports aplib.aplib but that SWF is not in our library!
WARNING: training_beta imports eManager.eManager but that SWF is not in our library!
WARNING: Unhandled opcode 23: GET_MEMBER with stack [<bemani.format.afp.render.Global object at 0x7f6babcb8a30>, 'org_path']
WARNING: Unhandled opcode 24: IF, Comparison: IS NOT UNDEFINED, Offset To Jump To If True: 36 with stack [<bemani.format.afp.render.Global object at 0x7f6babcb8a30>, 'org_path']
WARNING: Tried to set attribute org_path on <bemani.format.afp.render.Global object at 0x7f6babcb8a30> to ../../ but that attribute doesn't exist!
WARNING: Unhandled opcode 41: GET_MEMBER with stack [<bemani.format.afp.render.Global object at 0x7f6babcb8a30>, 'org_path', <bemani.format.afp.render.Global object at 0x7f6babcb8a30>, 'aplib']
WARNING: Unhandled opcode 42: IF, Comparison: IS NOT UNDEFINED, Offset To Jump To If True: 84 with stack [<bemani.format.afp.render.Global object at 0x7f6babcb8a30>, 'org_path', <bemani.format.afp.render.Global object at 0x7f6babcb8a30>, 'aplib']
WARNING: Tried to set attribute aplib on <bemani.format.afp.render.Global object at 0x7f6babcb8a30> to UNDEFINED but that attribute doesn't exist!
WARNING: Tried to call afp_prop_init() on UNDEFINED but that method doesn't exist!
WARNING: Tried to call afp_prop_debug(False) on UNDEFINED but that method doesn't exist!
WARNING: Unhandled opcode 89: GET_MEMBER with stack [<bemani.format.afp.render.Global object at 0x7f6babcb8a30>, 'org_path', <bemani.format.afp.render.Global object at 0x7f6babcb8a30>, 'aplib', <bemani.format.afp.render.Global object at 0x7f6babcb8a30>, 'eManager']
WARNING: Unhandled opcode 90: IF, Comparison: IS NOT UNDEFINED, Offset To Jump To If True: 103 with stack [<bemani.format.afp.render.Global object at 0x7f6babcb8a30>, 'org_path', <bemani.format.afp.render.Global object at 0x7f6babcb8a30>, 'aplib', <bemani.format.afp.render.Global object at 0x7f6babcb8a30>, 'eManager']
WARNING: Tried to set attribute eManager on <bemani.format.afp.render.Global object at 0x7f6babcb8a30> to UNDEFINED but that attribute doesn't exist!
WARNING: Tried to set attribute training_path on <bemani.format.afp.render.Global object at 0x7f6babcb8a30> to xml/training.xml but that attribute doesn't exist!
WARNING: Tried to set attribute training on <bemani.format.afp.render.Global object at 0x7f6babcb8a30> to None but that attribute doesn't exist!
WARNING: Unhandled opcode 31: GET_MEMBER with stack [UNDEFINED, 't_txt']
WARNING: Tried to set attribute text on t_txt to CHAPTER but that attribute doesn't exist!
WARNING: Unhandled opcode 48: GET_MEMBER with stack [UNDEFINED, UNDEFINED, 't_txt']
WARNING: Tried to set attribute autoSize on t_txt to left but that attribute doesn't exist!
WARNING: Unhandled opcode 65: GET_MEMBER with stack [UNDEFINED, UNDEFINED, UNDEFINED, 't_txt']
WARNING: Tried to set attribute text on t_txt to  but that attribute doesn't exist!
WARNING: Unhandled opcode 82: GET_MEMBER with stack [UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, 't_txt']
WARNING: Tried to set attribute autoSize on t_txt to right but that attribute doesn't exist!
WARNING: Unhandled opcode 99: GET_MEMBER with stack [UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, 't_txt']
WARNING: Tried to set attribute text on t_txt to フリートレーニング  but that attribute doesn't exist!
WARNING: Unhandled opcode 116: GET_MEMBER with stack [UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, 't_txt']
WARNING: Tried to set attribute autoSize on t_txt to left but that attribute doesn't exist!
WARNING: Unhandled opcode 133: GET_MEMBER with stack [UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, 't_txt']
WARNING: Tried to set attribute text on t_txt to  but that attribute doesn't exist!
WARNING: Unhandled opcode 150: GET_MEMBER with stack [UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, UNDEFINED, 't_txt']
WARNING: Tried to set attribute autoSize on t_txt to left but that attribute doesn't exist!
WARNING: Requested sound Battle02.wav be played but we don't support sound yet!
WARNING: Unhandled opcode 6: STOP with stack []
WARNING: Unhandled opcode 12: DEFINE_LOCAL with stack ['step_flg', 0]
WARNING: Unsupported non-rectangle shape!
WARNING: Unsupported non-rectangle shape!
WARNING: Unsupported non-rectangle shape!
WARNING: Unsupported non-rectangle shape!
WARNING: Unsupported non-rectangle shape!
WARNING: Unsupported non-rectangle shape!
Rendered animation frame 1/4285.
Rendered animation frame 2/4285.
WARNING: Unhandled opcode 25: GET_MEMBER with stack [<bemani.format.afp.render.Global object at 0x7f6baabeff70>, 'training', UNDEFINED, <bemani.format.afp.render.Global object at 0x7f6baabeff70>, 'training_path']
WARNING: Unhandled opcode 26: ADD2 with stack [<bemani.format.afp.render.Global object at 0x7f6baabeff70>, 'training', UNDEFINED, <bemani.format.afp.render.Global object at 0x7f6baabeff70>, 'training_path']
WARNING: Tried to call afp_prop('training', 'rw', 'training_path') on UNDEFINED but that method doesn't exist!
Traceback (most recent call last):
  File "/etc/share/apps/bemaniutils/./afputils", line 12, in <module>
    runpy.run_module(f"bemani.utils.{name}", run_name="__main__")
  File "/usr/lib/python3.10/runpy.py", line 227, in run_module
    return _run_code(code, {}, init_globals, run_name, mod_spec)
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/etc/share/apps/bemaniutils/bemani/utils/afputils.py", line 1394, in <module>
    sys.exit(main())
  File "/etc/share/apps/bemaniutils/bemani/utils/afputils.py", line 1366, in main
    return render_path(
  File "/etc/share/apps/bemaniutils/bemani/utils/afputils.py", line 843, in render_path
    for i, img in enumerate(
  File "/etc/share/apps/bemaniutils/bemani/format/afp/render.py", line 755, in render_path
    yield from self.__render(
  File "/etc/share/apps/bemaniutils/bemani/format/afp/render.py", line 2108, in __render
    changed = self.__process_tags(root_clip, False)
  File "/etc/share/apps/bemaniutils/bemani/format/afp/render.py", line 1846, in __process_tags
    new_clip, clip_changed = self.__place(tag, clip, prefix=prefix)
  File "/etc/share/apps/bemaniutils/bemani/format/afp/render.py", line 1309, in __place
    self.__execute_bytecode(tag.bytecode, operating_clip, prefix=prefix + "      ")
  File "/etc/share/apps/bemaniutils/bemani/format/afp/render.py", line 867, in __execute_bytecode
    if not hasattr(obj, attribute):
TypeError: hasattr(): attribute name must be string

Second Error Example:

Info:
afp_demo.afp  - mga_title_coin - 1360x768 - 6 frames
Command Used:
./afputils render -s --path mga_title_coin --output ./afp/mga_title_coin.gif ./afp/afp_demo.afp
Traceback (most recent call last):
  File "/etc/share/apps/bemaniutils/./afputils", line 12, in <module>
    runpy.run_module(f"bemani.utils.{name}", run_name="__main__")
  File "/usr/lib/python3.10/runpy.py", line 227, in run_module
    return _run_code(code, {}, init_globals, run_name, mod_spec)
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/etc/share/apps/bemaniutils/bemani/utils/afputils.py", line 1394, in <module>
    sys.exit(main())
  File "/etc/share/apps/bemaniutils/bemani/utils/afputils.py", line 1366, in main
    return render_path(
  File "/etc/share/apps/bemaniutils/bemani/utils/afputils.py", line 843, in render_path
    for i, img in enumerate(
  File "/etc/share/apps/bemaniutils/bemani/format/afp/render.py", line 755, in render_path
    yield from self.__render(
  File "/etc/share/apps/bemaniutils/bemani/format/afp/render.py", line 2108, in __render
    changed = self.__process_tags(root_clip, False)
  File "/etc/share/apps/bemaniutils/bemani/format/afp/render.py", line 1846, in __process_tags
    new_clip, clip_changed = self.__place(tag, clip, prefix=prefix)
  File "/etc/share/apps/bemaniutils/bemani/format/afp/render.py", line 1309, in __place
    self.__execute_bytecode(tag.bytecode, operating_clip, prefix=prefix + "      ")
  File "/etc/share/apps/bemaniutils/bemani/format/afp/render.py", line 867, in __execute_bytecode
    if not hasattr(obj, attribute):
TypeError: hasattr(): attribute name must be string

Third Error Example:

Info:
afp_gameover.afp - gmo_LOGO - 1240x300 - 297 frames
Command Used:
./afputils render -s --path gmo_LOGO --output ./afp/gmo_LOGO.gif ./afp/afp_gameover.afp
Loading textures, shapes and animation instructions...
Calculating render parameters...
WARNING: Place object tag referencing 12 includes unparsed options and might not display properly!
WARNING: Unhandled DEFINE_FONT tag!
Traceback (most recent call last):
  File "/etc/share/apps/bemaniutils/./afputils", line 12, in <module>
    runpy.run_module(f"bemani.utils.{name}", run_name="__main__")
  File "/usr/lib/python3.10/runpy.py", line 227, in run_module
    return _run_code(code, {}, init_globals, run_name, mod_spec)
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/etc/share/apps/bemaniutils/bemani/utils/afputils.py", line 1394, in <module>
    sys.exit(main())
  File "/etc/share/apps/bemaniutils/bemani/utils/afputils.py", line 1366, in main
    return render_path(
  File "/etc/share/apps/bemaniutils/bemani/utils/afputils.py", line 843, in render_path
    for i, img in enumerate(
  File "/etc/share/apps/bemaniutils/bemani/format/afp/render.py", line 755, in render_path
    yield from self.__render(
  File "/etc/share/apps/bemaniutils/bemani/format/afp/render.py", line 2108, in __render
    changed = self.__process_tags(root_clip, False)
  File "/etc/share/apps/bemaniutils/bemani/format/afp/render.py", line 1846, in __process_tags
    new_clip, clip_changed = self.__place(tag, clip, prefix=prefix)
  File "/etc/share/apps/bemaniutils/bemani/format/afp/render.py", line 1347, in __place
    raise Exception(f"Failed to process tag: {tag}")
Exception: Failed to process tag: <bemani.format.afp.swf.AP2DefineTextTag object at 0x7f9821ab69b0>

Fourth Error Example:

Info:
afp_battle-start.afp - battle-start-TDM - 1360x768 - 5 frames
Command Used:
./afputils render -s --path battle-start-TDM --output ./afp/battle-start-TDM.png ./afp/afp_battle-start.afp
Loading textures, shapes and animation instructions...
Calculating render parameters...
WARNING: battle-start-TDM imports aplib.aplib but that SWF is not in our library!
WARNING: battle-start-TDM imports mgalib.mgalib but that SWF is not in our library!
WARNING: battle-start-TDM imports eManager.eManager but that SWF is not in our library!
WARNING: battle-start-TDM imports fontset.FONTmgaType3SC36P but that SWF is not in our library!
WARNING: battle-start-TDM imports fontset.FONTmarugosS32P but that SWF is not in our library!
WARNING: Unhandled DEFINE_FONT tag!
Traceback (most recent call last):
  File "/etc/share/apps/bemaniutils/./afputils", line 12, in <module>
    runpy.run_module(f"bemani.utils.{name}", run_name="__main__")
  File "/usr/lib/python3.10/runpy.py", line 227, in run_module
    return _run_code(code, {}, init_globals, run_name, mod_spec)
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/etc/share/apps/bemaniutils/bemani/utils/afputils.py", line 1394, in <module>
    sys.exit(main())
  File "/etc/share/apps/bemaniutils/bemani/utils/afputils.py", line 1366, in main
    return render_path(
  File "/etc/share/apps/bemaniutils/bemani/utils/afputils.py", line 890, in render_path
    for i, img in enumerate(
  File "/etc/share/apps/bemaniutils/bemani/format/afp/render.py", line 755, in render_path
    yield from self.__render(
  File "/etc/share/apps/bemaniutils/bemani/format/afp/render.py", line 2108, in __render
    changed = self.__process_tags(root_clip, False)
  File "/etc/share/apps/bemaniutils/bemani/format/afp/render.py", line 1846, in __process_tags
    new_clip, clip_changed = self.__place(tag, clip, prefix=prefix)
  File "/etc/share/apps/bemaniutils/bemani/format/afp/render.py", line 1347, in __place
    raise Exception(f"Failed to process tag: {tag}")
Exception: Failed to process tag: <bemani.format.afp.swf.AP2DefineTextTag object at 0x7fad1e38ac80>

I had to put the afp files in a .zip to be able to attach.
afp.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions