Page 1 of 6

Quest Progress

Posted: Fri Oct 02, 2015 6:05 pm
by wioluskaelk
Hi, I was looking in forum but I can not find it so I wanna ask. I use a Rpg Kit, I code and Dialogue System. And how I can make for example in Quest Description, the progress of quest? For example quest is to kill a 6 monster and I wanna show to player how monster he killes f.ex. 1/6 etc. Could anyone help me? Thank! Wiola :)

Re: Quest Progress

Posted: Fri Oct 02, 2015 8:39 pm
by Tony Li
Hi Wiola,

The best way is to use a quest entry. In the quest entry's text, use a [var=varName] tag. For example, say you're recording the number of monsters killed in a Dialogue System variable named "monstersKilled". Then set the quest to these values:
  • Tick Trackable and Track on Start if you want to show the quest in a quest tracker HUD.
  • Tick Has Entries, and then click Add New Quest Entry to add a new entry.
  • Set Entry 1's State to active. This makes it show as soon as the quest is activated.
  • Use the [var=varName] tag in the Entry 1 text.
Image

To record the number of monsters killed, use an Increment On Destroy component or the ICode SetIntVariable action.

For another example, look at the Quest Example scene in Assets/Dialogue System/Examples/Quest Example. Sergeant Graves' quest works exactly like this.

Re: Quest Progress

Posted: Tue Oct 06, 2015 4:34 am
by wioluskaelk
I tried this few days an option with increment on destroy, and with the SetIntVariable. And I have always the same error.
And I don`t know what what is wrong.
Image
Image

Re: Quest Progress

Posted: Tue Oct 06, 2015 4:48 am
by wioluskaelk
This is better photo :D

https://screencloud.net/v/9gvN

Re: Quest Progress

Posted: Tue Oct 06, 2015 10:14 am
by Tony Li
Hi,

Increment On Destroy updates a Dialogue System variable. Please make sure you've defined a variable named "SkeletonsKilled" in your dialogue database. Set the variable's Type to Number.

Since you're updating a Dialogue System variable, you don't need to do anything with it in your ICode state machines.

Try to fix the first two errors listed on the Console. These occur in your ICode state machine. It looks like you may need to assign a Text field, and also convert a Float to an Int. Hopefully that will resolve the third error, which is the RPC error.

Re: Quest Progress

Posted: Wed Oct 21, 2015 11:12 am
by wioluskaelk
Hi sorry but I was sick and I didn`t work on my project.

And I still have a problem with track. I think I did everything good.

This is console after killing.
https://screencloud.net/v/3X1R

This is variable
https://screencloud.net/v/3oow

And this is quest
https://screencloud.net/v/BGoN

Re: Quest Progress

Posted: Wed Oct 21, 2015 11:38 am
by Tony Li
Do any alerts work? What happens if you temporarily change the Increment On Destroy component's Alert Message to:

Code: Select all

0/1 Enemy Killed
When you kill the skeleton, it should show "0/1 Enemy Killed". If it also logs a NullReferenceException to the console, please let me know.

When we get rid of the NullReferenceException, the quest tracker should start working.

Re: Quest Progress

Posted: Wed Oct 21, 2015 1:03 pm
by wioluskaelk
In pause mode after killing:
(nothing changed)
https://screencloud.net/v/3DOj

And in normal editor mode:

https://screencloud.net/v/81Lv

I switch on collapse but every error is the same. I tried with don`t destroy on load and without this script and it`s the same.

Re: Quest Progress

Posted: Wed Oct 21, 2015 1:40 pm
by Tony Li
Do you have any idea why it's logging 6 NullReferenceExceptions? Are you killing 6 different skeletons?

As I understand it, the latest version of RPG Kit on Zerano's Subversion repository made some big changes. The Dialogue System's integration is for RPG Kit 3.1. I haven't yet had a chance to check compatibility with the latest version on the repository.

Today, I'll put together a video with the steps required to do this, and I'll post it here.

In the meantime, you could try to use a state machine (ICodeBehaviour) instead. For example, make a copy of ReceiveDamageHandler. In the node where the enemy dies, use the Dialogue System's GetIntVariable and SetIntVariable actions:
  1. GetIntVariable: Get SkeletonsKilled, and store it in an Int parameter.*
  2. Sum: Add one to the Int parameter.
  3. SetIntVariable: Set SkeletonsKilled, using the value of the Int parameter.*
  4. ShowAlert: Show your message.*
  5. BroadcastMessage: "UpdateTracker" to the Dialogue Manager GameObject.
* These are Dialogue System actions; the others are built-in ICode actions.

Re: Quest Progress

Posted: Wed Oct 21, 2015 1:47 pm
by wioluskaelk
Okey I will trydo something.
And I didn`t kill 6 skeletons. Only one. Earlier when I attached a SetIntVariable I had a error in console "val cannot convert int to float". I will try to do something tomorrow.