Description

Tired of all looted weapons being broken? Then this is the mod for you! For STCoM, including Weapon Degradation + FOV fix!

Preview
Enemies Dont Always Drop Broken Guns - STCoM
Comments
-Ghost-
-Ghost-

Thanks, this never really made sense to me. Damaged/worn guns, yeah. But unless every gun conveniently gets shot mid-firefight most of them are going to be in working order.

Reply Good karma Bad karma+3 votes
Kostov
Kostov

Adjusted FOVs for STCoM? I've already done that. Moddb.com

Reply Good karma Bad karma+3 votes
crazyiscombine Author
crazyiscombine

I know, but I'm making a version for more zoom actually. Mostly to make them consistent, for example, the TT33 has no zoom compared to every other pistol. Rifles for long range should have a bit of zoom, the SVT-40 is awkward to use since it looks like my face is sitting behind the stock rather than holding it like.. y'know, a rifle.

Reply Good karma+2 votes
Kostov
Kostov

Alright.

Reply Good karma Bad karma+2 votes
asdwtanyrn
asdwtanyrn

Me have already added this very helpful addon on my compilation :) Moddb.com
(for players dont use STCoM).

Reply Good karma Bad karma+2 votes
PotatoSalad_1
PotatoSalad_1

MORE TO COME:

Adjusted Weapon Degradation rates for STCoM (some weapons degrade ridiculously quickly)

really looking forward to this one mate, some weapons like PP bizon or vintorez degrade really quick! i shoot maybe 50-80 rounds and got 8k bill its unreal.

Reply Good karma Bad karma+2 votes
crazyiscombine Author
crazyiscombine

I know right? SVT-40 degrades a full ten percent after 20 rounds.

I've got a rough version I'm playing on right now, once I polish it up and fix the FOVs I'll add it to this file.

Reply Good karma+2 votes
crazyiscombine Author
crazyiscombine

And its up, have fun!

Reply Good karma+3 votes
PotatoSalad_1
PotatoSalad_1

i download now mate, i know it can be tedious editing those weapon configs one by one. thanks for doing it.

i was looking for mod to fix some pistols which zoom out when you aim down sight instead of zooming in! any clues?!

Reply Good karma Bad karma+2 votes
PotatoSalad_1
PotatoSalad_1

FOV fix just fixes some inconsistencies, like the TT33 having no zoom at all

lmao you ninja-ed me! i was looking for a fix

Reply Good karma Bad karma+2 votes
mita968
mita968

I merged this mod with Autism if anyone is interested i'll upload the file if you guys want both

Reply Good karma Bad karma+3 votes
bi0nicman
bi0nicman

Go ahead. Would be great.

Reply Good karma Bad karma+2 votes
PotatoSalad_1
PotatoSalad_1

mate would it be possible to fix the FOV on MP-412 REX? it suffers from the same issue as TT33

Reply Good karma Bad karma+2 votes
crazyiscombine Author
crazyiscombine

Damn, forgot about that one, I'll fix it soon.

Reply Good karma+2 votes
PotatoSalad_1
PotatoSalad_1

i played with the new update for few hours yesterday and i have to say the gun maintenance feels a lot more reasonable now! you can't go wrong with this mod! thanks for making it.

Reply Good karma Bad karma+1 vote
PotatoSalad_1
PotatoSalad_1

does this mod need update for the new STCoM fix?

Reply Good karma Bad karma+2 votes
PotatoSalad_1
PotatoSalad_1

i narrowed it down to this mod! it crashes at the trader due to new weapon profiles added by recent STCoM fix

Reply Good karma Bad karma+2 votes
crazyiscombine Author
crazyiscombine

Yeah looks like its got to do with the new things added, I'll have to investigate and probably will have to re do all the degradation/fov edits, I'll get on it soon.

Reply Good karma+2 votes
crazyiscombine Author
crazyiscombine

Fixed it, it had to do with the new Sig 550 variant added, should work now

Reply Good karma+2 votes
Kostov
Kostov

Here's a patch for AUTiSM, using this mod's condition values. Dropbox.com

Reply Good karma Bad karma+2 votes
prezidento
prezidento

Getting an "unhandled exception" crash when using the fov + weapon degradation fix. Weird, because when I compared the modded weapon configs vs. unmodded and there weren't any changes apart from fov and degradation values, so why tf does it crash for me?

Reply Good karma Bad karma+1 vote
crazyiscombine Author
crazyiscombine

Weird, might be some kind of memory issue, have you tried reinstalling?

Reply Good karma+1 vote
Guest
Guest

I am having trouble editing the numbers. Could you please explain how to edit the drop rates in order to adjust them to our own liking? Eventually, could you make it so that there's a 5% chance for perfectly maintained weapons, another 5% for well maintained, 30% for medium maintained and the rest being for poorly maintained and destroyed weapons?

