How to replace Npc's weapon?

Discussions on Modding of S.T.A.L.K.E.R. SoC & Clear Sky

How to replace Npc's weapon?

Postby deakblack on 01 Jun 2010 07:31

Hello all~
im new to STALKER modification and know few about it~
Recently im playing COP~ what i want to do is replacing weapons carried by those NPCs like Stalker,duty,freedom etc.
i've searched many tutorial but none mentions how to do so. (if where is i might miss it)
Can someone please tell me the particular way to proceed it?


Ps:sorry for bad english
User avatar
deakblack
New Member
 
Posts: 8
Joined: 01 Jun 2010 05:45

Re: How to replace Npc's weapon?

Postby jamie1992 on 01 Jun 2010 14:41

Hi, and welcome to the forum.

Let me give you a brief run over how to change someones weapons and such.

Ok so at this point I gathered you have extraced the Stalker DB files to somewhere. If so then please continue.

So the files you need to find are =

character_desc_general.xml
character_desc_jupiter.xml
character_desc_zaton.xml
character_desc_pripyat.xml


These files can be found in = gamedata\configs\gameplay

Once you find them, open one up, you will see alot of Sections.

Pay attention to the sections labelled as [spawn] \n

You will see one that might say for example

<supplies>
[spawn] \n
wpn_ak47 \n
ammo_5.56x45_ss190 = 1 \n
grenade_rgd5 = 1 \n
wpn_binoc = 1 \n
#include "gameplay\character_items.xml"
#include "gameplay\character_food.xml"
#include "gameplay\character_drugs.xml"
</supplies>


All you need to do is change the wpn_xxx to something, or add your own, make sure to add the \n otherwise you will get a crash. As for Ammo such as the 5.56 the 1 denotes how many full boxes will be given.

The #include"xxxxx\xxxxxxx_xxxxx.xml" is a add on file, if you wish, you can create your own XML and set various parameters or even spawn chances, so in essence you can create random weapon load-outs each and every time they spawn etc. But that's a different story. Anyway, after editing the above to whatever it is that suits your fancy, save it, and create the gamedata tree or if its already done then just save, load up stalker, and you have to start a new game if I recall.

Hope this helps.

Jamie
Wu Tang! Wu Tang! Wu Tang!
User avatar
jamie1992
Senior Resident
 
Posts: 802
Joined: 12 Sep 2008 23:04
Location: Oxford, Oxfordshire, United Kingdom

Re: How to replace Npc's weapon?

Postby deakblack on 05 Jun 2010 15:02

thank u for answering my question twice ,jamie~
very particular~ it helps a lot~~~~~

thanks~
User avatar
deakblack
New Member
 
Posts: 8
Joined: 01 Jun 2010 05:45

Re: How to replace Npc's weapon?

Postby ket on 07 Jun 2010 14:38

To clear what J is unsure on, yes, you have to start a new game to see NPCs using the weapons you gave them.
Mobo: MSI X570 Tomahawk
CPU: R7 3700X @ 4.4GHz 1.3v
RAM: 2x16GB Klevv BoltX 3600MHz 16-20-20-35
GPU: Powercolor 6800XT Red Devil
Sound: Asus Xonar DX 7.1 PCI-E, Realtek ALC1200
HDD: 250GB & 500GB nVME 3.0 M.2 drives, 2TB Seagate Barracuda, Sata3 64MB Cache, 250GB Hynix SL301
Opticals: DVD-RW, Blu-Ray
PSU: eVGA 1000w G2 Supernova
Case: NZXT Phantom 530

STALKER: Singularity (SIN) homepage
User avatar
ket
Senior Resident
 
Posts: 1262
Joined: 14 Sep 2008 11:57
Location: The solar system

Re: How to replace Npc's weapon?

Postby deakblack on 07 Jun 2010 15:45

jamie1992 wrote:The #include"xxxxx\xxxxxxx_xxxxx.xml" is a add on file, if you wish, you can create your own XML and set various parameters or even spawn chances, so in essence you can create random weapon load-outs each and every time they spawn etc. But that's a different story. Anyway, after editing the above to whatever it is that suits your fancy, save it, and create the gamedata tree or if its already done then just save, load up stalker, and you have to start a new game if I recall.



oh~~~
MR J plz plz plz plz plz tell me how to give them random weapon load-outs ~
also,i want them to use grenadelauncher addons~ i saw someone made it from youtube video without description.
User avatar
deakblack
New Member
 
Posts: 8
Joined: 01 Jun 2010 05:45

Re: How to replace Npc's weapon?

