Putting the 'role' back in role-playing games since 2002.
Donate to Codex
Good Old Games
  • Welcome to rpgcodex.net, a site dedicated to discussing computer based role-playing games in a free and open fashion. We're less strict than other forums, but please refer to the rules.

    "This message is awaiting moderator approval": All new users must pass through our moderation queue before they will be able to post normally. Until your account has "passed" your posts will only be visible to yourself (and moderators) until they are approved. Give us a week to get around to approving / deleting / ignoring your mundane opinion on crap before hassling us about it. Once you have passed the moderation period (think of it as a test), you will be able to post normally, just like all the other retards.

Incline Fallout 2 Mechanics Overhaul Mod Discussion

baturinsky

Arcane
Joined
Apr 21, 2013
Messages
5,614
Location
Russia
So besides two mechanics for assassination, there are no mechanics for assassination. Got it.
No general mechanics for assassination.
 

tuluse

Arcane
Joined
Jul 20, 2008
Messages
11,400
Serpent in the Staglands Divinity: Original Sin Project: Eternity Torment: Tides of Numenera Shadorwun: Hong Kong
How is planting bombs on people not general? And how in the world is it less general than the developer making dialog options to assassinate?
 

baturinsky

Arcane
Joined
Apr 21, 2013
Messages
5,614
Location
Russia
Depends on your definition of assassination, of cause. If it's "non-exploity way to kill someone without making his friends hostile and you", then there none, except few scripted cases.
 
Joined
Nov 19, 2009
Messages
3,144
The thing is that a lot of such stuff depends on how well do you manage to fix the rest of mechanics. Original Fallout isn't particularly strong mechanically.

Just curious: is there an rpg out there you consider to have particularly strong mechanics? I haven't played a lot of rpg's outside of the usual suspects, but I always felt that of those Fallout 2 was the strongest mechanically (though that might not be saying much).
 

DraQ

Arcane
Joined
Oct 24, 2007
Messages
32,828
Location
Chrząszczyżewoszyce, powiat Łękołody
The thing is that a lot of such stuff depends on how well do you manage to fix the rest of mechanics. Original Fallout isn't particularly strong mechanically.

Just curious: is there an rpg out there you consider to have particularly strong mechanics? I haven't played a lot of rpg's outside of the usual suspects, but I always felt that of those Fallout 2 was the strongest mechanically (though that might not be saying much).
TBH, I'm not really sure.

There are excellent bits and pieces of mechanics scattered about the genre (FO DR/DT mechanics wouldn't be that easy to significantly improve upon, for instance), but there are also tons of obvious flaws and fuckups and they tend to be mixed together.
The thing with Fallouts is that they aren't really conductive of interesting combat - AI is dumb, artefacts of TB are exploitable, you can't really use cover or change stance, you can't use stealth, positioning is bare bones, you just stand and shoot or run up to target and hit it. There simply isn't much tactics involved because there is no room for much tactics in this game to begin with. You just spray and pray to the RNG god for the criticals to be with you.
 
Joined
Nov 19, 2009
Messages
3,144
The thing with Fallouts is that they aren't really conductive of interesting combat - AI is dumb, artefacts of TB are exploitable, you can't really use cover or change stance, you can't use stealth, positioning is bare bones, you just stand and shoot or run up to target and hit it. There simply isn't much tactics involved because there is no room for much tactics in this game to begin with. You just spray and pray to the RNG god for the criticals to be with you.

I know it's heresy, but I'm actually glad that Fallout didn't feature stance changes. Sacrificing mobility for increased defense and (often) to hit just is a nobrainer in games where mobility doesn't play the role it does IRL. Lying prone inside a house constantly shouldn't be the right tactic, but it is because the AI won't be able to handle that (maybe modern AI in shooters do, wouldn't know, but in JA2 they certainly didn't).

Combat (until the mid-game point) was actually a lot of fun for me; even stuff most people hated like uncontrollable companions serves as a way for limiting the TB exploits you mention (i.e. you might want to play the peek a boo game around the corner, but if you want to keep Cassidy from being blown apart as he idiotically charges into a room full of baddies, you usually have to be more proactive). But you're right that there's not enough choices for the player to influence the course of combat; the only choice there really is is between low-THC/high-damage and high-THC/low-damage (with even that choice dissappearing by the mid-late game in the past), so it'd be nice if something like the weapon/ammo choice also became relevant. Not sure if I'd like more than that done however, though I'm probably more to the character skill side of rpg design than most.

The most frustrating thing about the FO AI is that it would instantly become so much better if it just stopped in its tracks when it acquired a target instead of moving on like a moron.
 

DraQ

Arcane
Joined
Oct 24, 2007
Messages
32,828
Location
Chrząszczyżewoszyce, powiat Łękołody
The thing with Fallouts is that they aren't really conductive of interesting combat - AI is dumb, artefacts of TB are exploitable, you can't really use cover or change stance, you can't use stealth, positioning is bare bones, you just stand and shoot or run up to target and hit it. There simply isn't much tactics involved because there is no room for much tactics in this game to begin with. You just spray and pray to the RNG god for the criticals to be with you.

I know it's heresy, but I'm actually glad that Fallout didn't feature stance changes. Sacrificing mobility for increased defense and (often) to hit just is a nobrainer in games where mobility doesn't play the role it does IRL. Lying prone inside a house constantly shouldn't be the right tactic, but it is because the AI won't be able to handle that (maybe modern AI in shooters do, wouldn't know, but in JA2 they certainly didn't).
Lying prone inside a house should invoke pineapples/cocktails, once the AI knows where you are, or, failing that, AI attacking through more than one entrance/opening.
If there are no alternative openings, then it doesn't actually seem half bad.

Plus, lying prone should not be a substitute of actual cover and should actually give you penalties to hit up close, without providing much protection any more.

Besides, just porting Fallout to FoT (art assets and dialogue window too) would be an immense improvement already, let alone redesigning environments to benefit from climbing and crawling.
 

CappenVarra

phase-based phantasmist
Patron
Joined
Mar 14, 2011
Messages
2,912
Location
Ardamai
The thing with Fallouts is that they aren't really conductive of interesting combat - AI is dumb, artefacts of TB are exploitable, you can't really use cover or change stance, you can't use stealth, positioning is bare bones, you just stand and shoot or run up to target and hit it. There simply isn't much tactics involved because there is no room for much tactics in this game to begin with. You just spray and pray to the RNG god for the criticals to be with you.
While many of these points do stand, I'm in a nitpicking mood :P
You can use stealth in combat, and it'll often help you break large encounters into smaller ones. I had enemies completely ignore my character shooting their comrade standing a few hexes away from them simply because they didin't have line of sight to him (as gamebreaking as chameleon in Morrowind - i.e. delicious god mode), and in other cases you can kill one opponent, then run behind a corner and hit End Combat - and it'll work. It's not great, but you can use stealth in FO combat :)
Also, having superior weapon range and/or movement rate means active kiting is a real possibility. And if it's not initially, you aim for the legs and make it so. Not much, certainly, but far from "just spray and pray to the RNG god for the criticals to be with you". I.e. just because the game is easy enough that you don't need anything resembling tactics to win it doesn't mean it doesn't allow for tactics. You just need to up the difficulty a bit, willfully take on higher level challenges, or LARP a masochist :D
 

DraQ

Arcane
Joined
Oct 24, 2007
Messages
32,828
Location
Chrząszczyżewoszyce, powiat Łękołody
The thing with Fallouts is that they aren't really conductive of interesting combat - AI is dumb, artefacts of TB are exploitable, you can't really use cover or change stance, you can't use stealth, positioning is bare bones, you just stand and shoot or run up to target and hit it. There simply isn't much tactics involved because there is no room for much tactics in this game to begin with. You just spray and pray to the RNG god for the criticals to be with you.
While many of these points do stand, I'm in a nitpicking mood :P
You can use stealth in combat, and it'll often help you break large encounters into smaller ones. I had enemies completely ignore my character shooting their comrade standing a few hexes away from them simply because they didin't have line of sight to him (as gamebreaking as chameleon in Morrowind - i.e. delicious god mode), and in other cases you can kill one opponent, then run behind a corner and hit End Combat - and it'll work. It's not great, but you can use stealth in FO combat :)
Does it bear any relation to sneak skill?
Because if it doesn't, it's not stealth, it's just AI hurpadurping - hardly something you'd hold in game's favour.
 

CappenVarra

phase-based phantasmist
Patron
Joined
Mar 14, 2011
Messages
2,912
Location
Ardamai
Does it bear any relation to sneak skill?
Because if it doesn't, it's not stealth, it's just AI hurpadurping - hardly something you'd hold in game's favour.
I've only had it happen with characters who tagged Sneak. But perhaps somebody who knows the actual code should chime in to confirm :)
 

Sduibek

Creator of Fallout Fixt
Patron
Joined
Feb 15, 2013
Messages
391
Location
Los Angeles, CA, USA
Codex 2013
I like the idea of dialog-based "sneaky" options when initiating dialog with Sneak enabled. Sneak is way under-utilized in Fallout from its potential. And scripting that would be pretty easy, it could probably even be done without Sfall, unless you're looking for Alert-The-Whole-Town-Like-In-Fallout-3 insanity.

There's lots of things you can take into account, too:
light_level (time of day)
character facing
Perception
can_see_dude
can_hear_dude

But on a basic level, yeah being able to have some kind of "[sneak up and murder their ass like a fucking ninja]" dialog option, assuming reasonable checks and requirements are implemented, could be really fun.
 
Joined
Nov 19, 2009
Messages
3,144
DOWNLOAD VERSION 1.25

You can download the mods here.

REQUIREMENTS/COMPATIBILITY

The only requirement for this to work is that you have sfall installed. It is compatible with either the official 1.02 patch, or killap's Unofficial Patch (v. 1.02.28).

INSTRUCTIONS

Step 1 (for official patch): Make a folder titled Patch000.dat in the game directory, and then use Dat Explorer or another program to extract your Patch000.dat file in that directory.

Step 1 (for RP or UP): Install either RP or UP.

Step 2: Extract the contents of the "Full Install ([your version])" folder in your game folder and let it overwrite what it needs to.

Step 3: If you want to use the fixed hp system, go to these lines in sfall's ddraw.ini file in your game folder:
;To change the relationship between SPECIAL stats and derived stats, uncomment the next line
; See the stats.ini in the modders pack for an example file
;DerivedStats=stats.ini
and uncomment the last line.

Step 4: Write protect the "maps" and "proto" folders in the Patch000.dat folder (right click on the folders and go to the permission options).



CHANGES TO THE TO HIT CHANCE FORMULA

I'm convinced that the root of the balancing problem lies in the fact that whereas the chance to hit system works quite well in the beginning (e.g. if I have an 80% chance of hitting someone with an unaimed shot, then I have a 20% chance of hitting them in the eyes), it quickly veers off the tracks towards the end (e.g. if you're skilled enough, which you will be by mid-game, then an unaimed shot and an eye shot will invariably both end up as 95% hits). While fixing balance is my primary concern, I've also tried to address what are in my view unlogical (e.g. sniping) or boring (e.g. unarmed combat) aspects of the current combat system. I'll now start explaining all the new calculations and the reasoning behind them. The calculations proceed in three phases (two for melee and unarmed), and I'll deal with them one by one.

TO HIT CHANCE FIRST STAGE

Unarmed and Melee Combat

The current system works like this:

Code:
old:(unarmed skill attacker)-(AC target)

This is how it changes in the mod:

Code:
new:(has_skill(attacker, SKILL_UNARMED_COMBAT))+targetexhaustion+attackerkamikaze+targetkamikaze+onehander-cripplepen-bodypen-attackerexhaustion-(has_skill(attacker, SKILL_UNARMED_COMBAT)-100)-(get_critter_stat(target, STAT_ag)*agilitymod)-(get_critter_stat(target, STAT_pe))

