Post tutorial Report RSS Making a primitive/simple quest

A simple tutorial showing how to make a simple "bring item" quest. No more than 15 minutes is required for this,and you gain the scripting knowledge to do much bigger stuff. Good luck to all who try this. Kaplan994

Posted by on - Intermediate Other

So i will show you how to create a basic/primitive quest in Stalker Call of Pripyat.

The first thing you need is Notepad ++,this little tool is making this much easier.
So the files we need to edit are:
Configs/gameplay/character_desc_zaton.xml ,dialogs_zaton.xml , info_zaton.xml .
Configs/misc/tm_zaton.ltx
Configs /text/eng/st_quests_zaton.xml
Scripts/dialogs_zaton.script

So first thing is to create a dialog for the quest.
Open dialogs_zaton.xml and at the bottom before add this

xml code:
<dialog id="spas12_quest">
<dont_has_info>quest_spas12_done</dont_has_info>
<dont_has_info>quest_spas12_give</dont_has_info>
<phrase_list>
  <phrase id="1">
    <text>Bring the shotgun.</text>
    <give_info>quest_spas12_give</give_info>
    <action>dialogs_zaton.give_spas12_quest</action>
  </phrase>
  <phrase id="0">
    <text>Do you need a rifle?</text>
    <next>1</next>
  </phrase>
</phrase_list>
</dialog>

This is the dialog with Gonta,the one that starts the quest.
Now to explain this a little.

Do you need a rifle?
1
Phrase id 0 means that this is the first line that is shown when talking to Gonta,now when selecting that line you will start the quest.
How.
if you look down you will see 1,this means that when you select the previous line,when selected leads to Phrase 1,and that phrase starts the quest.
Now that is just the first dialog,now add a second below this one.

xml code:
<dialog id="spas12_quest_bring">
<has_info>quest_spas12_give</has_info>
<precondition>dialogs_zaton.is_has_spas12_gonta</precondition>
<phrase_list>
  <phrase id="1">
    <text>Thank you stalker.</text>
    <give_info>quest_spas12_done</give_info>
  </phrase>
  <phrase id="0">
    <has_info>quest_has_spas12</has_info>
    <text>Here's the shotgun.</text>
    <action>dialogs_zaton.transfer_wpn_spas12_to_gonta</action>
    <next>1</next>
  </phrase>
</phrase_list>
</dialog>

This is the dialog for bringing the weapon back to Gonta,and taking the reward.
Same things as in the first one so i won't explain anything here.
When you are finished,it should look like this.


Now we have the dialog.
Now open info_zaton.xml and add these lines at the end before .

code:
<info_portion id="quest_spas12_give"></info_portion>
<info_portion id="quest_has_spas12"></info_portion>
<info_portion id="quest_spas12_done"></info_portion>

And then open character_desc_zaton.xml and find
and add these lines before actor_break_dialog

code:
<actor_dialog>spas12_quest</actor_dialog>   <actor_dialog>spas12_quest_bring</actor_dialog>

When finished it should look like this.










Now open tm_zaton.xml,and add this at the botom

code:
[quest_spas12_give]
icon = ui_inGame2_Put_v_pripyat
prior = 2
storyline = false
title = {=actor_has_item(wpn_spas12) =actor_has_item(wpn_spas12)}spas12_gonta_bring_name, spas12_gonta_find_name
descr = spas12_gonta_descr
target = {=actor_has_item(wpn_spas12) =actor_has_item(wpn_spas12)}zat_b106_stalker_gonta
condlist_0 = {+quest_spas12_done} complete

It look like this
Now to add a description to the quest.
open st_quests_zaton.xml
and add these lines

code:
<string id="spas12_gonta_find_name">
    <text>Find Gonta a SPAS 12.</text>
  </string>
  <string id="spas12_gonta_bring_name">
    <text>Bring Gonta the shotgun.</text>
  </string>
  <string id="spas12_gonta_descr">
    <text>Gonta needs a good weapon for hunting,a better shotgun.He was interested in the SPAS 12 shotgun.</text>
  </string>

You can add whatever you want here,i kept it simple.

Now the last part of the quest is to add something to dialogs_zaton.scripts
So open the file and add this at the top.

code:
function give_spas12_quest()
   task_manager.get_task_manager():give_task("quest_spas12_give")
end
function is_has_spas12_gonta()
  if db.actor:object("wpn_spas12") then
    return true
  end
  return false
end
function transfer_wpn_spas12_to_gonta(first_speaker, second_speaker)
  dialogs.relocate_item_section_from_actor(first_speaker, second_speaker, "wpn_spas12")
  dialogs.relocate_money_to_actor(first_speaker, second_speaker, 1000)
end

So now your quest is done.
Speak to Gonta and you will receive a quest to get him a Spas 12 shotgun.
This shows what to do to make a simple quest.
For more complex things there is more work.

Post comment Comments
Das_P0m
Das_P0m - - 539 comments

Its about some time this was written... but hey:

Thanks man!

Will use this to try to add my own quests in Clear Sky.
Yes... I know, its a bit different, there, but the basics are the same... at least from what I can see and understand.^^

Reply Good karma Bad karma+2 votes
Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account: