Modding existing weapons and ammo

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

Modding existing weapons and ammo

Postby mimic on 27 Nov 2010 18:04

Hi all,
first i want to say, since i tried SoC i fell in love with the game (even considering moving to prypiat and go live in the exclusion zone :-bd ).
now i installed CS with the 1.5.10 patch and was thinking, why not have a Saiga analog weapon.
Since i am new to modding, all i did was take the AK/74 and change the ammo it uses and make it so npcs don't use it to avoid having problems with npc trying to shoot 5.45mm out of a gun that uses 12gauge shot.
but i feel the gun has not enough power, needing 3-5 shots to kill a renegade in the swamp (i don't know why, but i start the game with an AK in my inventory).

this is what i have so far, had no crashes with this appart from when i tried to use a medkit:
things i've changed are in bold and red
[wpn_ak74]:identity_immunities,weapon_probability,default_weapon_params
GroupControlSection = spawn_group
discovery_dependency =
$spawn = "weapons\ak-74" ; name and section in level editor
$npc = off
$prefetch = 8
scheduled = off ; option for ALife Simulator
cform = skeleton
class = WP_AK74 ; class of the weapon that corresponding to CPP class
min_radius = 30 ; [] for AI
max_radius = 100 ; [] for AI
description = st_wpn_ak74_descr

ef_main_weapon_type = 2
ef_weapon_type = 6

default_to_ruck = false
sprint_allowed = true
control_inertion_factor = 1.0

;---DOF-------------------------------------------------------------------------
zoom_dof = 0.5, 1.0, 180
reload_dof = 0.0, 0.5, 5, 1.7
;-------------------------------------------------------------------------------

;-------------------------------------------------------------------------------
holder_range_modifier = 1.0 ; âî ñêîëüêî ðàç óâåëè÷èâàåòñÿ eye_range
holder_fov_modifier = 0.7 ; âî ñêîëüêî ðàç óâåëè÷èâàåòñÿ eye_fov
;-------------------------------------------------------------------------------
upgrades = up_gr_a_ak74, up_gr_b_ak74, up_gr_c_ak74, up_gr_d_ak74, up_gr_e_ak74, up_gr_f_ak74, up_gr_g_ak74, up_gr_h_ak74, up_gr_i_ak74, up_gr_j_ak74, up_gr_k_ak74
installed_upgrades =
upgrade_scheme = upgrade_scheme_u17b


cost = 4500 ; the price of the item
weapon_class = assault_rifle ; the type of the box that will be used in buy-menu in multiplayer mode

ammo_limit = 210 ; obsolete
ammo_elapsed = 30 ; obsolete
ammo_elapsed = 30

ammo_mag_size = 20 ; clip (magazine) size
fire_modes = 1, -1 ;removed the triple shot

ammo_class = ammo_12x70_buck, ammo_12x76_zhekan, ammo_12x76_dart; name of the ltx-section of used ammo
grenade_class = ammo_vog-25, ammo_vog-25p ; name of the ltx-section of used grenades

launch_speed = 0
hand_dependence = 1
single_handed = 0

slot = 2 ; // secondary
animation_slot = 2 ; type of the animation that will be used

inv_name = st_wpn_ak74 ; name in inventory
inv_name_short = st_wpn_ak74
inv_weight = 3.1 ; weight in inventory

inv_grid_width = 5 ; position and size of the icon that will be used to display weapon in the inventory menu
inv_grid_height = 2 ; all icons are on the texture ui_icon_equipment.dds,
inv_grid_x = 5 ; position and size are in terms of 64x64 squares
inv_grid_y = 5

kill_msg_x = 0
kill_msg_y = 28
kill_msg_width = 84
kill_msg_height = 28

;-------------------------------------------------------------------------------
;params of weapon recoil
fire_dispersion_base = 0.8 ;óãîë (â ãðàäóñàõ) áàçîâîé äèñïåðñèè îðóæèÿ (îðóæèÿ çàæàòîãî â òèñêàõ)
control_inertion_factor = 1.2f

;îòäà÷à
cam_relax_speed = 5 ;ñêîðîñòü âîçâðàòà â èñõîäíîå ïîëîæåíèå
cam_relax_speed_ai = 360
cam_dispersion = 0.7 ;óâåëè÷åíèÿ óãëà (â ãðàäóñàõ) ñ ïåðâûì âûñòðåëîì
cam_dispersion_inc = 0.7 ;óâåëè÷åíèe cam_dispersion ñ êàæäûì âûñòðåëîì
cam_dispersion_frac = 0.7 ;ñòâîë áóäåò ïîäûìàòüñÿ íà cam_dispersion*cam_dispersion_frac +- cam_dispersion*(1-cam_dispersion_frac)
cam_max_angle = 15.0 ;ìàêñèìàëüíûé óãîë îòäà÷è
cam_max_angle_horz = 5.0 ;(degree) maximum shot horizontal degree
cam_step_angle_horz = 0.7 ;(degree) size of step camera moved in horizontal position while shooting

zoom_cam_relax_speed = 5 ; scope & ironsight
zoom_cam_relax_speed_ai = 360
zoom_cam_dispersion = 0.6
zoom_cam_dispersion_inc = 0.6
zoom_cam_dispersion_frac = 0.7
zoom_cam_max_angle = 10.0
zoom_cam_max_angle_horz = 5.0
zoom_cam_step_angle_horz = 0.6

fire_dispersion_condition_factor = 15 ;óâåëè÷åíèå äèñïåðñèè â ïðîöåíòàõ ïðè ìàêñèìàëüíîì èçíîñå
misfire_probability = 0.0001 ;âåðîÿòíîñòü îñå÷êè ïðè ìàêñèìàëüíîì èçíîñå
misfire_condition_k = 0.7
condition_shot_dec = 0.0001 ;óâåëè÷åíèå èçíîñà ïðè êàæäîì âûñòðåëå
;-------------------------------------------------------------------------------



position = -0.026, -0.175, 0.0
orientation = 0, 0, 0

fire_point = 0,0.218,0.656 ; position (3rd person view) for particles of fire
fire_point2 = 0,0.161,0.583 ; position (3rd person view) for particles of fire (when shooting with secondary fire)

flame_particles = weapons\generic_weapon05 ; particles for shooting effects
smoke_particles = weapons\generic_shoot_00
grenade_flame_particles = weapons\generic_weapon01

shell_point = 0,0.216,0.174 ; position (3rd person view) for shell to throw out
shell_particles = weapons\generic_shells ; name of the particles for shells
shell_particles = weapons\generic_shells

PDM_disp_base = 1.0
PDM_disp_vel_factor = 1.7 ;äèñïåðñèÿ = 1+(ñêîðîñòü àêòåðà/10)*disp_vel_factor*PDM_disp_vel_factor
PDM_disp_accel_factor = 1.7
PDM_disp_crouch = 1.0
PDM_disp_crouch_no_acc = 1.0

; ttc
hit_power = 0.9, 0.9, 0.9, 0.9
hit_impulse = 120 ; size of physic impulse by bullet
hit_type = fire_wound ; [] type of the wound

hit_probability_gd_novice = 1
hit_probability_gd_stalker = 1
hit_probability_gd_veteran = 1
hit_probability_gd_master = 1

fire_distance = 1000 ; 1200 ; maximum fire distance that bullet can fly
bullet_speed = 900 ; starting bullet speed
rpm = 300 ; max round per minute
rpm_empty_click = 200
; end ttc

use_aim_bullet = true ;Ïîääåðæèâàåòñÿ ëè ïåðâàÿ ñóïïåð ïóëÿ
time_to_aim = 1.0

hud = wpn_ak74_hud

;--STRAP PARAMETERS-----------------------------------------------------------------
;ïîä ìèøêîé
strap_position = -0.26,-0.11,0.25 ; position (offset) and orientation of the weapon when it is strapped
strap_orientation = -15,-9,110 ; (3rd person view in degrees)
strap_bone0 = bip01_spine2
strap_bone1 = bip01_spine1

startup_ammo = 90
visual = dynamics\weapons\wpn_ak74\wpn_ak74.ogf

light_disabled = false
light_color = 0.6,0.5,0.3
light_range = 5
light_var_color = 0.05
light_var_range = 0.5
light_time = 0.2

ph_mass = 4
;cost = 2100

;addons
scope_status = 0 ; 0 - no addon
silencer_status = 2 ; 1 - permanent
grenade_launcher_status = 0 ; 2 - attachable

zoom_enabled = true ; (on,off)zoom mode (right mouse button)
zoom_rotate_time = 0.25
scope_zoom_factor = 50 ; fov for zoom mode

scope_name = wpn_addon_scope ; section name for the attachable scope
scope_x = 47 ; offset in inventory icon
scope_y = 0
silencer_name = wpn_addon_silencer ; section name for the attachable silencer
silencer_x = 224 ; offset in inventory icon
silencer_y = 13
grenade_launcher_name = wpn_addon_grenade_launcher
grenade_launcher_x = 126
grenade_launcher_y = 24

;çâóêè
snd_draw = weapons\ak74_draw
snd_holster = weapons\generic_holster
snd_shoot = weapons\n_ak74_shot

snd_empty = weapons\gen_empty, 0.5
snd_reload = weapons\groza_reload, 0.7
snd_shoot_grenade = weapons\gen_grenshoot
snd_reload_grenade = weapons\gen_grenload, 1.0, 0.8
snd_switch = weapons\groza_switch, 1.0, 0.5


;íàñòðîéêè äëÿ ãëóøèòåëÿ
silencer_hit_power = 0.77, 0.77, 0.77, 0.77
silencer_hit_impulse = 120
silencer_fire_distance = 1050
silencer_bullet_speed = 900

;silencer_flame_particles = weapons\generic_weapon01
silencer_smoke_particles = weapons\generic_shoot_00

snd_silncer_shot = weapons\w_ak74_shot1

silencer_light_color = 0.6,0.5,0.3
silencer_light_range = 0.01
silencer_light_var_color= 0.05
silencer_light_var_range= 0.5
silencer_light_time = 0.2


[wpn_ak74_hud]
zoom_hide_crosshair = true
attach_place_idx = 0
item_visual = dynamics\weapons\wpn_ak74\wpn_ak74_hud.ogf

hands_position = -0.120500,-0.180999,0.132501
hands_orientation = -2.599998,0.000000,-2.549999

hands_position_16x9 = -0.119500,-0.199000,0.091000
hands_orientation_16x9 = -0.750000,1.700000,-4.199999

item_position = 0.004111,0.008527,-0.005906
item_orientation = -15.488927,-3.320898,367.220154

shell_point = 0.017,0.054,0.17
shell_dir = 0.0, 1.0, 0.0
shell_bone = wpn_body

fire_point = 0,0.042,0.684
fire_bone = wpn_body
fire_point2 = 0.0,-0.011,0.553
fire_bone2 = wpn_body

anm_show = ak74_draw
anm_hide = ak74_holster
anm_idle = ak74_idle
anm_idle_sprint = ak74_idle_sprint
anm_idle_moving = ak74_idle_moving
anm_shots = ak74_shoot
anm_reload = ak74_reload
anm_idle_aim = ak74_idle_aim

anm_switch = ak74_switch_off ;abakan_switch_off
anm_switch_g = ak74_switch_on ;abakan_switch_on
anm_bore = ak74_idle_bore

anm_hide_w_gl = ak74_holster_w_gl
anm_show_w_gl = ak74_draw_w_gl
anm_idle_w_gl = ak74_idle_w_gl
anm_shots_w_gl = ak74_shoot_w_gl
anm_reload_w_gl = ak74_reload_w_gl
anm_idle_w_gl_aim = ak74_idle_aim_w_gl
anm_idle_sprint_w_gl = ak74_idle_sprint_w_gl
anm_idle_moving_w_gl = ak74_idle_moving_w_gl
anm_bore_w_gl = ak74_idle_bore_w_gl

anm_show_g = ak74_draw_w_gl ;abakan_draw_grenade
anm_hide_g = ak74_holster_w_gl ;abakan_holster_grenade
anm_idle_g = ak74_idle_w_gl ;abakan_idle_grenade
anm_reload_g = ak74_reload_grenade
anm_idle_g_aim = ak74_idle_aim_w_gl ;abakan_idle_grenade
anm_shots_g = ak74_shoot_grenade
anm_idle_sprint_g = ak74_idle_sprint_w_gl ;abakan_idle_sprint_grenade
anm_idle_moving_g = ak74_idle_moving_w_gl ;abakan_idle_moving_grenade
anm_bore_g = ak74_idle_bore_w_gl


aim_hud_offset_pos = -0.101500,0.012500,-0.018000
aim_hud_offset_rot = -0.032500,-0.032500,0.020000

aim_hud_offset_pos_16x9 = -0.100000,0.033500,0.029000
aim_hud_offset_rot_16x9 = 0.002500,-0.002500,-0.007500

gl_hud_offset_pos = 0,0,0;-0.053000,-0.059000,0.000000
gl_hud_offset_rot = 0,0,0;-0.145000,0.000000,0.000000

gl_hud_offset_pos_16x9 = 0,0,0;-0.130000,0.003500,0.000500
gl_hud_offset_rot_16x9 = 0,0,0;0.052500,0.045000,-0.010000

lean_hud_offset_pos = 0,0,0
lean_hud_offset_rot = 0,0,0

;-----------------------------------------------------------------------------
; Óíèêàëüíûå
;-----------------------------------------------------------------------------

[wpn_ak74_minigame]:wpn_ak74 ;new weapon for minigame "Shooting"
ammo_limit = 100
;ammo_mag_size = 10
ammo_class = ammo_minigame
fire_modes = 1
$spawn = "weapons\wpn_ak74_minigame"
cost = 0
quest_item = true
upgrades = up_gr_a_ak74, up_gr_b_ak74, up_gr_c_ak74, up_gr_d_ak74, up_gr_e_ak74, up_gr_f_ak74, up_gr_g_ak74, up_gr_h_ak74, up_gr_i_ak74, up_gr_j_ak74, up_gr_k_ak74
installed_upgrades = up_b_ak74, up_d_ak74, up_bd_ak74
upgrade_scheme = upgrade_scheme_u17b

[wpn_ak74_up]:wpn_ak74
$spawn = "weapons\uniq\ak_74_up"

upgrades = up_gr_a_ak74, up_gr_b_ak74, up_gr_c_ak74, up_gr_d_ak74, up_gr_e_ak74, up_gr_f_ak74, up_gr_g_ak74, up_gr_h_ak74, up_gr_i_ak74, up_gr_j_ak74, up_gr_k_ak74
installed_upgrades = up_b_ak74, up_d_ak74, up_e_ak74, up_i_ak74
upgrade_scheme = upgrade_scheme_u17b

[wpn_ak74_up2]:wpn_ak74
$spawn = "weapons\uniq\ak_74_up2"

scope_status = 2
grenade_launcher_status = 2

upgrades = up_gr_a_ak74, up_gr_b_ak74, up_gr_c_ak74, up_gr_d_ak74, up_gr_e_ak74, up_gr_f_ak74, up_gr_g_ak74, up_gr_h_ak74, up_gr_i_ak74, up_gr_j_ak74, up_gr_k_ak74
installed_upgrades = up_a_ak74, up_c_ak74, up_e_ak74, up_i_ak74, up_j_ak74
upgrade_scheme = upgrade_scheme_u17b


i really want to make this gun fun, so i can use it from start to finish.
this means i need to change the ammo power this gun uses: i would like shot to be more precise (less dispersion on longer distance) slug to be able to pretty much instakill unarmored NPCs, and dart to be used to pierce almost any armor.
also, i want to have fun seeing them fly through the air so the ragdoll effect should be quite high (without exagerating as i don't want them to die because of the flight...)
when i tried to change the ammo numbers in the weapons.tlx, i got CTD, same with the changes i made to the weapon, but this only when i use a medkit, go figure..., no biggy i just use a trainer so i can't die...
but if you could help me buy telling me what parameters have to be changed for this to work and be kind of reallistic, please let me know.

i would also appreciate if someone could write a guide explaining how to mod, i learned by checking this post:

http://forums.filefront.com/s-t-l-k-e-r-soc-modding-mapping-editing/307191-basic-modding-playable-examples.html

but i feel like it is not the best place to learn modding for total noobs like me.
tnx
mimic
New Member
 
Posts: 11
Joined: 27 Nov 2010 17:38

Re: Modding existing weapons and ammo

Postby Nightwatch on 29 Nov 2010 16:01

Welcome to the forum, mimic.

On the AK-74 issue, changing to a seemingly more powerful ammo does not necessarily help increasing the weapon's hitting power to an extent you wished. Instead of making the AK-74 fire shotgun shells, you can keep its original ammo or an ammo to still near to its own ammo size, but you can increase the hit_power and hit_impulse. You can check the values of more powerful similar weapons in the game and start from there.

On the modding guides question, the site that you refer seem quite adequate enough for giving a range of information on modding works. While it is relatively easier to change some values on item by item basis,( even which, I must emphasize that could produce some hazardous results if the game is checking "those values" in order to proceed with other functions) however, a larger scale modding would inevitably require a certain degree of understanding of scripting; how to read it to understand what a particular piece actually does and how that piece also affect the whole in general, so that the things would not contradict in the sense of computer working logic and so that the game would not crash.
It's learning process and can be achievable. There are a wealth of information on this site as well, you can start reading, it's a long walk; also there are many links on this site as well which refers some others sites giving additional and in some cases more detail information on various subjects in this work. :mozilla_smile:
NEWSA.SIMBION_TWEAK 3.0
Mod Website= Features, Video, Tips & Download Link: NEWSA.SIMBION_Tweak

Watch the Trailer: http://www.youtube.com/watch?v=1Ajw_f8K ... re=channel
Please Do Not download and install any files from links other than those on the Mod's Website
User avatar
Nightwatch
Site Admin
 
Posts: 2676
Joined: 13 Apr 2007 05:42
Location: London, United Kingdom

Re: Modding existing weapons and ammo

Postby mimic on 01 Dec 2010 14:34

Thanks for the quick reply, as the game is a few years old and got worse reviews then SoC, I feared it might be a while.

On another topic, can you please explain me (this is just for my personal fun...) how to create a completely new weapon from an existing one, without removing the game gun. I tried to create a .50 cal sniper rifle (Barrett m107) based on the SVD rifle and the 7.62 7h14 ammo (both just for visuals as i don't know how to create all the graphics and such associated with creating from scratch) without removing the SVD and the 7.62mm ammo. i just want to have fun and have a gun specifically for shooting bad guys hiding behind cars (so hit power on the gun and AP on the ammo will be quite high), is there a limit to the nuber you can put in those fields, i tried 10 and it didn't work, when the base was around 1.5. so i did a copy-paste of both in their respective file and changed the name, description, and values, all the rest remained unchanged..., however when i try to launch the game, it either CTD on startup, or when i load the game, on the "client synchronizing" phase. Can this be done, or can a specific weapon (graphic, animation, sounds...) be only used once?
mimic
New Member
 
Posts: 11
Joined: 27 Nov 2010 17:38

Re: Modding existing weapons and ammo

Postby Nightwatch on 02 Dec 2010 13:02

You're welcome :mozilla_smile:

Making a new gun from scratch with its graphics and animation, such as adding a Barret.50 cal with its own visuals, for example, is not an undertaking that can be seen lightly by any standards. It involves the knowledge and ability of working with professional graphics software, just for the visuals. On this forum, our talented friend jamie1992 has a graphics thread in which he renders some cars and other stuff which shows the level of graphics knowledge required for such tasks.
Show off your 3D models:
viewtopic.php?f=26&t=176

Apart from that, apart from (graphically) creating and incorporating a new gun into the game, an existing weapon can be changed in values as if it is a new weapon while keeping its visuals as the original one, but in a way having visually two copies of the same weapon, while each behaves differently. But this involves a bit more work than just adjusting the power values of the weapon, of course.

Long articles exist on this matter.

Check threats on this section of this forum, and also check the links on this section again on Important Links to Modding Questions and Answers, here:
viewtopic.php?f=3&t=145&p=2379#p2379

And, some example links from that thread:

Basic Modding with Playable Examples
http://forums.filefront.com/s-t-l-k-e-r ... mples.html

Also, another link from there to MOD SDK Official Help site: (you can navigate in the site to the subject you are interested in)
http://sdk.stalker-game.com/en/index.ph ... icial_help

I believe those articles that you would find in these places/threads would answer and direct your questions. Good luck. :mozilla_smile:
NEWSA.SIMBION_TWEAK 3.0
Mod Website= Features, Video, Tips & Download Link: NEWSA.SIMBION_Tweak

Watch the Trailer: http://www.youtube.com/watch?v=1Ajw_f8K ... re=channel
Please Do Not download and install any files from links other than those on the Mod's Website
User avatar
Nightwatch
Site Admin
 
Posts: 2676
Joined: 13 Apr 2007 05:42
Location: London, United Kingdom

Re: Modding existing weapons and ammo

Postby VINTAR on 07 Dec 2010 07:01

Hi mimic,

Just by reading your post I`m assuming youre getting a "duplicate section" crash.

What you need to do is :

1) create a new section name and inherit from the old one like so :

[wpn_barret]:wpn_svd
--here change all that you want to change IE ammo and the like

2) add your new section to mp_ranks so that npc`s can evaluate the weapon when picking it up.

3) add your weapon to the trader files so that it can be bought

4) add a new icon to ui_icon_equipment.dds so that your new weapon will look unique in your inventory
This will not mean, however, that it will look different ingame, this will require making a new model and meshes.

Then it should work fine :)
Core2Quad Q8300 2.5 @ 3.6ghz
Cooler Master Hyper TX 2 CPU cooler
Gigabyte EP45 UD3R mobo
Nvidia GTS450
2 GIGS Transcend DDR2 800 pc6400 @ 960
Thermaltake Tough Power 650w PSU
Samsung Syncmaster P2350
-----------------------------------
Apartheid veteran
User avatar
VINTAR
Senior Resident
 
Posts: 441
Joined: 18 Sep 2008 15:07
Location: Durban, South Africa


Return to Modding Techniques

Who is online

Users browsing this forum: No registered users and 20 guests

cron