Okay, probably looks like gibberish, but I'll do my best to explain every element of the calculation.

First, there's of course the unarmed skill of the attacker.

Next, the exhaustion of the target is added. Once the number of turns has exceeded the target's endurance (so after the first turn if your endurance is 1, after the tenth turn if it is 10), a potential 6 point bonus is added to your chance to hit for each consecutive turn, half of which is determined by the ratio of weight carried to maximum weight (that is to say, if you are lightly packed, the effects of exhaustion will be less severe). The same principle however also applies to the attacker's exhaustion, which results in a penalty to hit.

Checks are made for whether the attacker or the target have the Kamikaze trait. In the original, this trait was rarely useful; you sacrificed armor class in favor of a possible extra early turn. I've made the Kamikaze trait into what I originally expected it to be: sacrificing defense for offense. So, what the trait does now is add an agility*3 bonus to to hit and a agility*3 bonus to the opponent's to hit, on top of the old sequence bonus. Will probably have to be changed around a bit still, but I like the principle.

The One Hander trait is somewhat nerfed from the original: 10% bonus for one handed weapons, 20% penalty for two handed weapons.

Being crippled in one arm affects your accuracy by 50% if the weapon is in the relevant arm (or if you are carrying a two handed weapon). Being blind not only gives another 50% penalty, but also an additional gross distance modifier penalty (4 per hex).

The basic bodypart penalty is only slightly changed from the original. Now, the unaimed shot is what I originally imagined it to be: a snapshot. So it's faster than a precision strike, but often also less precise. This means that for melee/unarmed, an unaimed shot has a -20 basic penalty to hit, while for ranged combat it has a -10 basic penalty on top of a -1 per hex distance penalty. So now there's finally a reason to do an aimed blow to the body.

The opponent's unarmed and melee skill now also factors into the calculation. Where in the original system you would eventually always just slug it out, with each blow safely landing, now a superior pugilist will be able to dodge your blows. If the target is carrying a ranged weapon then the attacker gets a 20 point bonus.

Instead of Armor Class, which is now an entirely redundant stat (for more on that see one of the later posts in this thread), agility itself plays a large role. For now the agility bonus gets calculated as follows. As long as the target is not wearing hindering armor (starting with Metal Armor), the penalty is the target's agility*2, which becomes *4 with the dodger perk and even *7 with the hthevade perk on top (if you're not wielding a weapon at the moment that is ofcourse). Once the target is hindered by being armored (this also applies to critters such as Super Mutants), or heavily armored (starting with Power Armor), these penalties drop significantly (e.g. with Power Armor, the target's agility and dodge perk advantages dissappear and only a third of the hth evade perk still applies).

Finally, the target's perception also plays a (minor) roll, as it determines how well the target can anticipate attacker's blows.

Ranged Combat

Here's how the mod calculates ranged combat:
Code:
new:(has_skill(attacker, SKILL_SMALL_GUNS))+targetexhaustion+attackerkamikaze+targetkamikaze+onehander-bodypen-attackerexhaustion-(get_critter_stat(target, STAT_ag)*agilitymod)+(get_critter_stat(attacker, STAT_pe)) - (strengthpen)

A lot of it is similar to the unarmed/melee system, except that the opponent's skill plays no role, that not the target's perception is used for a penalty, but the attacker's perception for a mild bonus and that the strength penalty now applies. The minimum strength was a bit arbitrary in the original (a gatling laser as heavy as a tommy gun, really?) and is now calculated in this way:

Code:
minstrength:=(weaponweight/4)+recoil-((has_trait(TRAIT_PERK, attacker, PERK_weapon_handling_perk) > 0)*3);

So it's basically a combination of the weapon's weight and its "recoil", which I just used a heavy/medium/light weapon scheme for. The result is that a minigun now has a minimum strength of 10, instead of the original 7, which seems reasonable (perhaps still even a bit too optimistic). Here's the resulting penalty, which is calculated on the basis of the amount the attacker is below the minimum strength and how exhausted he is:

Code:
strengthpen:=((minstrength)-(get_critter_stat(attacker, STAT_st)))* (4+(exhaustion/4));

The first stage of thrown weapons is identical to that of other weapons.

TO HIT CHANCE SECOND STAGE (RANGED ONLY)

The basics of determining distance modifiers are as follows:

Code:
(hexes)*((10+lightmod)-perceptionmod);

The basic principle is that the further away the target is, the faster the modifier rises (so that with a 10mm pistol the first 5 hexes have a penalty of 10-perception per hex, the next hexes a penalty of 11-perception, and so on). This process slows down when the weapon's range increases. The perception value for determining range is changed by one with the sharpshooter perk. With a scoped rifle, the distance modifier stays at 10-perception for every distance, but only when aiming. So if you have a perception of 10, and you're aiming a sniper rifle with the sharpshooter perk, the target actually becomes easierto hit the farther he's away, which I think finally makes an explicit sniper character an interesting option. Conversely, taking an unaimed snapshot now gives you an additional one point distance penalty.

The way light affects distance modifiers is that high light levels yield no penalty, medium one point, and low ones two points. What I have now is that, on top of their light adjustments, the night vision perk and the fn fal with nightsight now reduce the penalty by one. Hopefully this makes them a bit less useless.

Throwing weapons work more or less the same way as other ranged weapons, except that the distance modifier is not just impacted by perception, but agility as well. Also, the heave-ho perk is now also a throwing variant of the sharpshooter perk in that it gives a 2 point bonus to distance modifiers (might be a bit too big, but I don't know terribly much about the throwing skill to be honest).

As a side note, you now also get a slight penalty when using a melee weapon over two hexes; not sure if this was the case already.

TO HIT CHANCE THIRD PHASE

To further balance things out, the to hit chance that rolls out of the previous two phases is finally adjusted further based on the bodypart aimed at. This is done in a way akin to the skill progression system: progress becomes gradually more costly. The consequence is that, in addition to the basic penalty, the chance to hit the eyes progresses slower than the chance to hit the body (in the former it's the case that getting to 20% chance progresses normally, then to 40% the "cost" becomes two points per increase, then up to 60% three points, etc. while for the body it's simply the first 50% regular and the next double cost).

I could try to give a complicated rationale for this, but the main reason is balancing. The point of the system is that early combat stays more or less as difficult as it is, while crazy late-game eye-crit rampages stop. To even get above 75% for an eye hit you need to think in the range of a 250+ investment in the related (ranged) combat stat. Some might think this system sacrifices realism for the sake of balance, perhaps pointing out that a skilled marksman can easily reach 80+% hits on eyes during target practice. To that I'd just say I believe combat in Fallout should be thought of as much more dynamic than it looks through the trappings of turn-based combat; what seems like a stationary target in the middle of a dirt road is best thought of as actually someone maneuvering at speed from cover to cover (hence the emphasis on agility, endurance and perception in my system); try getting 80% eye-hits on a dynamic target like that.

Finally, the attacker gets a further 40% bonus if the target is lying down, just like in the original.

CHANGES TO AP COST

I've always felt the AP costs of the various weapons in Fallout were often extremely arbitrary (e.g. why is a .44 magnum faster to shoot than a 10 MM pistol?).

With my own approach, I've tried to keep things as simple and unarbitrary as possible. The base AP cost for an unaimed snapshot (remember that this now has a penalty, making the aimed bodyshot the new "safe" option) is now 3 points (the exception is 4 points for thrown), to which points are added for two handed weapons (1), for energy weapons (1), for big guns (2), for aimed shots (2, or 3 if with a scoped weapon), and for bursts as a secondary mode (2). The consequence is that whereas for instance the Minigun stays the same AP (3+1+2=6), the super sledge now costs 4 for the primary attack (3+1=4). Of course the old exceptions (like flares costing 1 AP) still apply. Unarmed has stayed the same as in the original, except that I've incorporated Magnus's common sense fix of making the secondary attacks cost only one additional AP. Having crippled arms also raises the AP cost, though only if the weapon is in the relevant arm or if you're using a two-handed weapon.

Of the AP-related perks and traits I needed to change at least one, given that I've already lowered the base cost for ranged weapons
from 4 to 3. I decided to make the fast shot trait something which makes you better at fast shots, so that the basic 10% penalty for snapshots now dissappears (the ranged penalty still applies however). The increased rate of fire/hth attacks perks still reduce the relevant AP costs, though (given that they are so incredibly overpowered at the moment), they also come with a base penalty of 10% to hit now. These perks are still huge advantages all the same of course.

ATTRIBUTE CHANGES

First, I've raised the cap on max strength. It makes sense that of the attributes that can be raised to super-human levels, strength should be the most obvious candidate. Of course you still can't reach higher that 10 strength with perks or at character creation, but it makes little sense that they would take the effort to make power armor, but restrict its capabilities to the level of an extraordinarily strong human. Same goes for Super Mutants: what sense does FEV make if the only result is that of a particularly strong human being? This change has allowed me to put the minimum strength requirement for weapons at the level I wanted it, namely "recoil" (2,3, or 4) + weapon weight divided by 3 (so a minigun is at the reasonable super-human requirement of 13 to handle perfectly, and the 10mm pistol remains at its original 3 strength minimum).

The second thing I've changed is that bulky armor now affects agility (not improved chance to hit, as it did before in my system). Now, starting with metal armor you (and all other critters) suffer a -1 penalty to agility, and starting with Power Armor, this becomes a -2 penalty.

CRITICAL HIT/FAILURE CHANGES

Let me start with critical hits.

The current system works like this: if you score a hit, this has a chance of being upgraded to a critical hit according to the following metric:

Code:
(CRITCHANCE + ((TOHIT−RND(1,100))/10))%

CRITCHANCE being the modifier of Luck + better criticals perks + finesse, and an extra roll being made if you have the Sniper or Slayer perk.

The one thing I don't agree with in this system is the fact that the to hit chance still plays a roll: why should a lucky shot to the eye have more of a chance of causing extra damage than a skill-driven one? Maybe this would make sense with the Living Anatomy perk, but that would be a future project. In my system, skill plays no role in getting critical hits.

The other thing is the way the Slayer and Sniper perks work. I know, I know, everyone loves them in spite of the balancing issues, but my main gripe with them isn't even the balancing aspect, but how boring they are. For instance, the first time I heard something about the almighty Sniper perk, I assumed it would have something to do with, you know, sniping.

Anyway, in my system they're still pretty damn powerful, only now they correspond a bit better with their titles/vault boy images. I've made the Slayer perk into the Conan the Barbarian type dealy it looks like from the image, meaning that your critical hit change rises bases on the number of men, women and children you've heard the lamentations of before killing them (divided by 10, natch). The sniper perk now increases the critical hit chance based on the distance of the target (so, with a sniper rifle at max distance, it gives +50 critical hit chance).

Other than these changes I've kept things more or less the same (I wasn't exactly sure what the original body part mods were, so I just did more or less the original penalties; i.e. eyes give +60% to critical hit chance, head +40%, etc.).

With critical misses, a miss gets upgraded to a critical miss in the current system like so:

Code:
(CRITCHANCE + ((TOHIT−RND(1,100))/10))%

The biggest problem with this in my view is that only misses can become critical failures, while many of the critical failures involve events like faulty ammo or defective weapons: a potential hit or miss should be irrelevant to such events. So, in my system, every shot/blow can potentially turn into a critical failure (in accordance with this I've raised the max possible to hit chance from the arbitrary 95% to 100%).

My other problem with the current system is the exact opposite of the one I had with critical hits: with critical misses skill should play a role, while it doesn't (i.e. whether or not you drop your spear in a frantic thrust should depend on your melee skill). I'll just use an example to show how the new system works:

Code:
if (get_sfall_global_int("weaponty") == small_arms_type) then begin
            if random(1,1000) > (get_critter_stat(attacker, STAT_pe)*10) + (has_skill(attacker, SKILL_REPAIR)) + (has_skill(attacker, SKILL_SMALL_GUNS)*2) then begin
            if random(1,100) > 65 + (get_critter_stat(attacker, STAT_lu)*3) then begin
                hit:=0;
            end
        end
    end

So there's now two rolls; the first checks against the players relevant skills and stats (in the example it's the repair skill needed to keep weapons and ammo in working condition, the perception needed to notice problems before it's too late and of course the skill of handling a fire arm; I've tried basing these required stats on the five possible failures per weapon type); the second roll checks against luck (another thing the current system inexplicably didn't do yet). Theoretically it is possible to avoid critical failures from being possible, but in practice it isn't (e.g. with Energy Weapons you would need 300 Science, 300 Repair, 300 Energy weapons skill and 10 PE).



CONSISTENT LOCALIZATION

The issue it addresses is this: why is it that a shot at the target's eyes either hits the eyes or misses entirely; why is there no chance that it will miss the eyes, but hit the head or even the torso?

The system I use is that there's a certain percentage you have for hitting the desired body part, which rises as your chance to hit rises. Conversely, the chance to hit adjacent body parts diminishes, and that of "remote" body parts disappears (e.g., with a higher chance to hit the left arm, there is no longer a chance to hit, say, the right arm, and the chance to hit, say, the torso diminishes, until at 100+ percent to hit, you'll exclusively hit the left arm).

For most body parts the system is quite straightforward and the to hit system isn't changed, but there are two important exceptions: the eyes and the groin. These two are unique because they are entirely "embedded" in other body parts, namely the eyes in the head and the groin in the legs and torso. This is significant because the new system means that a 100% to hit when aiming for a certain bodypart no longer necessarily means a 100% hit on that body part but a 100% hit on the target. What this means is that whereas a 100% to hit when aiming for the torso is an automatic torso hit, a 100% to hit on the eyes can also mean a head hit. The practical consequence of this for the to hit system is that it no longer makes sense to give an eye shot a bigger basic penalty than a head shot; after all, whether your aiming for the eyes or the head "in general", you have the same chance of hitting the target.

Of course, in gameplay terms, this produces a problem; after all, say the head and the eyes are equally hard to hit, then why not always hit for the eyes instead of the head to get better criticals, etc.? The solution I've come up with is as follows: suppose you have a 10% chance to hit the eyes/head, then whichever target you choose, the chance to hit either body part is the exact same (roughly 1% for the eyes and 4% for the head). However, as your chance to hit rises, you become able to differentiate between the two, with the eye shot becoming progressively more difficult than the head shot. I believe this is a nice solution (in case you're wondering, this means I replace the basic penalties, which are as I said now equal, with a penalty in the "third phase" progressive nerfing).

