## [Tutorial] Creating a unique NPC

Alundaio
S.T.A.L.K.E.R.
Posts: 1368
Joined: 26 May 2012, 22:26

### Re: [Tutorial] Creating a unique NPC

enable debug hud with -dbg and checkbox in game options.

Then press F3 while in the main menu until it says you toggled the Gulag Hud.

Then on the right panel you should see a list of jobs available at the nearest smart to your location, so get close as possible to the smart that has this job and make sure you see it. It will say nil if no NPC has the job and it will have game object ID if someone does.

Also, you can press F2 until it says 'squad hud' and this should reveal the target smart and curent job of nearest npc or npc you are looking at with crosshair. See what it says for your unique NPC.
"I have a dream that one day this community will rise up and live out the true meaning of its creed: "We hold these truths to be self-evident; that all mods are created equal."

Crowbar92
Scavenger
Posts: 5
Joined: 09 Jan 2017, 19:35

### Re: [Tutorial] Creating a unique NPC

Hi.

Been following this topic, but I am a bit unsure if I can accomplish what I want to create. I know I can create an unique npc with this tutorial. But, is it possible to create an unique Loner with a specific name and make him randomly travel and stay at multiple locations in the world? Like the guys on pda ranking.

Alundaio
S.T.A.L.K.E.R.
Posts: 1368
Joined: 26 May 2012, 22:26

### Re: [Tutorial] Creating a unique NPC

Yes, create the Unique NPC, but instead of giving him an exclusive job, don't. Also don't set 'target_smart' in squad description.
Just spawn him at a terrain and he will eventually go wherever. Don't give him a story_id if you want him to show up in top100.
"I have a dream that one day this community will rise up and live out the true meaning of its creed: "We hold these truths to be self-evident; that all mods are created equal."

Crowbar92
Scavenger
Posts: 5
Joined: 09 Jan 2017, 19:35

### Re: [Tutorial] Creating a unique NPC

Alundaio wrote:Yes, create the Unique NPC, but instead of giving him an exclusive job, don't. Also don't set 'target_smart' in squad description.
Just spawn him at a terrain and he will eventually go wherever. Don't give him a story_id if you want him to show up in top100.

Alright, thanks. Will try this out.

Crowbar92
Scavenger
Posts: 5
Joined: 09 Jan 2017, 19:35

### Re: [Tutorial] Creating a unique NPC

What is the scale of the "rank" and "reputation"?
For example:
<rank>3456</rank>
<reputation>778</reputation>

I tried comparing to others, but it doesn't make much sense to me. I don't know between which range the rank would make someone a rookie or experienced for example.

Alundaio
S.T.A.L.K.E.R.
Posts: 1368
Joined: 26 May 2012, 22:26

### Re: [Tutorial] Creating a unique NPC

gamedata\configs\creatures\game_relations.ltx

Code: Select all

rating_names      = st_rank_novice, 999, st_rank_trainee, 2999, st_rank_experienced, 5999, st_rank_professional, 9999, st_rank_veteran, 14999, st_rank_expert, 20999, st_rank_master, 27999, st_rank_legend

0 to 999 is novice
1000 to 2999 is trainee
3000 to 5999 is experienced
6000 to 9999 is professional
10,000 to 14,999 is veteran
15,000 to 20,999 is expert
21,000 to 27,999 is master
28,000+ is legendary
"I have a dream that one day this community will rise up and live out the true meaning of its creed: "We hold these truths to be self-evident; that all mods are created equal."

theharkonnen
Scavenger
Posts: 6
Joined: 04 Feb 2017, 11:31

### Re: [Tutorial] Creating a unique NPC

How does one get coordinates via the positional_info.txt for inaccessible locations?

For example, if I want to put a prisoner in the stalker Cordon base behind bars or a bartender in the Agroprom military base where the Duty one was.

Alundaio
S.T.A.L.K.E.R.
Posts: 1368
Joined: 26 May 2012, 22:26

### Re: [Tutorial] Creating a unique NPC

You can use demo_record to fly anywhere you want and press 'enter' to teleport to the camera position.
"I have a dream that one day this community will rise up and live out the true meaning of its creed: "We hold these truths to be self-evident; that all mods are created equal."

olivius74
Loner
Posts: 469
Joined: 12 Apr 2014, 17:09

### Re: [Tutorial] Creating a unique NPC

Last edited by olivius74 on 11 Feb 2017, 07:53, edited 1 time in total.

theharkonnen
Scavenger
Posts: 6
Joined: 04 Feb 2017, 11:31

### Re: [Tutorial] Creating a unique NPC

Alundaio wrote:You can use demo_record to fly anywhere you want and press 'enter' to teleport to the camera position.

Thank you, Alundaio.

