Page 1 of 2

Question for my mobile game project 1

Posted: Fri Apr 14, 2017 4:25 am
by davidsibya08
Hi sir Tony! I hope your having a great day!

I am here again for some questions I really been doing hardly and got no progress yet even though I did everything I could.
I know the best way to get answer and solution is through you.

Please take note that I am developing in android platform. Here are my questions:

1. I am using The Menu Framework's you gave earlier in my post. Is it possible to add another panels? I wanted to add a panel like Achievements Menu and Book Of Knowledge Menu (basically, it is a dictionary which information can be added once you completed a certain task). How would I do that?

2. If that number one is possible, can you help me have a quick guide where I could get a tutorial on making Achievement Menu mainly using Dialogue System and the Menu Framework? Like, using the dialogue I can set an Achievement 'Achieved'.

3. How can I use a UI Button to open the Pause Menu? Because in the Menu Framework it uses a key Escape.

4. How can I make an object checkpoint that saves the current state of the game when triggered by the player?

5. In the game I'm developing, I really got hard time detecting my player health. I have another set of code from a tutorial regarding with the Health bar and now my problem is to detect that the player is dead and restart the game from its last checkpoint/saved game.

6. Can you help me start a conversation using a UI Button, I know I asked this before but I'm just gonna ask it again. In my attempt on doing your instructions, it turns out that the button is triggering the same conversation over and over from all my NPCs. I have at least 6 NPC in my main village, so when the button appears it triggers the other conversation I've got. I tried to duplicate buttons to trigger the NPCs conversation and it worked but it just doesn't seem so right to use many buttons. My game is using a analog joystick at the bottom left, so when I walked on the NPC, the button that should be clicked to trigger the conversation appears and just when I released the other which is joystick button it already trigger the conversation.

7. Can you give advise or tips in developing and an educational RPG in mobile platform? This not compulsory. haha

8. I wish you could create a lot of tutorial using the Dialogue System for Unity in a mobile platform. It would really be great especially for students like me.

I hope you are not annoyed with me, you really helped me a lot. I will always credit you on my works. Thank you very sir Tony! Your amazing. :)

Re: Question for my mobile game project 1

Posted: Fri Apr 14, 2017 10:23 am
by Tony Li
Hi,
davidsibya08 wrote:1. I am using The Menu Framework's you gave earlier in my post. Is it possible to add another panels? I wanted to add a panel like Achievements Menu and Book Of Knowledge Menu (basically, it is a dictionary which information can be added once you completed a certain task). How would I do that?
Examine how the Options Panel is set up. Add a similar panel. (In fact, you could duplicate the Options Panel and remove all the Options-specific components.)

Then add a button to the Pause Panel, and configure it similarly to the Options button, except call your new panel's SelectablePanel.Open method.

Add UI elements to hold your dictionary info.

If you copy your panel from Options, it will have a SelectablePanel component. This component has an OnOpen() event. You will need to write a method that sets up your panel with the dictionary of information. Then call this method in the OnOpen() event.
davidsibya08 wrote:2. If that number one is possible, can you help me have a quick guide where I could get a tutorial on making Achievement Menu mainly using Dialogue System and the Menu Framework? Like, using the dialogue I can set an Achievement 'Achieved'.
Same way as above:

1. Copy Options Panel.
2. Remove any Options-specific components.
3. Add UI elements for your achievements.
4. Use the OnOpen() event to activate the achievements that the player has earned.
5. Add a button to the Panel Panel that opens your achievements panel.

The Dialogue System doesn't have a built-in achievements system (remember, it's mainly a conversation system). You'll have to provide your own achievements code.
davidsibya08 wrote:3. How can I use a UI Button to open the Pause Menu? Because in the Menu Framework it uses a key Escape.
Hook up the UI Button's OnClick() event to the Pause Panel's SelectablePanel.Open method.
davidsibya08 wrote:4. How can I make an object checkpoint that saves the current state of the game when triggered by the player?
Add a script with a method like this:

Code: Select all

void OnTriggerEnter(Collider other) {
    if (other.CompareTag("Player")) {
        FindObjectOfType<SaveHelper>().QuickSave();
    }
}
davidsibya08 wrote:5. In the game I'm developing, I really got hard time detecting my player health. I have another set of code from a tutorial regarding with the Health bar and now my problem is to detect that the player is dead and restart the game from its last checkpoint/saved game.
When you detect that the player is dead, you can restart the game with this line of code:

Code: Select all

FindObjectOfType<SaveHelper>().QuickLoad();
davidsibya08 wrote:6. Can you help me start a conversation using a UI Button, I know I asked this before but I'm just gonna ask it again. In my attempt on doing your instructions, it turns out that the button is triggering the same conversation over and over from all my NPCs. I have at least 6 NPC in my main village, so when the button appears it triggers the other conversation I've got. I tried to duplicate buttons to trigger the NPCs conversation and it worked but it just doesn't seem so right to use many buttons. My game is using a analog joystick at the bottom left, so when I walked on the NPC, the button that should be clicked to trigger the conversation appears and just when I released the other which is joystick button it already trigger the conversation.
You can use the Proximity Selector component. Tick the Enable Touch checkbox.