Finally, an example to make the mechanics a bit more clear:

Code:
    else if (bodypart==eyes) then begin
        roll:=random(1,99);
        if (roll < (10 + (n*7))) then begin
            bodypart := eyes;
        end else if (roll < (50 + (n*7))) then begin
            bodypart := head;
        end else if (roll < (80 + (n*7))) then begin
            bodypart := torso;
        end else if (roll < (90 + (n*7))) then begin
            bodypart := random(left_arm,right_arm);
        end else begin
            bodypart := random(left_arm,right_arm);
        end
    end

the "n" variable stands for roughly the to hit chance divided by ten, so with more than 10% to hit, the chance to hit the eyes (upon a hit of course), becomes 17%.
 
Last edited:
Joined
Nov 19, 2009
Messages
3,144
FIXED MAX HITPOINTS

In my opinion the biggest contributor to mid-/late-game boringness other than the to hit problems already addressed is becoming a complete bullet sponge. It's completely absurd that even a low endurance character will be able to absorb more punishment by the end-game than a Super Mutant. Needless to say, fixing the max hitpoints (I've done so at 20+strength+endurance*5) creates potentially huge balancing issues. This doesn't address non-humans, making death claws and super mutants a tougher fight in all likelihood. This I don't mind (I always felt the big baddies were a bit tame in Fallout 2), but some might.

(PASSIVE) ARMOR REPAIR

With this the armor's damage resistances (so not thresholds) get adjusted based on the wearer's skills. Here is the system I use:

Code:
#define normal(x)                             (-3 + (has_skill(x, SKILL_REPAIR)/50))
#define laser(x)                             (-5 + (has_skill(x, SKILL_REPAIR)/50) + (has_skill(x, SKILL_SCIENCE)/50))
#define plasma(x)                             (-5 + (has_skill(x, SKILL_REPAIR)/50) + (has_skill(x, SKILL_SCIENCE)/50))
#define explosion(x)                         (-5 + (has_skill(x, SKILL_REPAIR)/50) + (has_skill(x, SKILL_TRAPS)/50))
#define electrical(x)                         (-5 + (has_skill(x, SKILL_REPAIR)/50) + (has_skill(x, SKILL_SCIENCE)/50))
#define fire(x)                             (-5 + (has_skill(x, SKILL_REPAIR)/50) + (has_skill(x, SKILL_TRAPS)/50))

This formula then gets multiplied based on how heavy the armor is (leather*1, metal*2, etc.); meaning that if a critter has 50 traps skill and 50 repair skill and is wearing metal armor, his explosive damage resistance gets changed by (-5+1+1)*2= -6%. There's still a lot more I need to do with this, mainly to reflect the fact that places like the Enclave have specialists for armor maintanence and the like.

DRUG/HEALTH SYSTEM CHANGES

- (Super-)stimpaks are now combat stimulants rather than health potions, they heal only minor wounds (4 for regular, 10 for super), and mainly serve as a temporary measure (16 temp hp for regular, 40 temp hp + 10 extra temp max hitpoints for super), which means that taking more than your endurance allows will be deadly. To avoid exploitation, injecting someone other than a party member with a stimpak causes him to attack (which makes sense).

- Because I'm not a big fan of the way the first aid skill works as an active skill, I've decided to make it a passive skill through its raising the Healing Rate. So now "resting" also accounts for medical treatment (which makes sense; who ever slept off a bullet wound?). So now instead of pumping everyone full of stims after a battle, taking a medical break will be necessary.

- Psycho is now also different: instead of the silly Damage Resistance mod (you can block bullets, but not lasers?) it now drastically raises you max hit points to represent the additional punishment you can take, but also has a harsh comedown.

One final note concerning the exploit blocking system; a lot of people dislike this in sfall because it takes away the only stealth kill that works. To fix this (though this is a longer term project) I want to make an assassination system through dialogue (that is, if you're in stealth mode when entering dialogue you'll get a range of options with relevant skill checks). I'm guessing this will allow us to do more fun stuff like have guards react and investigate, etc.

PLAYER MORALE SYSTEM

I always felt it was a bit unfair how NPC's all have the wonderfully human characteristic of occasionally bursting into fits of abject fear, while the player can happily blast away while having half his body shot off.

Now, I'm sure a lot of you like the idea of being some kind of B-movie action hero (it's the same debate as always about Fallout whether you like it for the Reno sillyness or grave Mark Morgan-y graveness - the curse of a game which can't decide on what it wants to be I guess), but I like my heroes a bit more human. Don't worry, you won't be forced to run away, it's just that if you fail a morale check at the beginning of a turn you get one of three effects, each notified by a red lettered floater:

Code:
{142}{}{[Panic suddenly takes a hold of you, and your legs momentarily feel like they are made of lead.]}
{143}{}{[Panic suddenly hits you, and steadying your hands becomes almost impossible.]}
{144}{}{[You're suddenly overcome with fear of the enemy, and convincing yourself to attack would take more effort than ever.]}

The first causes your movement to cost twice as many AP's; the second causes you to get a hefty 40% penalty to hit; and the third raises your attacking AP cost by two (unfortunately the numbers don't update immediately for this last one, but it does work).

The morale check itself works like this: you always start off with zero chance of morale failure, then as you kill more and more humans (especially children) it starts building up. It also rises when you're hurt, and goes back down when you're healed. You can bring down the morale failure chance by drinking alcoholic beverages.

To make things more interesting I've added some dialogue to Cameron in the Temple of Trials where you can change aspects of this morale system. The dialogue is this:


Code:
{313}{}{. I have the honor of being your final challenge. My task is to first test your resolve, then your physical prowess.}
{314}{}{Listen, me standing here covered in giant ant-entrails or whatever the hell this purple stuff is should be proof enough of my resolve, buddy, so you can just skip that part right away.}
{315}{}{How do you plan on testing my resolve?}
{316}{}{Re...solve?}
{317}{}{Just one simple question. This village has shielded you all your life from the horrors of the wasteland; but soon you will have to face these horrors head on. How do you plan on coping with this?}
{318}{}{I'll probably have some liquid resolve now and then to steady the nerves. But if the Elder asks, tell her I said something about the plight of the village, or whatever.}
{319}{}{My resolve will not falter because I will know that my cause is just.}
{320}{}{Let's just say that I'll make sure that these horrors befall others, not me.}
{321}{}{I'll cope just fine, now get to the last part already.}
{322}{}{[Your venomous breath tells Cameron all he needs to know.]}
{323}{}{Me know good.}
{324}{}{Maybe me horror.}
{326}{}{Muh. [You can't help but wonder whether you couldn't have been more eloquent there.]}
{325}{}{Very well. As to your final challenge, to continue in your quest you must defeat me in unarmed combat. Shall we begin?}

As you can see you'll have three options to change things up: (1) the "liquid resolve" options makes alcohol a more effective morale booster, while also making the stuff more addictive, (2) The "righteous" option makes increases in karma improve your morale, while the killing of humans more easily shakes your resolve, and (3) the selfish option makes killing humans not factor in at all, but makes getting hurt yourself far more demoralizing.

SUPPLY AND DEMAND SYSTEM

Code:
procedure start;


#include "C:\Program Files (x86)\GOG.com\Fallout 2 Mapper\scripts\HEADERS\sfall.h"
#include "C:\Program Files (x86)\GOG.com\Fallout 2 Mapper\scripts\HEADERS\define.h"
#include "C:\Program Files (x86)\GOG.com\Fallout 2 Mapper\scripts\HEADERS\command.h"


procedure start begin
  variable critter;
  variable container;
  variable n;
    variable amount;
  if game_loaded then begin
    set_global_script_type(1);
    set_global_script_repeat(100);
  end else begin
  if get_sfall_global_int("priceset") ^ 524 then begin
    n:=get_sfall_global_int("priceset");
    //display_msg("GVAR SET" + get_sfall_global_int("priceset"));
  if (get_sfall_global_int("priceset") == n)  then begin
      foreach critter in list_as_array(LIST_CRITTERS) begin
      amount+=obj_is_carrying_obj_pid(critter,n);
    //display_msg("amount" + amount);
      end
      foreach container in list_as_array(LIST_GROUNDITEMS) begin
      amount+=obj_is_carrying_obj_pid(container,n);
      end
    if amount > 0 and not (n == 41) then begin
    set_proto_data(n, 120, (pid_cost(n)/(amount)));
    //display_msg("cost" + pid_cost(n));
    end
    amount:=0;
    set_sfall_global("priceset", n+1);
    //display_msg("what" + n);
    end
    end
  end
end
(Had to change the "lesser than" symbol into ^ for the site)

The sequence gets fired by the player entering a new map, which causes the sfall global to be reset to 1 (hence the dude_obj script in the download; if you're wary of accepting a stranger's dude_obj, then just add "set_sfall_global("priceset", 1);" under map_enter_p_proc and you're set). The script checks for every item proto (1-524) how many of it someone or some container is carrying, and if this number is more than 0 the price gets adjusted. For the moment, the formula is still quite (too) simple: original price divided by amount on map. The practical consequence is that, for instance, your spear will now net only 13 dollars in Arroyo, instead of the original 80. I've tested it in the Arroyo and Klamath maps, and it seems to work great. Hope you find some use for it (the download is in the original post).

NPC GEAR RANDOMIZATION

Anyway, before I get into what it is exactly that the mod does, here's why I did it:
(1) Variation: Too many groups in Fallout look like they have a standard issue firearm. Not only doesn't it make a lot of sense in a post-apoc setting that every mexican mobster has a 10MM SMG, but it also neglects a lot of interesting animations (pistols, rifles, etc.).
(2) Replayability (obviously): you can by now already dream the progression in which you'll acquire your weapons, and which weapons will be utterly useless by the time you get them (Mauser, Grease Gun, Switchblade, etc.). It's nice to have that switched up a bit.
(3) Ye Olde Ammo Problem: There's just way too much ammo in Fallout for a post-apoc setting. I'll get to how I try to address this in a minute, but you'll see that for this whole mod I've tried to incorporate part of the following comment by VD over at the Codex:

You didn't really have to survive in Fallout (which deserves a special topic), but what bugged me the most was the overabundance of ammo.

So, if I was designing a Fallout-like game, I'd make melee a pretty much mandatory skill, as melee weapons are the easiest to make, find, and use. I'd make widely available guns clearly superior to melee but unreliable (high chance of misfire due to wear, tear, and poor maintenance). 30-40% chance of misfire maybe.

Then you'd have rare "mothballed" guns in mint condition and special weapons, found in pre-war facilities, sort of like +2 weapons in fantasy dungeons. Ammo is rare, so running out should be a frequent occasion. Ammo for special weapons should be extremely rare. Burst mode should be the last resort option.

In the end, a well to-do post-apoc warrior would have a mint condition magnum with 2 rounds, an old glock with 12 rounds, a well maintained hunting rifle with 5 rounds, and an assortment of melee weapons.

I disagree with a lot of things he's saying (from a gameplay standpoint), but that last thing is what makes most sense to me and that I've tried to generalize across the game: expect to see way more critters with a half-loaded rifle and a quarter-loaded pistol on the side.

To explain what the mod does I'll use segments of the script as an examples in spoiler tags:

First, I reduce the ammo stack sizes to about a fifth of their original size (some exceptions are: 45 cal and 9mm, which get reduced by less). I have no clue why the devs made such huge ammo stacks (50 .223 rounds, really?) other than to make sense of the weight system, but it's just way out of hand for the setting.

Code:
       if get_proto_data(PID_10MM_AP, 40) != 5 then begin
          set_proto_data(PID_10MM_AP, 40, 5);
       end if get_proto_data(PID_10MM_JHP, 40) != 5 then begin
          set_proto_data(PID_10MM_JHP, 40, 5);
       end if get_proto_data(PID_5MM_JHP, 40) != 10 then begin
          set_proto_data(PID_5MM_JHP, 40, 10);
       end if get_proto_data(PID_5MM_AP, 40) != 10 then begin
          set_proto_data(PID_5MM_AP, 40, 10);
       end if get_proto_data(PID_44_MAGNUM_JHP, 40) != 4 then begin
          set_proto_data(PID_44_MAGNUM_JHP, 40, 4);
       end if get_proto_data(PID_44_FMJ_MAGNUM, 40) != 4 then begin
          set_proto_data(PID_44_FMJ_MAGNUM, 40, 4);
       end if get_proto_data(PID_223_FMJ, 40) != 10 then begin
          set_proto_data(PID_223_FMJ, 40, 10);
       end if get_proto_data(PID_45_CALIBER_AMMO, 40) != 5 then begin
          set_proto_data(PID_45_CALIBER_AMMO, 40, 5);
       end if get_proto_data(PID_2MM_EC_AMMO, 40) != 10 then begin
          set_proto_data(PID_2MM_EC_AMMO, 40, 10);
       end if get_proto_data(PID_4_7MM_CASELESS, 40) != 10 then begin
          set_proto_data(PID_4_7MM_CASELESS, 40, 10);
       end if get_proto_data(PID_7_62MM_AMMO, 40) != 10 then begin
          set_proto_data(PID_7_62MM_AMMO, 40, 10);
       end if get_proto_data(PID_9MM_AMMO, 40) != 5 then begin
          set_proto_data(PID_9MM_AMMO, 40, 5);
       end if get_proto_data(PID_9MM_BALL, 40) != 5 then begin
          set_proto_data(PID_9MM_BALL, 40, 5);
       end if get_proto_data(PID_14MM_AP, 40) != 6 then begin
          set_proto_data(PID_14MM_AP, 40, 6);
       end if get_proto_data(PID_SHOTGUN_SHELLS, 40) != 4 then begin
          set_proto_data(PID_SHOTGUN_SHELLS, 40, 4);
       end if get_proto_data(PID_FLAMETHROWER_FUEL, 40) != 5 then begin
          set_proto_data(PID_FLAMETHROWER_FUEL, 40, 5);
       end if get_proto_data(PID_FLAMETHROWER_FUEL_MK_II, 40) != 5 then begin
          set_proto_data(PID_FLAMETHROWER_FUEL_MK_II, 40, 5);
       end if get_proto_data(PID_HN_AP_NEEDLER_CARTRIDGE, 40) != 6 then begin
          set_proto_data(PID_HN_AP_NEEDLER_CARTRIDGE, 40, 6);
       end if get_proto_data(PID_HN_NEEDLER_CARTRIDGE, 40) != 6 then begin
          set_proto_data(PID_HN_NEEDLER_CARTRIDGE, 40, 6);
       end if get_proto_data(PID_MICRO_FUSION_CELL, 40) != 10 then begin
          set_proto_data(PID_MICRO_FUSION_CELL, 40, 10);
       end if get_proto_data(PID_SMALL_ENERGY_CELL, 40) != 8 then begin
          set_proto_data(PID_SMALL_ENERGY_CELL, 40, 8);
       end

Next, I check that it's the first time a map is run, and if that is the case, each critter on the map gets checked if he's one of the character models which will get randomized (generally, "combat" humans (so no peasants), ghouls and super mutants), and whether it's not one of the exceptions (so, if it's not the player, a party member, or critters like the Salvatore men, Lo Pan, etc. which shouldn't be randomized for obvious reasons, though I probably missed some).

Code:
  foreach rndcritter in list_as_array(LIST_CRITTERS) begin
            //display_msg("critter");
         if ((proto_data(obj_pid(rndcritter),cr_fid) == FID_NMMAXX) or (proto_data(obj_pid(rndcritter),cr_fid) == FID_NFMAXX) or (proto_data(obj_pid(rndcritter),cr_fid) == FID_HMBMET) or (proto_data(obj_pid(rndcritter),cr_fid) == FID_NFMETL) or (proto_data(obj_pid(rndcritter),cr_fid) == FID_NMCOPP) or (proto_data(obj_pid(rndcritter),cr_fid) == FID_NAVGUL) or (proto_data(obj_pid(rndcritter),cr_fid) == FID_NAGHUL) or (proto_data(obj_pid(rndcritter),cr_fid) == FID_NMMEXI) or (proto_data(obj_pid(rndcritter),cr_fid) == FID_NMLTHR) or (proto_data(obj_pid(rndcritter),cr_fid) == FID_NMGANG) or (proto_data(obj_pid(rndcritter),cr_fid) == FID_NMRGNG) or (proto_data(obj_pid(rndcritter),cr_fid) == FID_MAMTNT) or (proto_data(obj_pid(rndcritter),cr_fid) == FID_MAMTN2) or (proto_data(obj_pid(rndcritter),cr_fid) == FID_NAPOWR) or (proto_data(obj_pid(rndcritter),cr_fid) == FID_HMMAXX) or (proto_data(obj_pid(rndcritter),cr_fid) == FID_HFMAXX) or (proto_data(obj_pid(rndcritter),cr_fid) == FID_HMMETL) or (proto_data(obj_pid(rndcritter),cr_fid) == FID_HFMETL) or (proto_data(obj_pid(rndcritter),cr_fid) == FID_HMLTHR) or (proto_data(obj_pid(rndcritter),cr_fid) == FID_HFLTHR) or (proto_data(obj_pid(rndcritter),cr_fid) == FID_HMCMBT) or (proto_data(obj_pid(rndcritter),cr_fid) == FID_HFCMBT) or (proto_data(obj_pid(rndcritter),cr_fid) == FID_HAPOWR) or (proto_data(obj_pid(rndcritter),cr_fid) == FID_HANPWR)) and rndcritter!=dude_obj and obj_pid(rndcritter) != PID_LIL_JESUS and obj_pid(rndcritter) != PID_LOPAN and obj_pid(rndcritter) != PID_THE_DRAGON and obj_pid(rndcritter) != PID_SALVATORE_THUG_1 and obj_pid(rndcritter) != PID_SALVATORE_THUG_2 and obj_pid(rndcritter) != PID_MASON and obj_pid(rndcritter) != PID_GUN_MERCHANT and not (party_member_obj(obj_pid(rndcritter))) then begin

Next, each inventory slot on the critter gets checked for weapons and ammo, and those get removed.

Code:
        if (inven_count(rndcritter) > 2) and ((obj_item_subtype(inven_ptr(rndcritter, 2)) == item_type_weapon) or (obj_item_subtype(inven_ptr(rndcritter, 2)) == item_type_ammo)) then begin
            item:=(inven_ptr(rndcritter, 2));
            destroy_object(inven_ptr(rndcritter, 2));
            if (inven_ptr(rndcritter, 2) == item) then begin
            destroy_object(item);
                if (inven_ptr(rndcritter, 2) == item) then begin
                destroy_object(item);
                    if (inven_ptr(rndcritter, 2) == item) then begin
                    destroy_object(item);
                        if (inven_ptr(rndcritter, 2) == item) then begin
                        destroy_object(item);
                            if (inven_ptr(rndcritter, 2) == item) then begin
                            destroy_object(item);
                                if (inven_ptr(rndcritter, 2) == item) then begin
                                destroy_object(item);
                                    if (inven_ptr(rndcritter, 2) == item) then begin
                                    destroy_object(item);
                                      end
                                  end
                              end
                          end
                      end
                  end
              end
          end

After that, I make a list of all the compatible animations, so Super Mutants can't get knives, etc. (I'll probably update this after the final RP/UP release).

Code:
              rifle:=((proto_data(obj_pid(rndcritter),cr_fid) != FID_NMMAXX) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_NFMAXX) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_HMBMET) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_NFMETL) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_NAPOWR) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_NAVGUL) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_MAMTNT) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_MAMTN2)); 
              pistol:=((proto_data(obj_pid(rndcritter),cr_fid) != FID_NFMAXX) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_NFMETL) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_NAPOWR) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_NAGHUL) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_MAMTNT) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_MAMTN2)); 
              smg:=((proto_data(obj_pid(rndcritter),cr_fid) != FID_NMMAXX) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_NMLTHR) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_HMBMET) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_NFMETL) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_NAPOWR) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_NAGHUL) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_MAMTNT) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_MAMTN2)); 
              big_gun:=((proto_data(obj_pid(rndcritter),cr_fid) != FID_NMMAXX) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_NFMAXX) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_HMBMET) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_NFMETL) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_NAPOWR) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_NAVGUL) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_NAGHUL) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_NMMEXI) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_NMLTHR)); 
              minigun:=((proto_data(obj_pid(rndcritter),cr_fid) != FID_NMMAXX) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_NFMAXX) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_HMBMET) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_NFMETL) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_NMCOPP) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_NAVGUL) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_NAGHUL) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_NMMEXI) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_NMLTHR) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_NMGANG) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_NMRGNG)); 
              rocket_launcher:=((proto_data(obj_pid(rndcritter),cr_fid) != FID_NMMAXX) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_NFMAXX) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_HMBMET) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_NFMETL) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_NMCOPP) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_NAVGUL) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_NAGHUL) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_NMMEXI) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_NMLTHR) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_NMGANG) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_NMRGNG)); 
              clubs:=((proto_data(obj_pid(rndcritter),cr_fid) != FID_NMMAXX) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_NFMAXX) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_HMBMET) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_NFMETL) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_NMCOPP) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_NAVGUL) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_NAGHUL) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_NMMEXI) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_NMLTHR) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_NMGANG) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_NMRGNG) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_MAMTNT) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_MAMTN2) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_NAPOWR)); 
              spear:=((proto_data(obj_pid(rndcritter),cr_fid) != FID_NMMAXX) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_HMBMET) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_NMCOPP) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_NAVGUL) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_NMMEXI) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_NMGANG) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_NMRGNG) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_MAMTNT) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_MAMTN2) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_NAPOWR)); 
              knife:=((proto_data(obj_pid(rndcritter),cr_fid) != FID_NMCOPP) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_NMLTHR) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_MAMTNT) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_MAMTN2) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_NAPOWR)); 
              thrown:=((proto_data(obj_pid(rndcritter),cr_fid) != FID_NMMAXX) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_NFMETL) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_NFMAXX) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_NMLTHR) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_NMLTHR) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_NAPOWR)); 
              sledge:=((proto_data(obj_pid(rndcritter),cr_fid) != FID_NMMAXX) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_NFMAXX) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_NFMETL) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_NMCOPP) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_NAVGUL) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_NAGHUL) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_NMMEXI) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_NMLTHR) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_NMGANG) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_NMRGNG) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_MAMTNT) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_MAMTN2) and (proto_data(obj_pid(rndcritter),cr_fid) != FID_NAPOWR));