Postby MeanderingBeing on 08 Jun 2010 01:15

deakblack wrote:
jamie1992 wrote:The #include"xxxxx\xxxxxxx_xxxxx.xml" is a add on file, if you wish, you can create your own XML and set various parameters or even spawn chances, so in essence you can create random weapon load-outs each and every time they spawn etc. But that's a different story. Anyway, after editing the above to whatever it is that suits your fancy, save it, and create the gamedata tree or if its already done then just save, load up stalker, and you have to start a new game if I recall.



oh~~~
MR J plz plz plz plz plz tell me how to give them random weapon load-outs ~
also,i want them to use grenadelauncher addons~ i saw someone made it from youtube video without description.


They use em in AMK NS... Couldn't tell you what files it'd be in though... you may wish to give the files a look over anyways though... I remember my shock when I found that out. I was assaulting the military in agroprom (they get helicopter support and reinforcements) and I had ran into a building. Next thing I knew, one of the soldiers had launched a grenade through the window and made me a nice smear on the wall... I was actually on skype with Jamie at the time, and if I recall correctly, I was swearing and yelling excitedly "THEY USE GRENADE LAUNCHERS! THE MOTHERF***ERS USE GRENADE LAUNCHERS!" Ah, nothing like a mixture of being pissed off and happy to make yer day... XD
LOOK! It says gullible on the ceiling!!!
User avatar
MeanderingBeing
Senior Resident
 
Posts: 631
Joined: 28 Sep 2008 07:03
Location: The Road.... AGAIN....

Re: How to replace Npc's weapon?

Postby deakblack on 08 Jun 2010 16:49

yeahh~~~i do understand that feeling~~~so Fxxking exciting~ i may try to download AMK and research it sometime~~~ damn ~ i wish i can have a long time break that i can focus on it.

errrr.... what about there random weapon loadouts?
User avatar
deakblack
New Member
 
Posts: 8
Joined: 01 Jun 2010 05:45

Re: How to replace Npc's weapon?

Postby jamie1992 on 08 Jun 2010 16:53

deakblack wrote:
jamie1992 wrote:The #include"xxxxx\xxxxxxx_xxxxx.xml" is a add on file, if you wish, you can create your own XML and set various parameters or even spawn chances, so in essence you can create random weapon load-outs each and every time they spawn etc. But that's a different story. Anyway, after editing the above to whatever it is that suits your fancy, save it, and create the gamedata tree or if its already done then just save, load up stalker, and you have to start a new game if I recall.



oh~~~
MR J plz plz plz plz plz tell me how to give them random weapon load-outs ~
also,i want them to use grenadelauncher addons~ i saw someone made it from youtube video without description.


No problem! Let me help.

Ok so take for example any XML file. It matters not which one, completely clear it and name it something like weapon.xml

Open up a Desc Char file, for example character_desc_escape.xml

Move down to wolfs section. - esc_wolf In his supplies section as noted above in my previous post. Put #include "gameplay\weapon.xml" Make sure your weapon.xml file is in the gameplay folder like all others.

Remove all other entries, or atleast the ones of which you wanna randomize, lets say for example you want to do assault rifles. Get rid of his AK and ammo.

Now, open the new file you made. And inside it should be blank, what you now need to do is this.

Place a line inside as so.

wpn_xxxx = 1, prob = 0.5 \n

The = 1 is how many to calculate, and the prob = 0.5 is a 50% chance for that one to spawn. If you put = 2, prob = 0.5 then there would be a 50% chance for both seperatly to spawn. If that makes sense.

You can also make it so that they have addons on their weapons.

wpn_xxxx = 1, scope prob = 0.3 \n

This means 1 marked rifle, with a scope that has a 30% chance to spawn.

All you need to do now is make multiple lines, consisting of all guns. Various loadouts and such. You can also make seperate ones, so you can make one for Rifles, one for Pistols, etc, and name them as so, so that both pistol & rifle are calculated randomly.

You will need to do the same with Ammo, there are ways to refine it. And such. This is just a breif run down. I hope it helps you and clears things up.

Jamie
Wu Tang! Wu Tang! Wu Tang!
User avatar
jamie1992
Senior Resident
 
Posts: 802
Joined: 12 Sep 2008 23:04
Location: Oxford, Oxfordshire, United Kingdom

Re: How to replace Npc's weapon?

Postby deakblack on 09 Jun 2010 17:10

Thank you Thank you Thank you Thank you so much !!!!!
Very particular very helpful ~~~
This forum is full of good guys who are willing to help rookies (IMO)

