Fallout 2 mod FO2 Engine Tweaks (Sfall)

Discussion in 'Fallout General Modding' started by Dude101, Jul 30, 2007.

  1. JimTheDinosaur

    JimTheDinosaur Vault Dweller
    Modder

    736
    Mar 17, 2013
    Timeslip, could you possibly add my new damage formula to sfall? It compiles fine for me and works as intended (as far as I can tell). It's very compact because a lot of elements I didn't need (crit, difficulty multipliers, etc.) are cut out.

    edit: sorry, made a mistake. Will upload the proper version in a bit.

    edit2: here it is:

    edit3: never mind, I only just realized that I've ended up doing the exact same thing as Haen only in a more contrived way.
     
    Last edited: Dec 27, 2013
  2. hexer

    hexer It's PJ! Modder

    320
    Dec 7, 2013
    Can I apply Traits and Perks to NPCs with sfall? If not, could it be possibly added?
     
  3. JimTheDinosaur

    JimTheDinosaur Vault Dweller
    Modder

    736
    Mar 17, 2013
    Nirran has made mods that add perks for NPC's with the help of sfall. You can download them at his site.
     
  4. phobos2077

    phobos2077 Mildly Dipped
    Modder

    596
    Apr 24, 2010
    I have a question regarding hs_itemdamage.int hook script, specifically: "int arg5 - The type of attack". What type exactly is that?
    I've been testing this hook script with sfall version 3.2 with many different weapons (including unarmed) and getting weird results. SOME weapons return either 0 or 1 if I use this weapon attack type 1 or 2 respectively (in PRO format, all weapons have only 2 types of attack), while other weapons return values 2 or 3, and I can't understand the pattern (mostly pistols and SMGs return 2 for single and 3 for burst fire, while rifles and shotguns return 0 for single and 1 for burst). Unarmed attacks may return greater numbers. How should I read treat parameter?

    Second thing is function "int get_proto_data(objptr, int offset)".
    a) Notes say that I should use offset from PRO file minus 12, but that's not true. Actual offsets from PRO file work (like 0x0030 for item cost).
    b) But when I tried to use offsets which are not multiples of 4 (like 2 or 7), I had very strenge result, that does not match appropriate address in PRO file. I think there is some kind of bug.
    c) it says "objptr" which likely to be pointer to an item object, but instead it works only on item PIDs.
     
    Last edited: Dec 29, 2013
  5. NovaRain

    NovaRain Casual Modder Modder

    Mar 10, 2007
    Last edited by a moderator: Jan 9, 2016
  6. hexer

    hexer It's PJ! Modder

    320
    Dec 7, 2013
    Can you activate / reactivate time limit with sfall?
     
  7. phobos2077

    phobos2077 Mildly Dipped
    Modder

    596
    Apr 24, 2010
    Yes! I finally got it! The type of attack =
    If using left-hand weapon ("Item 1"):
    0 - primary attack mode
    1 - secondary attack mode
    If using right-hand weapon ("Item 2"):
    2 - primary attack mode
    3 - secondary attack mode

    So, if I need to check what type of attack was used, I need to get remainder: type % 2 and use it as index in weapon attack types array (2 items of 4 bits)!

    @NovaRain
    Thanks for the link, it helped. Strange though, those offsets completely different from PRO file format... I just hope these offsets are consistent.
     
  8. JimTheDinosaur

    JimTheDinosaur Vault Dweller
    Modder

    736
    Mar 17, 2013
    Here's the rest of the attack types (I always used to forget to check all the documentation Timeslip added too):

    //The attack types returned by get_attack_type
    #define ATKTYPE_LWEP1 (0)
    #define ATKTYPE_LWEP2 (1)
    #define ATKTYPE_RWEP1 (2)
    #define ATKTYPE_RWEP2 (3)
    #define ATKTYPE_PUNCH (4)
    #define ATKTYPE_KICK (5)
    #define ATKTYPE_LWEP_RELOAD (6)
    #define ATKTYPE_RWEP_RELOAD (7)
    #define ATKTYPE_STRONGPUNCH (8)
    #define ATKTYPE_HAMMERPUNCH (9)
    #define ATKTYPE_HAYMAKER (10)
    #define ATKTYPE_JAB (11)
    #define ATKTYPE_PALMSTRIKE (12)
    #define ATKTYPE_PIERCINGSTRIKE (13)
    #define ATKTYPE_STRONGKICK (14)
    #define ATKTYPE_SNAPKICK (15)
    #define ATKTYPE_POWERKICK (16)
    #define ATKTYPE_HIPKICK (17)
    #define ATKTYPE_HOOKKICK (18)
    #define ATKTYPE_PIERCINGKICK (19)
     
  9. phobos2077

    phobos2077 Mildly Dipped
    Modder

    596
    Apr 24, 2010
    @JimTheDinosaur,
    Thanks!

    Does anyone knows if it is possible to somehow change (add another hook script) to SELLING prices? I know using hs_barterprice it's not possible, but I still hope there is some solution... Just imagine what possibilities it would give. A real trader roleplay, when mastering Barter skill will enable you to make money on price differences buying and selling to different trader. Currently it's not possible, because all selling prices are always fixed :(

    Edit: question #2: is it possible to somehow catch map_enter event inside global script? I need to add some objects in the game without modifying maps in mapper or using global variables. I was thinking on doing it on first enter of each map.
     
    Last edited: Jan 6, 2014
  10. NovaRain

    NovaRain Casual Modder Modder

    Mar 10, 2007
    [strike]Just found out that the additional DR values from all four combat implant perks are only for show. They do increase DR values displayed in the inventory and character screen (for normal DR), but using F12se to check the character data you'll see there's no real increment on DR. And testing in combat can also verify this.[/strike]

    I modified BB gun with 100-100 dmg (other attributes unchanged), gave it to Cassidy, and controlled him to shoot me wearing no armor in combat. My character has Toughness Lv3 (+30 DR), Prizefighter reputation (+5 DR), and Dermal Impact perk (+5 DR). In game it shows my DR is 40, so the damage I received should be 60. But actually I got hit for 65 damage, and checking with F12se shows my normal DR is 35, which is the same as before gaining the implant.

    EDIT: OK, it seems the "displayed" DR does work. It's my fault to use NPC control function for testing. If I reverse-pickpocket a NPC the modified BB gun and make him attack me, like purposely getting caught for stealing, I will correctly get hit for 60 points. Sorry for crying wolf. :oops:
     
    Last edited: Jan 21, 2014
  11. JimTheDinosaur

    JimTheDinosaur Vault Dweller
    Modder

    736
    Mar 17, 2013
    You probably already have your own workaround by now, but what I always do is set a global var to 1 in the dude script's map_enter and then have a global script check for that.
     
  12. Darek

    Darek is currently unavailable

    Jan 7, 2008
    NPCs can't have perks (or at least they don't work on them), I guess the dude is treated as an NPC while you control another character. Also, all perk effects don't show up in F2se as you noticed, so you will have to test them in-game.
     
  13. MIB88

    MIB88 So Old I'm Losing Radiation Signs
    Modder

    Feb 22, 2005
    Really? I never knew that. I just want to be clear here, though: Do you mean they can't have perks ever? Or, that they just can't have them when the player has control of them? I'm just trying to confirm if additions to the MM were just wasted effort in regards to armor for Marcus and Dogmeat. Each of those NPCs has code to add perks if they are wearing their respective armors.
     
  14. Darek

    Darek is currently unavailable

    Jan 7, 2008
    Eh, I remembered wrong. They can, at least some of them. It's not very clear what works though, I mean how do you see it or test it?
    I tested with giving Lenny the add strength and agility perks, as that can be easily checked in-game. He got the traits, but they didn't raise his stats (checked with throwing a float if he had the perk). Tried giving him the extra action point perk and that worked, but as soon as he leveled up he lost the extra point while my perk check still claimed he had it (so he didn't lose the perk, just the stat gain). So basically, it's very hard knowing what perks work and how leveling up affects them. Do perks that don't alter stats work at all, and if so, do they stop working at level up? I don't know...
     
  15. Glovz

    Glovz Vault Dweller
    Modder

    736
    Sep 16, 2005
    @Darek
    NPC level up means a new proto file is referenced correct? So is that what might be the problem with perks being lost on level up?
     
    Last edited by a moderator: Jan 9, 2016
  16. Felipefpl

    Felipefpl Look, Ma! Two Heads!

    375
    Jun 17, 2010
    hi-res patch became a sticky, when this will happen with this thread?
     
  17. Felipefpl

    Felipefpl Look, Ma! Two Heads!

    375
    Jun 17, 2010
    hi-res patch became a sticky, when this will happen with this thread?
     
  18. NovaRain

    NovaRain Casual Modder Modder

    Mar 10, 2007
    Since Timeslip hasn't been active for two weeks, I decided to go ahead and compile the updated code of Glovz's ammo mod with current SVN r254: (removed due to newer version)

    It'll be probably equal to r255 if Timeslip doesn't update other codes in next revision.
     
    Last edited: Feb 7, 2014
  19. JimTheDinosaur

    JimTheDinosaur Vault Dweller
    Modder

    736
    Mar 17, 2013
    Well aware of the negligible chance of any of these request actually being filled, (I'm really just spoiled given all the stuff you've already made possible) but whatever, here's three more requests (also added to the request wiki):

    - Allowing us to know the tile number the mouse is hovering over (either in the hs_movecost hookscript or universally)
    - An option for limiting the max carry weight calculation to item worn and item carried in active hand.
    - An option for raising the AP-cost for the inventory opening during combat (I know I already asked this one, just making it "formal")
     
  20. phobos2077

    phobos2077 Mildly Dipped
    Modder

    596
    Apr 24, 2010
    I've added some requests too.