Reply Good karma Bad karma0 votes
crazyiscombine Author
crazyiscombine

It's pretty easy to adjust if you know a bit of programming, its probably doable without any previous knowledge if you just keep a few things in mind:

What the top part that says local rng = math.random(100) is doing is assigning a variable, rng, with a random number between 1-100.

The the if and elseif are conditionals, basically they only execute the line that's directly below them if they part within the brackets are true. A list of conditionals starts with an if and end with an else, and ifelse in the middle.

So whats basically going on here its checking "if this is true, do this, if not and this is true, do this, if not this is true, do this, if none of the above are true, do this."

So when it says (rng <= 5), its checking whether rng is less than or equal to 5, this is therefore the 5% chance of it happening.

Now the part that actually assigns the weapon condition, where it says condition is a variable that was created earlier, math.random is a number generator, the two numbers in the brackets are the range, so in this case it will pick a number between 80 and 100, if you put only one number in the brackets it will pick between 1 and whichever number is in the brackets. the /100 at the end is to divide it by 100, because STALKER uses a decimal value to represent condition (ie 100% = 1, 75% = 0.75, etc)

In Lua, anything starting with a "--" is a comment, meaning the program does not read it, I put them in there to say what the general percentage is of each.

As you can see, I've listed the rng conditionals starting from low to high on its way down. So to do what you're describing, I would make the top one (rng <= 5), the next one (rng <= 10) and then (rng <= 40), with the last one being the rest. This is because you want to start with lowest percentage first and add it to the next larger percentage.

I hope this helps, I know its a god damn essay at this point, maybe I'll make an edit for it, if I do I'll probably make a few different versions.

Reply Good karma+1 vote
Guest
Guest

Hey, the same guest here.
Thanks for the lightning swift response! Sadly, this is exactly what I've done even before posting a comment, yet I've received errors upon trying to load a game. After you had uploaded the instructions, I tried redoing it but ended up with an error mentioning the death_manager.script in its directory and talk of a nil value. So, I am unsure what I'm doing wrong or if it's perhaps the fact that the changes are conflicting with some mods (though it shouldn't be, as your version of the drop rates work just fine).

In any case, if you do get to uploading several versions of the drop rates, which would be great, please, do include my version if you have the time!

Thanks again for explaining how the script works, it was a fun read.

Reply Good karma Bad karma0 votes
crazyiscombine Author
crazyiscombine

Yeah when I was trying to make it I had a lot of errors and crashes at first, it was a lot of trial and error to get it to work (especially since I don't actually know lua, I do java and just tried to improvise with googling lua syntax).

In any case, I'll eventually make a few different versions once I get some more ideas, I'll likely include yours.

Reply Good karma+1 vote
ninjaklan
ninjaklan

I tried changing this to, to 5, 35 and 75 and last if destroyed would then be 25%. But my game crashes and calls for error in deathmanager script. But all I did was change values from 5, 55 and 85 to 5, 35 and 75. What could be wrong here?

Reply Good karma Bad karma+1 vote
crazyiscombine Author
crazyiscombine

Could be a lot of things, try copy-pasting your code here and I'll look at it

Reply Good karma+1 vote
ninjaklan
ninjaklan

function set_weapon_drop_condition(npc,itm)
local rng = math.random(100)
local condition
if (rng <= 3) then c
--Good Condition 3% chance
elseif (rng <= 13) then c
--Average condition 10% chance
elseif (rng <= 63) then c
--Poor condition 50% chance
else c
--Destroyed condition 50% chance
end
--printf("condition [%s]", tostring(condition))
itm:set_condition(condition)

Reply Good karma Bad karma+1 vote
crazyiscombine Author
crazyiscombine

Well I see how that wouldn't work, the conditionals are missing the code that actually end up creating the number determining the weapon condition. You seem to have thought the comments did that. With what you posted, the variable condition would be a null value and that's what causes the crash.

Mind that any line beginning with -- is a comment, it's not actual code read by the program. It's essentially notes left by the programmer (in this case me).

Try this:

function set_weapon_drop_condition(npc,itm)
local rng = math.random(100)
local condition
if (rng <= 3) then c
--Good Condition 3% chance
elseif (rng <= 13) then c
--Average condition 10% chance
elseif (rng <= 63) then c
--Poor condition 50% chance
else c
--Destroyed condition 37% chance
end
--printf("condition [%s]", tostring(condition))
itm:set_condition(condition)

If you want to change the condition percentage range (ie, how I have good condition as between 80%-100%), change the two numbers separated by a comma in the math.random(80, 100)/100 parts, here's how it works:

In math.random(x, y)/100, x is the lower range and y is the upper, which means it will pick a number between x and y including x and y.

In math.random(x)/100, as there is no second number in the parenthesis, x is the upper range and the lower range is automatically set as 0.

Do not remove the /100 from any of them, because stalker interprets percentages as decimal (as I've said in another comment, 1 = 100%, 0.75 = 75%, 0.5 = 50% and so on)

Hope this helps

Reply Good karma+1 vote
crazyiscombine Author
crazyiscombine

Oh, my mistake, its moddb cuts off part of the code for some reason, I'll pm you what the code should look like

Reply Good karma+1 vote
ninjaklan
ninjaklan

Yes, the code was cut off by Moddb. I think I actually have the same numbers as you wrote and same code but still get crash. Or maybe do I need to do a new game for this to work?
I'll 1:1 inspect your code versus mine and see if it's my fault.

Reply Good karma Bad karma+1 vote
crazyiscombine Author
crazyiscombine

I PM'ed you the snippet I wrote, it should work, it shouldn't need a new game I don't think but if it still occurs try

Reply Good karma+1 vote
Diенаrd
Diенаrd

thanks for this mod. makes it less grindy :)

already finished mysery without addons and since CoM is just freeplay ill use this mod :)

Reply Good karma Bad karma+1 vote
Diенаrd
Diенаrd

updated the FOV+Weapon Degradation Adjustments config files - Www119.zippyshare.com - for the STCoM Weapon Pack fix (updated Apr 7th, 2017)

Reply Good karma Bad karma+1 vote
crazyiscombine Author
crazyiscombine

What exactly did you change here? I already updated my addon for latest STCoM since 1.3 :/

Reply Good karma+1 vote
Diенаrd
Diенаrd

when i extracted your fov+weapons config files i had a ctd on loading my save game. this is with latest STCoM Weapon Pack fix.

in winmerge i noticed the STCoM Weapon Pack fix weapon files had values that were missing in your fov+weapons config files.

i just changed the zoom levels and degradation values by adding over your values. no more ctd on load up :)

