How to make Achievements?

Announcements, support questions, and discussion for the Dialogue System.
User avatar
Alatriste
Posts: 181
Joined: Wed Nov 11, 2015 5:07 pm
Contact:

Re: How to make Achievements?

Post by Alatriste »

Glad to know that you have a clear idea about the implementation... I was thinking about how to do it with the save system and I was even considering to have 2 different saving systems. :lol:
User avatar
Tony Li
Posts: 21050
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to make Achievements?

Post by Tony Li »

Hi,

Here's an early release copy of the Visual Novel Framework 2.0.3:

VisualNovelFramework_2_0_3b2.unitypackage

It has these improvements:
  • Added Achievements.
  • Added Quest Log button.
  • Added background fading.
  • Updated VNLoadLevel() sequencer command to support Save System.
  • Panels now support open/close animations.
See page 8 of the manual for information about achievements and background fading. There are two new Lua functions: BackgroundFadeDuration(#) and UnlockAchievement("name").
User avatar
Alatriste
Posts: 181
Joined: Wed Nov 11, 2015 5:07 pm
Contact:

Re: How to make Achievements?

Post by Alatriste »

Awesome! I will play with it during the weekend. I'll let you know how it goes. :)

Thanks a lot Tony!!!
User avatar
Alatriste
Posts: 181
Joined: Wed Nov 11, 2015 5:07 pm
Contact:

Re: How to make Achievements?

Post by Alatriste »

Hi Tony,

It has been a while since I started my project from the Start scene, and I'm getting a few issues before installing the update:

1) Error in the "Load Typewriter Speed" script:
NullReferenceException: Object reference not set to an instance of an object
PixelCrushers.DialogueSystem.VisualNovelFramework.LoadTypewriterSpeed.Start () (at Assets/Dialogue System Extras/Visual Novel Framework/Scripts/LoadTypewriterSpeed.cs:19)
I checked my Visual Novel Menu Canvas and it has attached the "Load Typewriter Speed" script. I even replaced the script for a fresh copy just in case was corrupted, but no luck. The only way to bypass the error is disabling the script.

2) Save Helper script doesn't have any conversation and I cannot select any. I thought it might be missing the dialogue database, but it seems correct...

I'm running version VN2.0.2 using DS 2.0.5
User avatar
Tony Li
Posts: 21050
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to make Achievements?

Post by Tony Li »

Hi,

Please try this version:

VisualNovelFramework_2_0_3b3.unitypackage

If the Save Helper's conversation dropdown isn't working, you can now assign the dialogue database to the Save Helper so it knows what database to get conversation titles from.
User avatar
Alatriste
Posts: 181
Joined: Wed Nov 11, 2015 5:07 pm
Contact:

Re: How to make Achievements?

Post by Alatriste »

I think I know why the Save Helper wasn't working properly:

I had disabled the Dialogue Manager by default and I enabled through playmaker. That was causing me a lot of weird behaviors in some scripts. Now seems to be fine.

A few questions more:

1) Does the system allow to have more than one page of achievements?
2) I was thinking to create a sort of album where you can have different characters pictures and clicking on them, the player would access to a gallery of achievements you unlocked with them. Is this something I could achieve with the current system?
3) It could be a good idea to have the achievements panel accessible through the start scene as well.
4) How the localization work with the achievements names and descriptions? I noticed that the name is always displayed so the variable cannot change when I call the UnlockAchievement.
5) The LUA code through an exception when I don't start the game from the start scene. I guess because the Visual Novel Menu Canvas is not loaded in the gameplay scene. Is there a work around?
Dialogue System: Lua code 'UnlockAchievement("achievementName")
' threw exception 'Tried to invoke a function call on a non-function value. If you're calling a function, is it registered with Lua?'
But so far the system seems to be working fine!
Last edited by Alatriste on Sun Nov 11, 2018 6:24 am, edited 1 time in total.
User avatar
Alatriste
Posts: 181
Joined: Wed Nov 11, 2015 5:07 pm
Contact:

Backgrounds Scene Transition

Post by Alatriste »

I saw that the Standard Scene transition is also included. However, I couldn't make it work for the background transition (it works when changing the scenes).

In the manual said:
You can use the Dialogue Manager’s Scene Transition Manager to fade to black before changing
backgrounds and then fade back in after changing backgrounds. To do this, set the Background
Manager component’s Fade Duration field or use the Lua function BackgroundFadeDuration:
But I couldn't find the "Fade duration field".
User avatar
Tony Li
Posts: 21050
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to make Achievements?

