This tutorial teaches you:
- How to create a new unique stalker and squad
- How to create an exclusive gulag job using the 'beh' scheme (No need for Level Editor or ACDC)
- How to spawn squads
Files you will edit:
- S.T.A.L.K.E.R. - Call of Chernobyl\gamedata\configs\gameplay\npc_profile.xml
- S.T.A.L.K.E.R. - Call of Chernobyl\gamedata\configs\gameplay\character_desc_marsh.xml
- S.T.A.L.K.E.R. - Call of Chernobyl\gamedata\configs\gameplay\dialogs_marsh.xml
- S.T.A.L.K.E.R. - Call of Chernobyl\gamedata\configs\text\eng\st_dialogs_marsh.xml
- S.T.A.L.K.E.R. - Call of Chernobyl\gamedata\configs\text\eng\st_characters.xml
- S.T.A.L.K.E.R. - Call of Chernobyl\gamedata\configs\creatures\spawn_sections_marsh.ltx
- S.T.A.L.K.E.R. - Call of Chernobyl\gamedata\configs\misc\squad_descr_marsh.ltx
- S.T.A.L.K.E.R. - Call of Chernobyl\gamedata\configs\scripts\marsh\smart\mar_smart_terrain_base.ltx
- S.T.A.L.K.E.R. - Call of Chernobyl\gamedata\configs\misc\simulation.ltx
Files you will create:
- S.T.A.L.K.E.R. - Call of Chernobyl\gamedata\configs\scripts\marsh\mar_smart_terrain_base_new_job.ltx
Creating a new NPC:
- Decide where you would like your NPC to be located. For this tutorial, I want to make a NPC in Clear Sky base.
- Open S.T.A.L.K.E.R. - Call of Chernobyl\gamedata\configs\gameplay\npc_profile.xml
- Create a new xml tag containing a new Character and Class ID. This will be used by our new Character Profile.
Code: Select all
<character id="mar_smart_terrain_my_new_npc">
<class>mar_smart_terrain_my_new_npc</class>
</character>
- Create a new xml tag containing a new Character and Class ID. This will be used by our new Character Profile.
- Open S.T.A.L.K.E.R. - Call of Chernobyl\gamedata\configs\gameplay\character_desc_marsh.xml
- Create a new Character Profile. You can copy an existing profile and change the tags as needed.
Code: Select all
<!-- MY NEW NPC -->
<specific_character id="mar_smart_terrain_my_new_npc" team_default = "1">
<name>mar_smart_terrain_my_new_npc_name</name>
<icon>ui_inGame2_csky_1</icon>
<map_icon x="1" y="0">
</map_icon>
<bio></bio>
<class>mar_smart_terrain_my_new_npc</class>
<community>csky</community>
<terrain_sect>stalker_terrain</terrain_sect>
<snd_config>characters_voice\human_02\csky\</snd_config>
<rank>7215</rank>
<reputation>1403</reputation>
<money min="1000000" max="1000000" infinitive="1" />
<visual>actors\stalker_nebo\stalker_nebo_1</visual>
<supplies>
[spawn] \n
wpn_ak74u = 1 \n
ammo_5.45x39_fmj = 1 \n
</supplies>
<start_dialog>mar_smart_terrain_my_new_npc_start</start_dialog>
<actor_dialog>dm_ordered_task_dialog</actor_dialog>
<actor_dialog>dm_ordered_task_completed_dialog</actor_dialog>
<actor_dialog>dm_ordered_task_cancel_dialog</actor_dialog>
<actor_dialog>actor_break_dialog</actor_dialog>
#include "gameplay\character_criticals_4.xml"
</specific_character>
- For 'specific_character id' we want to use the name we defined in npc_profile.xml. I used mar_smart_terrain_my_new_npc.
- For the 'name' tag we will use mar_smart_terrain_my_new_npc_name. This will refer to a text string alias that we will add later on in this tutorial.
- The 'icon' tag refers to a texture alias defined in gamedata\configs\ui\textures_descr\ui_actor_portrets.xml. For this tutorial I'll just use generic ui_inGame2_csky_1
- The 'visual' tag refers to the NPC's mesh name. For this tutorial I will just use generic actors\stalker_nebo\stalker_nebo_1
- The 'supplies' tag allows you to set the npc's spawn loadout. It's important to use the '\n' because the text within this tag is loaded by the engine as an .ltx.
- For 'start_dialog' I will use mar_smart_terrain_my_new_npc_start. This refers to a dialog xml tag we have yet to add!
- For 'actor_dialog' I want this NPC to be able to use the new CoC task system. So we add the three new dialogs 'dm_ordered_task_*'
- 'community' refers to faction. Make sure you use the names from game_relations.ltx, (ie. Duty would be <community>dolg</community>).
- 'snd_config' refers to the character voice sets. I'll just use the generic human_02\csky set.
- Create a new Character Profile. You can copy an existing profile and change the tags as needed.
- Open S.T.A.L.K.E.R. - Call of Chernobyl\gamedata\configs\gameplay\dialogs_marsh.xml
- We're just going to add a tag for mar_smart_terrain_my_new_npc_start. This will just be a very simple start dialog.
Code: Select all
<dialog id="mar_smart_terrain_my_new_npc_start">
<phrase_list>
<phrase id="0">
<text>mar_smart_terrain_my_new_npc_start_dialog_1</text>
</phrase>
</phrase_list>
</dialog>
- mar_smart_terrain_my_new_npc_start_dialog_1 refers to a text string we will be adding later.
- We're just going to add a tag for mar_smart_terrain_my_new_npc_start. This will just be a very simple start dialog.
- Open S.T.A.L.K.E.R. - Call of Chernobyl\gamedata\configs\text\eng\st_dialogs_marsh.xml
- Add a new string tag with id="mar_smart_terrain_my_new_npc_start_dialog_1". For this tutorial, I'll just keep it simple:
Code: Select all
<string id="mar_smart_terrain_my_new_npc_start_dialog_1">
<text>Yes? What do you need, stalker?</text>
</string>
- Add a new string tag with id="mar_smart_terrain_my_new_npc_start_dialog_1". For this tutorial, I'll just keep it simple:
- Open S.T.A.L.K.E.R. - Call of Chernobyl\gamedata\configs\text\eng\st_characters.xml
- We want to added a new string tag for our character's name:
Code: Select all
<string id="mar_smart_terrain_my_new_npc_name">
<text>Tutorial NPC</text>
</string>
- We want to added a new string tag for our character's name:
- Open S.T.A.L.K.E.R. - Call of Chernobyl\gamedata\configs\creatures\spawn_sections_marsh.ltx
- Here is where we create the object section for our new stalker.
Code: Select all
[mar_smart_terrain_my_new_npc]:stalker
$spawn = "respawn\mar_smart_terrain_my_new_npc"
character_profile = mar_smart_terrain_my_new_npc
community = csky
story_id = mar_smart_terrain_my_new_npc
- The section name doesn't necessarily have to be the same as our character profile name. Story ID doesn't necessarily have to be the same as our section or character profile name, but it makes it easier to remember.
- Here is where we create the object section for our new stalker.
- Open S.T.A.L.K.E.R. - Call of Chernobyl\gamedata\configs\misc\squad_descr_marsh.ltx
- Now we need to create a new squad that will spawn this NPC.
Code: Select all
[mar_smart_terrain_my_new_npc_squad]:online_offline_group
faction = csky
npc = mar_smart_terrain_my_new_npc
target_smart = mar_smart_terrain_base
story_id = mar_smart_terrain_my_new_npc_squad
- Since we are creating a unique NPC, we will want to force it to target a specific smart. We want mar_smart_terrain_base for our tutorial. This refers to the actual section name of the smart_terrain. You can use debug hud in PDA to find them.
Okay, our NPC is done, now we need to create a gulag job for it. Make sure you have -dbg passed to your shortcut to enabled debug mode. You'll need it. - Now we need to create a new squad that will spawn this NPC.
- Run Stalker Call of Chernobyl by launching the game.
- While in-game, enable the debug hud through gameplay options.
- Pause the game to enter the main menu. Press F3 until you see 'actor_position' in the developer console (press `).
- While back in-game you will see a HUD displaying positional data.
- Find a suitable location you want your NPC to sit or stand. Make sure it says 'valid = true' in the HUD for this position.
- Pause the game to enter main menu. Press 'P' while in the main menu to print this positional information to a file called positional_info.txt in your main game directory.
- Exit the game and open the S.T.A.L.K.E.R. - Call of Chernobyl\positional_info.txt.
- Open S.T.A.L.K.E.R. - Call of Chernobyl\gamedata\configs\scripts\marsh\smart\mar_smart_terrain_base.ltx
- This is the "custom data" or "logic" for the mar_smart_terrain_base smart terrain.
- We want to add our new exclusive job to the smart terrain.
Code: Select all
[exclusive]
our_new_exclusive_job = marsh\mar_smart_terrain_base_new_job.ltx
- Now create a new file S.T.A.L.K.E.R. - Call of Chernobyl\gamedata\configs\scripts\marsh\mar_smart_terrain_base_new_job.ltx
- This is the "custom data" or "logic" for the mar_smart_terrain_base smart terrain.
- Open S.T.A.L.K.E.R. - Call of Chernobyl\gamedata\configs\scripts\marsh\mar_smart_terrain_base_new_job.ltx
- The 'beh' scheme is a new scheme created in Call of Chernobyl. It allows the ability to use scripted waypoints without the need to create them in all.spawn or Level Editor. But keep in mind positional data changes if the level geometry is changed.
- You can have as many points as you want. You can use path_end = loop or path_end = reverse
- guard refers to an animation state defined in gamedata\scripts\state_lib.script.
- 88860000 refers to the delay in miliseconds before changing to the next point.
- If you want to use an animpoint animation, then you need to use 'animpoint:' instead of 'pos:'. But with animpoint it uses 6 params instead of three: x,y,z,dirx,diry,dirz Direction should be the same as 'Heading' in the positional data.
Code: Select all
[logic@mar_smart_terrain_base_new_job]
active = beh@mar_smart_terrain_base_new_job
suitable = {=check_npc_name(mar_smart_terrain_my_new_npc)} true
prior = 100
[beh@general]
behavior_state = beh_move
target = waypoint
walk_dist = 100
jog_dist = 220
wait_anim = rush
walk_anim = rush
jog_anim = rush
run_anim = rush
delay_anim = guard
gather_items_enabled = false
help_wounded_enabled = false
corpse_detection_enabled = false
meet = meet@general
[beh@mar_smart_terrain_base_new_job]:beh@general
pt1 = 88860000,guard | pos:-158.74140930176,0.61138713359833,-312.51971435547 look:-156.08723449707,0.5962917804718,-309.91674804688
path_end = loop
- The 'beh' scheme is a new scheme created in Call of Chernobyl. It allows the ability to use scripted waypoints without the need to create them in all.spawn or Level Editor. But keep in mind positional data changes if the level geometry is changed.
- Now that we created the exclusive gulag job, we want to spawn the NPC.
- Open S.T.A.L.K.E.R. - Call of Chernobyl\gamedata\configs\misc\simulation.ltx
- This file is the 'starting' spawns for the game. These only work on a NEW GAME.
- Find mar_smart_terrain_base section and add our squad section!
Code: Select all
[mar_smart_terrain_base]
mar_smart_terrain_my_new_npc_squad
- Now run the game and start a new game closest to your new NPC's location. You should see him. If not, feel free to comment below for help!