Code Monkey home page Code Monkey logo

Comments (15)

jrbudda avatar jrbudda commented on June 9, 2024

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.

jrbudda avatar jrbudda commented on June 9, 2024

Oh I see your problem you have the chat triggers in Step 2 and no ZAP command to get there.

from denizen.

ConfuzzledWolf avatar ConfuzzledWolf commented on June 9, 2024

Such a fast reply, wow. Thanks.
I only started scripting these yesterday, so how would a ZAP command work with this script?

from denizen.

jrbudda avatar jrbudda commented on June 9, 2024

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.

ConfuzzledWolf avatar ConfuzzledWolf commented on June 9, 2024

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.

ConfuzzledWolf avatar ConfuzzledWolf commented on June 9, 2024

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.

jrbudda avatar jrbudda commented on June 9, 2024

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.

ConfuzzledWolf avatar ConfuzzledWolf commented on June 9, 2024

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.

jrbudda avatar jrbudda commented on June 9, 2024

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.

ConfuzzledWolf avatar ConfuzzledWolf commented on June 9, 2024

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.

jrbudda avatar jrbudda commented on June 9, 2024

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.

jrbudda avatar jrbudda commented on June 9, 2024

Also there was an indent error on the script, step 2: needed to be 1 space over. I fixed it.

from denizen.

ConfuzzledWolf avatar ConfuzzledWolf commented on June 9, 2024

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.

ConfuzzledWolf avatar ConfuzzledWolf commented on June 9, 2024

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.

eduardo31 avatar eduardo31 commented on June 9, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.