PolluxTroy0 9 Posted May 22, 2022 Share Posted May 22, 2022 (edited) Hi, Can't find anything about this question. Could someone point me in the right direction ? Regards ;) Edited May 22, 2022 by PolluxTroy0 Link to comment
Flix 5,116 Posted May 22, 2022 Share Posted May 22, 2022 Hello. This is accomplished by adding a "taskcreature" entry in quest.txt. For example here is an Iron Wolf mercenary that I added to the Swamps: quest.createTaskCreature(10727, { itemtype = 13908, creature = 2835, faction_id = 84, behaviour = "JOB_MERCENARY", ismortal = 0, isfighting = 0, persistent = 1, position = { 60,40,0 , 1280.650,2940.450,90.979, -60.000 }, }) 1 Link to comment
PolluxTroy0 9 Posted May 22, 2022 Author Share Posted May 22, 2022 Thank you @Flix ;) Link to comment
PolluxTroy0 9 Posted May 22, 2022 Author Share Posted May 22, 2022 I've found some usefull commands ingame for position etc, thank you. Do I need to edit global.res if I just want for this npc to only "speak" (just show a message") ? Link to comment
Flix 5,116 Posted May 22, 2022 Share Posted May 22, 2022 I believe the only way an NPC will speak with a written message is to craft a small quest for them in quest.txt. But yes, you would have to edit global.res to add the speech bubble text. In this case it could be a reaching quest, where the objective is simply to speak to the NPC. You could mark the quest as "silent" if you didn't want all the quest-related stuff like logbook entries and map pointers to pop up. I'll try to post an example later with some comments. I'm actually working on something similar right now for D2F. Link to comment
PolluxTroy0 9 Posted May 22, 2022 Author Share Posted May 22, 2022 (edited) Ok I understand ;) Thank you for your help. My goal is to have a NPC to display some text when you speak to him. Nothing more ^^ Edited May 22, 2022 by PolluxTroy0 Link to comment
Flix 5,116 Posted May 22, 2022 Share Posted May 22, 2022 quest.createQuest(10000, { -- You can give this another numerical ID, I just picked an unused one id = 10000, name = "S_HE_nn-Talk to Me", questtype = 3, silent=1, ismainquest = 0, mainquestchapter = 0, questbookstrategy = 0, continues_quest_id = 0, continues_bookentry = 0, forpathnot = 0, reservedforpath = 0, reservedforhero = 0, reservedforgod = 0, reward_exp=0, reward_gold=0, reward_drop=0, reward_attr=0, reward_skill=0, report_required = 0, dangerclass=1, author_ready = 0, qa_ready = 0, releasestage = 30, progress = 0, autostart = 0, anyprequest = 0, showdlgonwin = 0, lostondecline = 0, questReach = { stations0 = { taskcreature = 10695, -- Change this to the ID of your new taskcreature needsActivation = 0, }, }, }) The above is what I would use. Paste it into the bottom of quest.txt after you make your ID changes. One other important part: afterwards, go to the top of quest.txt and search for this section: quest.reserveQuestType { Killquest = 796, Rescuequest = 118, Reachingquest = 1272, -- whatever value this is set to in your copy, increase it by 1. the game needs an exact count of each quest type. Collectquest = 377, Convoyquest = 0, } Finally, the quest text could be added to global.res by using this Loka-ID: QUEST_10000_STATION_0 Change the 10000 to whatever the quest ID is if you decide to change it. Use s2rw.exe program to generate the hash and then paste the whole thing in the correct spot in the decoded texts. Then re-encode the text and you'll have an NPC that delivers a message when you speak to them. So if you used 10000 as the quest ID, the final chunk would look like: 2284674290 Hello! Nice to meet you. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now