Then comes the most important part: establishing who gets what class of weapon. I do so on the basis of how high tech the area is, combined with the critter's experience value.

Code:
if (( ((((cur_town == AREA_VAULT_CITY) and (cur_map_index != MAP_VAULTCITY_COURTYARD)) or (cur_town == AREA_NCR) or (cur_town == AREA_SAN_FRANCISCO))*290) + (((cur_town == AREA_NAVARRO) or (cur_town == AREA_THE_ENCLAVE) or (cur_town == AREA_MILITARY_BASE))*420) + (((cur_map_index == MAP_VAULTCITY_COURTYARD) or (cur_map_index == MAP_REDDING_WANAMINGO_ENT) or (cur_town == AREA_GECKO) or (cur_town == AREA_BROKEN_HILLS) or (cur_town == AREA_NEW_RENO) or (cur_town == AREA_VAULT_15) or (cur_town == AREA_RAIDERS) or (cur_town == AREA_RENO_STABLES))*190) + (((cur_town == AREA_DEN) or (cur_town == AREA_GHOST_TOWN) or (cur_town == AREA_MODOC) or ((cur_town == AREA_REDDING) and (cur_map_index != MAP_REDDING_WANAMINGO_ENT)))*110) + (get_proto_data(obj_pid(rndcritter), 392)/5)) > 570) then
                  rollmod:=570;
              else
                  rollmod:=( ((((cur_town == AREA_VAULT_CITY) and (cur_map_index != MAP_VAULTCITY_COURTYARD)) or (cur_town == AREA_NCR) or (cur_town == AREA_SAN_FRANCISCO))*290) + (((cur_town == AREA_NAVARRO) or (cur_town == AREA_THE_ENCLAVE) or (cur_town == AREA_MILITARY_BASE))*420) + (((cur_map_index == MAP_VAULTCITY_COURTYARD) or (cur_map_index == MAP_REDDING_WANAMINGO_ENT) or (cur_town == AREA_GECKO) or (cur_town == AREA_BROKEN_HILLS) or (cur_town == AREA_NEW_RENO) or (cur_town == AREA_VAULT_15) or (cur_town == AREA_RAIDERS) or (cur_town == AREA_RENO_STABLES))*190) + (((cur_town == AREA_DEN) or (cur_town == AREA_GHOST_TOWN) or (cur_town == AREA_MODOC) or ((cur_town == AREA_REDDING) and (cur_map_index != MAP_REDDING_WANAMINGO_ENT)))*110) + (get_proto_data(obj_pid(rndcritter), 392)/5));

Then, if the critter is not a melee/unarmed character, the roll is made for his ranged weapon. I simply made a list of the ranged weapons from "bad" to "good", but let me know if you think the order should be different.

Code:
if (has_skill(rndcritter, SKILL_ENERGY_WEAPONS) >= has_skill(rndcritter, SKILL_MELEE)) or (has_skill(rndcritter, SKILL_BIG_GUNS) >= has_skill(rndcritter, SKILL_MELEE)) or (has_skill(rndcritter, SKILL_SMALL_GUNS) >= has_skill(rndcritter, SKILL_MELEE)) then begin
                  primary_roll:=random(rollmod, 150+rollmod);   
                  if (primary_roll ^ 70) and (rifle == 1) then
                  primary := create_object( PID_SPRINGER_RIFLE, 0, 0 );
                  else if (primary_roll ^ 90) and (pistol == 1) then
                  primary := create_object( PID_9MM_MAUSER, 0, 0 );
                  else if (primary_roll ^ 170) and (pistol == 1) then
                  primary := create_object( PID_10MM_PISTOL, 0, 0 );
                  else if (primary_roll ^ 190) and (pistol == 1) then
                  primary := create_object( PID_44_MAGNUM_REVOLVER, 0, 0 );
                  else if (primary_roll ^ 205) and (pistol == 1) then
                  primary := create_object( PID_DESERT_EAGLE, 0, 0 );
                  else if (primary_roll ^ 220) and (smg == 1) then
                  primary := create_object( PID_14MM_PISTOL, 0, 0 );
                  else if (primary_roll ^ 245) and (smg == 1) then
                  primary := create_object( PID_10MM_SMG, 0, 0 );
                  else if (primary_roll ^ 265) and (rifle == 1) then
                  primary := create_object( PID_SHOTGUN, 0, 0 );
                  else if (primary_roll ^ 280) and (rifle == 1) then
                  primary := create_object( PID_SAWED_OFF_SHOTGUN, 0, 0 );
                  else if (primary_roll ^ 290) and (rifle == 1) then
                  primary := create_object( PID_TOMMY_GUN, 0, 0 );
                  else if (primary_roll ^ 305) and (smg == 1) then
                  primary := create_object( PID_GREASE_GUN, 0, 0 );
                  else if (primary_roll ^ 325) and (rifle == 1) then
                  primary := create_object( PID_ASSAULT_RIFLE, 0, 0 );
                  else if (primary_roll ^ 345) and (rifle == 1) then
                  primary := create_object( PID_HUNTING_RIFLE, 0, 0 );
                  else if (primary_roll ^ 365) and (rifle == 1) then
                  primary := create_object( PID_FN_FAL, 0, 0 );
                  else if (primary_roll ^ 375) and (smg == 1) then
                  primary := create_object( PID_HK_P90C, 0, 0 );
                  else if (primary_roll ^ 390) and (pistol == 1) then
                  primary := create_object( PID_NEEDLER_PISTOL, 0, 0 );
                  else if (primary_roll ^ 405) and (pistol == 1) and (has_skill(rndcritter, SKILL_ENERGY_WEAPONS) > 70) then
                  primary := create_object( PID_LASER_PISTOL, 0, 0 );
                  else if (primary_roll ^ 420) and (rifle == 1) then
                  primary := create_object( PID_COMBAT_SHOTGUN, 0, 0 );
                  else if (primary_roll ^ 430) and (rifle == 1) then
                  primary := create_object( PID_HK_CAWS, 0, 0 );
                  else if (primary_roll ^ 440) and (pistol == 1) and (has_skill(rndcritter, SKILL_ENERGY_WEAPONS) > 70) then
                  primary := create_object( PID_PLASMA_PISTOL, 0, 0 );
                  else if (primary_roll ^ 450) and (rifle == 1) and (get_critter_stat(rndcritter, STAT_pe) > 7) then
                  primary := create_object( PID_SNIPER_RIFLE, 0, 0 );
                  else if (primary_roll ^ 460) and (rifle == 1) then
                  primary := create_object( PID_PANCOR_JACKHAMMER, 0, 0 );
                  else if (primary_roll ^ 470) and (smg == 1) then
                  primary := create_object( PID_HK_G11, 0, 0 );
                  else if (primary_roll ^ 480) and (smg == 1) then
                  primary := create_object( PID_223_PISTOL, 0, 0 );
                  else if (primary_roll ^ 490) and (rifle == 1) then
                  primary := create_object( PID_INDEPENDENT, 0, 0 );
                  else if (primary_roll ^ 505) and (minigun == 1) and (has_skill(rndcritter, SKILL_BIG_GUNS) > 70) then
                  primary := create_object( PID_MINIGUN, 0, 0 );
                  else if (primary_roll ^ 515) and (big_gun == 1) and (has_skill(rndcritter, SKILL_BIG_GUNS) > 70) then
                  primary := create_object( PID_LIGHT_SUPPORT_WEAPON, 0, 0 );
                  else if (primary_roll ^ 525) and (big_gun == 1)and (has_skill(rndcritter, SKILL_BIG_GUNS) > 70) then
                  primary := create_object( PID_M60, 0, 0 );
                  else if (primary_roll ^ 540) and (big_gun == 1) and (has_skill(rndcritter, SKILL_BIG_GUNS) > 70) then
                  primary := create_object( PID_FLAMER, 0, 0 );
                  else if (primary_roll ^ 550) and (pistol == 1) then
                  primary := create_object( PID_PK12_GAUSS_PISTOL, 0, 0 );
                  else if (primary_roll ^ 560) and (big_gun == 1) and (has_skill(rndcritter, SKILL_BIG_GUNS) > 70) then
                  primary := create_object( PID_BOZAR, 0, 0 );
                  else if (primary_roll ^ 570) and (pistol == 1) and (has_skill(rndcritter, SKILL_ENERGY_WEAPONS) > 70) then
                  primary := create_object( PID_YK32_PULSE_PISTOL, 0, 0 );
                  else if (primary_roll ^ 585) and (minigun == 1) and (has_skill(rndcritter, SKILL_BIG_GUNS) > 70) then
                  primary := create_object( PID_AVENGER_MINIGUN, 0, 0 );
                  else if (primary_roll ^ 600) and (big_gun == 1) and (has_skill(rndcritter, SKILL_ENERGY_WEAPONS) > 70) then
                  primary := create_object( PID_LASER_RIFLE, 0, 0 );
                  else if (primary_roll ^ 610) and (big_gun == 1) and (has_skill(rndcritter, SKILL_ENERGY_WEAPONS) > 70) then
                  primary := create_object( PID_PLASMA_RIFLE, 0, 0 );
                  else if (primary_roll ^ 625) and (rifle == 1) then
                  primary := create_object( PID_M72_GAUSS_RIFLE, 0, 0 );
                  else if (primary_roll ^ 655) and (rocket_launcher == 1) and (has_skill(rndcritter, SKILL_BIG_GUNS) > 70) then
                  primary := create_object( PID_ROCKET_LAUNCHER, 0, 0 );
                  else if (primary_roll ^ 665) and (minigun == 1) and (has_skill(rndcritter, SKILL_BIG_GUNS) > 70) then
                  primary := create_object( PID_VINDICATOR_MINIGUN, 0, 0 );
                  else if (primary_roll ^ 680) and (minigun == 1) and (has_skill(rndcritter, SKILL_ENERGY_WEAPONS) > 70) then
                  primary := create_object( PID_GATLING_LASER, 0, 0 );
                  else if (primary_roll ^ 700) and (rifle == 1) and (has_skill(rndcritter, SKILL_ENERGY_WEAPONS) > 70) then
                  primary := create_object( PID_YK42B_PULSE_RIFLE, 0, 0 );
                  else if (primary_roll ^ 710) and (big_gun == 1) and (has_skill(rndcritter, SKILL_BIG_GUNS) > 70) then
                  primary := create_object( PID_IMPROVED_FLAMETHROWER, 0, 0 );
                  else if (primary_roll ^= 720) and (big_gun == 1) and (has_skill(rndcritter, SKILL_ENERGY_WEAPONS) > 70) then
                  primary := create_object( PID_TURBO_PLASMA_RIFLE, 0, 0 );

