Dual Destinies - Return To Cross-Examination ; Tutorial

Find detailed help from the AAO community, or write your own tutorials.

Moderator: EN - Forum Moderators

Post Reply
fanfreak247
Posts: 51
Joined: Sun Jun 12, 2016 1:45 am
Gender: Male
Spoken languages: English, Limited Spanish, Patois/Patwa
Location: Anywhere you are

Dual Destinies - Return To Cross-Examination ; Tutorial

Post by fanfreak247 »

In Phoenix Wright: Ace Attorney Dual Destines (i have only played a demo of the iOS version tbh) or at least in my experience, when you
lose all of your HP during your cross-examination, you would go back to the cross-examination you were at before you lost. Now, AAO provides
you with a feature that allows you to save. But now in cross-examination and with a little bit of coding, it's not necessary! I'm going to show you how!
NOTE: This is my first time writing a tutorial. My wording may be really bad. I'd really appreciate criticism (no matter how bad) and maybe suggestions to improve. I will provide images to try and make things easier.
If you would like to see a video of it in action, click here
If you would like to see the actual trial where it is performed, check it out and try it here
If you would like to look at the trial in the editor in its entirety look here
(Don't worry, editing it will not do anything.)
Now let's get into the tutorial!
STEP 1: Create the Game Over Sequence
Spoiler : :
This doesn't really have to be your first step. In fact, when I created the test trial it was the last thing I did. But this is obviously a necessity. Just make sure this is done.
In the image below, there's a frame with the "Would You Like to Try Again" and that's going to be where the magic happens. Of course, I will get to them later.
Image
Don't forget to also set the Game Over redirection sooner or later. Also, I'm going to assume that you have already created your Failure Conversations. So that you can lose health obviously.
STEP 2: Define your variables
Spoiler : :
You now have to define variables near the actual cross-examination sequence. I recommend doing it at the frame with the cross-examination pop-up. Give your variable a name that will remind you what the variable represents when you view the same frame later, such as testimonyNumber. Set the value of the variable to 1.
Image
Image
Image
STEP 3: Actual Coding
Spoiler : :
Now here comes the fun part (sarcasm). If you know how to use variables to created a press-all to continue cross-examination, this is going to be easier. But, I'm going to try my best to explain it if your new anyways.
1. After the "Would You Like to Try Again" frame (I mentioned it in Step 1), create another frame after it. If the player selects No, make it goto frame 0 (which will just end the game entirely) and if they select Yes make it go to the frame that you created. (Frame # on the top left for those who are fairly new to the editor.)
2. Now here is where what you did in Step 2 is going to be put into good use. I'm going to attempt to explain what I think the editor does while teaching how to do it. Let's proceed.
EDIT: On the next frame after the "Would You Like To Try Again" frame, set the action to Set player's health points or Increase player's health points that way you won't have to do it later. Then set action to Evaluate conditions to redirect the player and then create 1 more frame after it. If we assume that we named our variables via the # and we have only 3 testimonies in the trial, then in the Expressions to test box, insert testimony1 + testimony2 + testimony3 = 1.
Now you may be a little confused as to why we are making 3 variables equate to 1. Allow me to explain. When you lose during a cross-examination, a variable is already set. So if it's our first cross-examination, testimony1 will be defined but nothing else will. When it evaluates the conditions, it's going to ignore the other 2 variables (that being testimony2 and testimony3) since it wasn't already defined. Since all of our variables are set to the value 1, the expression to test now becomes testimony1 = 1 which it does, so it will go to the frame we set it (which we'll get to later.) Let's say your in the second cross-examination, and you lose. When you go here, testimony1 and testimony 2 will be defined. testimony1 and 2 are both set to the value of one. Since testimony3 wasn't defined, the expression becomes testimony1 + testimony2 = 1. But wait a second, 1 + 1 = 2 and NOT 1. It will then proceed to the failure frame which we will set later.
Here is an example, pay attention only to the expression to test box for now.
Image
EDIT; This image is outdated, you should have the Healing Health frame first and then the Evaluate Conditions. Eveything else should fall be self-explanatory.
3. We have that completed, but we have 1 empty frame. What do we do with that?
Now on that, click Set Action, and put Proceed to Another Frame, you should then return to where your cross-examination is.
It should look a little something like this:
Image
EDIT; This image is outdated, you should have the Healing Health frame first and then the Evaluate Conditions. Eveything else should fall be self-explanatory.
4. Now in your Evaluate Conditions to Redirect the Player frame, set the Target Frame #ID to the frame afterwards.
5. Now we have it for the first cross-examination, but what now? Now, we are going to do the exact same thing but with very small variations.
After your first Proceed to another frame frame, you are going to create 2 more empty frames. The first being Evaluate Conditions to redirect the player. Now instead of testimony1 + testimony2 + testimony3 = 1, we make it testimony1 + testimony2 + testimony3 = 2. One number higher. Set the Target Frame #ID to the frame afterwards. Then you set the next frame afterwards to Proceed to Another Frame to the second cross-examination. Now, we must go back. In the first Evaluate Conditions to Redirect the Player, set the Failure Frame #ID to the frame of the second Evaluate Conditions to Redirect the Player. Keep repeating the process with 3 and even 4 sets of these frames until all of your cross-examinations are completed.
Once your finished with everything, there should be a box on each of the frames with Wait for. Set that to 1. That way, it will do all this as fast as it possibly can. Or if I'm wrong, 1 milliseconds to be more precise. Also make sure to playtest this just to make sure yoi didn't miss any steps.
Well, that concludes this tutorial. Thank You for reading. If there's something you don't understand about this, want me to personally implement it in your trial, or want to give feedback, just respond to this thread or don't be afraid to PM me. I hope you guys all will be able to enjoy and implement this in your trial, and possibly learn something from this. Happy Trial Making!
-fanfreak247

Step 2 and 3 Alternative!
Spoiler : :
This time. it's much simpler! It's little variations that make a big difference.
In each cross-examination, you only need to define the same variable but with different values.
Image
Image
Than, after your "Would You Like to Try Again" Frame, set action to Set Player's Health Points or Increase Player's Health Points to 120 and set the wait time to 1.
After that, set another frame after it with Test an expression's value. Set expression to test to Variables and set for the values, set it to the values you put for the specific cross-examination.
Add as many "Add accepted values" as necessary!
Image
Hope this makes things better!
Last edited by fanfreak247 on Mon Aug 22, 2016 7:52 pm, edited 3 times in total.
User avatar
Enthalpy
Community Manager
Posts: 5169
Joined: Wed Jan 04, 2012 4:40 am
Gender: Male
Spoken languages: English, limited Spanish

Re: Dual Destinies - Return To Cross-Examination ; Tutorial

Post by Enthalpy »

Good idea for a tutorial, but the execution needs improvement:
  • Creating a separate variable for each testimony is overcomplicated. Create a single variable, and instead of letting it be 0 or 1 (boolean), let it contain an integer or string. Instead of "Evaluate Conditions to Redirect the Player," use "Test an expression's value," setting checks for each possible value.
  • Set health between asking the player if they want to restart and checking the value of that variable. This way, you only need to set health once, and you don't need to bother with these "proceed directly to frame" actions.
  • Keep your tutorials concise. Trim irrelevancies and redundancies, both in your sample case and your tutorial. I can give examples if necessary.
I'll post more detailed thoughts once those issues are fixed.
[D]isordered speech is not so much injury to the lips that give it forth, as to the disproportion and incoherence of things in themselves, so negligently expressed. ~ Ben Jonson
fanfreak247
Posts: 51
Joined: Sun Jun 12, 2016 1:45 am
Gender: Male
Spoken languages: English, Limited Spanish, Patois/Patwa
Location: Anywhere you are

Re: Dual Destinies - Return To Cross-Examination ; Tutorial

Post by fanfreak247 »

Enthalpy wrote:Good idea for a tutorial, but the execution needs improvement:
  • Creating a separate variable for each testimony is overcomplicated. Create a single variable, and instead of letting it be 0 or 1 (boolean), let it contain an integer or string. Instead of "Evaluate Conditions to Redirect the Player," use "Test an expression's value," setting checks for each possible value.
  • Set health between asking the player if they want to restart and checking the value of that variable. This way, you only need to set health once, and you don't need to bother with these "proceed directly to frame" actions.
  • Keep your tutorials concise. Trim irrelevancies and redundancies, both in your sample case and your tutorial. I can give examples if necessary.
I'll post more detailed thoughts once those issues are fixed.
I'll get out of my comfort zone and try those. I'm not very familiar with it and I just got creative and thought of something. The idea of setting the health first is something I wouldn'tve have thought of. I'll edit my tutorial once I get the time. Thank you for the feedback. I'm not very familiar with the terms your using so examples would be appreciated. I would edit my tutorial accordingly.
-fanfreak247
User avatar
Enthalpy
Community Manager
Posts: 5169
Joined: Wed Jan 04, 2012 4:40 am
Gender: Male
Spoken languages: English, limited Spanish

Re: Dual Destinies - Return To Cross-Examination ; Tutorial

Post by Enthalpy »

Use Test an expression's value when you need to check the same expression for different values. Use Evaluate Conditions to Redirect the Player when you need to check multiple different conditions. Any Test an expression's value can be written as a Evaluate Conditions to Redirect the Player, but it's clearer to write as a Test an expression's value.

Irrelevancy = Words that give unimportant information
Redundancy = Words that can be removed without losing any information

So paragraphs like
fanfreak247 wrote:Forget what I said before, this is the easiest part of the entire thing. You have to define variables near the actual cross-examination sequence. I recommend doing it right at the frame with the cross-examination pop-up. It makes things really easy. You can name the variable anything, but any programmer knows to name their variables something easy to remember and identify so that they don't get confused later. So let's just call them 'testimony[insert # of cross-examination here] Also make sure to set the value of the variable to 1.
become
Enthalpy wrote:You now have to define variables near the actual cross-examination sequence. I recommend doing it at the frame with the cross-examination pop-up. Give your variable a name that will remind you what the variable represents when you view the same frame later, such as testimonyNumber. Set the value of the variable to 1.
Let me know if anything is unclear!
[D]isordered speech is not so much injury to the lips that give it forth, as to the disproportion and incoherence of things in themselves, so negligently expressed. ~ Ben Jonson
fanfreak247
Posts: 51
Joined: Sun Jun 12, 2016 1:45 am
Gender: Male
Spoken languages: English, Limited Spanish, Patois/Patwa
Location: Anywhere you are

Re: Dual Destinies - Return To Cross-Examination ; Tutorial

Post by fanfreak247 »

Enthalpy wrote:Use Test an expression's value when you need to check the same expression for different values. Use Evaluate Conditions to Redirect the Player when you need to check multiple different conditions. Any Test an expression's value can be written as a Evaluate Conditions to Redirect the Player, but it's clearer to write as a Test an expression's value.

Irrelevancy = Words that give unimportant information
Redundancy = Words that can be removed without losing any information

So paragraphs like
fanfreak247 wrote:Forget what I said before, this is the easiest part of the entire thing. You have to define variables near the actual cross-examination sequence. I recommend doing it right at the frame with the cross-examination pop-up. It makes things really easy. You can name the variable anything, but any programmer knows to name their variables something easy to remember and identify so that they don't get confused later. So let's just call them 'testimony[insert # of cross-examination here] Also make sure to set the value of the variable to 1.
become
Enthalpy wrote:You now have to define variables near the actual cross-examination sequence. I recommend doing it at the frame with the cross-examination pop-up. Give your variable a name that will remind you what the variable represents when you view the same frame later, such as testimonyNumber. Set the value of the variable to 1.
Let me know if anything is unclear!
I don't exactly understand how to use the test an expression's value. I might want to read one of your tutorials on it since I read your variables one. Your completely right about the Irrelevancy and redundancy. Sooner or later Ill edit it and to make it bettter. If you could explain how the test an expression's value works and maybe how to implement it in here, it would be great for the people who read it here and maybe for me to add it as an alternative to this tutorial. Thanks a bunch :)
-fanfreak247
User avatar
Enthalpy
Community Manager
Posts: 5169
Joined: Wed Jan 04, 2012 4:40 am
Gender: Male
Spoken languages: English, limited Spanish

Re: Dual Destinies - Return To Cross-Examination ; Tutorial

Post by Enthalpy »

I think you're overcomplicating this. Set "type of object to test" to variable, put the name of the variable to test in the box marked "name of the variable to test," and everything else is just as self-explanatory. Do you have a specific question?
[D]isordered speech is not so much injury to the lips that give it forth, as to the disproportion and incoherence of things in themselves, so negligently expressed. ~ Ben Jonson
fanfreak247
Posts: 51
Joined: Sun Jun 12, 2016 1:45 am
Gender: Male
Spoken languages: English, Limited Spanish, Patois/Patwa
Location: Anywhere you are

Re: Dual Destinies - Return To Cross-Examination ; Tutorial

Post by fanfreak247 »

Enthalpy wrote:I think you're overcomplicating this. Set "type of object to test" to variable, put the name of the variable to test in the box marked "name of the variable to test," and everything else is just as self-explanatory. Do you have a specific question?
Oh my gosh, I actually took a look at the editor (EDIT) and I thought I understood everything. I don't understand how exactly I can use it. I'm thinking that in the accepted values box, if I do 1, it will go to the target frame ID but what about the others?
-fanfreak247
User avatar
Enthalpy
Community Manager
Posts: 5169
Joined: Wed Jan 04, 2012 4:40 am
Gender: Male
Spoken languages: English, limited Spanish

Re: Dual Destinies - Return To Cross-Examination ; Tutorial

Post by Enthalpy »

You change the value of the variable depending on the redirect destination and then check for each possible value. For example, you could let the value be 1, 2, 3, 4, 5, etc., or maybe the more descriptive 'ce1', 'ce2', 'ce3', 'accuse_suspect', 'ce4', etc.
[D]isordered speech is not so much injury to the lips that give it forth, as to the disproportion and incoherence of things in themselves, so negligently expressed. ~ Ben Jonson
Post Reply