Page 1 of 1

Question Regarding NPCs

Posted: Wed Aug 13, 2008 12:18 am
by Tyr
Hello, it’s me, again.
Today my question is regarding the creation of NPCs, in particular non-attackable quest giver NPCs.
You see, I am trying to get this here NPC to spawn and give me quest A, I can get him to spawn where I want and all, but I am having trouble with two things
1. When I hail him he does absolutely nothing.
2. I can only target him via tab.
As always it’s probably something horrendously simple, but I have been messing with options for going on two hours without any luck, so if someone *cough* john *cough* could maybe be ever so helpful as to post the database information from, say, Murrar Shar, so that I could cross reference all the options, see what I did wrong, and never do it again, I would be very, very, very grateful.
Thank you.

Posted: Wed Aug 13, 2008 6:14 am
by John Adams
Let me see what I can dig out today. The morning is starting, and the Hellmouth is open at work - so it may be a while.
Hint: command_primary needs to reference the Hail command in entity_commands table - that might get you started unless you already have that. A lot of this config happens when you parse logs and populate your DB from the raw data. I have not built an NPC manually yet. Haven't needed to... but yes, our data should serve as a guide.

Posted: Wed Aug 13, 2008 7:31 pm
by John Adams
Here is Murrar Shar's spawn, spawn_npcs, and entity_commands records.

Code: Select all

-- table: spawn (primary record, must be inserted first)
insert into spawn (id, name, race, race_type, size, targetable, show_name, command_primary, command_secondary, visual_state, attackable, show_level, show_command_icon, display_hand_icon, faction_id, collision_radius, hp, power) values ('2530007','Murrar Shar','11','101','32','1','1','2','0','0','0','0','1','0','0','38','0','0');
-- table: spawn_npcs
insert into spawn_npcs (id, spawn_id, min_level, max_level, enc_level, class_, gender, min_group_size, max_group_size, hair_type_id, facial_hair_type_id, wing_type_id, chest_type_id, legs_type_id, soga_hair_type_id, soga_facial_hair_type_id, soga_race_type, heroic_flag, action_state, mood_state, initial_state, activity_status) values ('171','2530007','50','50','9','3','1','0','0','1113','0','0','5549','5550','1113','0','101','1','0','0','16512','0');
-- table: entity_commands
insert into entity_commands (id, command_list_id, command_text, distance, command, error_text) values ('2','2','hail','10','hail','');
Be mindful of the auto-increment IDs, otherwise this is how it looks in my tables. I did not include appearances or spawn points, because I think this is what you're after.

Posted: Wed Aug 13, 2008 7:42 pm
by Tyr
Woot! that is just what i was looking for, thank you very much ;)

Posted: Wed Aug 13, 2008 8:36 pm
by Tyr
Right, I am 99.5% sure I have everything set up as it should be, the NPC is spawning where I want him, when I hail him he turns around toward me and all that jazz, but still no quest or anything, and all the files are where they should be according to the LE's quest post.
I am beginning to think it’s just my files out of date, as some other “fixedâ€

Posted: Thu Aug 14, 2008 6:22 am
by John Adams
If you are running rev 122 from SVN, it should have most of the latest quest work in place - that is the version I am running on my server, and folks are able to complete that test quest we have on Murrar Shar.
Be sure you have a function spawn() even in your script that tells the server that this spawn "ProvidesQuest(NPC, {quest_id})" where quest_id is the ID from your `quests` table. Also make sure your function hailed() that you create a new conversation, then add StartConversation and AddConversationOption's. etc.
Note: I am not sure if the spawn has to ProvidesQuest() before a CreateConversation() can be added? I don't think so, but test it anyway.
Maybe you should post your spawnscript here so we can better help solve the problem.