ok ~ next question ~ (i got tons of questions about modding although im reading those tutorials because most of them are old may be not suitable for COP)

i want to add new weapons from other mods (like SMRTER mod,which is not a pure weapon mod), what files should i copy to my own gamedata folder?

meshes? textures? and XXXX.LTX from gamedata\configs\weapons ?
as least i know i should change something in the mise folder to make a trader selling new weapons.

the more particular the better~

sorry for my bad english~ XD
User avatar
deakblack
New Member
 
Posts: 8
Joined: 01 Jun 2010 05:45

Re: How to replace Npc's weapon?

Postby jamie1992 on 09 Jun 2010 17:42

deakblack wrote:Thank you Thank you Thank you Thank you so much !!!!!
Very particular very helpful ~~~
This forum is full of good guys who are willing to help rookies (IMO)

ok ~ next question ~ (i got tons of questions about modding although im reading those tutorials because most of them are old may be not suitable for COP)

i want to add new weapons from other mods (like SMRTER mod,which is not a pure weapon mod), what files should i copy to my own gamedata folder?

meshes? textures? and XXXX.LTX from gamedata\configs\weapons ?
as least i know i should change something in the mise folder to make a trader selling new weapons.

the more particular the better~

sorry for my bad english~ XD


Thats a good question.

Well I do not have Smrter installed, however the principle still applies.

Open up a specific weapons LTX file, nearly everything you will need to find, will be listed inside.

One example, it will say. description = xxx_xxxxx_xxxxx This is what description for the weapon is. You can find this line inside the Text folders. Such as for example, string_table_enc_weapons contains a large part all text for weapons, its description and TAG id. This is one file. How you take the info is down to you, either take it and put it into your own, or just use the smrter files and clean them up afterwards.

inv_name = ars-beretta92
inv_name_short = ars-beretta92


I Suggest you get Agent Ransack and learn how to use it, you will find files containing specific lines of text and code VERY easily and quickly.

Eventually, you will get to the point, where you will just have to find which models and sounds, textures, and code it requires, you then compile it all together into your own mod and test. Even if you miss something, the crash log with clear up anything you have missed.

It really is THAT simple.

Sorry this was short, I've got no Smrter files to be specific from nor do I have much time today. However if you scan the LTX in the weapons folder of whichever weapon you wish to rip out, you will be able to find all the Mesh names and sounds etc. Its straight forward when you apply a little bit of Logical thinking.

Hope this helped. Again sorry for the short reply.

Jamie
Wu Tang! Wu Tang! Wu Tang!
User avatar
jamie1992
Senior Resident
 
Posts: 802
Joined: 12 Sep 2008 23:04
Location: Oxford, Oxfordshire, United Kingdom

Re: How to replace Npc's weapon?

Postby deakblack on 09 Jun 2010 18:09

Oh dear! u r online! (why i dont see that red "online" label? Hmm...whatever)

no~~ this reply isnt short at all~
as helpful as before.
i will download Agent Ransack and try to use it~

is there any tool for checking out the error that cause CTD~
i got the Ltx Checker 0.7.0.0 but it always say "Input file not found" when i try to check that file , im sure i give it the correct direction.

ok~ next short question~
im editting those weapon ltx files.

about w_l85.ltx,i was trying to give it a silencer without the requirement of upgrade.so i made this change as below:

;addons
scope_status = 1
silencer_status = 0 =====> 1
grenade_launcher_status = 0

once i save the file and start a new game~ it CTD in loading screen, i have no idea about this problem so i had to give it up.

about w_g36.ltx,i want to give it an attachable grenadelauncher so i change "grenade_launcher_status = 0" to "grenade_launcher_status = 2" but it doesnt work.No CTD,just cant attach nato grenadelauncher to it in game.Any idea?
User avatar
deakblack
New Member
 
Posts: 8
Joined: 01 Jun 2010 05:45

Re: How to replace Npc's weapon?

Postby deakblack on 09 Jun 2010 18:13

oh no!
wrong typing!

what i did to the l85 is changed "silencer_status = 0 =====> 2" which means attachable.
sorry for that~

sorry for my bad english again . XD
User avatar
deakblack
New Member
 
Posts: 8
Joined: 01 Jun 2010 05:45

Re: How to replace Npc's weapon?

Postby deakblack on 10 Jun 2010 09:17

i've downloaded the Agent Ransack ......
so hard to use it...
User avatar
deakblack
New Member
 
Posts: 8
Joined: 01 Jun 2010 05:45


Return to Modding Techniques

Who is online

Users browsing this forum: No registered users and 60 guests

cron