Add a Conversation Trigger to each NPC, and set the trigger to OnUse.
davidsibya08 wrote:7. Can you give advise or tips in developing and an educational RPG in mobile platform? This not compulsory. haha
Just take it slowly, one thing at a time. Rome was not built in a day. :-)
davidsibya08 wrote:8. I wish you could create a lot of tutorial using the Dialogue System for Unity in a mobile platform. It would really be great especially for students like me.
I'm planning a new set of video tutorials. (The old ones need updating.) I'll try to keep mobile in mind, too, and mention mobile-specific tips when I think of them.

Re: Question for my mobile game project 1

Posted: Fri Apr 14, 2017 12:01 pm
by davidsibya08
Wow! Hahaha. That just cleared my mind. I just got some few additional and clarification questions sir.

I already set the UI Button's OnClick() event on UI Component ShowPanels.ShowPausePanel and it really worked fine when I play it on the gameplay. But when I start it on a Main Menu and load the gameplay it doesn't work anymore. My button is from another Canvas and not included in the UI Prefab Canvas provided by you.

So I think I am planning to add an HUD to the UI Prefab (Menu Framework) that can be seen immediately when it detected that the scene is a gameplay. But, how is that possible?

With the Proximity Selector, I can trigger the event by clicking the Fire1 (which is equivalent to touch). But my problem is, when I release my touch on my joystick button it immediately triggers the event. And if i modify the Touch Area. How would I set it on a left corner of the screen?

Re: Question for my mobile game project 1

Posted: Fri Apr 14, 2017 12:01 pm
by davidsibya08
Thank you for your response sir Tony! :)

Re: Question for my mobile game project 1

Posted: Fri Apr 14, 2017 1:06 pm
by Tony Li
davidsibya08 wrote:I already set the UI Button's OnClick() event on UI Component ShowPanels.ShowPausePanel and it really worked fine when I play it on the gameplay. But when I start it on a Main Menu and load the gameplay it doesn't work anymore. My button is from another Canvas and not included in the UI Prefab Canvas provided by you.

So I think I am planning to add an HUD to the UI Prefab (Menu Framework) that can be seen immediately when it detected that the scene is a gameplay. But, how is that possible?
You may just need to put your custom panel on the same level as the Options panel. Notice that the Options panel is not a child of the Pause panel. This allows the main menu scene to show the Options panel even if the Pause panel is inactive.
davidsibya08 wrote:With the Proximity Selector, I can trigger the event by clicking the Fire1 (which is equivalent to touch). But my problem is, when I release my touch on my joystick button it immediately triggers the event. And if i modify the Touch Area. How would I set it on a left corner of the screen?
Inspect the Proximity Selector and set the Use Button to a blank string. This will prevent it from clicking when you release your touch.

To adjust the Touch Area to the lower left, set it to:
  • Origin: Bottom Left
  • Alignment: Bottom Left
  • X and Y: 0
If you want the Touch Area to take exactly 128 x 128 pixels, set Width and Height to Pixels, 128.

If you want the Touch Area to take exactly 20% of the lower left corner, set Width and Height to Normalized, 0.2.

Re: Question for my mobile game project 1

Posted: Fri Apr 14, 2017 2:03 pm
by davidsibya08
Thank you sir. Please correct me if I'm wrong. If I will leave the Use Button blank, then how would I be able to trigger the conversation event?

What I want to achieve in the dialogue with an NCP is something like in the mobile game of 'Oceanhorn: Monster of the Uncharted Sea' https://www.youtube.com/watch?v=k6V_l68 ... 48aXu5uhRI

Re: Question for my mobile game project 1

Posted: Fri Apr 14, 2017 2:22 pm
by Tony Li
davidsibya08 wrote:Thank you sir. Please correct me if I'm wrong. If I will leave the Use Button blank, then how would I be able to trigger the conversation event?

What I want to achieve in the dialogue with an NCP is something like in the mobile game of 'Oceanhorn: Monster of the Uncharted Sea' https://www.youtube.com/watch?v=k6V_l68 ... 48aXu5uhRI
If you tick Enable Touch, it will check for touches in the Touch Area, even if Use Button is blank.

In other cases, such as approaching the door at 09:38, you'll probably want to set a Conversation Trigger to OnTriggerEnter and set up a trigger collider. This will cause the conversation to start automatically when the player enters the door's trigger collider.

Re: Question for my mobile game project 1

Posted: Wed Apr 19, 2017 9:34 am
by davidsibya08
Thank you sir! I got my solution out there.

Sir, there's just a thing I want to have more clarification. I can't seem to get all things right into place and I'm having hard time to improvise the given code from Menu Framework. What I want is that the HUD(head up display) Panel will be automatically be seen during the game play.

In my HUD, I have a button such as Quest Log button, Achievement Log button, Dictionary button and Pause button. Each button will access corresponding panels of course. The problem is that, I don't know how to set the HUD Panel to true when it identifies it is the gameplay and turns of when it is in the main menu and in my cut scene. How will I do it?

Re: Question for my mobile game project 1

Posted: Wed Apr 19, 2017 10:29 am
by Tony Li
Can you please post screenshots of your HUD and your scene's Hierarchy? By "HUD" I don't know if you're referring to the Menu Framework's Pause panel or a new UI panel that you created.

Re: Question for my mobile game project 1

Posted: Thu Apr 20, 2017 12:05 am
by davidsibya08
This is the HUD i want to be active only during game play of my game. It contains these following buttons.