After several hours of fiddling, I finally was able to add Sultan's first bodyguard. However, I noticed he does not face the direction I need. Is there a way to fix this? I followed your logic script on page 1. I copied the "direction" points as generated in the positional_info.ltx. I believe it may have to do something with his not generating on point, rather running to that point.

Alundaio
S.T.A.L.K.E.R.
Posts: 1368
Joined: 26 May 2012, 22:26

### Re: [Tutorial] Creating a unique NPC

stand where you want him to look, then print out the position and use it for look:x,y,z

pt1 = 88860000,guard | pos:x,y,z look:x,y,z
"I have a dream that one day this community will rise up and live out the true meaning of its creed: "We hold these truths to be self-evident; that all mods are created equal."

theharkonnen
Scavenger
Posts: 6
Joined: 04 Feb 2017, 11:31

### Re: [Tutorial] Creating a unique NPC

Alundaio wrote:stand where you want him to look, then print out the position and use it for look:x,y,z

pt1 = 88860000,guard | pos:x,y,z look:x,y,z

That is what I did. I copied and pasted the data straight from the positional_info.txt. But it seems that when they spawn, after they run to the target coordinates, they then face whatever direction they came from. So, despite adding six bodyguards now, they all face the wall.

Should i use "direction" or "direction HP"? I am not sure what the difference is.

I saw you had discussed something about animpoint in the original post, but I was not sure if that would solve the issue.

This is an example of what I used:

[logic@dv_bandit_bodyguard_1]
active = beh@dv_bandit_bodyguard_1
suitable = {=check_npc_name(dv_bandit_bodyguard_1)} 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@dv_bandit_bodyguard_1]:beh@general
pt1 = 1,guard | pos:28.983041763306,4.5425734519958,-85.995315551758
look:0.023988872766495,-0.05756762996316,0.99805337190628
path_end = loop

Alundaio
S.T.A.L.K.E.R.
Posts: 1368
Joined: 26 May 2012, 22:26

### Re: [Tutorial] Creating a unique NPC

I don't know if that is a formating mistake here but look needs to be on the exact same line as the point, not a new line
"I have a dream that one day this community will rise up and live out the true meaning of its creed: "We hold these truths to be self-evident; that all mods are created equal."

theharkonnen
Scavenger
Posts: 6
Joined: 04 Feb 2017, 11:31

### Re: [Tutorial] Creating a unique NPC

Alundaio wrote:I don't know if that is a formating mistake here but look needs to be on the exact same line as the point, not a new line

That is what it was. Thanks, again.

olivius74
Loner
Posts: 469
Joined: 12 Apr 2014, 17:09

### Re: [Tutorial] Creating a unique NPC

NPC Creator ,now in English : https://yadi.sk/d/ldMqmJD43Dq7jw

Thank you very much to Graff46

Alundaio
S.T.A.L.K.E.R.
Posts: 1368
Joined: 26 May 2012, 22:26

### Re: [Tutorial] Creating a unique NPC

Nice to finally see Russian tool in English! Right on time with me making my own tool multi-lingual.
"I have a dream that one day this community will rise up and live out the true meaning of its creed: "We hold these truths to be self-evident; that all mods are created equal."

olivius74
Loner
Posts: 469
Joined: 12 Apr 2014, 17:09

### Re: [Tutorial] Creating a unique NPC

Hello Dear Alundiao

Your tools now in French,display all in one windows is the best have seen since I play game for 10 years!
http://imgur.com/a/VZuT4
Extraordinary!Fabulous!And we can even change the translation without pass an editor hexa...
You made so awesome work to mod easily mod the game.
Congratulation for all of that,you're an extraordinary fine person!

I dream now for a little tool to create simple quest,an editor quest...May be one day you will create such a tool?
Exist russian program,but so hard to understand how they work...
I'm sure you will find again an awesome idea...
Best regard
Last edited by olivius74 on 12 Feb 2017, 05:59, edited 1 time in total.

Alundaio
S.T.A.L.K.E.R.
Posts: 1368
Joined: 26 May 2012, 22:26

### Re: [Tutorial] Creating a unique NPC

Thanks for the kind words. If you want to translate AXRToolset better you can change text in AXRToolset\configs\text\language.ltx under the [french] section.

Maybe one day I will. It will be difficult to design intuitively enough that would make it superior then to just edit the files yourself.
"I have a dream that one day this community will rise up and live out the true meaning of its creed: "We hold these truths to be self-evident; that all mods are created equal."

morris
Scavenger
Posts: 12
Joined: 16 Feb 2017, 02:33

### Re: [Tutorial] Creating a unique NPC

Well, attempted to create an elite simulation squad for Monolith as a test if I can implement more for everyone else, but... I'm getting errors all the time.

Here's the piece of code from character_desc_general.ltx