Reply Good karma Bad karma+1 vote
ComptonUnhh
ComptonUnhh

EDIT: Nevermind, my problem is CTD's involving the item condition mod, not the FOV config

Reply Good karma Bad karma+1 vote
ComptonUnhh
ComptonUnhh

I really dont understand why it has a problem with my tweak, keep getting a CTD and all I did was change the numbers to suit my ideal drop rate.

I think ive narrowed down the issue to this segment here.


local function eat(temp,itm)
if (is_weapon(itm:section())) then local c
if (cond > 0.8) then
itm:set_condition(math.random(5,50)/100)
printf("-eaten:"..itm:section())
end
end
end
npc:iterate_inventory(eat,nil)
utils.se_obj_save_var(npc:id(),npc:name(),"items_eaten",true)
end

If im reading this correctly, its saying any time a corpse is spawned, if the condition of the weapon is above 80%, it will set the condition to between 5% and 50% which completely contradicts the other drop specifications.

Reply Good karma Bad karma+1 vote
crazyiscombine Author
crazyiscombine

That's a section I did not touch at all, I'm not really sure whats going on in it but it looks like it some kind of food related thing. You shouldn't have to edit any other part to make your values work though.

Reply Good karma+1 vote
Rocker006
Rocker006

Tried editing your code, first with Notepad, game crashed. Then used Notepad++ and it worked. Ty for this mod, I earn a bit more money with it, no more silly broken guns everywhere.

Reply Good karma Bad karma+1 vote
☣GenezisO☢
☣GenezisO☢

Anybody noticed that in-game inventory custom avatar in a mod preview picture ? cyka :D

Reply Good karma Bad karma+1 vote
KrustyPieRat
KrustyPieRat

Hello would you like help me ???

With it

function set_weapon_drop_condition(npc,itm)
local rng = math.random(100)
local condition
if (rng <= 5) then c
--Good Condition 5% chance
elseif (rng <= 35) then c
--Average condition 30% chance
elseif (rng <= 85) then c
--Poor condition 50% chance
else c
--Destroyed condition 15% chance
end
--printf("condition [%s]", tostring(condition))
itm:set_condition(condition)

BECAUSE!!\Expression : <no expression>
Function : CScriptEngine::lua_error
File : ..\xrServerEntities\script_engine.cpp
Line : 189
Description : fatal error
Arguments : LUA error: e:\call of misery\gamedata\scripts\bind_stalker.script:49: attempt to index global 'death_manager' (a nil value)

stack trace:

0023:0072717C xrCore.dll, xrDebug::fatal()
0023:051FB774 xrGame.dll, CDialogHolder::UseIndicators()

Reply Good karma Bad karma+1 vote
Post a comment
Sign in or join with:

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.

Tags

Enemies Dont Always Drop Broken Guns - STCoM has not been tagged yet.