AAI 2 Script research

Discuss topics that are unrelated to Ace Attorney Online, introduce yourself if you're new and read the latest Member of the Month interview.

Moderators: EN - Assistant Moderators, EN - Forum Moderators

Post Reply
User avatar
henke37
Security expert / tools programmer
Posts: 3031
Joined: Wed Mar 04, 2009 9:42 pm
Gender: Male
Spoken languages: Swedish,English
Location: Sweden
Contact:

AAI 2 Script research

Post by henke37 »

It sure has been some time since I dropped by here... Anyway!

I am currently trying to reverse engineer the script system used in Gyakuten Kenji 2 (more commonly known as Ace attorney Investigations 2). I have made some good progress, but I am no where near done yet.

I am looking for help in identifying control codes and their arguments. Anyone can help me here with just some basic deductive reasoning! It is nothing more than being able to link a number with an obvious behavior.

As an example of the script looks like, here is part of the intro to the first case in the game (from the fan translation):
Spoiler : Case gk2-1 intro :

Code: Select all

<scriptSection id="0">
  <loadScene scene="1"/>
  <revealEvidence evidence="252"/>
  <revealEvidence evidence="1"/>
  <unknownCommand commandType="e12b"/>
  <unknownCommand commandType="e15b"/>
  <unknown data="100"/>
  <unknown data="a8"/>
  <unknown data="0"/>
  <unknownCommand commandType="e177"/>
  <unknown data="1"/>
  <unknown data="1"/>
  <sceneChange a="0" b="0" c="4"/>
  <waitForSceneChange/>
  <music a="1" b="0" command="0xE172"/>
  <showTextWindow/>
  <speaker char="65535" nametag="BLANK"/>
  <center/>
  <textSpeed speed="10"/>
  <greenText/>
  March_25,_2:46_PM
  <br/>
  <center/>
  Gourd_Lake_Park
  <br/>
  <center/>
  Audience
  <whiteText/>
  <textSpeed speed="4"/>
  <ack/>
  <hideTextWindow/>
  <miniWalk command="0xE13A" char="0" x="256" y="166" d="0" e="1" f="1"/>
  <waitCharAnim char="0"/>
  <charAnim char="44" anim="25" command="0xE150"/>
  <syncCtrl enable="1"/>
  <charAnim char="44" anim="27" command="0xE150"/>
  <syncCtrl enable="0"/>
  <wait time="60"/>
  <showTextWindow/>
  <speaker char="0" nametag="Edgeworth"/>
  <textSpeed speed="3"/>
  (
  <textSpeed speed="8"/>
  ‥‥‥
  <textSpeed speed="3"/>
  Word_of_this_must_have
  <br/>
  reached_every_corner_of
  <br/>
  the_world_by_now‥)
  <ack/>
  <hideTextWindow/>
  <wait time="60"/>
  <unknownCommand commandType="e12b"/>
  <panCamera x="256" y="0" c="0" d="1" command="0xE141"/>
  <sceneChange a="1" b="1" c="2"/>
  <waitForSceneChange/>
  <loadScene scene="0"/>
  <setFlag flag="33"/>
  <charAnim char="1" anim="5" command="0xE150"/>
  <miniAnim char="44" anim="0" dir="1" command="0xE155"/>
  <unknownCommand commandType="e15b"/>
  <unknown data="100"/>
  <unknown data="c4"/>
  <unknown data="0"/>
  <panCamera x="256" y="136" c="0" d="1" command="0xE141"/>
  <sceneChange a="0" b="1" c="3"/>
  <waitForSceneChange/>
  <waitForCameraPan/>
  <wait time="30"/>
  <showTextWindow/>
  <speaker char="0" nametag="Edgeworth"/>
  <textSpeed speed="4"/>
  (An_assassination_attempt
  <br/>
  on_the_
  <orangeText/>
  President_
  <blueText/>
  of_the
  <br/>
  Republic_of_Zheng_Fa
  <textSpeed speed="8"/>
  ‥‥‥)
  <ack/>
  <hideTextWindow/>
  <sceneChange a="1" b="1" c="3"/>
  <waitForSceneChange/>
  <unknownCommand commandType="e14a"/>
  <unknown data="1"/>
  <unknown data="2"/>
  <unknown data="0"/>
  <unknownCommand commandType="e14a"/>
  <unknown data="2c"/>
  <unknown data="2"/>
  <unknown data="0"/>
  <unknownCommand commandType="e14a"/>
  <unknown data="2e"/>
  <unknown data="2"/>
  <unknown data="0"/>
  <unknownCommand commandType="e14a"/>
  <unknown data="32"/>
  <unknown data="2"/>
  <unknown data="0"/>
  <beginBustDisplay a="2" b="0"/>
  <fadeToGrayscale a="2" b="0"/>
  <unknownCommand commandType="e149"/>
  <addCharacter char="0" b="0" c="0" d="0" e="0" f="0"/>
  <waitForCharTween char="0"/>
  <sceneChange a="0" b="1" c="3"/>
  <waitForSceneChange/>
  <wait time="30"/>
  <unknownCommand commandType="e211"/>
  <unknown data="0"/>
  <showTextWindow/>
  <speaker char="65535" nametag="Edgeworth"/>
  <textSpeed speed="3"/>
  My_name_is_Miles_Edgeworth‥
  <wait time="6"/>
  <br/>
  I_am_a_prosecutor‥
  <ack/>
  <speaker char="65535" nametag="Edgeworth"/>
  I_was_asked_to_investigate
  <br/>
  this_grave_incident,_
  <wait time="8"/>
  but
  <br/>
  upon_my_arrival
  <textSpeed speed="8"/>
  ‥‥‥
  <ack/>
  <hideTextWindow/>
  <unknownCommand commandType="e211"/>
  <unknown data="1"/>
  <sceneChange a="1" b="1" c="3"/>
  <waitForSceneChange/>
  <fadeChar char="0" b="0" c="0"/>
  <waitForCharTween char="0"/>
  <unknownCommand commandType="e10f"/>
  <unknown data="2"/>
  <unknown data="0"/>
  <unknownCommand commandType="e12b"/>
  <unknownCommand commandType="e15b"/>
  <unknown data="100"/>
  <unknown data="b0"/>
  <unknown data="0"/>
  <fadeToGrayscale a="0" b="0"/>
  <unknownCommand commandType="e14a"/>
  <unknown data="1"/>
  <unknown data="0"/>
  <unknown data="0"/>
  <unknownCommand commandType="e14a"/>
  <unknown data="2c"/>
  <unknown data="0"/>
  <unknown data="0"/>
  <unknownCommand commandType="e14a"/>
  <unknown data="2e"/>
  <unknown data="0"/>
  <unknown data="0"/>
  <unknownCommand commandType="e14a"/>
  <unknown data="32"/>
  <unknown data="0"/>
  <unknown data="0"/>
  <unknownCommand commandType="e149"/>
  <sceneChange a="0" b="1" c="3"/>
  <waitForSceneChange/>
  <wait time="30"/>
  <charAnim char="44" anim="25" command="0xE150"/>
  <charAnim char="46" anim="26" command="0xE150"/>
  <wait time="30"/>
  <miniAnim char="1" anim="0" dir="4" command="0xE155"/>
  <wait time="4"/>
  <miniAnim char="1" anim="0" dir="3" command="0xE155"/>
  <wait time="40"/>
  <charAnim char="1" anim="24" command="0xE150"/>
  <showTextWindow/>
  <speaker char="65535" nametag="???"/>
  <textSpeed speed="2"/>
  <sound a="48" b="0"/>
  <stopMusic a="0"/>
  <flash/>
  Mr‥_Edgeworth!
  <ack/>
  <hideTextWindow/>
  <miniWalk command="0xE13C" char="1" b="256" c="207" d="0" e="2" f="1"/>
  <waitCharAnim char="1"/>
  <miniWalk command="0xE13C" char="1" b="256" c="379" d="0" e="2" f="1"/>
  <waitCharAnim char="1"/>
  <sceneChange a="1" b="1" c="2"/>
  <waitForSceneChange/>
  <loadScene scene="1"/>
  <unknownCommand commandType="e1b8"/>
  <unknown data="12"/>
  <unknown data="0"/>
  <unknownCommand commandType="e12a"/>
  <unknown data="0"/>
  <beginBustDisplay a="2" b="0"/>
  <sceneChange a="0" b="1" c="2"/>
  <music a="23" b="0" command="0xE172"/>
  <waitForSceneChange/>
  <addCharacter char="1" b="7" c="2" d="0" e="1" f="2"/>
  <waitForCharTween char="1"/>
  <showTextWindow/>
  <speaker char="1" nametag="???"/>
  <flashShakeAndSound sfx="Slash" command="0xE280"/>
  We”ve_been_waiting_for_you,_sir!
  <ack/>
  <hideTextWindow/>
  <fadeToGrayscale a="2" b="3"/>
  <unknownCommand commandType="e149"/>
  <wait time="30"/>
  <showTextWindow/>
  <speaker char="0" nametag="Edgeworth"/>
  <textSpeed speed="3"/>
  (This_man_is_Dick_Gumshoe‥)
  <ack/>
  (He”s_a_detective_with_the_local
  <br/>
  precinct_who_assists_me_on_all
  <br/>
  cases_under_my_jurisdiction‥)
  <ack/>
  <hideTextWindow/>
  <fadeToGrayscale a="0" b="3"/>
  <unknownCommand commandType="e149"/>
  <addCharacter char="0" b="1" c="1" d="1" e="0" f="2"/>
  <tweenChar char="1" b="3" c="2"/>
  <waitForCharTween char="0"/>
  <waitForCharTween char="1"/>
  <showTextWindow/>
  <speaker char="0" nametag="Edgeworth"/>
  What_is_the_President”s
  <br/>
  current_condition?
  <ack/>
  <speaker char="1" nametag="Gumshoe"/>
  <textSpeed speed="2"/>
  <screenShake strength="mild"/>
  I”m_still_not_sure,_sir!
  <ack/>
  <charAnim char="1" anim="1" command="0xE12F"/>
  <speaker char="1" nametag="Gumshoe"/>
  <textSpeed speed="3"/>
  The_paramedics_just_entered
  <br/>
  his_plane_a_few_moments_ago
  <textSpeed speed="8"/>
  ‥‥‥
  <ack/>
  <speaker char="0" nametag="Edgeworth"/>
  <textSpeed speed="4"/>
  I_see
  <textSpeed speed="8"/>
  ‥‥‥
  <textSpeed speed="3"/>
  <br/>
  (I_hope_it”s_nothing_too_serious
  <textSpeed speed="8"/>
  ‥‥‥)
  <ack/>
  <charAnim char="0" anim="0" command="0xE12F"/>
  <speaker char="0" nametag="Edgeworth"/>
  <textSpeed speed="3"/>
  Very_well,_Detective‥
  <wait time="12"/>
  _Please_show
  <br/>
  me_around_the_crime_scene‥
  <ack/>
  <charAnim char="1" anim="2" command="0xE12F"/>
  <speaker char="1" nametag="Gumshoe"/>
  <textSpeed speed="2"/>
  <flashShakeAndSound sfx="Slash" command="0xE280"/>
  Roger_that,_sir!
  <ack/>
  <hideTextWindow/>
  <unknownCommand commandType="e195"/>
  <unknown data="0"/>
  <unknownCommand commandType="e10f"/>
  <unknown data="0"/>
  <unknown data="3"/>
  <miniWalk command="0xE13A" char="0" x="256" y="124" d="0" e="1" f="1"/>
  <miniWalk command="0xE13A" char="1" x="245" y="87" d="0" e="1" f="1"/>
  <wait time="30"/>
  <showTextWindow/>
  <speaker char="65535" nametag="BLANK"/>
  <sound a="52" b="0"/>
  <stopMusic a="0"/>
  <screenShake strength="moderate"/>
  <flash/>
  Hey,_mister!
  <wait time="24"/>
  <br/>
  <screenShake strength="mild"/>
  Just_a_minute,
  <wait time="8"/>
  _I”m_beggin”_ya!
  <ack/>
  <hideTextWindow/>
  <unknownCommand commandType="e1b8"/>
  <unknown data="12"/>
  <unknown data="1"/>
  <charAnim char="18" anim="24" command="0xE150"/>
  <waitCharAnim char="18"/>
  <unknownCommand commandType="e1a8"/>
  <unknown data="12"/>
  <unknown data="1"/>
  <charAnim char="18" anim="25" command="0xE150"/>
  <waitCharAnim char="0"/>
  <waitCharAnim char="1"/>
  <miniAnim char="0" anim="0" dir="0" command="0xE155"/>
  <wait time="4"/>
  <miniAnim char="0" anim="0" dir="1" command="0xE155"/>
  <wait time="4"/>
  <miniAnim char="0" anim="0" dir="2" command="0xE155"/>
  <miniAnim char="1" anim="0" dir="1" command="0xE155"/>
  <wait time="4"/>
  <miniAnim char="1" anim="0" dir="2" command="0xE155"/>
  <wait time="4"/>
  <miniAnim char="1" anim="0" dir="3" command="0xE155"/>
  <waitCharAnim char="18"/>
  <showTextWindow/>
  <speaker char="0" nametag="Edgeworth"/>
  <textSpeed speed="3"/>
  <sound a="47" b="0"/>
  <flash/>
  (Hm?
  <wait time="24"/>
  _What”s_this?)
  <ack/>
  <hideTextWindow/>
  <unknownCommand commandType="e1a8"/>
  <unknown data="12"/>
  <unknown data="2"/>
  <charAnim char="18" anim="26" command="0xE150"/>
  <waitCharAnim char="18"/>
  <charAnim char="18" anim="27" command="0xE150"/>
  <showTextWindow/>
  <hideTextWindow/>
  <showTextWindow/>
  <speaker char="65535" nametag="???"/>
  <textSpeed speed="3"/>
  Mister!_
  <wait time="16"/>
  Yer_the_prosecutor_in
  <br/>
  charge_”round_these_parts,
  <wait time="8"/>
  _right?
  <ack/>
  <speaker char="65535" nametag="???"/>
  Can_I_ask_you_a_little
  <br/>
  <textSpeed speed="2"/>
  <screenShake strength="mild"/>
  somethin”_real_quick?
  <ack/>
  <charAnim char="0" anim="40" command="0xE150"/>
  <speaker char="0" nametag="Edgeworth"/>
  <textSpeed speed="3"/>
  <sound a="48" b="0"/>
  <flash/>
  I”m_afraid_I_must_refrain
  <br/>
  from_commenting_for_now‥
  <wait time="16"/>
  <br/>
  <textSpeed speed="2"/>
  <miniAnim char="0" anim="0" dir="0" command="0xE155"/>
  Let”s_go,
  <wait time="8"/>
  _
  <screenShake strength="mild"/>
  Detective!
  <ack/>
  <hideTextWindow/>
  <waitCharAnim char="18"/>
  <charAnim char="0" anim="2" command="0xE150"/>
  <charAnim char="1" anim="3" command="0xE150"/>
  <miniWalk command="0xE13A" char="0" x="256" y="-32" d="0" e="1" f="1"/>
  <wait time="10"/>
  <miniWalk command="0xE13F" char="1" b="10" x="234" y="87" e="0" f="1" g="1"/>
  <waitCharAnim char="1"/>
  <miniAnim char="1" anim="0" dir="2" command="0xE155"/>
  <wait time="30"/>
  <miniAnim char="1" anim="0" dir="1" command="0xE155"/>
  <wait time="80"/>
  <charAnim char="18" anim="31" command="0xE150"/>
  <showTextWindow/>
  <speaker char="65535" nametag="???"/>
  <textSpeed speed="3"/>
  <screenShake strength="mild"/>
  Hey!_Wait!
  <wait time="16"/>
  _
  <textSpeed speed="2"/>
  <screenShake strength="mild"/>
  Mr‥_Prosecutor!
  <ack/>
  <miniAnim char="1" anim="0" dir="0" command="0xE155"/>
  <speaker char="1" nametag="Gumshoe"/>
  <textSpeed speed="4"/>
  H-
  <wait time="8"/>
  Hold_on,_
  <wait time="8"/>
  <textSpeed speed="2"/>
  <flashShakeAndSound sfx="Slash" command="0xE280"/>
  Mr‥_Edgeworth!
  <wait time="16"/>
  <br/>
  Wait_for_me,_sir!
  <ack/>
  <hideTextWindow/>
  <miniWalk command="0xE13C" char="1" b="245" c="-32" d="0" e="2" f="1"/>
  <wait time="10"/>
  <sceneChange a="1" b="1" c="2"/>
  <waitForSceneChange/>
  <setFlag flag="34"/>
  <setFlag flag="35"/>
  <setFlag flag="128"/>
  <longJump case="0" part="0" index="2"/>
</scriptSection>
Nothing too scary right?

If you are interested then just install the tool I wrote (it needs the AIR runtime) and use it to unpack the script from the game. From then you just need to cross reference the gameplay with the script, looking for things I haven't figured out yet.

Just reply in this topic if you figure anything out. And I mean anything, even something as trivial as an argument in an already known command that I haven't figured out yet.
Currently working on a redesign of Court-records.net.
Phantom

Re: AAI 2 Script research

Post by Phantom »

Court records will suit your needs better than anyone here could.
Post Reply