<!-- monolith -->
<specific_character id="sim_default_monolith_elite_1" team_default = "1">
<name>GENERATE_NAME_stalker</name>
<icon>ui_inGame2_monolit_4</icon>
<map_icon x="1" y="0"></map_icon>
<bio>ќпытный сталкер. ƒетальна¤ информаци¤ отсутствует.</bio>
<class>sim_monolith_elite</class>
<community>monolith</community> <terrain_sect>stalker_terrain</terrain_sect>
<snd_config>characters_voice\human_02\monolith\</snd_config>
<rank>8494</rank>
<reputation>140</reputation>
<visual>actors\stalker_monolith\stalker_monolith_4</visual>
<supplies>
[spawn] \n
wpn_groza \n
ammo_9x39_ap = 1 \n
wpn_sig220 = 1 \n
ammo_11.43x23_hydro = 1 \n
#include "gameplay\character_items_monolith.xml"
#include "gameplay\character_food.xml"
#include "gameplay\character_drugs_4.xml"
#include "gameplay\character_drugs_sci.xml"
#include "gameplay\character_drugs_mil.xml"
</supplies>
#include "gameplay\character_criticals_4.xml"
#include "gameplay\character_dialogs.xml"
</specific_character>

also 3 more, with ID's sim_default_monolith_elite_2/3/4 respectively.

npc_profile

<character id="sim_default_monolith_elite_1">
<class>sim_default_monolith_elite_1</class>
</character>

faction = monolith
npc_random = sim_default_monolith_elite_1, sim_default_monolith_elite_2, sim_default_monolith_elite_3, sim_default_monolith_elite_4

spawn_sections_general

[sim_monolith_elite]:stalker
$spawn = "respawn\sim_monolith_elite" character_profile = sim_monolith_elite spec_rank = master community = monolith simulation_objects_props [sim_monolith_elite_squad]:default_squad sim_avail = true Where do I have mistakes? Kimikim Scavenger Posts: 13 Joined: 21 Jul 2016, 16:00 ### Re: [Tutorial] Creating a unique NPC morris wrote:Well, attempted to create an elite simulation squad for Monolith as a test if I can implement more for everyone else, but... I'm getting errors all the time. Here's the piece of code from character_desc_general.ltx Code: Select all  <!-- monolith --> <specific_character id="sim_default_monolith_elite_1" team_default = "1"> <name>GENERATE_NAME_stalker</name> [...] <class>sim_monolith_elite</class> [...] </specific_character> From skimming through the CoC files, it seems to me that the text inside the class field is supposed to be the same as the class field in npc_profile.xml So in npc_profile.xml: Code: Select all  <character id="sim_default_monolith_elite_1"> <class>sim_monolith_elite</class> </character> I don't know so don't take my word for it, but if I were to guess, this creates a valid character_profile value (the ID of the "character" entry, "sim_default_monolith_elite_1"), to be used in spawn_sections_general (and squad descriptions?), which refers to a random "specific_character" entry in character_desc_general.xml with the same "class" field as that of the "character" entry in npc_profile.xml. This would mean that if you have several entries in "character_desc_general.xml" with the same "class" value, and create a character entry in "npc_profile.xml" also using that class value, you can just use the ID of the entry in npc_profile to refer to a random entry in character_desc_general.xml. Pure speculation though. also 3 more, with ID's sim_default_monolith_elite_2/3/4 respectively. If you don't want any randomness involved, set the "class"-field in "character_desc_general.xml" to be the same as the ID of the "specific_character". <character id="sim_default_monolith_elite_1"> <class>sim_default_monolith_elite_1</class> </character> Class here should be the same as class in character_desc_general.xml. Just to be clear. The ID is what you use in all the .ltx-files. Code: Select all [sim_monolith_elite_squad]:online_offline_groupfaction = monolithnpc_random = sim_default_monolith_elite_1, sim_default_monolith_elite_2, sim_default_monolith_elite_3, sim_default_monolith_elite_4npc_in_squad = 5 The list in npc_random I think refer to IDs inside npc_profile.xml. If it looks like this, you can set the "class" fields of every character in character_desc_general.xml to "sim_monolith_elite", make an entry in npc_profile.xml looking like this: Code: Select all <character id="sim_monolith_elite"> <class>sim_monolith_elite</class></character> And then, instead of the npc_random line above, this: Code: Select all [sim_monolith_elite_squad]:online_offline_groupfaction = monolithnpc_random = sim_monolith_elitenpc_in_squad = 5 This will (probably) choose 5 random NPCs from character_desc_general.xml that have the class "sim_monolith_elite". Code: Select all [sim_monolith_elite]:stalker$spawn                     = "respawn\sim_monolith_elite"character_profile     = sim_monolith_elitespec_rank = mastercommunity = monolith
Not sure how this works, but character_profile probably refers to a npc_profile.xml-entry. Leave it the way it is and it'll probably work the way you want. The same probably goes for the simulation_objects_props-entry.

Hopefully I relieved someone who actually knows how this works of some trouble Correct me if I'm wrong I guess.