Discord Thread how can i add a second quest to my quest npc system?

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

This thread came from the skUnity Discord. You can't reply to it here but if you join the skUnity Discord, you'll be able to post a reply there. The thread link is part of the thread's message.
Status
Not open for further replies.
i believe u are doing it very inefficiently
i think u should learn functions and list variables
for example
instead of using variables like these
code_language.skript:
{npc1state::%player's uuid%}
{npc1reward::%player's uuid%}
{npc1quest1::%player's uuid%}
do this

add 1 to {npc::%player's uuid%}
set {_questID} to {npc::%player's uuid%}
{npc::%player's uuid%::%{_questID}%::state}

and for dialogues
just do this

on script load:
  add "Wassup traveller, i want you to do this and this" {quest.dialogue::1::*} #QUEST 1's DIALOGUE
  add "The action is very dangerous! I know u can do it" {quest.dialogue::1::*}
  add "Thanks my dude." {quest.dialogue::1::*}

  #SECOND QUEST DIALOGUE
  add "Wassup traveller, this is the second quest" {quest.dialogue::2::*} #QUEST 1's DIALOGUE
  add "sorry for being needy" {quest.dialogue::2::*}
  add "Thanks my dude." {quest.dialogue::2::*}

then you can do:

set {_questID} to {npc::%player's uuid%}
loop {quest.dialogue::%{_questID}%::*}:
  send "%{quest.dialogue::%{_questID}%::%loop-index%}%" to player
  wait {@delay} seconds
send "Quest Received: {quest.dialogue.end::%{_questID}%}" to player
<@1088977397593935963
i hope this helps
and for detecting events, just use the if {_questID} is x:

Posted by: tjj123456 from the skUnity Discord.
 
pretty much just replaced it with if
fixed
but now the quest data isnt updating
and when ores are mined it doesnt register
fixed that too

current code

is there a different way to add a second quest now or is it the same as you explained before? <@842787321614696499>

Posted by: prohibit._ from the skUnity Discord.
 
so instead of making long lines like
send "{@q}&f Hello %player%! I am the Quest Master! I have a quest for you today!" to player
play sound "block.note_block.bit" at volume 1 and pitch 1 to player
wait {@delay} seconds
send "{@q}&f Complete this quest, and I will reward you." to player
play sound "block.note_block.bit" at volume 1 and pitch 1 to player
wait {@delay} seconds
send "{@q}&f For my first quest, I need you to mine 15 iron ore! Good luck." to player
play sound "block.note_block.bit" at volume 1 and pitch 1 to player
wait {@delay} seconds
send "&a&lQuest Received &7| &fMine 15 iron ore for the Quest Master. &7|&f Do &a/quests&f to check your quest statistics." to player
play sound "block.note_block.bit" at volume 1 and pitch 2 to player
and doing it for EVERY SINGLE QUEST

Posted by: tjj123456 from the skUnity Discord.
 
code_language.skript:
on script load:
  set {quest.dialogue.end::1} to "Mine 15 iron ore"
  add "Wassup traveller, i want you to do this and this" to {quest.dialogue::1::*} #QUEST 1's DIALOGUE
  add "The action is very dangerous! I know u can do it" to {quest.dialogue::1::*}
  add "Thanks my dude." to {quest.dialogue::1::*}

  #SECOND QUEST DIALOGUE
  set {quest.dialogue.end::2} to "Do something in the cave"
  add "Wassup traveller, this is the second quest" to {quest.dialogue::2::*}
  add "sorry for being needy" to {quest.dialogue::2::*}
  add "Thanks my dude." to {quest.dialogue::2::*}

#some code later...
set {_questID} to {npc::%player's uuid%}
loop {quest.dialogue::%{_questID}%::*}:
  send "%{quest.dialogue::%{_questID}%::%loop-index%}%" to player
  wait {@delay} seconds
send "Quest Received: {quest.dialogue.end::%{_questID}%}" to player

  add "Wassup traveller, this is the second quest" to {quest.dialogue::2::*}
  add "sorry for being needy" to {quest.dialogue::2::*}
  add "Thanks my dude." to {quest.dialogue::2::*}
first line adds it to {quest.dialogue::2::1}
second line adds to {quest.dialogue::2::2}
and so on
then we loop the variable
to send everything and wait delay serconds
if u dont know what i mean u need more experience
u definitely shouldnt try quests first
it's not really a game changer to your server and most server owners dont know how to make meaningful quests

Posted by: tjj123456 from the skUnity Discord.
 
Status
Not open for further replies.