Creating unique NPCs

From Mod Wiki

Jump to: navigation, search

This is the way to do it if spawing the NPC from the all.spawn and its also needed to keep him there this is how i spawned blade in my LITZ mod

Note: Be careful about copying and pasting, as it may cause problems!

I Really hope this helps you.

You have to edit quite a few files:

Config>Text>ENG:

Stable_bio_name.xml

Config>Gameplay:

NPC_Profile.xml Character_desc_escape

Config>Cretures:

m_stalker.ltx

scripts or Config>scripts not sure which one

Change the according gulag script EG:gulag_escape

and then you would have to edit the all.spawn to accomadate and spawn him

(shows example of blade My character from my LITZ mod)

m_stalker.ltx

[esc_blade]:stalker
character_profile = esc_blade
visual            = actors\dolg\stalker_do_nauchniy.ogf
corpse_visual     = actors\dolg\stalker_do_nauchniy.ogf
immunities_sect   = stalker_immunities

thats placed at the bottom

Character_desc_escape.XML

<!-------------------------------------esc_blade------------------------------------------------------->
<specific_character id="esc_blade" team_default = "1">
	<name>esc_blade_name</name>
	<icon>ui_npc_u_stalker_do_nauchniy</icon>
	<bio>esc_blade_bio</bio>
 
	<class>esc_blade</class>
	<community>stalker</community> <terrain_sect>stalker_terrain</terrain_sect>
 
	<rank>820</rank>
	<reputation>840</reputation>
	<money min="2000" max="5000" infinitive="0"></money>
 
	<snd_config>characters_voice\human_03\dolg</snd_config>
	<crouch_type>0</crouch_type>
 
	<visual>actors\dolgs\talker_do_nauchniy</visual>
	<supplies>
		[spawn] n\
		wpn_walther n\
		ammo_9x19_pbp = 1 n\
		wpn_groza n\
		ammo_9x39_ap = 1 n\
		ammo_9x39_sp5 = 1 n\
		ammo_vog-25p = 2 n\
		#include "gameplaycharacter_items.xml" n\
		#include "gameplaycharacter_food.xml" n\
		#include "gameplaycharacter_drugs.xml"
	</supplies>
 
 
	#include "gameplaycharacter_criticals_6.xml"
	#include "gameplaycharacter_dialogs.xml"
 
	<start_dialog>hello_dialog</start_dialog>
</specific_character>

NPC_Profile.XML

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

Stable_bio_name

<string id="esc_blade_name">
	<text>Blade</text>
</string>
<string id="esc_blade_bio">
	<text>The leader of the Duty camp near the military outpost, his good leadership skills and tactics won Duty the camp and overthrew the Bandits</text>
</string>

(shows all.spawn section for blade):

[870]
; cse_abstract properties
section_name = stalker
name         = esc_blade
position     = 109.19536590576, 7.1485390663147, 0.9805214738846
direction    = 0.0445535257458687,-0.000645029998850077,0.0144814234226942
 
; cse_alife_trader_abstract properties
money             = 5000
character_profile = esc_blade
 
; cse_alife_object properties
game_vertex_id  = 119
distance        = 3.5
level_vertex_id = 410518
object_flags    = 0x==bf
custom_data     = <<END
[smart_terrains]
none = true
END
 
; cse_visual properties
visual_name = actors\dolg\stalker_do_nauchniy
 
; cse_alife_creature_abstract properties
g_team  = 0
g_squad = 1
g_group = 5
health  = 2
dynamic_out_restrictions =
dynamic_in_restrictions =
 
upd:health         = 2
upd:timestamp      = 0x6d6d695f
upd:creature_flags = 0x75
upd osition        = -210.632614135742,-20.050708770752,-142.461120605469
upd _model         = 0
upd _torso         = -0.000645029998850077,0.0445535257458687,0
upd:g_team         = 0
upd:g_squad        = 1
upd:g_group        = 5
 
; cse_alife_monster_abstract properties
 
upd:next_game_vertex_id = 65535
upd rev_game_vertex_id  = 65535
upd:distance_from_point = 0
upd:distance_to_point   = 0
 
; cse_alife_human_abstract properties
predicate5 = 1,0,0,2,0
predicate4 = 2,2,1,2
 
(Cant 100% remember what these do sorry)
 
; cse_ph_skeleton properties
 
upd:start_dialog =
 
; se_stalker properties

Just to add to the all.spawn part:

I find that all the things change around when compiled, you can muck things up, i usualy go to the last alife file and look at the last entity ID number, then add one up from that, however im sure i read once, for example, lets say escape_alife ends in 200 (I know it dosent its a example), and then the next alife file starts with 201, you can apprently make your character 201 in the escape file without messing up the rest, however to be safe do the first thing i said.

Apart from the gulag scripts thats pretty much it, lets move to that now with a quick summary of what they do:

Gulags control the Smart Terrains (ST) and quite alot of logic for the Alife in stalker, mainly controling the places NPC's and monsters "Camp", it also contains the list of "Job's" for each ST, if changing ST's then be carefull, if you chance the capacity beyond that of the Availble jobs, the game will crash, you can also change the the type of communites that can occupy a certain ST, which in turn can bring intresting results, but thats not for here. :)

Hope this helped you please tell me if this worked for you.

Tutorial By Jamie Roberts (Jamie1992)

Personal tools