Author Topic: NPC Dialog/Quests SQL questions  (Read 1488 times)

Ezrec

  • Traveller
  • *
  • Posts: 10
    • View Profile
NPC Dialog/Quests SQL questions
« on: March 13, 2006, 06:14:31 am »
I think I\'m almost there with respect to My First NPC Dialog, but
I\'m missing the \'link\' between the npc_responses table and the
quests/quest_scripts table.

Here is a link to a SQL file you can just load into a \'NPCRoom\'
server, and get what I have to far. I can get as far as the
\'greetings\' NPC response for the \'tutorial\' knowledge domain
I created, but the dialog doesn\'t go on to the quest.

Could  a dev give the SQL a once-over and tell me if I\'m close,
or if I\'m so off the mark I should start from scratch.

http://www.evillabs.net/~gus/planeshift/newbie_quests.sql

NOTE: This NPC is a prototype for one I\'d like to build to have added
to the game\'s content as an \'introductory\' character, which teaches
PCs the ropes with respect to common in-game phrases, who to
talk to first as newbies, and places that newbies should go for
rat squashing. Currently, only the language module is in the .SQL
file, but the others are being sketched out.
« Last Edit: March 13, 2006, 06:14:59 am by Ezrec »

Uyaem

  • Hydlaa Notable
  • *
  • Posts: 747
    • View Profile
(No subject)
« Reply #1 on: March 13, 2006, 08:38:50 am »
There\'s a field called \'quest_id\' in table \'npc_responses\', that might be what you are looking for.
I don\'t know for sure, I\'m not into that stuff, just trying to give pointers. :)

EDIT: Bah, looked at your script, you already use it... so my hint was worth nothing I guess.
The internet is "the terrorists'" most important weapon, they say.
Wrong.
Fear is their most important weapon.
Ours is our freedom.

Ezrec

  • Traveller
  • *
  • Posts: 10
    • View Profile
(No subject)
« Reply #2 on: March 20, 2006, 06:16:58 pm »
I\'m still at a loss here, guys.

I\'d like to contribute quest content, but the \'black magic\' that
I need to do to get a NPC to initiate a quest sequence
isn\'t really clear.

Any help?

Wired_Crawler

  • Hydlaa Citizen
  • *
  • Posts: 429
    • View Profile
(No subject)
« Reply #3 on: March 21, 2006, 10:24:34 pm »
Strange. Nobody knows ...? I guess there are very few people who know, how quest system works... ;)
I have compared data of other NPC\'s with your script and after several tries I have found things, which require change:

Code: [Select]
Sampehl: Sounds like I should teach you some simple phrases, as your accent is
The first response in script should start with whole first name of NPC (why? I don\'t know.)
Code: [Select]
INSERT INTO npc_knowledge_areas (player_id,area,priority)
                VALUES (900,\"Sampehl\",1);
This one + previous one are sufficient to make NPC react properly to \"about language\" (I mean - you receive quest and it is possible to complete it)
Code: [Select]
INSERT INTO npc_responses (id,response1,quest_id)
                        VALUES (900,\"Welcome to the city of etc...etc...\",0);
INSERT INTO npc_triggers (id,`trigger`,response_id,area)
                        VALUES (900,\"greetings\",900,\"Sampehl\"[I][/I]);
This enables custom response to \"greetings\" before you receive quest. Probably You must create additional responses (with quest_id=900) and triggers to get proper answers to \"greetings\" and \"who are you\" after receiving quest.

Good luck :)
"Close the world, txEn eht nepO."

Ezrec

  • Traveller
  • *
  • Posts: 10
    • View Profile
(No subject)
« Reply #4 on: March 21, 2006, 10:30:17 pm »
Thanks! Can\'t wait to try this out!

Vengeance

  • Veteran
  • *
  • Posts: 1452
    • View Profile
(No subject)
« Reply #5 on: March 30, 2006, 03:53:34 pm »
Look at the quest_scripts table.  ID 5 is a good example of a working quest in the cvs data.  The way to trigger it in-game is to walk up to the MaleEnki and say hello.

You can code triggers by hand in npc_triggers and npc_responses, but this quest_script approach was developed last summer to make it easier for the Settings team to create them.

- Vengeance