Comments (15)
turn on /denizen debug and put the output on pastebin.com. Do the same for the script as you see github kinda screws it up.
For the 2nd question take a look at the LISTEN KILL command, which will make a Denizen run a task script when the players kills certain mobs or npcs.
from denizen.
Oh I see your problem you have the chat triggers in Step 2 and no ZAP command to get there.
from denizen.
Such a fast reply, wow. Thanks.
I only started scripting these yesterday, so how would a ZAP command work with this script?
from denizen.
Scripts do not move between steps automatically.Best thing there is to put the click the and chat triggers all in Step 1. Run listen kill using a task script that sets a Flag or calls Finish when its complete. Then make another interact script with a requirement that said Flag is set, and reward the player.
from denizen.
Alright, sounds complicated but I'm sure it'll be simple once I get back into it.
I'll try that out now.
from denizen.
Okay, I've managed to get most of it working. I've got the chat trigger working but he doesn't recognise when the task is completed. Here's the scripts themselves: http://pastebin.com/f6jmhKxr
It doesn't show up as me completing the task in the saves, so maybe something with the task imitating?
from denizen.
The listen kill is a command that goes in the Interact script. The task runs once the denizen has 'heard' the required kills. nothing runs if you put it in the task script. Also I think you need Type:NPC and NPCID:16
from denizen.
So the listen kill would go into the second interact script and would apply to if the player has killed that NPC? Would the NPC need to be dead at the time for him to reward or just for the player to have killed him at some point? Also, how would the task script fit in if the listen kill command is required in the interact script? (Sorry for being so dense at this)
from denizen.
Check this guy out, been meaning to write it.
http://scripts.citizensnpcs.com/view/h0i1td
(I just wrote it up in notepad and haven't tested it, so I'm not guaranteeing i didn't screw up the syntax :) If it don't work turn on /denizen debug and let me know.
from denizen.
It doesn't work for me. :(
I assigned it to Steve in the assignment.yml and added the script to the bottom of my scripts.yml (Also, can scripts be done in separate files, which might be more organised since CitizensUI just puts them all in one and it's a bit cluttered)
Here's the debug:
23:29:27 [INFO] | ERROR! Could not find any scripts assigned!
23:29:27 [INFO] +---------------------+
23:29:27 [INFO] +- Parsing click trigger: Steve/ConfuzzledWolf -+
23:29:27 [INFO] | Getting current step:
23:29:27 [INFO] | ...current step not found, assuming '1'.
23:29:27 [INFO] | ERROR! Could not find script at:
23:29:27 [INFO] | null.Steps.1.Click Trigger.Script
23:29:27 [INFO] | Check YML spacing, or is something spelled wrong in your script
I also tried opening it in CitizensUI to assign it to Steve through that and it couldn't locate any of the scripts (Hope this info helps at all)
from denizen.
Looks like something is wrong with the assignment (hence the 'no scripts assigned' error). Yes scripts can be in multiple files, the UI does 1 file by default but you can change that in the options.
from denizen.
Also there was an indent error on the script, step 2: needed to be 1 space over. I fixed it.
from denizen.
Oh, that'd be incredibly useful. I'll do that and test it out for you tomorrow when I get the time to. Hopefully that'll help me with my script too.
from denizen.
The script was still broken at some points but I managed to find and fix them. I hope you don't mind. It will now load in CitizensUI and can be assigned to the NPC sucessfully except I can't get it to recognise the LISTEN KILL command. The NPC just tells me to kill 10 zombies and then doesn't acknowledge it. Here's the link to the "fixed" script: http://pastebin.com/pstTUM9K
from denizen.
I just fixed it do you want it ?it's adapeted to my quest but it does what you wanted !
assignements.yml
Denizens:
Maggie:
Interact Scripts:
- 0 Magic Shop
- 10 ^Magic Shop Not Enough Money
- 20 ^Magic Shop Feathers
- 20 ^Magic Shop Dust
'Investigator':
Interact Scripts:
- 0 Thiefs
- 1 Reward
'Thief':
Interact Scripts:
- 10 GuardDeath
thief.yml
'Thiefs':
Type: Interact
Requirements:
Mode: All
List:
- -FINISHED Reward
Steps:
1:
Proximity Trigger:
Script:
- CHAT "Hey, you there! You look strong, can you help me kill some things?"
Click Trigger:
Script:
- CHAT "Do you want to be a hero?/Queres ser um herói?"
- HINT
Chat Trigger:
1:
Trigger: /Yes/. I can./Sim
Script:
#Tell the player what to do.
- CHAT "Help me catch the thieves!/Ajuda-me a capturar os ladrões!"
#Start the Denizen listening for the killed Zombies, the KillComplete script will run once done.
- FLAG 'Thiefs'
#set this script to step 2. So the player gets the hint message.
- ZAP
2:
Trigger: /No/. I cannot./Não
Script:
- CHAT "Are you sure? OK. maybe later?/Ok então volta mais tarde!"
2:
Click Trigger:
Script:
- CHAT "Kill them!/Mata-os de que estas à espera ?"
'GuardDeath':
Type: Interact
Requirements:
Mode: All
List:
- FLAGGED 'Thiefs'
Steps:
1:
Click Trigger:
Script:
- CHAT "Do you want to be a hero?/Queres ser um herói?"
Npcdeath Trigger:
Script: #The ^ before the commands makes the command ignore the normal inter-command delay.. so the NPC dies immediately.
- ^CHAT "ARARRRRRGRGGRRH!"
- ^FLAG 'GuardDeath'
- ^NARRATE 'You killed the last thief return to the Investigator/Matas-te o ultimo! Vai falar com o investigador!'
- ^DIE
'Reward':
Type: Trigger
Requirements:
Mode: All
List:
- FLAGGED 'GuardDeath'
- -FINISHED Reward
Steps:
'1':
Click Trigger:
Script:
#Engage is used to keep the player from clicking twice.
- ENGAGE
- CHAT "Thank you so much! Here, take this as a reward!/Aqui tens a recompenssa!"
- GIVE Money QTY:1000
- NARRATE 'You just received 1000$!/Recebes-te 1000$'
- WAIT 1
- CHAT "And have a good day!/E tenha um bom dia!"
#These next 2 commands reset the quest so it can be repeated. If you don't want it repeatable make a step 2 on this script and call ZAP instead.
- ZAP 1 SCRIPT:Thiefs
- RESET FINISHED SCRIPT:KillComplete
#Always disengagae after an Engage
- FINISH
- DISENGAGE
'2':
Click Trigger:
Script:
- ZAP
from denizen.
Related Issues (20)
- Plugin Fails to Enable on 1.18.2
- mechanism loot_table_id HOT 1
- MongoDB
- NPCs Sinking into ground instead of sitting HOT 1
- Spread Around New Tag Param Usage, Static Tag Registration, new Property format, and Command autoExecute HOT 1
- Short-circuit tags HOT 1
- Move Denizen packet listener to async, HOT 2
- Chicken EggLayTime mechanism feature HOT 1
- folder delete
- Improve Tag <PlayerInventoryTag.map_slots> HOT 1
- Add wolf collar dyed and cat collar dyed event HOT 2
- New FurnaceStartsSmeltingEvent returns an incorrect total_cook_time context value
- Discord Appeal HOT 1
- Custom explorer maps creation
- Update to 1.19.4 HOT 1
- Nested translate tags produce broken strings HOT 2
- Oraxen Support HOT 3
- Some artifacts are missing in the published Maven artifacts HOT 1
- java.lang.NoClassDefFoundError: net/citizensnpcs/trait/HologramTrait$HologramDirection HOT 2
- NoClassDefFoundError "craftbukkit/v1_20_R3/inventory/CraftInventoryCustom" HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from denizen.