Then the ammo type gets randomized if there are multiple possibilities (e.g. 10MM AP/JHP)

Code:
                  if (get_weapon_ammo_pid(primary) == PID_5MM_JHP) or (get_weapon_ammo_pid(primary) == PID_5MM_AP) then begin
                  set_weapon_ammo_pid(primary, random(PID_5MM_JHP,PID_5MM_AP));
                  end else if (get_weapon_ammo_pid(primary) == PID_10MM_JHP) or (get_weapon_ammo_pid(primary) == PID_10MM_AP) then begin
                  set_weapon_ammo_pid(primary, random(PID_10MM_JHP,PID_10MM_AP));
                  end else if (get_weapon_ammo_pid(primary) == PID_HN_NEEDLER_CARTRIDGE) or (get_weapon_ammo_pid(primary) == PID_HN_AP_NEEDLER_CARTRIDGE) then begin
                  set_weapon_ammo_pid(primary, random(PID_HN_NEEDLER_CARTRIDGE,PID_HN_AP_NEEDLER_CARTRIDGE));            
                  end else if (get_weapon_ammo_pid(primary) == PID_EXPLOSIVE_ROCKET) or (get_weapon_ammo_pid(primary) == PID_ROCKET_AP) then begin
                      if random(1,50) ^ 26 then
                      set_weapon_ammo_pid(primary, PID_EXPLOSIVE_ROCKET);
                      else
                      set_weapon_ammo_pid(primary, PID_ROCKET_AP);
                  end    else if (get_weapon_ammo_pid(primary) == PID_9MM_BALL) or (get_weapon_ammo_pid(primary) == PID_9MM_AMMO) then begin
                      if random(1,50) ^ 26 then
                      set_weapon_ammo_pid(primary, PID_9MM_BALL);
                      else
                      set_weapon_ammo_pid(primary, PID_9MM_AMMO);
                  end else if (get_weapon_ammo_pid(primary) == PID_44_MAGNUM_JHP) or (get_weapon_ammo_pid(primary) == PID_44_FMJ_MAGNUM) then begin
                      if random(1,50) ^ 26 then
                      set_weapon_ammo_pid(primary, PID_44_MAGNUM_JHP);
                      else
                      set_weapon_ammo_pid(primary, PID_44_FMJ_MAGNUM);
                  end

Next, the ammount of ammo gets determined, based on the same factors as for the weapon itself. The possible outcome ranges from the weapon having a 1/4 filled magazine to a maximum of five additional ammo stacks (so that'd probably only be one extra magazine in the old system).

Code:
                  ammo_roll:=random(rollmod, 430+rollmod);
                  if (ammo_roll ^ 351) and (obj_pid(primary) == PID_SHOTGUN or obj_pid(primary) == PID_SAWED_OFF_SHOTGUN or obj_pid(primary) == PID_SPRINGER_RIFLE) then
                      ammo_roll:=351;
                  if (ammo_roll ^ 101) then begin
                      set_weapon_ammo_count(primary, (get_weapon_ammo_count(primary)/4));
                  end else if (ammo_roll ^ 201) then begin
                      set_weapon_ammo_count(primary, (get_weapon_ammo_count(primary)/2));
                  end else if (ammo_roll ^ 351) then begin
                      set_weapon_ammo_count(primary, (get_weapon_ammo_count(primary) - (get_weapon_ammo_count(primary)/4)));
                  end else if (ammo_roll ^ 501) then begin
                  end else if (ammo_roll ^ 601) then begin
                      ammo1 := create_object( get_weapon_ammo_pid(primary), 0, 0 );
                    add_obj_to_inven(rndcritter, ammo1);
                  end else if (ammo_roll ^ 701) then begin
                      ammo1 := create_object( get_weapon_ammo_pid(primary), 0, 0 );
                      ammo2 := create_object( get_weapon_ammo_pid(primary), 0, 0 );
                    add_obj_to_inven(rndcritter, ammo1);
                    add_obj_to_inven(rndcritter, ammo2);
                  end else if (ammo_roll ^ 801) then begin
                      ammo1 := create_object( get_weapon_ammo_pid(primary), 0, 0 );
                      ammo2 := create_object( get_weapon_ammo_pid(primary), 0, 0 );
                      ammo3 := create_object( get_weapon_ammo_pid(primary), 0, 0 );
                    add_obj_to_inven(rndcritter, ammo1);
                    add_obj_to_inven(rndcritter, ammo2);
                    add_obj_to_inven(rndcritter, ammo3);
                  end else if (ammo_roll ^ 901) then begin
                      ammo1 := create_object( get_weapon_ammo_pid(primary), 0, 0 );
                      ammo2 := create_object( get_weapon_ammo_pid(primary), 0, 0 );
                      ammo3 := create_object( get_weapon_ammo_pid(primary), 0, 0 );
                      ammo4 := create_object( get_weapon_ammo_pid(primary), 0, 0 );
                    add_obj_to_inven(rndcritter, ammo1);
                    add_obj_to_inven(rndcritter, ammo2);
                    add_obj_to_inven(rndcritter, ammo3);
                    add_obj_to_inven(rndcritter, ammo4);
                  end else begin
                      ammo1 := create_object( get_weapon_ammo_pid(primary), 0, 0 );
                      ammo2 := create_object( get_weapon_ammo_pid(primary), 0, 0 );
                      ammo3 := create_object( get_weapon_ammo_pid(primary), 0, 0 );
                      ammo4 := create_object( get_weapon_ammo_pid(primary), 0, 0 );
                      ammo5 := create_object( get_weapon_ammo_pid(primary), 0, 0 );
                    add_obj_to_inven(rndcritter, ammo1);
                    add_obj_to_inven(rndcritter, ammo2);
                    add_obj_to_inven(rndcritter, ammo3);
                    add_obj_to_inven(rndcritter, ammo4);
                    add_obj_to_inven(rndcritter, ammo5);
                  end

Next, the ranged critter gets a possible (weaker) roll for an additional sidearm, whose ammo count is always 1/2 to 3/4 empty.

Code:
                  if (primary_roll >= 170) and (random(1,100) > 50) and (pistol == 1) then begin
                      if (primary_roll ^= 220) then begin 
                          if random(1,50) ^ 20 then
                          tertiary := create_object( PID_9MM_MAUSER, 0, 0 );
                          else
                          tertiary := create_object( PID_10MM_PISTOL, 0, 0 );
                      end else if (primary_roll ^= 550) then begin
                          tertiary_roll:=random(1, 100);
                          if (tertiary_roll ^ 34) then
                          tertiary := create_object( PID_10MM_PISTOL, 0, 0 );
                          else if (tertiary_roll ^ 67) then
                          tertiary := create_object( PID_44_MAGNUM_REVOLVER, 0, 0 );
                          else
                          tertiary := create_object( PID_DESERT_EAGLE, 0, 0 );
                      end else begin
                          tertiary_roll:=random(1, 100);
                          if (tertiary_roll ^ 26) and (has_skill(rndcritter, SKILL_ENERGY_WEAPONS) > 70) then
                          tertiary := create_object( PID_PLASMA_PISTOL, 0, 0 );
                          else if (tertiary_roll ^ 51) and (has_skill(rndcritter, SKILL_ENERGY_WEAPONS) > 70) then
                          tertiary := create_object( PID_LASER_PISTOL, 0, 0 );
                          else if (tertiary_roll ^ 76) then
                          tertiary := create_object( PID_NEEDLER_PISTOL, 0, 0 );
                          else 
                          tertiary := create_object( PID_PK12_GAUSS_PISTOL, 0, 0 );
                      end
                      if (get_weapon_ammo_pid(tertiary) == PID_10MM_JHP) or (get_weapon_ammo_pid(tertiary) == PID_10MM_AP) then begin
                          set_weapon_ammo_pid(tertiary, random(PID_10MM_JHP,PID_10MM_AP));
                      end else if (get_weapon_ammo_pid(tertiary) == PID_HN_NEEDLER_CARTRIDGE) or (get_weapon_ammo_pid(tertiary) == PID_HN_AP_NEEDLER_CARTRIDGE) then begin
                          set_weapon_ammo_pid(tertiary, random(PID_HN_NEEDLER_CARTRIDGE,PID_HN_AP_NEEDLER_CARTRIDGE));            
                      end else if (get_weapon_ammo_pid(tertiary) == PID_9MM_BALL) or (get_weapon_ammo_pid(tertiary) == PID_9MM_AMMO) then begin
                          if random(1,50) ^ 26 then
                          set_weapon_ammo_pid(tertiary, PID_9MM_BALL);
                          else
                          set_weapon_ammo_pid(tertiary, PID_9MM_AMMO);
                      end else if (get_weapon_ammo_pid(tertiary) == PID_44_MAGNUM_JHP) or (get_weapon_ammo_pid(tertiary) == PID_44_FMJ_MAGNUM) then begin
                          if random(1,50) ^ 26 then
                          set_weapon_ammo_pid(tertiary, PID_44_MAGNUM_JHP);
                          else
                          set_weapon_ammo_pid(tertiary, PID_44_FMJ_MAGNUM);
                      end
                      set_weapon_ammo_count(tertiary, (get_weapon_ammo_count(tertiary)/random(2,4)));
                    add_obj_to_inven(rndcritter, tertiary);
                  end

Next, the melee character get a roll; first the bruisers (clubs, sledges, brass knuckles, etc.), then the agile fighters (knives and spears). Energy melee weapons get an ammo roll.

Code:
              if (get_critter_stat(rndcritter, STAT_st) > 6) and (critter_kill_type(rndcritter) != KILL_TYPE_women_kills) then begin
                  if (primary_roll ^= 280) then begin
                      secondary_roll:=random(1, 80);
                      if (secondary_roll ^ 16) and (clubs == 1) then
                      secondary := create_object( PID_CLUB, 0, 0 );
                      else if (secondary_roll ^ 31) and (clubs == 1) then
                      secondary := create_object( PID_CROWBAR, 0, 0 );
                      else if (secondary_roll ^ 46) and (sledge == 1) then
                      secondary := create_object( PID_SLEDGEHAMMER, 0, 0 );
                      else 
                      secondary := create_object( PID_BRASS_KNUCKLES, 0, 0 );
                  end else if (primary_roll ^= 500) then begin
                      secondary_roll:=random(1, 80);
                      if (secondary_roll ^ 21) and (clubs == 1) then
                      secondary := create_object( PID_CATTLE_PROD, 0, 0 );
                      else if (secondary_roll ^ 41) and (sledge == 1) then
                      secondary := create_object( PID_SLEDGEHAMMER, 0, 0 );
                      else 
                      secondary := create_object( PID_SPIKED_KNUCKLES, 0, 0 );
                  end else begin                      
                      if (random(1,100) ^ 51) and (sledge == 1) then
                      secondary := create_object( PID_SUPER_SLEDGE, 0, 0 );
                      else
                      secondary := create_object( PID_POWER_FIST, 0, 0 );
                  end
              end else begin
                  if (primary_roll ^= 120) then begin
                      if (random(1,100) ^ 51) and (knife == 1) then
                      secondary := create_object( PID_SHIV, 0, 0 );
                      else if (spear == 1) then
                      secondary := create_object( PID_SHARPENED_POLE, 0, 0 );
                      else
                      secondary := create_object( PID_SHIV, 0, 0 );
                  end else if (primary_roll ^= 240) then begin
                      if (random(1,100) ^ 51) and (knife == 1) then
                      secondary := create_object( PID_KNIFE, 0, 0 );
                      else if (spear == 1) then
                      secondary := create_object( PID_SPEAR, 0, 0 );
                      else
                      secondary := create_object( PID_KNIFE, 0, 0 );
                  end else if (primary_roll ^= 370) then begin
                      secondary_roll:=random(1, 80);
                      if (secondary_roll ^ 41) and (spear == 1) then
                      secondary := create_object( PID_SHARP_SPEAR, 0, 0 );
                      else if (knife == 1) then
                      secondary := create_object( PID_SWITCHBLADE, 0, 0 );
                      else
                      secondary := create_object( PID_SHARP_SPEAR, 0, 0 );
                  end else if (primary_roll ^= 500) then begin                      
                      if (knife == 1) then
                      secondary := create_object( PID_COMBAT_KNIFE, 0, 0 );
                  end else begin       
                      if (knife == 1) then
                      secondary := create_object( PID_RIPPER, 0, 0 );
                  end
              end

Next, both ranged and melee characters get a possible (1/5 or so chance, and only if they have at least some throwing skill) roll for a throwing weapons. With throwing knives there'll be more chance of getting additional ones than with grenades and such.

Code:
if (random(1,100) > 80) and thrown == 1 and (has_skill(rndcritter, SKILL_THROWING) > 59) then begin
                      if primary_roll ^ 200 then begin
                          if knife == 1 then begin
                          quaternary := create_object( PID_THROWING_KNIFE, 0, 0 );
                        add_obj_to_inven(rndcritter, quaternary);
                            if (random(1,100) > 30) then begin
                              quaternary := create_object( PID_THROWING_KNIFE, 0, 0 );
                            add_obj_to_inven(rndcritter, quaternary);
                                if (random(1,100) > 30) then begin
                                  quaternary := create_object( PID_THROWING_KNIFE, 0, 0 );
                                add_obj_to_inven(rndcritter, quaternary);
                                    if (random(1,100) > 30) then begin
                                      quaternary := create_object( PID_THROWING_KNIFE, 0, 0 );
                                    add_obj_to_inven(rndcritter, quaternary);
                                        if (random(1,100) > 30) then begin
                                          quaternary := create_object( PID_THROWING_KNIFE, 0, 0 );
                                        add_obj_to_inven(rndcritter, quaternary);
                                        end
                                    end
                                end
                            end
                        end
                      end else if primary_roll ^ 400 then begin
                          if random(1,100) ^ 51 and knife == 1 then begin
                          quaternary := create_object( PID_THROWING_KNIFE, 0, 0 );
                        add_obj_to_inven(rndcritter, quaternary);
                            if (random(1,100) > 30) then begin
                              quaternary := create_object( PID_THROWING_KNIFE, 0, 0 );
                            add_obj_to_inven(rndcritter, quaternary);
                                if (random(1,100) > 30) then begin
                                  quaternary := create_object( PID_THROWING_KNIFE, 0, 0 );
                                add_obj_to_inven(rndcritter, quaternary);
                                    if (random(1,100) > 30) then begin
                                      quaternary := create_object( PID_THROWING_KNIFE, 0, 0 );
                                    add_obj_to_inven(rndcritter, quaternary);
                                        if (random(1,100) > 30) then begin
                                          quaternary := create_object( PID_THROWING_KNIFE, 0, 0 );
                                        add_obj_to_inven(rndcritter, quaternary);
                                        end
                                    end
                                end
                            end
                        end

Finally, both character types get a possible (weaker) roll for a (additional, in the case of melee characters) melee weapon.

Code:
           end else if (random(1,100) > 30) and not ((proto_data(obj_pid(rndcritter),cr_fid) == FID_HAPOWR) or (proto_data(obj_pid(rndcritter),cr_fid) == FID_HANPWR) or (proto_data(obj_pid(rndcritter),cr_fid) == FID_MAMTNT) or (proto_data(obj_pid(rndcritter),cr_fid) == FID_MAMTN2) or (proto_data(obj_pid(rndcritter),cr_fid) == FID_NAPOWR)) then begin
                  if primary_roll ^ 270 then begin
                      quaternary_roll:=random(1,100);
                      if (quaternary_roll ^ 21) and (knife == 1) then 
                      quaternary := create_object( PID_SHIV, 0, 0 );
                      else if (quaternary_roll ^ 41) and (clubs == 1) then
                      quaternary := create_object( PID_CLUB, 0, 0 );
                      else if (quaternary_roll ^ 61) and (knife == 1) then
                      quaternary := create_object( PID_KNIFE, 0, 0 );
                      else if (quaternary_roll ^ 81) then
                      quaternary := create_object( PID_BRASS_KNUCKLES, 0, 0 );
                      else if (clubs == 1) then
                      quaternary := create_object( PID_CROWBAR, 0, 0 );
                  end else if primary_roll ^ 380 then begin
                      quaternary_roll:=random(1,100);
                      if random(1,50) ^ 25 then
                      quaternary := create_object( PID_SPIKED_KNUCKLES, 0, 0 );
                      else if (knife == 1) then
                      quaternary := create_object( PID_SWITCHBLADE, 0, 0 );
                      else
                      quaternary := create_object( PID_SPIKED_KNUCKLES, 0, 0 );
                  end else begin
                      if (knife == 1) then
                      quaternary := create_object( PID_COMBAT_KNIFE, 0, 0 );
                end
                add_obj_to_inven(rndcritter, quaternary);

Note that all critters immediately wield their primary weapon, so you sometimes get a bit strange scene upon first entering a map of characters holstering their destroyed weapons and unholstering their new ones, but nothing too bad.

Also, @Redeye.
 
Last edited:
Joined
Nov 19, 2009
Messages
3,144
Doubt it; all of it requires sfall in some shape or form.

Isn't the whole FO1->FO2 Engine project already 99% complete anyway?
 

CappenVarra

phase-based phantasmist
Patron
Joined
Mar 14, 2011
Messages
2,912
Location
Ardamai
Hey @Jim the Dinosaur, that changelog looks good - seems you know what you want to change, and actually get it done - :bro: for that.

Too bad I just replayed FO2 a few months ago and I'm all burned out...
 
Joined
Nov 19, 2009
Messages
3,144
Thanks dude; don't worry, it'll still be there when all the incline turns out to be shit.+M

You shouldn't download it yet anyway, there's still an issue with the Morale System dealio. I'll have it all fixed along with a more practical/versatile installation method (configuration .ini, why didn't I resort to you earlier) and a big update later today.
 
