Denizen support
DrakeEldridge opened this issue ยท 1 comments
Hi, I am trying to add denizen scripts to my quest but it doesn't seem to work.
There doesn't seem to be any information on what type the denizen script needs to be to work with quests plugin. Assignment, Task, Interact, world etc etc etc.
I just picked up denizen coding to try adding dialogue to the quests plugin and more advanced scripted quests. The quests plugin doesnt seem to allow for a lot of dialogue to be made easily (without stage after stage of start and finish messages which can be annoying to make) So I wanted to use denizens to make long dialogues easier.
The example script posted at the bottom works when assigned to an npc, so how do I edit it to make it work within quests plugin?
In the quest editor, under stages it says 11:Denizen Script
and I add the script. But when I do the quest nothing happens. It does not run the script.
Even if I cant do click or chat triggers with quests plugin, a simple script like the one below would be good to be able to get working on quests plugin.
mytask:
type: task
script:
- chat "Here, a book for you!"
- wait 1
- narrate "You take the book"
Any ideas?
Example script:
"test":
type: assignment
actions:
on assignment:
- trigger name:chat toggle:true
- trigger name:click toggle:true
interact scripts:
- 10 GoldBarStart
'GoldBarStart':
type: interact
steps:
's1*':
click trigger:
script:
- chat "Hello <player.name>, I need some help!"
- wait 1
- chat "Can you help me?"
- wait 1
- narrate "<&b>Say:"
- narrate "<&a>Yes"
- narrate "<&a>No"
chat trigger:
'Question':
trigger: <&b>/Yes/, I will help you!
script:
- wait 1
- chat "Oh great! I need 10 gold bars."
- wait 1
- chat "Come back when you have them!"
- wait 1
- narrate "<&c>Collect <&b>10<&c> gold bars for <&6><npc.name><&c>."
- zap 'step:s2'
's2':
click trigger:
script:
- chat "Do you have my gold bars?"
- wait 1
- narrate "<&b>Say:"
- narrate "<&a>Yes"
- narrate "<&a>No"
chat trigger:
'Question':
trigger: <&b>/Yes/, I have your gold bars.
script:
- if <player.inventory.contains[266].qty[10]> {
- wait 1
- chat "Really? Oh great!"
- ^take gold_ingot qty:10
- wait 1
- narrate "<&c><&b>10<&c> gold bars have been removed from your inventory."
- chat "My gold bars!"
- wait 1
- chat "Thank you so much! Here is your reward!"
- give money qty:200
- wait 1
- narrate "<&6><npc.name> has rewarded you with <&b>$200<&6>."
- zap 'step:s3'
} else {
- wait 1
- narrate "<&c>You do not have <&b>10<&c> gold bars in your inventory."
- wait 1
- chat "Oh, so you don't have it. Please don't waste my time!"
- wait 1
- narrate "<&6><npc.name> frowns at you."
- wait 1
- narrate "<&c>Collect <&b>10<&c> gold bars for <&6><npc.name><&c>."
}
'Reply':
trigger: <&c>/No/, I am still looking for your gold bars.
script:
- wait 1
- chat "Oh darn, come back when you have them..."
's3':
click trigger:
script:
- chat "Thank you so much for your help earlier!"
- wait 1
- chat "I would be broke without you!"
- wait 1
- narrate "<&6><npc.name> is grateful and has no further use for you..."
Hi,
I guess you want to map a click trigger on a NPC which already has a click trigger, from quests. That will not work. You would need to map the conversation (script) to another NPC which has no interactions at all.
A NPC can only have 1 click trigger (quests, trading, denizen, teleport, ...).
So far I worked with denizen scripts in quests, the denizen script has to be Type: Task, something as below would work for your case.
MINER_GIVEREDSTONEORE:
type: task
script:
- chat npc:147 "Here is your Redstone Ore?"
- give i@redstone_ore quantity:30
We do our NPC conversation directly in quests as stages with start messages, not optimal but the fastest.