Post by Tony Li »

Alatriste wrote: Sun Nov 11, 2018 5:04 am1) Does the system allow to have more than one page of achievements?
It's not designed that way. Maybe it could be extended. What about using a scroll rect?
Alatriste wrote: Sun Nov 11, 2018 5:04 am2) I was thinking to create a sort of album where you can have different characters pictures and clicking on them, the player would access to a gallery of achievements you unlocked with them. Is this something I could achieve with the current system?
Alatriste wrote: Sun Nov 11, 2018 5:04 am3) It could be a good idea to have the achievements panel accessible through the start scene as well.
Good idea. I'll do that. In the meantime, you can add a button to the Start scene yourself. Configure its OnClick() event to call the Visual Novel Menu Canvas's Menus.ShowAchievements.
Alatriste wrote: Sun Nov 11, 2018 5:04 am4) How the localization work with the achievements names and descriptions? I noticed that the name is always displayed so the variable cannot change when I call the UnlockAchievement.
If a translation exists in the Text Table that's assigned to the Dialogue Manager, it will use the translation. In the example scene, there is an achievement named "Creep". If the Text Table has a field named "Creep", it will use the translation.
Alatriste wrote: Sun Nov 11, 2018 5:04 am5) The LUA code through an exception when I don't start the game from the start scene. I guess because the Visual Novel Menu Canvas is not loaded in the gameplay scene. Is there a work around?
Add the Achievements component to the Gameplay scene's Dialogue Manager. In fact, in the Start scene you can move the Achievements component to the Dialogue Manager and save it as a prefab so your testing Dialogue Manager in the Gameplay scene will receive the same changes.
Alatriste wrote: Sun Nov 11, 2018 6:03 amI saw that the Standard Scene transition is also included. However, I couldn't make it work for the background transition (it works when changing the scenes).

In the manual said:
You can use the Dialogue Manager’s Scene Transition Manager to fade to black before changing
backgrounds and then fade back in after changing backgrounds. To do this, set the Background
Manager component’s Fade Duration field or use the Lua function BackgroundFadeDuration:
But I couldn't find the "Fade duration field".
The Fade Duration field should be on the Background Manager component in the Gameplay scene. This component is on Background Canvas > Images > Background.
User avatar
Alatriste
Posts: 181
Joined: Wed Nov 11, 2015 5:07 pm
Contact:

Re: How to make Achievements?

Post by Alatriste »

It's not designed that way. Maybe it could be extended. What about using a scroll rect?
That would work. 8-)
The Fade Duration field should be on the Background Manager component in the Gameplay scene. This component is on Background Canvas > Images > Background.
Fount it. However, the value resets to 0 as soon as I press the start button. :?:
If a translation exists in the Text Table that's assigned to the Dialogue Manager, it will use the translation. In the example scene, there is an achievement named "Creep". If the Text Table has a field named "Creep", it will use the translation.
Sorry, I don't think I explain myself properly. The thing is that I have to define the Name (for instance, "C1_Actor1Item1") of the achievement and the Description. The name is displayed during the alert, no matter the description, therefore, I cannot use the name convention or the player will see something like: "Achievement unlocked: C1_Actor1Item1"
User avatar
Tony Li
Posts: 21050
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to make Achievements?

Post by Tony Li »

Alatriste wrote: Sun Nov 11, 2018 11:08 am
The Fade Duration field should be on the Background Manager component in the Gameplay scene. This component is on Background Canvas > Images > Background.
Fount it. However, the value resets to 0 as soon as I press the start button. :?:
Sounds like a bug. I'll double check this and fix it if necessary.
Alatriste wrote: Sun Nov 11, 2018 11:08 am
If a translation exists in the Text Table that's assigned to the Dialogue Manager, it will use the translation. In the example scene, there is an achievement named "Creep". If the Text Table has a field named "Creep", it will use the translation.
Sorry, I don't think I explain myself properly. The thing is that I have to define the Name (for instance, "C1_Actor1Item1") of the achievement and the Description. The name is displayed during the alert, no matter the description, therefore, I cannot use the name convention or the player will see something like: "Achievement unlocked: C1_Actor1Item1"
I understand now. I'll make it so you can show the name and/or description, but neither will be required. You will be able to use {0} for the name and {1} for the description. So if you do this:

Code: Select all

Achievement unlocked: {1}
it will show "Achievement unlocked: " + the description.
Post Reply