Critical failure tables

Discussion in 'Fallout General Modding' started by Kanhef, Dec 2, 2011.

  1. Kanhef

    Kanhef Vault Dweller

    793
    Sep 2, 2007
    Finally got these worked out, significantly harder than the critical hit tables were. Which table is used depends on what type of weapon was used for the attack. The specific failure is chosen by the calculation random(1-100) - 5 * (LK - 5), divided into the ranges <=20; 21-50; 51-75; 76-95; and >= 96. Note that having a Luck of 6 or more makes the worst failure impossible, and 10 Luck prevents the worst two. On the other extreme, a Luck of 1 means you can't get the least bad failure, and the worst one is much more frequent.

    Interestingly, the player is prevented from making any critical failures during the first 5 game days. I haven't figured out what makes a normal critical failure, but having the Jinxed trait or perk gives a 50% chance of 'upgrading' any regular miss to a critical one.

    The tables:
    Code:
    Unarmed-class attacks:
    1 - miss
    2 - lose turn
    3 - lose turn
    4 - take 1-5 damage, knockdown
    5 - random crippled arm or leg
    
    Melee/low-tech weapons (includes thrown spears and knives):
    1 - miss
    2 - lose turn
    3 - drop weapon
    4 - hit randomly
    5 - hit self
    
    Firearms (small arms and miniguns/machine guns):
    1 - miss
    2 - lose ammo
    3 - drop weapon
    4 - hit randomly
    5 -  weapon destroyed
    
    Energy weapons:
    1 - lose turn
    2 - lose ammo, lose turn
    3 - drop weapon, lose turn
    4 - hit randomly
    5 - weapon explodes, lose turn
    
    Grenades:
    1 - dud shot
    2 - drop weapon
    3 - take 1-5 damage, drop weapon
    4 - hit randomly
    5 - weapon explodes
    
    Rocket launchers:
    1 - lose turn
    2 - dud shot
    3 - weapon destroyed
    4 - hit randomly
    5 - weapon explodes, lose turn, knockdown
    
    Flamers:
    1 - miss
    2 - lose turn
    3 - hit randomly
    4 - weapon destroyed
    5 - weapon explodes, lose turn, set on fire
     
  2. Sub-Human

    Sub-Human -

    May 31, 2011
    Cool. Now I know what to expect... :)

    What about a critical hits table, or something (if there's none such yet)?
     
  3. Kanhef

    Kanhef Vault Dweller

    793
    Sep 2, 2007
  4. Darek

    Darek is currently unavailable

    Jan 7, 2008
    Kanhef, have you looked anymore at the save.dat file? I'm interested in getting to know more of function 24 (listed as unknown in the wiki).

    It contains your current party members and some info on them I suppose. They are referred to as 18000 + their proto number (so Myron is 18160).
    18000 or "FP" is the player (maybe you have some insight to why they went with 18000 as a default value).
    When a party member or the player uses drugs that will be recorded here (so FP can exist in more than only function 5).
    I haven't verified this but to me it looks like what is written here is the time when a drugs positive effects stops, and then when the withdrawal wears off.
    If the player becomes a jet addict, one instance of "FP" will remain here even if you use the jet antidote.

    Aside from stuff about you and your party members, everything will get cleared when you exit a map, and new things will be added from the map you enter.
    If you are on an empty random map this function will be very small, but get bigger if you hit a map with many critters (their scripts seems to be the factor here).
    I'm not sure what gets written here, but my guess is all timer events in a map, it would fit.
     
  5. Kanhef

    Kanhef Vault Dweller

    793
    Sep 2, 2007
    I haven't looked at that part yet, but it sounds like it's the event queue. That makes sense; drug protos contain the delay until their second and third effects happen, and lots of scripts have timers that need to persist across gaming sessions.

    Edit: Yep, function #24 is queue_save.
     
  6. Darek

    Darek is currently unavailable

    Jan 7, 2008
    Good, thanks for confirming. :ok:
    That explains why the "rm_timer_event" command also clears the drug timers (though it probably wasn't intended that way).