RPG kit 'You need the key' quest

Announcements, support questions, and discussion for the Dialogue System.
terrymorgan
Posts: 97
Joined: Wed Sep 10, 2014 5:29 pm

RPG kit 'You need the key' quest

Post by terrymorgan »

In this tutorial using action rpg kit, there was a door "NPC" that told you it needed a key to unlock it. The key had to be added to the item database,
etc. When the door 'saw' you with the key it would open.

https://sites.google.com/site/terrymorg ... e_player_9

How would I go about converting this to RPG kit using dialog system?


I'm guessing this would figure into it maybe?

PlayerHasItem(itemName, amount) Boolean Check player has amount of item PlayerHasItem("Axe", 1)



Here's the ARPG dialog database with the "Door NPC" conversation
https://dl.dropboxusercontent.com/u/102 ... tabase.zip
6k

Standalone demo of tuts 8 and 9 (most of)
https://dl.dropboxusercontent.com/u/102 ... dialog.zip
16mb

I notice Zerano put in a quest video, but his 3.13 version doesn't work (not that quests are in there)

His directions
'Delete UI Controls, Json and Shared folder, then import the new version.'
I did that, imported all except the scenes I changed 'main level' level1, and the databases

Assets/Unitycoding/Conversation/Scripts/Runtime/ConversationWindow.cs(9,43): error CS0246: The type or namespace name `UIWindow' could not be found. Are you missing a using directive or an assembly reference?
bohnstudios
Posts: 68
Joined: Sun Aug 16, 2015 3:01 am
Location: St. Louis, MO
Contact:

Re: RPG kit 'You need the key' quest

Post by bohnstudios »

Enable and disable a game object based on a condition in the dialogue conversation/database?

1) If the key is in your inventory then enable the unlocked door game object and disable the the locked door game object with the set enabled sequencer command.

2) You could also probably do this by completing a quest or sub-quest condition (this could even be as simple as on-trigger quest complete when you pick up the key)

I use dialogue system for my quests, so if you don't then #2 might not work. In concept, I think this would work basically the same way with most, if not all assets that Tony has created an inventory and/or quest lua bridge. I do this with my ARPG dungeon keys because I think it's just way easier and flexible than using the more hard-coded example in the ARPG demo.

There's probably a few other ways to go about doing this, but to me I think the above would be the easiest and have minimal chance of going wrong, no actual scripting required etc. I also learned about this from Tony and it basically changed my life...ok maybe it's a stretch but it was a pretty big epiphany. If I am completely missing something regarding what you are needing to do I apologize in advance. Cheers!
User avatar
Tony Li
Posts: 21033
Joined: Thu Jul 18, 2013 1:27 pm

Re: RPG kit 'You need the key' quest

Post by Tony Li »

That sounds like a good approach to me.

To get RPG Kit-specific:

1. Add an RPG Kit Conversation Trigger to your Door.

2. Create a conversation for the trigger with two branches. For example:
  • Conditions: PlayerHasItem("Blue Key", 1)
    Dialogue Text: "*click*"
    Sequence: AudioWait(doorCreakOpen); Animation(open)
  • Conditions: PlayerHasItem("Blue Key", 1) == false
    Dialogue Text: "You need the blue key."
    Sequence: Audio(rattleDoor); Delay({{end}})

For the RPG Kit 3.1.3 error message, import the updated RPG Kit Support package in Dialogue System 1.6.0.1, or download the same RPG Kit Support package from the very bottom of the Dialogue System Extras page.
terrymorgan
Posts: 97
Joined: Wed Sep 10, 2014 5:29 pm

Re: RPG kit 'You need the key' quest

Post by terrymorgan »

@bohnstudios

quote
ARPG dungeon keys because I think it's just way easier and flexible than using the more hard-coded example in the ARPG demo.
unquote

I'm not using ARPG, I just used it until Zerano got his RPG kit working. I will say this, ARPG camera clips the walls, it's the WOW camera you can get on the Unity Forum. I'm going to try out the Standard Assets controller/camera, it also clips walls.
bohnstudios
Posts: 68
Joined: Sun Aug 16, 2015 3:01 am
Location: St. Louis, MO
Contact:

Re: RPG kit 'You need the key' quest

Post by bohnstudios »

Hi terrymorgan,

Apologies for any confusion. I was aware that you are using Zerano's RPG Kit when I posted that, but I appreciate you checking :)

The process that I mentioned is applicable to more than just ARPG kit (UFPS is just one example I know for sure). The concept works pretty much the same way that I described as long as you are using just about a third-party integration asset where Dialogue System can read what items are in your inventory via the lua bridge.

http://www.pixelcrushers.com/dialogue_s ... dSetActive ...this is the exact sequencer command I was talking about and is a default dialogue system sequencer command....hence I think it works with any of the third party integrations (ARPG, RPG Kit, UFPS, ORK, Realistic FPS, and so on.

Also, you can do a lot with ARPG camera including making it a first person where you scroll from third to first person with the middle mouse wheel, just like fallout 4, skyrim, GTA etc. Then use raycast for your targeting and boom! My overall set-up is very different from the ARPG demo. The clipping you mentioned has not been an issue for me and I am very deep into the level design stage of my project. There are at least a couple ways to accomplish this in addition to the FPS approach mentioned above. If you ever want to know, I'd be happy to tell you some of the other ways that I've avoided the clipping if you are curious or ever decide to go back to ARPG. I vaguely remember reading one of your posts about that clipping problem you were having on this forum a very long time ago.

I apologize that my response was not more useful to you and containing the exact code for RPG Kit. I've at least skimmed most of this forum including your many of your past posts and I thought what I posted could help you. I admit that I did not take the time to download your files, look up your specific RPG Kit documentation, and give an answer more code specific answer to your project. Perhaps I should have.

I hope your project is going well overall. I'm definitely aware of the issues that you've dealt with using it along the way (I read this forum a lot). I'm glad to hear that it's more stable than it was! Also, I've also read your development notes on your website more than once (first time about a year ago). For whatever it's worth I wasn't just randomly posting just for the heck of it. I honestly thought it would be helpful.
How would I go about converting this to RPG kit using dialog system?
...although I did not have the best answer. This is the question I was addressing. Sorry again if there was any bother and for the long message.

I look forward to playing your game! Cheers!
terrymorgan
Posts: 97
Joined: Wed Sep 10, 2014 5:29 pm

Re: RPG kit 'You need the key' quest

Post by terrymorgan »

For some reason I'm not getting any 'you need the key' message. I'm not sure what kind of item the key should be either, however
he does have it in his inventory after he clicks on it, it just doesn't disappear from the ground
Is there supposed to be some sort of box collider is trigger on the door? It looks like the green disk of the conversation trigger script should be the trigger.

Rename .zip to .unitypackage
Attachments
you_need_the_key.jpg
you_need_the_key.jpg (116.97 KiB) Viewed 3638 times
you_need_the_key.zip
(98.59 KiB) Downloaded 141 times
bohnstudios
Posts: 68
Joined: Sun Aug 16, 2015 3:01 am
Location: St. Louis, MO
Contact:

Re: RPG kit 'You need the key' quest

Post by bohnstudios »

Have you tried clicking the box that says "is trigger" on your box collider?
User avatar
Tony Li
Posts: 21033
Joined: Thu Jul 18, 2013 1:27 pm

Re: RPG kit 'You need the key' quest

Post by Tony Li »

Hi Terry,

Create an RPG Kit item definition for your key. Select menu item Tools > Unitycoding > Item System > Editor > RPGItemDatabase.asset, then click the Create... button and define your item as a plain old Item.

Leave the item editor window open. On your blue_key_prefab, add the key item to the Items list at the bottom of the Item Trigger component.

Then inspect your hinge_prefab_key and assign a conversation. Your hinge_prefab_key has an RPG Kit Conversation Trigger that will fire when the player clicks on it, but no conversation is selected. The conversation's Conditions fields should check PlayerHasItem(key, 1) where key is the name of the item you defined in the item editor. So it'll be something like this (with both nodes assigned to the door, not the PC):
  • START
    • {Conditions: PlayerHasItem(key,1)==false} "You need the key."
    • {Conditions: PlayerHasItem(key,1)==true} "The door opens..." {Sequence: Animation(hinge_rotate)}
terrymorgan
Posts: 97
Joined: Wed Sep 10, 2014 5:29 pm

Re: RPG kit 'You need the key' quest

Post by terrymorgan »

Here's some shots of my conversation. I made a big 'is trigger' collider on the hinge even though there's a green collider disk on
the conversation script. I'm getting the icon in the inventory (should have tooltips) but I might have the conversation nodes wrong.

Wiol says it should be an equipment item, maybe the only way to get it to disappear from the ground?

Dialogue System: Lua code 'return PlayerHasItem("Blue_Key_Plain_Item", 1) == false' threw exception 'Invoke function call on non function value.'
UnityEngine.Debug:LogError(Object)

shots of the dialog
https://sites.google.com/site/terrymorg ... u_need_key
User avatar
Tony Li
Posts: 21033
Joined: Thu Jul 18, 2013 1:27 pm

Re: RPG kit 'You need the key' quest

Post by Tony Li »

Terry,

Does the Dialogue Manager in your Loading scene have an RPG Kit Bridge component? This component adds the RPG Kit Lua functions (such as PlayerHasItem) to the Dialogue System.
Post Reply