Call of Chernobyl is a free-play sandbox mod for S.T.A.L.K.E.R. : Call of Pripyat created by TeamEPIC. It features 32 explorable maps, reworked level design and level fixes, new original level, Trucks Cemetery, Full AI and A-Life overhaul, engine and script enhancements, Repeatable task system which bases itself on A-Life events, Customizable weather environments for every map as well as surges and psi-storms from AF3, Character creation which includes name, portrait and faction selection; Several optional modes such as Ironman mode, story mode and zombie survival mode, New achievements, rankings and reputation system, PDA leaderboard and enhanced PDA statistics, Companion system with keyboard issued commands, many optional side-features and community-made addons . Call of Chernobyl was player's choice Mod of the Year 9th place in 2015 and 1st place in 2016!

Forum Thread
  Posts  
Reducing amount of ammo on when unloading droped weapon (Games : S.T.A.L.K.E.R.: Call of Pripyat : Mods : S.T.A.L.K.E.R.: Call of Chernobyl : Forum : Support : Reducing amount of ammo on when unloading droped weapon) Locked
Thread Options
Jan 21 2016 Anchor

It's always full magazines , Is there any way this can be adjusted?

Jan 21 2016 Anchor

It's possible, I think. I haven't tried but this should work:

in death_manager.script add this function:

function set_rnd_ammo_in_mag(wpn)
	local se_wpn = wpn and alife():object(wpn:id())
	data = se_wpn and stpk_utils.get_weapon_data(se_wpn)

	if (data) then
		local ammo_max = system_ini():r_float(wpn:section(),"ammo_mag_size") or 0
		if (ammo_max > 0) then
			data.ammo_current = math.random(0,ammo_max)
			stpk_utils.set_weapon_data(data,se_wpn)
		end
	end
end

In death_manager.script find and add set_rnd_ammo_in_mag below set_weapon_drop_condition(item)

	local cls = item:clsid()
	if IsWeapon(item,cls) and not(cls==clsid.wpn_grenade_rgd5_s or cls==clsid.wpn_grenade_f1_s) then
		set_weapon_drop_condition(item)
		set_rnd_ammo_in_mag(item)
		return
	end


Edited by: Alundaio

Jan 22 2016 Anchor

cant get this to work ,game is not crashing but weapons still drop full mags

here is mine death_manager.script ,would truly appreciate if you could check it

Mega.nz

Edited by: IronRec

Reply to thread
click to sign in and post

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.