Joined
Nov 19, 2009
Messages
3,144
Took a while longer than I said, but I have a big, big new update so there's that. First, and most importantly, everything is now customizable through the JimsMods.ini file (viewable below): not only can you now change lots and lots of the values in the mods and have more control over which components to use, installation has become a lot more straightforward, without all the annoying separate folders (see a couple of posts above, or the readme, for new installation instructions).

Second, three new features:

NEW POISON SYSTEM

Poison doesn't really do much in FO2 because (a) it's basically only radscorpions that dispense poison and (b) poison has such an immensely delayed effect that it's more an annoyance than anything else. This mod tries to address both these points: (a) Needler pistols now do poison damage: if the dart pierces the armor of the opponent, its regular damage becomes zero and a range of poison damage is done (lower for AP darts than regular ones by default, but all these values can be changed). (B) Poison works a lot faster now: outside of combat every five seconds (can be changed) a check is made against endurance to see if between all and 1/5 of the poison damage is taken. The same is done every combat round.

SHOTGUNS

Shotguns in FO2 never really felt like shotguns: their damage output was the same whether you were shooting a critter at maximum range or at point blank range. This mod makes them more shotgun-y by making long range shots less damaging than close range ones (how much so can be changed through the .ini).

CRITTER FORMULAS

Earlier, I just had a formula for the HP of armor-wearing critters; now there's a lot more formulas. For one, armor-wearing critters get a formula for a variety of skills that they need for some features to work properly (armor repair, critical failures and healing rates), for which the values can be changed (in fact, all the formulas can be messed with a lot, see the .ini below). Non-armor-wearing critters get formulas for HP and DR/DT , of course with the alterations for various types (e.g. Floaters are immune to electricity for some reason).

Some examples for the default non-armor wearing critter formulas:

First example, part of the rat family tree (all DT's are for normal damage for the examples):

Code:
Original:

Rat: 6 HP, 0 DT, 0 DR
Pig Rat: 9 HP, 0 DT, 0 DR
Mole Rat: 26 HP, 0 DT, 0 DR
Greater Mole Rat: 36 HP, 2 DT, 25 DR
Mutated Mole Rat: 72 HP, 4 DT, 30 DR

Code:
With Revised Formula:

Rat: 6 HP, 0 DT, 3 DR
Pig Rat: 14 HP, 1 DT, 6 DR
Mole Rat: 26 HP, 2 DT, 9 DR
Greater Mole Rat: 34 HP, 6 DT, 27 DR
Mutated Mole Rat: 52 HP, 5 DT, 25 DR

And for part of the Gecko tree:

Code:
Original:

Little Gecko: 25 HP, 0 DT, 20 DR
Tough Little Gecko: 35 HP, 0 DT, 20 DR
Golden Gecko: 45 HP, 2 DT, 25 DR
Tough Golden Gecko: 65 HP, 2 DT, 25 DR

Code:
With Revised Formula:

Little Gecko: 18 HP, 3 DT, 17 DR
Tough Little Gecko: 20 HP, 3 DT, 17 DR
Golden Gecko: 28 HP, 6 DT, 24 DR
Tough Golden Gecko: 37 HP, 6 DT, 24 DR

Deathclaw tree:

Code:
Original:

Immature Deathclaw: 50 HP, 2 DT, 15 DR
Tough Deathclaw: 310 HP, 10 DT, 50 DR

Code:
Revised new Formula:

Immature Deathclaw: 49 HP, 4 DT, 18 DR
Tough Deathclaw: 208 HP, 10 DT, 54 DR

Various weak critters:

Code:
Original:

Radscorpion: 26 HP, 2 DT, 0 DR
Spore Plant: 40 HP, 0 DT, 0 DR
Mantis: 16 HP, 0 DT, 0 DR

Code:
Revised New Formula:

Radscorpion: 36 HP, 2 DT, 8 DR
Spore Plant: 31 HP, 2 DT, 18 DR
Mantis: 25 HP, 1 DT, 15 DR

Various strong critters:

Code:
Original:

Sentry Bot Mark II: 120 HP, 13 DT, 50 DR
Robobrain: 80 HP, 5 DT, 40 DR
Floating Eyebot: 60 HP, 4 DT, 30 DR
Floater: 175 HP, 5 DT, 40 DR
Centaur: 150 HP, 4 DT, 35 DR
Alien: 120 HP, 6 DT, 40 DR

Code:
New Formula:

Sentry Bot Mark II: 93 HP, 9 DT, 49 DR
Robobrain: 60 HP, 7 DT, 44 DR
Floating Eyebot: 51 HP, 3 DT, 31 DR
Floater: 107 HP, 8 DT, 44 DR
Centaur: 93 HP, 6 DT, 36 DR
Alien: 79 HP, 9 DT, 46 DR

Super Mutants:

Code:
Original:

Super Mutant: 100 HP, 5 DT, 40 DR
Strong Super Mutant: 110 HP, 8 DT, 40 DR

Code:
New Formula (after adding 4 ST):

Super Mutant: 72 HP, 10 DT, 44 DR
Strong Super Mutant: 83 HP, 11 DT, 47 DR

Finally, a copy of the spiffy new .ini file for your viewing pleasure so you can see all the things that can now be changed (I'll try and add more changeable stuff at some point):

THE .INI

Code:
[MODS]
;//*****************************************************Morale System*****************************************************;//
;There are four different options for the Morale System (setting MoraleSystem to 0 disables it):
;(1) is the default option, killing people (especially children) and losing health lowers your morale, while drinking alcohol moderately boosts it
;(2) makes alcohol an even more effective morale booster, but also makes the stuff more addictive
;(3) is the "good guy" option: a high karma boosts your morale, but killing people is even more detrimental to it than normally
;(4) is the inner Eichmann option: killing people doesn't faze you a bit, but losing health is very perturbing.
MoraleSystem=1

;//*****************************************************Revised Poison System*****************************************************;//
;This makes poison work far more rapidly than in the original (you make a check against your endurance every combat round and every five seconds
; in non-combat) and causes the Needler Pistol to poison enemies.
PoisonSystem=1
; If the Poison System is enabled, the following adjusts the amount of Poison damage the Needler Pistol does: as you see base values
; are 15-35 for regular ammo, and 10-25 for AP ammo. So raising NeedlerStrength to 5 makes the range 20-40 and dropping APNeedlerStrength to -5
; makes its range 5-15. NOTE: this doesn't affect the likelihood of piercing armor at all.
NeedlerLowerRange=20
NeedlerUpperRange=35
APNeedlerLowerRange=15
APNeedlerUpperRange=25
; PoisonSpeed changes every how many "game ticks" (10 to a second) you have to make a check against your endurance to see if you get a poison hit.
PoisonSpeed=50

;//*****************************************************Shotgun Changes*****************************************************;//
;This causes shotguns to do increased damage at close range, and decreased damage at long range.
NewShotgunSystem=1
;If above is enabled, the following value adjusts the range modifier: at default (5) max range does half damage and point blank range does 1.5 times damage.
;Put the value at minimum (1), and point blank range does 1.1 times the damage and max range 0.9 times the damage.
;Put the value at max (9), and point blank range does 1.9 times damage, etc. DON'T make the range higher than 9 or lower than 1. Default is 5.
ShotgunDamageMod=5

;//*****************************************************Consistent Localization*****************************************************;//
;This makes attacks "realistically" hit the bodypart they would hit based on a simulated targeting reticule (i.e. a large THC translates to
;usually hitting the bodypart aimed at, a low THC can be all over the place).
Localization=1

;//*****************************************************AP Changes*****************************************************;//
;This enables a simplified Action Point formula to overwrite the arbitrary ones of the original.
APChanges=1

;//*****************************************************To Hit Changes*****************************************************;//
;A long, long list of changes meant mainly to balance things out properly.
ToHitChanges=1
;If above is enabled, the following adjusts the To Hit cap (set to 100% by default).
ToHitCap=100
;The following enables the exhaustion system affecting to hit chances after a certain (endurance governed) amount of turns.
Exhaustion=1

;//*****************************************************Gear Randomization*****************************************************;//
;Randomizes NPC's weapons and ammo reserves.
GearRandomization=1

;//*****************************************************Fixed HP*****************************************************;//
;Fixes the player's HP. The formula can be changed through Stats.ini.
FixedHP=1

;//*****************************************************Drug Changes*****************************************************;//
;Stimpaks now mainly heal temporarily and SuperStims give a temporary higher max HP.
DrugChanges=1
;If above is enabled, the following values affect how much temporary, and permanent health regular (16 and 4 by default respectively) and Super Stims
; (50 and 10) heal. The temporary values change in increments of 2. So, for instance, a value of -5 for StimTemporary makes it 6 (16-5*2).
; SuperstimMaxHP changes the ammount of (temporary) max hp superstims increase (10 default). PsychoMaxHP does the same for Psycho (
StimPermanent=0
StimTemporary=0
SuperStimPermanent=0
SuperStimTemporary=0
SuperStimMaxHP=0
;Non-party critters will now also attack you if you try to use stims on them and the following is enabled:
NoDrugExploits=1
;To replace the time tested stimpak healing method out of combat, the following boosts your healing rate based on first aid skill.
;FirstAidMod modifies how much the First Aid skill is divided by to arrive at this (so, raising the number actually lowers the effect).
FirstAidResting=1
FirstAidMod=10

;//*****************************************************Critical Hit Changes*****************************************************;//
;Changes the way crit chances work.
CriticalHits=1

;//*****************************************************Critical Failure Changes*****************************************************;//
;Changes the way critical failure chances work. There are now two rolls (one based on Luck, another based on other attributes and skills
; related to the weapon type used).
CriticalFailures=1
;If above is enabled, the following values affect the new system:
;LuckImportance changes the value of n in the formula
; (it's a roll of 1-to-100 against 99-(n*10) + luck*(n), so the higher LuckImportance, the higher the importance of Luck, herp).
; MAX is 9, MIN is 1. Default is 3.
LuckImportance=3
;FailureChance decreases or increases the overal critical failure chance by changing the other roll
; (e.g. for Unarmed weapons it changes n for the roll of 1-to-(n) against agility*20+unarmedskill*4).
;strictly speaking Min is 1 and Max is however high you want, but you can tell by the formula what'll work best. Default is 1000.
FailureChance=1000

;//*****************************************************Passive Armor Repair*****************************************************;//
;Affects the usefulness of armor based on the wearer's skill.
ArmorRepair=1

;//*****************************************************Supply and Demand Mod*****************************************************;//
;Affects the prices of goods based on how many are in any particular map.
SupplyAndDemand=1
;If above is enabled, SupplyImportance and BasePrice let you manipulate the new pricing formula: (itemcost*BasePrice)/(80+(itemamount*SupplyImportance)),
;the higher SupplyImportance is set, the more the amount of items lowers the price. The higher BasePrice is set, the higher the base price is, herp.
SupplyImportance=20
BasePrice=100


;//*****************************************************Stat Changes*****************************************************;//
;Affects HP and a number of skills for Armor wearing (non-party) critters, and in addition DR and DT ratings for non-armor wearing (non-party) critters
;Note that if you want to change the player's HP formula, you need to go to Stats.ini.
StatChanges=1
;For armor-wearing critters the formula for HP is BaseHPMod+(Endurance*EnduranceHPMod)+(Strength*StrengthHPMod)
BaseHPMod=20
EnduranceHPMod=5
StrengthHPMod=1
;For armor-wearing critters the formula for skills is (AttributeSkillMod*Attribute1)+(AttributeSkillMod*Attribute2)+(Experience Value/ExperienceSkillMod).
;Attribute1 & 2 represent the attributes associated with the skill (so, for traps it'd be PE and AG, and for science both IN).
ExperienceSkillMod=10
AttributeSkillMod=4
;For non-armor-wearing critters the formula for HP is (Experience Value/ExperienceHPMod)+(Endurance*EnduranceHPMod2)+(Strength*StrengthHPMod2).
ExperienceHPMod=10
EnduranceHPMod2=3
StrengthHPMod2=1
;For non-armor-wearing critters the formula for DT is (Strength/StrengthDTMod)+(ExtraAC/ExtraACDTMod)
;ExtraAC is the armor class bonus given to critters on top of the agility bonus.
StrengthDTMod=2
ExtraACDTMod=5
;For non-armor-wearing critters the formula for DR is (Endurance*EnduranceDRMod)+(ExtraAC/ExtraACDRMod)
EnduranceDRMod=3
ExtraACDRMod=1
;Armor wearing critters get penalties to their agility: HeavyArmorAgilityMod for metal armor and upwards, LightArmorAgilityMod for lower.
HeavyArmorAgilityMod=-2
LightArmorAgilityMod=-1

One more thing: because the mod invalidates the old difficulty system, the new mutable formulas can more or less be seen as (unconventional) difficulty sliders.

Almost forgot, @Redeye
 
Last edited:
Joined
Nov 19, 2009
Messages
3,144
Should I Ironman it? FO2 is notably hard to Ironman, I have a feeling I'm gonna be sodomized with this mod.

All the extreme armor bypassing mega-crits are still in there (can't do nothing about that), so that'll be about as horrible/amusing as the original. With the default settings a lot of early combat will have a lot more crit failures than normal (they're now tied to skill to a large degree), though you can of course change that. Also, the late game should be a lot more tricky because you can no longer eye crit your way out of it.

I wonder if you can find someone to make interface changes for you. The interface can certainly be changed, as the RP proves with its unlimited save slots, appearance options, etc.

What would you like to change then? It seems a lot of hassle/probable impossibility for the stuff I'd do (remove AC counter, replace with Morale counter).

What Weapons/combat mod are you using alongside? YAAM and Magnus' mod were quite good. I really really need my awesome pew pew lasers.

YAAM is fucking awesome in theory, but it has some problems in practice. For one I think it's affected by a "bug" that deals with making divisions in the FO engine, but even if working perfectly it has some unfortunate side effects in homogenizing a lot of higher end damage outputs (you can check the spreadsheet that comes with his mod to see what I mean). @Glovz is in the finishing stages of his final damage formula, and I'll finish some minor final-ish scripting work for him today (this has to do with something that should also make Magnus' mod and YAAM buggy as hell in practice, namely that the FO engine apparently doesn't take item (e.g. ammo) modding kindly and requires you to either manually replace each item in every map or script the change at every map entry, like I'm doing now, but Glovz can probably tell you more about that).

How does Gear Randomization works? Is there some level-scaling element? What about the sprites?

No sprite changes (doesn't affect armor unfortunately), no level scaling (it's all location/experience value based). Random encounters still (slightly) level scale because my mod doesn't affect them. You can read a breakdown by unspoilering the last topic in this post.

Jim, can you make poison weaken stats in accordance to the ammount of poison and time spent poisoned?



That's a pretty damn good idea, I'll look into it.

Also, Geckos are (supposed) to be poisonous if I remember right, yet the only poisonous creatures in the game are Radscorpions and Floaters.

Right, floaters, forgot about them. Never heard that about Geckos (checked the wiki and that didn't seem to mention it), but maybe someone else knows more.

I remember there was a guy with the idea of a mod adding more radiation hazard into the game, in places and situations you should find them (Toxic Caves, Gecko town and reactor, Broken Hills mine and from critter attacks in general). Maybe I will hunt it down and ask him to compare notes.
Do you think you can make it work with Killap's Restoration Pack?

Yeah, that really should be implemented. Are you asking if it's compatible? Because it should be (with UP as well).

Suggestion: I think I saw a while back you guys were talking about NPCs demanding payment of somesort or such. You could do it like Surf Solar will do in What Remains: If I remember right, having a NPC or more lessens the ammount of loot, kinda like the inverse of the perk that increases amount of money loot (can't remember which it was) and increases with numbers. This seems awesome and fixes any problem involving inventories. Unsure if you can do it in the Fallout engine, but its worth a

Interesting... Should be possible, though I'd still prefer to one day give my own idea a try at some point (every other map entry or so in a town divvies up some "extra" loot, which gets "sold" at market price automatically and exchanged for goods NPC's happen to like). Seems unrealistic at first, but there's a similar script in the original game for the orphans stealing your stuff.



Edit: By the way, I added some examples for the default values on the critter HP/DR/DT formula in my previous post (in the spoiler tags).
 
Last edited:

As an Amazon Associate, rpgcodex.net earns from qualifying purchases.
Back
Top Bottom